Sanchez Milsim 70 Posted November 12, 2014 Hi, im trying to make a task to be suceeded when player place ATmine near position to a marker. This is an example of script that im using but no works. waituntil {(count ((markerpos "putmine1") nearObjects ["ATMine",1])) > 50}; In theory when i place mine and its nearest 50m to marker "putmine1". But it doesn´t work. Its possible when player pace a ATmine classname change for other? Im using AGM, but i check github and no place change classname for these item. thanks!!! Share this post Link to post Share on other sites
jshock 513 Posted November 12, 2014 Theorectically you could try a mixture of a "Put" EH and within that have a check on the object placed by the player (_this select 3), and the distance of the player from the marker (in the following example the marker/player distance check is probably incorrect): player addEventHandler ["Put", { if (_this select 3 == "ATMine" && player distance (getMarkerPos "putmine1") < 50) then { //set task state to true }; }]; Share this post Link to post Share on other sites
dr_strangepete 6 Posted November 12, 2014 I think the error is the 50 and 1 are swapped....as I'm reading above, you are waiting until 50 AT mines spawn within 1m of the marker location. Share this post Link to post Share on other sites
jshock 513 Posted November 12, 2014 (edited) I think the error is the 50 and 1 are swapped....as I'm reading above, you are waiting until 50 AT mines spawn within 1m of the marker location. Ahhh, that is a good point, and looking at the wiki page for nearestObjects, the code he is using isn't syntactically correct: waitUntil {count ((getMarkerPos "putmine1") nearObjects [["ATMine"], 50]) >=1}; //^This is done based off the comment made by Katulobotomia in the wiki for nearestObjects command (in 2013) //so if that doesn't work, then waitUntil {count (nearestObjects [(getMarkerPos "putmine1"), ["ATMine"], 50]) >=1}; Edited November 12, 2014 by JShock Share this post Link to post Share on other sites
iceman77 19 Posted November 12, 2014 He's using nearObjects though =) Share this post Link to post Share on other sites
jshock 513 Posted November 12, 2014 (edited) He's using nearObjects though =) Well...reading fast doesn't do me any good does it...missed the missing "est". Updated my previous post with necessary changes. Edited November 12, 2014 by JShock Share this post Link to post Share on other sites
Sanchez Milsim 70 Posted November 12, 2014 Thanks for answer but have not worked. A lot of syntax errors. Line on my post works with an ammo truck for example: waituntil {(count ((markerpos "respawn_west3") nearObjects ["B_Truck_01_fuel_F",15])) > 0}; It works with an fuel truck when it is near than 15 meters of marker, quantity one. I use same with cointainers to move with helicopters and it works. But i dont know why no work with atmine. At cfgweapons appear 3 diferent classnames: ModuleMine_ATMine_F ATMine ATMine_Range_Mag I think its no working because mine change classname when its placed. Its that true? Thanks!!! Share this post Link to post Share on other sites
jshock 513 Posted November 12, 2014 Thanks for answer but have not worked. A lot of syntax errors.Line on my post works with an ammo truck for example: waituntil {(count ((markerpos "respawn_west3") nearObjects ["B_Truck_01_fuel_F",15])) > 0}; It works with an fuel truck when it is near than 15 meters of marker, quantity one. I use same with cointainers to move with helicopters and it works. But i dont know why no work with atmine. At cfgweapons appear 3 diferent classnames: ModuleMine_ATMine_F ATMine ATMine_Range_Mag I think its no working because mine change classname when its placed. Its that true? Thanks!!! I'm not too sure myself, have you tried each classname to see if it will work? Share this post Link to post Share on other sites
2nd ranger 282 Posted November 12, 2014 Pretty sure you need to search for "ATMine_Range_Ammo". Share this post Link to post Share on other sites
Sanchez Milsim 70 Posted November 12, 2014 I'm not too sure myself, have you tried each classname to see if it will work? Yes but not worked. : ( ---------- Post added at 20:45 ---------- Previous post was at 20:23 ---------- Im looking for that http://forums.bistudio.com/showthread.php?150767-Task-quot-Success-quot-activated-by-deactivation-of-multiple-mines this is for deactivation and requires the name of placed mine on map. {mineActive _x} count [mine1, mine2, mine3] == 0 Do you know how to make it work without defining name of mines?? With that "ATMine_Range_Ammo" no works neither. Share this post Link to post Share on other sites
Sanchez Milsim 70 Posted November 12, 2014 Solution: waituntil {(count ((markerpos "putmine1") nearObjects ["ATMine_Range_Ammo",50])) > 5}; 6 mines of class "ATMine_Range_Ammo" less than 50m marker "putmine1" Thanks 2nd Ranger finally using ammo name works, before when i check class i did something wrong. Share this post Link to post Share on other sites