Jeremy James 2 Posted February 15, 2018 Hi Guys, Looking for help in giving orders to spawned AI's. I know how to command AI's that don't spawn but not spawned ones. I want the AI's that spawn to get into a certain aircraft or move to a certain area, guard, attack etc. Is there a list of Spawning AI commands that goes into the init section of the spawn point attributes? Thanks in advance. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted February 15, 2018 1 minute ago, Jeremy James said: Hi Guys, Looking for help in giving orders to spawned AI's. I know how to command AI's that don't spawn but not spawned ones. I want the AI's that spawn to get into a certain aircraft or move to a certain area, guard, attack etc. Is there a list of Spawning AI commands that goes into the init section of the spawn point attributes? Thanks in advance. Do you need help to reference the spawned AI units? How do you spawn those units? Cheers Share this post Link to post Share on other sites
IloveArma 1 Posted February 15, 2018 Hmm id be interested in this also. I use the spawn AI function. However it limits to Opfor, blufor and AAF. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted February 15, 2018 Well in that case the simplest way to reference newly spawned units would be to check the allUnits array, something like this: //select all units that have not been handled yet: _freshSpawns = (allUnits - [player]) select {_x getVariable ["TAG_fnc_isFreshSpawn",true]}; { //do what you want with the fresh spawns, like the sidechat example: _x sideChat "I am a fresh spawned unit!"; //after we're done we tag the unit so it's not handled as a fresh spawn _x setVariable ["TAG_fnc_isFreshSpawn",false]; } forEach _freshSpawns; Depending on if you want to include the player or all players on MP would need a minor change. Cheers Share this post Link to post Share on other sites
IloveArma 1 Posted February 15, 2018 thanks. doi I replace the _x with unti name or no need? Also can't seem to get units to talk with the gorup chat in their init. Share this post Link to post Share on other sites
Jeremy James 2 Posted February 15, 2018 Not sure what you mean by referencing to AI's to start with and the rest of the replies were a little over my head. I think I should try and make myself a little more understood. So, I know what to do with normal AI's, so that aside.......... Say, we have an AI spawn position, when those AI's spawn they do nothing other than shoot back when shot at and their position is set by the spawns attributes. Now let say we want these spawned AI's to get into a vehicle or aircraft or engage the enemy at a certain position, how do you command them? Bear in mind that the commands are set at the start of a mission, part of the mission set up and not by Zeus or in game by a player, commands that would be set up into attributes of the spawn module itself, just for that module and or just for the units spawned on that module. Funny, its clear as a bell in my head but more difficult to explain it. Share this post Link to post Share on other sites
AZCoder 921 Posted February 15, 2018 3 hours ago, IloveArma said: thanks. doi I replace the _x with unti name or no need? Also can't seem to get units to talk with the gorup chat in their init. The _x in the GOM's example is a magic variable, don't change it or it breaks. You cannot issue chat from a unit's init because the mission has to be running first ... at least last time I checked this was true. Which is why you have to reference the unit in script. In GOM's example he loops through all units that are not the player and makes them chat. Regarding the spawn module, I never use it so I can't say much on it. I assume it has variables that can be set during it's initialization, but I don't know what they are. Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted February 15, 2018 16 minutes ago, AZCoder said: You cannot issue chat from a unit's init because the mission has to be running first ... at least last time I checked this was true. Which is why you have to reference the unit in script. Correct, still the case, object init fields are the third task being run before the mission begins (time > 0). So no one will ever see this chat, same for animations from object init fields. 3 hours ago, IloveArma said: thanks. doi I replace the _x with unti name or no need? Also can't seem to get units to talk with the gorup chat in their init. No need to change the _x, as @AZCoder said, it's a magic variable. Why do you use the AI spawn module (from what it looks like)? Any specific reason? You can also place AI in the editor and have them invisible and inactive until needed without performance hit. Cheers 1 Share this post Link to post Share on other sites