OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wildcat22 on 28 Apr 2004, 21:43:02
-
Hello,
I'd like to make an objective done when a player (named "T1") has the pipe bomb. I know how it works and I looked it up in the official com.ref .
But the function "hasWeapon" doesn"t work. Can someone help me ? Thanks a lot in advance :)
-
Could you explain a little bit more? Mabey, if your using a script or trigger, etc...
-
Well I use triggers, 2 of them. One activates the obj status to "done" when "armes" (condition from the first trigger) = true.
The init for "armes" is "T1 hasWeapon "Pipebomb" " but that last doesn't work (it tells me I need bool or something you know the thing).
So I'd like to have the first objective completed when the player has a pipebomb that he has to get from an ammo crate. :)
-
Up ;D
If I'm not clear enough tell me ;)
-
Nevermind I think I solved it :-[ ;D
Doh...
-
I managed to do it with any weapon, but there is a problem with the "pipebomb"...
-
I think the problem is that "pipebomb" isn't a weapon; it is technically a "magazine" for the weapon "put" (an invisible weapon that everybody has). So instead of using 'hasweapon', you may be able to use the "ammo" command:
unit ammo "magazine"
This returns a number; the number of shots in the persons current magazie. So in your case, try putting this in the trigger's condition field:
T1 ammo "pipebomb" > 0
Maybe even try putting "put" instead of "pipebomb". Hope it works :(
-
Thank you I'll check it out ;)
-
Thank you, it worked with "put" :)
-
The same thing worked for any weapon but now (and I don't know why) it doesn't work anymore. Could you help me ?
Is it right ?
Cond. Ap HasWeapon "Ak47"
On Act. test = true
("test" worked for the pipebomb thing you told me).
-
Indeed... a pipebomb is considered to be a magazine.
If you ever want to get a list (well... an array actually) of the magazines in a unit's inventory, try:
magazines unit
To test to see if there is a pipebomb in there, try:
"Pipebomb" in (magazines unit)
That should do the trick ;)
-
Thank you :)