OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wolf on 10 Sep 2002, 05:54:20

Title: Artillery script, without user input?
Post by: Wolf on 10 Sep 2002, 05:54:20
Alright, I have no scripting skill what so ever.
So I don't know how to edit scripts beyond basic changing of numbers.
I have looked at the availeble scripts in the editors depot, and they all seem require the player to designate them.

What I need is a script that can be excuted to go off on a game logic, or some thing in the game besides markers,
I need it to create some shells about 10 meters off the ground and randomly fall in an area of about 60 by 60 meters at about a rate of 5 shells every 2 seconds in a loop, until I use another trigger to stop it.
Now, how do I go about making this, and using it?
Thank you.
Title: Re:Artillery script, without user input?
Post by: Cedaie on 10 Sep 2002, 06:14:55
Pfft, all that trouble when really all you need is triggers that the player will step on, and mines on the ground will go boom, so in each trigger activation field just put:

Mine1 setdammage 1

set the trig to be activated by the players side, present

Useful for the whole 'Wrong place, at the wrong time' scheme ;)

EDIT:*turns on his brain* Ahh now I get ya, something that doesn't require the player to set it off, hrrm, that would have something to do with random XYZ command, but I've neva used that so, this will be a lesson for me too.
Title: Re:Artillery script, without user input?
Post by: Wolf on 10 Sep 2002, 06:21:13
Yes, but that's long and time consuming for a long, full scale artilery barrage.
I need it for cutscenes, and any time an artilley barrage might be hitting somewhere, without any user input.
Title: Re:Artillery script, without user input?
Post by: Dinger on 10 Sep 2002, 06:42:42
In theory, these scripts will work for you.
In practice, they might be too complicated (I disagree, but some don't care how artillery really works).
oops. It turns out OFPEC has downtuned their file submission size.  Hopefully soon I'll be able to post the artillery suite here.  I can say for sure that in a couple days, it will be available at www.thechainofcommand.net .

In any case, the easy answer is: make a trigger (set activation/deactivation as you see fit), that each time it fires shells the area
shell = "Shell120"; radius = 60; "shell camcreate [((getpos this) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos this) select 1) + (((_x mod 1)*radius)*cos _x), 300]" foreach [random 360, random 360, random 360, random 360]

Shell120 may be a little beefy, so you can go smaller.
Title: Re:Artillery script, without user input?
Post by: Wolf on 10 Sep 2002, 06:46:15
So all I need to do is put this in the on activation line of a trigger?

Quote
shell = "Shell120"; radius = 60; "shell camcreate [((getpos this) select 0) + (((_x mod 1)*radius)*sin _x), ((getpos this) select 1) + (((_x mod 1)*radius)*cos _x), 300]" foreach [random 360, random 360, random 360, random 360]
Title: Re:Artillery script, without user input?
Post by: Wolf on 10 Sep 2002, 18:10:03
Thanks, that will work fine I guess.