PDA

View Full Version : Making trigger affect multiple objects



keppo
Jul 5 2009, 14:23
Lets say I would like to blow markers bomb, bomb2, bomb3. I would use

bomb = "Bo_GBU12_LGB" createvehicle getmarkerpos "bomb"; bomb = "Bo_GBU12_LGB" createvehicle getmarkerpos "bomb2"; bomb = "Bo_GBU12_LGB" createvehicle getmarkerpos "bomb3"
but it kinda sucks to put those everytime, especially if you have more objects.
So is there easier way to do this, like give those units one name or sumthing.

Thank you in advance and sorry, kinda hard to explain >:)

Inkompetent
Jul 5 2009, 16:03
{ bomb = "Bo_GBU12_LGB" createVehicle getMarkerPos _x } forEach ["bomb1","bomb2","bomb3"]; would be the shortened way to write it :)

I.e. run the code within the curly brackets for each element in the list, where _x is the currently looked at element.