OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: mcnils on 25 Mar 2003, 13:36:31
-
Yeah, cool, i found a tutorial, but since im not that super in maths
i would preffear to use an example script instead and modify it.
I searched the net for a while now but i cant find any.
I just need a lil fire column for abit of atmosphere on the battlefield, nothing special (= no nukes lol).
Anyone that doesnt sux at maths here and that is ready to help me out with an example script? plz ;D
::)
-
The most famous is the helicopter dust script in the Ed Depot. Or is it the tank dust one? Or are they the same? Anyway .... go look :)
-
huumm yes i know of the heli dust script,
but.. ehm... heli dust doesnt really seem a fire column also if its red,
seems more somekind of firestorm.. so.. erhm.. well im at the starting point... :-X
Im a dam' evergreen noob... O_O
-
I remember looking at one of those scripts and I don't think changing the colour is much of a problem. Shape would be much harder.
-
Thats what i meant with "im not super in maths" O_O
-
From vektorboson's drop tutorial (which can be found in the editors depot)
Drop [ShapeName, AnimationName, Type, TimerPeriod, LifeTime, Position, MoveVelocity, RotationVelocity, Weight, Volume, Rubbing, Size, Color, AnimationPhase, RandomDirectionPeriod, RandomDirectionIntensity, OnTimer, BeforeDestroy, Object]
Color | particle color (transition) | Array
We want first red, then green and last but not least blue.
color = [ [1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1] ]
Yellow is a mix-up of red and green, so yellow=[1, 1, 0, 1] and black [0, 0, 0, 1] and white [1, 1, 1, 1].
So our color format is (like everywhere else in OFP): [RED, GREEN, BLUE, ALPHA]
Alpha is opacity or transparency. 1 is fully opaque, while 0 means full transparency (invisible)!
So you see no math required :D
Here's also a line of the drop command in action.
drop ["cl_fire", "", "Billboard", _lifetime, _lifetime, [_x, _y, 0.2], _vel, 0, 0.2, 0.157, 0.001, _size, _color,
The drop command has lots of parameters you can use, but don't be confused about it.
Every drop script 'pre-defines' the values of those parameters before executing the actual drop command. ^ up there some parameters defined earlier in the script are '_lifetime', '_x', '_y', '_size' and '_color'
here's an example of defining the color array
_color = [[0.4,0.4,0.4,0],[0.6,0.6,0.6,1],[0.7,0.7,0.65,1], [0.65, 0.6, 0.5, 0]]