If the targets (for the spawned aircraft) are mobile and aren't better defined than "generic player 1 forces" (I might specify the type like heavy mounted, heavy infantry as different targets but cannot be sure what exact units the player will still have at this point)
For a bombing scenario, it's also funny to use:
Code: Select all
// void AttackAreaWithSelection(const char *in_szAreaName)
// Give an attack area goal to the currently selected units, targeted
// at the area named in_szAttackee. This is only for units with area
// attacks (projectiles, etc.), not for telling the selection to kill
// everyone in a given area. After giving the goal, this flushes the
// current selection.
// example usage:
SelectGroup("Bombers");
AttackAreaWithSelection("Guernica");
Depending on the size of the map, and the number of bombers you're trying to use. It might look very nice when bombers arrive, drop bombs without rotating, and then leave the map. Like every single bomber is set to drop a bomb at different location. Areas placed in the Map Editor can have very tiny sizes. With a good timing you are able to leave the map without rotating.
But it's just my idea, so don't keep it in minds too much. On the other hand attacking the empty ground is also unrealistic in real-life (unless you fight with forest wildfires in Sweden).
Also, you say that to finish I can move MoveSelection() / MoveSelectionToArea() to some point outside of the map (like -200, -200 and such), to make it more realistic if any player sees where they escape - love that, I suppose you can do that with any unit (like your truck example), and can you spawn the units (aircraft or other, with CreateNamedUnitInArea(), CreateGroupedUnitAtLocation() etc.) also at some point outside the map, then have them MoveSelectionToAreaWithAttack(), so we don't just see them "pop" into existence?
I could be misleading. It's possible that units can't be spawned / moved to negative locations (like less than 0). It would need to be tested. But then, you can move to 0,0 or 500,500 (if the map is 500x500) and make them disappear here. I would recommend to check my planes scenario script, as there are bombers used that disappear when they're in the area at the end of the map.
However, my scripting methods were unique and hard to understand. I generally created a world based on looped events, so it's like multithreaded scenario, where events repeat multiple times, using exactly the same function in the .IES. It required a lot of tests like "DoesUnitExists", bools, and other stuff to make it error-free. After this scenario I decided to never do anything .IES related in the future. It gives too many headaches. In my opinion IES is nice for easy stuff. Not to mention the unique camera rotation method that I made especially for it.
what if a player has lots of units stationed there at time of spawning? could it block the spawning? never mind that it would look super odd if player can see the "pop-in" effect :p
Well, it's not a big problem. In EE2: AOS "Rorke's Drift" Turning Point, they spwan all the time, and you can see it. Maybe it's not worth too put too many attention on details that even the main game studio didn't care about. I'm a bit hypocrite saying this (based on even littles possible bug fixes in UP1.5), but this attitude helps not to go crazy with stuff.