OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: O Neil on 06 Apr 2003, 11:27:44

Title: Spray
Post by: O Neil on 06 Apr 2003, 11:27:44
Hey

Umm....I think this has been asked a few times, but it never worked. I need to know how to get a shilka to spray into a group of planes.

I also need to know that for just a normal person, I'm sure it's the same thing.

O Neil

PS: Is there a way to make a gamlogic hostile ? Might make things work better.
Title: Re:Spray
Post by: Burn on 06 Apr 2003, 19:03:47
U mean how to make a unit fire at a nother??? ...wel that's easy...
just type the following in the shilkas or whatewer units init. field: this doFire unitname ...unitname is the name of the unit to be fiered on. NOTE: this works for any unit with a weapon!!!
Hope this helps ;)
[shadow=red,left,300] ;DHAPPY EDITING ;D[/shadow]
Title: Re:Spray
Post by: O Neil on 07 Apr 2003, 07:19:45
Umm.......yea I know that, but are you sure it sprays at nothing? I thought it's basically, OPEN FIRE  :-\

O Neil

PS: Sol Fire said I need a script...guess I'll get it
Title: Re:Spray
Post by: Der_Richter on 07 Apr 2003, 08:55:13
Create a GL and make it fire at that.

_unit doFire GLName


You could create several GLÂ's too. One for each plane to simulate targetting them one by one. then make a script that looks like this:'

_unit = _this select 0
_GL1 = _this select 1
_GL2 = _this select 2
_GL3 = _this select 3

_unit doFire _GL1
~1
_unit doFire _GL2
~1
_unit doFire _GL3
~1
exit

then save it as ShilkaTarget.sqs.


Then in the shilkas init-field type: [this, GLName1, GLName2, GLName3] exec "ShilkaTarget.sqs".

- where GLName1-3 is the names of the GLÂ's u are using. u will want to add movement of the GLÂ's to follow the planes and a loop to keep it firing. If u need help with that, i might be able to do it for u and attach it. well, if i forgot something, iÂ'm in a hurry, then just point that out.  
Title: Re:Spray
Post by: O Neil on 07 Apr 2003, 10:41:33
Soz, doesn't work, I think it could be cause the GL isn't hostile.


O Neil

PS: I might try setcaptive red.....but I gtg now ;)
Title: Re:Spray
Post by: Der_Richter on 07 Apr 2003, 11:51:28
let me know how it goes.
Title: Re:Spray
Post by: macguba on 07 Apr 2003, 16:57:56
I suspect you can't target or fire on a gamelogic

doFire works better if preceded by doTarget.    for example


Shilka1 doTarget plane1
Shilka1 doTarget plane1
~3
Shilka1 doTarget plane2
Shilka1 doTarget plane2

etc
Title: Re:Spray
Post by: Der_Richter on 07 Apr 2003, 19:55:17
Actually u can. a GL can be treated as any unit within the game, basically. So if u make the GL hostile to you, u can target it, and afire upon it.
Title: Re:Spray
Post by: Flapje on 07 Apr 2003, 20:07:43
Actually u can. a GL can be treated as any unit within the game, basically. So if u make the GL hostile to you, u can target it, and afire upon it.

do you know how to make it hostile?
Title: Re:Spray
Post by: macguba on 07 Apr 2003, 21:47:13
Dunno, but if you grouped it under a leader of the opposite side and then deleted the leader, that might work.
Title: Re:Spray
Post by: Der_Richter on 08 Apr 2003, 00:23:17
macguba beat me to it ;D

thatÂ's what iÂ've done. perhepas u could use the side-command as well... havenÂ't tried that.
Title: Re:Spray
Post by: macguba on 08 Apr 2003, 00:27:57
side only returns the side of a unit, you can't use it to change a unit's side.
Title: Re:Spray
Post by: Der_Richter on 08 Apr 2003, 09:12:25
isnÂ't there a "switchSide"-type command?
Title: Re:Spray
Post by: O Neil on 08 Apr 2003, 09:59:20
unit setcaptive "red"    to make it hostile
unit setcaptive "green"    to make it neutral and will fire if any action is taken

red doesn't work for me I NEED A SPRAY SCRIPT OR SOMETHING !
  :-X
O Neil ;)
Title: Re:Spray
Post by: Der_Richter on 08 Apr 2003, 10:05:10
try to group it with a leader as macguba already noted. otherwise i can try some stuff out and see if i can write u a script that works.
Title: Re:Spray
Post by: Chris Death on 08 Apr 2003, 15:16:20
Or you could try reading through the thread (linked below),
where MI_Fred and me posted some scripts to let units fire
without using a gamelogic as target.

If you are in the need for more information on how to set it
up for your situation just let me know  ;)

http://www.ofpec.com/yabbse/index.php?board=9;action=display;threadid=6999

~S~ CD
Title: Re:Spray
Post by: Der_Richter on 08 Apr 2003, 16:32:27
Hmm. seems interesting.