Silver Surfer 0 Posted December 21, 2006 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. 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
whisper 0 Posted December 21, 2006 You've put "NOTHING" (I hope my german didn't failed me here and "KEINE" means indeed "NOTHING" ) on the "Activation" condition Try with "Anything" instead Share this post Link to post Share on other sites
Silver Surfer 0 Posted December 21, 2006 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
Big Dawg KS 6 Posted December 21, 2006 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
Silver Surfer 0 Posted December 21, 2006 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
Big Dawg KS 6 Posted December 21, 2006 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. Share this post Link to post Share on other sites
raedor 8 Posted December 21, 2006 Oh, my mistake, I thought the condition needed to be string like foreach, [...] In ArmA even forEach needs code Share this post Link to post Share on other sites
Big Dawg KS 6 Posted December 21, 2006 Oh, my mistake, I thought the condition needed to be string like foreach, [...] In ArmA even forEach needs code Well tell that to the wiki! I know... I know... Share this post Link to post Share on other sites
raedor 8 Posted December 21, 2006 Oh, my mistake, I thought the condition needed to be string like foreach, [...] In ArmA even forEach needs code Well tell that to the wiki! I know... I know... > < It's there! Share this post Link to post Share on other sites
Silver Surfer 0 Posted December 21, 2006 Arma is taking the code but it dosen´t execute it 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
Big Dawg KS 6 Posted December 22, 2006 Well, I'm not even sure if mines will even be detected by triggers. Actually I'm fairly certain that they won't. You might have to use nearestObject. Share this post Link to post Share on other sites