Jump to content
Sign in to follow this  
j w

Detect wearing weapon

Recommended Posts

I'm trying to make a side vs side MP mission, where you have the choice to surrender, wich meaning the loose their weapon, and also becomes captive so AI soldiers doesn't shoot you. But, I wanna do so that if you pick up a weapon you're not a captive anymore (set by setCaptive false) so that AI will open fire at you again, if you steal a dead guys weapon.

Can it be detected by triggers or easy script when carrying a weapon (maybe that carrying a weapon means "this setCaptive false") or something?

HELP!

Darn, I hate that OFPEC is down confused_o.gif

Share this post


Link to post
Share on other sites

The weapons command will return an array of all the weapons carried by a unit - you could have a trigger fire when this array is not empty.  Alternatively primaryWeapon is another command that will return a string giving the name of the primary weapon carried by a unit.   The trigger could fire whenever this is not = ""

Quote[/b] ]Darn, I hate that OFPEC is down
Me too.

Share this post


Link to post
Share on other sites

Uhmm. I don't really understand that.

Could you explain a little more?

Thanks for helping anyways smile_o.gif

Share this post


Link to post
Share on other sites

Well I am on holiday and so am away from my games computer and ofpec is down so I can't check their comref. So from memory try something like:

@ (weapons unitname != [])

or

@ (unitname primaryWeapon != "")

It may be a load of crap but it is worth experimenting with.

Share this post


Link to post
Share on other sites

This is what I have in trigger for one of my missions, it will detect if unit POW has ANY weapons or ANY magazines (incl. Hand Grenades, Satchels, Smokes, etc.) in their inventory.

Condition: ((count (weapons pow)) > 0) or ((count (magazines pow)) > 0)

On Activation: pow setcaptive false

Works great for me.

Share this post


Link to post
Share on other sites

Count!! That's it!! I was forgetting. Weapons unitname gives you an array of the weapons carried by the unit. Count weapons unitname will count how many wepaons the guy has.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×