OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gadolinite on 16 Jan 2006, 06:13:01

Title: AI place satchel charge
Post by: gadolinite on 16 Jan 2006, 06:13:01
How do you get the AI to place a satchel charge?
Title: Re:AI place satchel charge
Post by: General Barron on 16 Jan 2006, 06:21:32
Satchels and mines are placed by "firing" the "put" weapon. I'd have to double-check, but I'm pretty sure it goes like this:

soldier fire "put"

This assumes the soldier only has satchels, not mines.

To get them to touch off the bomb, you need to use the "action" command. See the reference in the ed depot. An alternative is to give the AI "timebomb" magazines, which automatically blows up after 30 seconds (instead of "pipebomb"-- the normal satchel charge).
Title: Re:AI place satchel charge
Post by: yankme on 16 Jan 2006, 07:21:09
Hello Great General Barron, i was just looking at that, theres a way to set timer to some how too  
Quote
unitname fire ["put","pipebomb"]
Title: Re:AI place satchel charge
Post by: MrN on 16 Jan 2006, 11:01:17
Quote
Unitname action ["put","pipebomb"]     or     UnitName fire ["put","pipebomb"]  

then
Quote
unitname action ["touchoff"]


Should do the job.
 :)
Title: Re:AI place satchel charge
Post by: yankme on 16 Jan 2006, 12:13:59
MrN  i think put and  "fire" sets it on 30 then, action leaves it open for the "touchoff" , is that correct ?
Title: Re:AI place satchel charge
Post by: MrN on 16 Jan 2006, 13:44:34
Quote
MrN  i think put and  "fire" sets it on 30 then, action leaves it open for the "touchoff" , is that correct ?

Don't think so, no.

I've just had a play around with this and as always it's a little more complicated than I thought. :)

I couldn't get action to work at all.
The best result seems to be:
Quote
UnitName fire ["put","pipebomb"]  

then
Quote
unitname action ["touchoff"]


Or
Quote
UnitName fire ["put","pipebomb"]  

followed by
Quote
UnitName action ["settimer"]
When the unit is near the bomb he placed.

Or
Quote
UnitName fire ["put","timebomb"]  

for a timed explosive.
Note that you need to make sure timebomb is in the inventory for the unit to place it.

I've attached a little demo with the different combinations I tried.
Title: Re:AI place satchel charge
Post by: yankme on 16 Jan 2006, 13:48:32
ok Great , give her a look ,,,,    i'll save the camands from it thanks, cheers yank.




EDIT    yes after reveiwing the demo,,,,,, yes it rehatches lots,,,, radio alpha,, very good ,, thanks ;)
Title: Re: AI place satchel charge
Post by: 999chris on 27 May 2006, 13:15:04
Word of advice to those doing this in the future,.. For god sake! dont be a Tart like me and make the Soldier that places the charge; drive to the otherside of the island and expect UnitName action ["TOUCHOFF"] to work (stupid me not realising BIS actually made OpF realistic and took the strength of radio signlas into account). I did this and was racking my brain wondering why the hell my soldier wasn't doing his job properly.

I reccomend your soldier to keep within good viewing distance of the object you're blowing up...  ;D