and it appears to work for all the units, although interestingly not warp prisms in phasing mode... are they not considered units in the editor or something?
Okay, so it worked...kind of. If I spawn 5 Zealots then use AISetUnitScriptControlled on UnitLastCreated the AI will use 4 of the Zealots and ignore 1. So, I could spawn each zealot one at a time and use this method, but it does seem inefficient. Any ideas?
Ah, that's the problem - I don't want to delete the AI initializing triggers... I could I guess, by having a seperate AI and initialize the AI's individually, but I ideally want the AI to play a normal game of Starcraft but Also the game will spawn some units into an area of which I want the AI to ignore these units so they can defend that area.
I'll try MaskedImposter's method of disabling script control for the last created units tonight and let you know how successful I am.
I don't know why but I can't seem to find any information on what should be one of the most simplest things to do in the editor. I have placed units on the map and they belong to an AI. I want the AI to not use these units like they normally would, (ie bunch them up together/defend/attack) I want the units to just stand in that area and wait for the player to come and engage them - just like you would have in the campaign or in co-op. Yet I can't seem to get the AI to decide against grabbing everything on the map and immediately attacking the player with it rendering my map unplayable.
I have gone to Object properties and unchecked "Available for attack waves" and I thought this would do the trick, but to no avail.
If anyone can help or link a tutorial I'd much appreciate it.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Thanks, it works. I'm using:
AISetGroupScriptControlled((UnitGroup(null,4,(RegionEntireMap()),Excluded: Worker, Missile, Dead, Hidden,0)),false)
and it appears to work for all the units, although interestingly not warp prisms in phasing mode... are they not considered units in the editor or something?
Okay, so it worked...kind of. If I spawn 5 Zealots then use AISetUnitScriptControlled on UnitLastCreated the AI will use 4 of the Zealots and ignore 1. So, I could spawn each zealot one at a time and use this method, but it does seem inefficient. Any ideas?
Attached is my attempt in case I'm doing it wrong
Ah, that's the problem - I don't want to delete the AI initializing triggers... I could I guess, by having a seperate AI and initialize the AI's individually, but I ideally want the AI to play a normal game of Starcraft but Also the game will spawn some units into an area of which I want the AI to ignore these units so they can defend that area.
I'll try MaskedImposter's method of disabling script control for the last created units tonight and let you know how successful I am.
I still can't seem to do it. Trying to copy what someone else has done here: https://www.sc2mapster.com/forums/development/triggers/152771-pick-all-units-in-region if I spawn some units in a region, I can't seem to figure out how to make this apply only to them. I'm new to triggers but have spent about a week googling with no luck.
Hi there,
I don't know why but I can't seem to find any information on what should be one of the most simplest things to do in the editor. I have placed units on the map and they belong to an AI. I want the AI to not use these units like they normally would, (ie bunch them up together/defend/attack) I want the units to just stand in that area and wait for the player to come and engage them - just like you would have in the campaign or in co-op. Yet I can't seem to get the AI to decide against grabbing everything on the map and immediately attacking the player with it rendering my map unplayable.
I have gone to Object properties and unchecked "Available for attack waves" and I thought this would do the trick, but to no avail.
If anyone can help or link a tutorial I'd much appreciate it.