Home   Help Search Login Register  

Author Topic: Detect Satchel Charges  (Read 488 times)

0 Members and 1 Guest are viewing this topic.

shadow99

  • Guest
Detect Satchel Charges
« on: 13 Nov 2004, 13:02:51 »
Hello. Anyone know how I have a trigger that in the condition field has a way of checking if the player has placed down 2 satchel charges?

I suppose it has to be done through scripting.

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Detect Satchel Charges
« Reply #1 on: 13 Nov 2004, 15:52:32 »
I could tell you how to detect when all the satchels are gone  :-\. The command hasWeapon should come in handy.

Use:

!(player hasWeapon "Pipebomb") in in condition field

If you gave the player only two satchels then this would work. If you needed more you could get the player to pick them up in the field but I don't know how practical this would be.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Detect Satchel Charges
« Reply #2 on: 13 Nov 2004, 23:40:32 »
Yeah, I think a wee bit of scripting would be the best way to do it. C0LDSt33L's suggestion would almost work, except the player could drop the weapon, not "place" it, and it would still go off.

An event handler would do the job perfectly, though. Pop this in the player's init field:

bombslaid = 0; this addeventhandler ["fired", {if((_this select 1) == "put" && (_this select 4) == "pipebomb") then {bombslaid = bombslaid + 1}}]

That will make the variable "bombslaid" go up by 1 each time the player places a satchel. Then just make a trigger with condition:

bombslaid >= 2

And you're in business!
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

shadow99

  • Guest
Re:Detect Satchel Charges
« Reply #3 on: 14 Nov 2004, 02:35:19 »
Thanks General, it did the job.

:)