Tutorial Part 03

Civilian AI

<<<– 4 –>>>
>>> Index >>> Tutorial Part 03

8. Now we need to add objects and scripts for our Civilian AI.

In our example we have already created 2 New Player of Civilian Faction. There they were named “CompEnemy” and “CompFriend“. So we have 2 players from whom we can transfer units according to certain scenarios. Or we just simply give them a role on our Map, with their own bases.

All Units and Structures of a Civilian AI Player should be named, that we find and use it in scripts. Remember, named Units can be spawned at locations in a certain angle. You can’t use the Team Builder tool here. So you have to spawn your units. Warfactories do not open its doors…. yes, sadly true. Of course you can pump out new units by triggering the commandbuttons of a building, but then you get unnamed units by that. So we have to write a lot of scripts in any case and name all wisely. There will be script snippets for this availble under Usefull Stuff on page 6.

I will reduce it to its core in this tutorial example map. Only “CompEnemy” will be used for this. I will first show the use of Build List Tool. And we will need a few scripts for the named Buildings and named Units.

8.1 Place some units on the map and make their Default Owner to be “teamCompEnemy”.

Next we name the units.

8.2 Place some base buildings for CompEnemy with the Build List Tool.

That “Pick A Unit” window is a little bit bugged. It pops up again by any click on map after closing it and by still having Build List Tool active. But for adding buildings now we need it to choose the right building.

After that you can close that Pick A Unit window and select a building in your Build List for CompEnemy and bring it in position.

Here we can also name our buildings and setting up the Rebuilds.

8.3 Add some scripts to make CompEnemy alive.

And we need to create scripts that units will be respawn when they have died.

Now give your Civilian AI some cash.

And maybe at least a subroutine script for the Gattling Cannon on its creation. I will link it in Build List Tool.

You can do a huge amount of actions via scripts here, but as announced I will reduce it in this example to its core. Only to show how to get it run.

<<<– 4 –>>>
>>> Index >>> Tutorial Part 03

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.