Jump to content
Sign in to follow this  
soldia

Check if any unit in array got a specific item (in trigger)

Recommended Posts

Hi guys,

I got a problem on checking if any unit in an array got a specific item/weapon. To be more precise:

Got 10 players in my mission, each named by guex (x = [1...10]). Further I got a crate and the item/weapon "EvMap" in it. Now I want to combine it with a trigger "if any unit of guex hasWeapon "EvMap" then blablabla" to detect if any of the units has taken the EvMap out.

Here is the question:

Is it sufficient if I put in the condition field of the trigger or is it problematic in MP scripting?

player hasWeapon "EvMap"

Another possibility would be to create a construct with a lot of OR conditions. It's ok with 10 units, but would be a lot of pain with 40 or more.

Can you help out on that? Thanks in advance

Share this post


Link to post
Share on other sites

Personally, I wouldn't use a trigger for that. But if I were to use a trigger, I would do:

If your using a trigger radius:

Activation: select player's side

Condition:
this & player hasWeapon "EvMap";
On Act:
hint "A player has 'EvMap'";

Otherwise, just make a trigger with:

Condition:
player hasWeapon "EvMap";
On Act:
hint "A player has 'EvMap'";

Share this post


Link to post
Share on other sites

That was my original approach. I am concerned that it inflicts problems when using in MP (with JIP). But I made it server side only and will test it anyway.

But thx for the help so far.

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  

×