OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: duckwilliamson on 05 Jul 2003, 08:50:10
-
This is probably the wrong place to ask this but;
How do you check to see if a player has satchels??
-
unitname hasweapon "pipebomb"
-
I've tried that already and it doesn't work ...
I've also tried timebomb ...
Does it matter whether or not you are picking it up out of a crate which had pipebomb added through addweaponcargo or addmagazinecargo?
-
see this thread
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=11043
-
where you got it from shouldn't matter, the problem may be "timebomb" and "pipebomb" are both magazines, not "weapons"
-
i always thought the pipebomb and timebomb where both weapons? oh well... first try the has weapon command with an m16, then if that works, try it with a pipebomb, and if that doesn't work, then the pipebomb is a magazine.
-
OK ... so does that mean I should try the ammo command??
I never thought of that ... I'll try out the idea & close this thread if it works:
player ammo "pipebomb" < 0:obj_1 "done"
-
I did some testing and here are my retarded results:
- satchels through addmagazinecargo don't count as either ammo nor weapon
- satchels through addweaponcargo don't give any actual satchels, but give you the empty weapon which can now be seen through hasweapon
- if you have satchel weapon and then take satchel magazine, any number of magazines will only give you '1' ammo
My recommendation (what I am doing) for if you want to have satchels detected: this addweapon "pipebomb" in the player's init, and when you want to detect if he has satchels just call the player ammo "pipebomb" (or even 'someammo' command)
-
Satchels are considered as magazines, therefore if you want to check whether someone carries any, here is a loop you could do :
_unit=_this select 0
_mag=count magazines _unit
_i=0
#loop
? (magazines _unit select _i)=="pipebomb":hint "I've got some !";exit
_i=_i+1
?_i>_mag:exit
~0.001
goto "loop"
Implementation : [myloon] exec "ammocheck.sqs"
-
i always thought the pipebomb and timebomb where both weapons? ...
The "Weapon" for those kinda toys is the default (and hidden) "PUT", which (as "Throw" for handGrenades) is pre-defined in the main configuration file for all units. :)
As stated, "PipeBomb" is a magazine; and to check if a units has the bomb, do this:
UnitName Ammo "PipeBomb" >0
...should work fine in the condition field of a trigger. :-*
-
:-\ I'm afraid I couldn't get the "ammo" command to work, and the line :
UnitName Ammo "PipeBomb" >0
in the condition field of a trigger doesn't work. For what reason, now you tell me... ::)
Sometimes you do need to do complicated things to obtain simple results.
-
yer right there, m8 ::) it's one of those buggy weapons.... well, try something about removing/adding the "PUT" weapon that is needed for a unit to be able to put satchels. :)
If ya don't have to put anything before you have the bomb, try & remove his "PUT" via the INIT field.
this removeWeapon "PUT"
maybe you can figure out how to let a trigger fire when you get close enough to the pipe to be able to actually grab it... som'n like:
[condition]: player distance crate <4
[activation]: player addWeapon "PUT"
Then you can take the bomb.... and another trigger fires with the condition:
[condition]: player hasWeapon "put"
[activation]: whatever it was... end#1 or alike
fiddle around w/ it mate! :-*
later
-
OK boys ... Like i was saying ...
Satchels are ammo, but you need a weapon to find the ammo, and you must have the PUT ability ...
So in order to overcome this you either add a PUT ability or add an empty weapon ... if you addweapon "pipebomb" it doesn't affect anything but allowing you to check for ammo ...
If anyone has any problems with my result reply here and I'll respond in detail if necessary ...