Jump to content
Sign in to follow this  
Silver Surfer

count all objects within trigger

Recommended Posts

Hi,

I would like to count all objects within the trigger. In this case I would like to count all mines in the trigger area and set a variable to true so soon the condition is complied.

count.jpg

Unfortunately the version in the picture dosen´t work.

I diden´t found something useful in the wiki so please don´t link me back to it.

thanks silver

Share this post


Link to post
Share on other sites

You've put "NOTHING" (I hope my german didn't failed me here and "KEINE" means indeed "NOTHING" tounge2.gif ) on the "Activation" condition

Try with "Anything" instead

Share this post


Link to post
Share on other sites

Arma is not taking the code. The picture is just an example to illustrate better what I am trying to do.

Share this post


Link to post
Share on other sites

The command object is being used wrongly here, it's only useful for finding objects pre-placed on the island. The object command doesn't even work in ArmA now I am told.

You want to use either typeOf or isKindOf. Also, using the count command your second parameter needs to be an array of what you are counting, in this case you need to use thislist to get the array of objects in the trigger area:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">("typeOf _x == ""Mine""" count thislist)<=6

Or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">("_x isKindOf ""Mine""" count thislist)<=6

Share this post


Link to post
Share on other sites

thanks for your answer Kyle.

part of my problem is that I have no idear how to script so I dont know how to put the commands into a line that works.

In both cases Arma doesn´t accept the code.

Share this post


Link to post
Share on other sites
thanks for your answer Kyle.

part of my problem is that I have no idear how to script so I dont know how to put the commands into a line that works.

In both cases Arma doesn´t accept the code.

Oh, my mistake, I thought the condition needed to be string like foreach, but it should be code:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">({typeOf _x == "Mine"} count thislist)<=6

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">({_x isKindOf "Mine"} count thislist)<=6

It would have worked in OFP. tounge2.gif

Share this post


Link to post
Share on other sites
Oh, my mistake, I thought the condition needed to be string like foreach, [...]

In ArmA even forEach needs code wink_o.gif

Share this post


Link to post
Share on other sites
Oh, my mistake, I thought the condition needed to be string like foreach, [...]

In ArmA even forEach needs code wink_o.gif

Well tell that to the wiki! icon_rolleyes.gif

I know... I know... whistle.gif

Share this post


Link to post
Share on other sites
Oh, my mistake, I thought the condition needed to be string like foreach, [...]

In ArmA even forEach needs code wink_o.gif

Well tell that to the wiki! icon_rolleyes.gif

I know... I know... whistle.gif

>nener.gif < It's there! wink_o.gif

Share this post


Link to post
Share on other sites

Arma is taking the code but it dosen´t execute it sad_o.gif

But maybe my idear was wrong so I better tell you what I am trying to do. The player is supposed to lay a minefield inside the trigger (the minefield have to be bigger than 6 mines) so I put this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">({_x isKindOf "Mine"} count thislist)>=6

inside the trigger. The rest stays like shown in the picture but everytime when I lay the mines inside the trigger it dosen´t take off.

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  

×