Home   Help Search Login Register  

Author Topic: Make satchel charge appear at X,Y,Z  (Read 622 times)

0 Members and 3 Guests are viewing this topic.

Offline Pr0ph3t

  • Members
  • *
Make satchel charge appear at X,Y,Z
« on: 15 Mar 2005, 04:30:31 »
I didn't get any responses yet lots of views on the regular editing/scripting forum therefore I am posting here.

I want to make a satchel charge appear at x,y,z coordinates and I also need some type of trigger that detects if the satchel charge has been disarmed.

Thanks :P

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Make satchel charge appear at X,Y,Z
« Reply #1 on: 15 Mar 2005, 18:48:08 »
_Bomb = camcreate "PIPEBOMB" getpos bombpos

@(isnull _Bomb)
hint"The bomb is busted!"

Im not sure about that isnull command as I've never used it so you may need to put it after _bomb instead of before... Also this script will go off if the bomb explodes too...
I like your approach, lets see your departure.
Download the New Flashlight Script!

Kyle Sarnik

  • Guest
Re:Make satchel charge appear at X,Y,Z
« Reply #2 on: 15 Mar 2005, 21:56:40 »
Out of memory (correct me if im wrong):

1. Camcreated satchels cannot be disarmed or detinated

2. @ isnull bomb will detect when its disarmed, but it will ALSO fire if the satchel is detinated.

3. To get around these, have a unit place the satchel charge first, then move it into your position, then have a timer or whatever, in your trigger/script that detinates the satchel, use a variable (ex. SatchelFired=true), and then use the @Isnull bomb to detect if the bomb is "gone" (disarmed or fired), then add another variable (ex. SatchelIsnull=true), then, using the time differences between these to variables, decide weather or not SatchelIsnull occured before SatchelFired, if they happened at the same time, then the bomb was not disarmed (ex. right before the detination command; ? SatchelIsnull : SatchelDisarmed=true) actualy you could do it an easier way (wow I should have done this from the start)

Code: [Select]
_unit = _this select 0
; unit is a person with a satchel charge
_unit fire ["pipebomb","put","put"]
; please correct the above line if its wrong
_bomb = nearestobject [_unit,"PIPEBOMB"]
_bomb setpos [x,y,z]

#loop
? Isnull _bomb : goto "disarmed"
? DetinateSatchel : goto "boom"
; detinatesatchel is a variable to tell when to detinate
goto "loop"

#disarmed
hint "Good job, you disarmed the bomb"
exit

#boom
_unit action ["TOUCHOFF"]
exit
« Last Edit: 16 Mar 2005, 21:36:06 by Kyle Sarnik »