Jump to content
Sign in to follow this  
celery

Mini Realism Mod - Accuracy enhancement

Recommended Posts

Thanks Celery for the code snippet smile_o.gif

And thanks Sickboy for the invaluable coding tip smile_o.gif

Incidentally Celery, I wrote an eventhandler that I wanted applied to everything in the map, and the solution suggested to me was to make a huge trigger that covers everything, set it to Anybody, present, once

and have something like this in the on activation:

{_x addeventhandler ["killed", {[_this select 0, _this select 1] exec "myHandler.sqs"}]} foreach thislist;

correcting for new knowledge from Sickboy wink_o.gif this should give you some ideas about how to apply the eventhandler without using the init field for each unit.

You can also use "nearObjects".

I was using createTrigger before, but finally found out that nearObjects to be much faster to get a list of objects. Unless of course you have a special condition to meet for the units you want to detect, in which case changing the condition statement of the trigger accordingly is better.

But for a simple "I need the list of all OPFOR soldiers 100m around here", I simply use a <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_position nearObjects ["SoldierEB", 100]

Share this post


Link to post
Share on other sites

Moving to mission editing and scripting

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  

×