OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wolf on 01 Oct 2002, 17:46:32
-
Alrighty, a while back someone gave me this line
shell = "Shell120"; radius = 60; "shell camcreate [((getpos boom) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos boom) select 1) + (((_x mod 1)*radius)*cos _x), 20]" foreach [random 360, random 360, random 360, random 360]
To go in a trigger to create a random artillery barrage, that did not need the player to do anything to start it.
Now, this is very useful, but it is also quite tedias(spelling?) to set up the nessasary triggers for a prolonged barrage.
What I need to know is how to put that in a looping script with about 5 to 10 second delay, that can be called upon from a trigger, and will end when I want it to from a trigger?
Thank you.
-
A. no script needed. Somewhere (such as the player's init field -- or for MP the init field of some object that always appears), put
MyShell = "FxExploGround1" camcreate [0,0,0]
Set the trigger tot he condition you want, and add:
&& getpos Myshell select 0 == 0
e.g., if you wnat the boolean BARRAGE to control the trigger:
barrage && getpos myshell select 0 == 0
Use the drop time to create an interval, according to the formula:
distance = 4.9 *(seconds ^2)
so for 5 seconds, that's: 4.9 * 25 or 72.5
Now put in the activation field that Z value, and clal the shell MyShell, viz:
shell = "Shell120"; radius = 60; "MyShell = shell camcreate [((getpos boom) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos boom) select 1) + (((_x mod 1)*radius)*cos _x), 72.5]" foreach [random 360, random 360, random 360, random 360]
voila`!
B. In a script:
shell = "Shell120"
radius = 60
@condition
#loop
"shell camcreate [((getpos boom) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos boom) select 1) + (((_x mod 1)*radius)*cos _x), 20]" foreach [random 360, random 360, random 360, random 360]
?condition:goto "loop"
-
Well, you kinda lost me on the A.
But, I'm just to copy what you got there for B. into an sqs file?
-
on A, do what it says and you'll be fine. Trust me, it's magic, and it's beautiful. Option A will score the babes.
On B, yeah, but be sure to put a ~5 before the "goto loop"
-
One more question.
How do I target it?
Will it come down on the object or trigger that has
[] Exec "script.sqs"
in it?
Or do I have to specify that in the script?
-
Can anyone tell me the answer to my above question?
Thank you.
-
Keep your pants on. sheesh ;)
make a gamelogic, and call it "boom"
that's where the shells will land.
-
Looks like I solved to soon.
I tryed the script and it did nothing.
just silence.
I placed an item with the proper name, and executed the script but ingame, notta.
That other one, is it for Res versions? as I don't have Res and you mention a drop command.
What did I do wrong with this script?
-
did you set condition = true?
-
Tryed it
still don't work
-
okay, then change the line so that it reads:
"MyShell = shell camcreate [((getpos boom) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos boom) select 1) + (((_x mod 1)*radius)*cos _x), 72.5]" foreach [random 360, random 360, random 360, random 360]
-
Works perfectly, thanks a bunch Dinger.