astruyk / Ares

An arma3 mod that adds some extra functionality to Zeus
51 stars 11 forks source link

Pass 'Unit under cursor' and location to 'Execute Script' modules. #191

Closed astruyk closed 9 years ago

astruyk commented 9 years ago

... So that people can easily run one-off custom code using a location on map or a unit on the map by dropping one of these modules on it. Right now it's executed without passing those parameters along.

Arcanum417 commented 9 years ago

I am trying to use it, but for example "this allowDamage false;" placed with execute code placed on vehicle is not working, how should I use it ?

astruyk commented 9 years ago

It's passed the same way it's passed to the custom modules. Use '_this select 0' to access the position of the dropped module, or '_this select 1' to access the unit under the cursor. You should always check that the unit under the cursor isn't null before using it (since the module might not be dropped on a unit).