Savage 2: A Tortured Soul Forum

Savage 2: A Tortured Soul Forum (
-   Savage 2 Modding (
-   -   AI Commander mod + map v0.5 (

Holleau 12-24-2011 02:55 AM

AI Commander mod + map v0.5
Update 2013.05.02 Durwyn's upgraded mod website

Visit this awesome site:

Update 2013.04.27 Durwyn's upgraded maps


Portable Savage 2:

The old post:

Merry Christmas!

I'm working a mod what tries to emulate commanders and players. It's still unfinished, but because it's Christmas:


Here are some pictures (there is no human on the field):

How to handle:
- You can set AI units (number, difficulty: reaction time & aggroradius), and AI Commander in the menu [Esc]
- If nothing happens in the first 20 seconds don't panic! Commander orders & PET spawns are delayed.
-The script is independent from the map. If you copy the triggerlist, and the files from the resources folder to ANY map it has to work. (The dumbness of the AI can depend on map layout + The PETs have a weird urge to slaughter NPCs.)

- If you enable the AI commanders first, the PETs won't be wandering around the map.

What's ready:
- The script finds mines at mapload, and use them as waypoints.
- The AI commander can build a preset base (the building places are set regardless if there's an other building or not, so please don't bulid in front of the base).
- The AI commander sends out workers, to build mines, garrisons, towers.
- Units (Pets) are using both ranged & melee weapons and sometimes an additional skill / spell. (The switch can be a bit slow.)
- The AI commander can give orders to the PETs.

The things I'm stuck with:
- The AI commanders won't use the game economy, because I can't reduce team gold.
- The detect hellshrine script is buggy (it's deactivated in this version)
- Collosion detection at spawning buildings (to avoid "overbuild")
- Let a human commander to give orders to pets. (Somehow use the UI multiselect indexes in SetPetJobPatrol)
- Do the same for summoned pets ("make" a guard position Petcommand)
- Do the same for officers. (Let them order around the Pet units.)
- Make AICommander voteable.
- Newly found bug: The basic pet commands (attack, return) can be binded in options. <= buggy function

If you enjoyed this sneak-peek, or if you can help me, please write a comment.

I wish you happy holidays: Holleau

Thank you Rohezal, for the knowledge and encouragement you gave me!

coolnesss 12-24-2011 08:03 AM

Very nice work buddy, and merry Christmas!

SonOfAthena 12-24-2011 10:39 AM

Merry Christmas.

Good luck! :happy:

lololala 12-25-2011 11:04 AM

Awesome !!!!

Holleau 12-25-2011 10:39 PM

Hi all!

Thank you for the positive replies... those keeps me "ticking"! I can't get enough :D Let me know, if you want something implemented in the script.

I have a serious question, to the modding community: i think i can manage to let a human commander give orders to PETs via SetPetJobPartol <index> <posx> <posy> <posz>, and the index can be "grabbed" fom multiselect-index in the UI, but i can't figure out how to catch the right click of the commander player, to start my "CommandPet" script. (Should i make a panel, or an instance, or a template?) Sadly i suck at UI scripting, any help or clue would be appreciated.

I really hope you can help me. Best regards: Holleau

Durwyn 12-27-2011 11:25 AM

Nice mod :D :D i love playing against AI x) (im sure to win =P xD)

edit: i take back what i said, its not easy to win against AI :( (as a commander xD)

Sintax 12-27-2011 05:19 PM

This is a really cool project! This can be a great way for new players to practice without worrying about other people, especially for commanding.

I wish I knew more about modding and could help you out.

edit: it's fun to play as commander and mess around and try to win, but it always seems to crash after a while

Holleau 12-27-2011 08:07 PM

Crashing bug
Hi all! Thank you for the feedback! It helps a lot. (I only can test in 2 computers & systems => so some problems can avoid my sight).

I've also experienced the crash problem under win7. The easy solution is to run Savage in XP compatibility mode => it wont't crash, only lag.

EDIT - the other solution: I can't put exactly my finger on the problem, my guess is that some scripts simply overused the memory. I've implemented some failsafes (if a sub-script is already running, the program won't start it again, and again, and again, and again...), so it should work. At least it's working on both of my computers without crash (under a 2 hour test). But if you experiencing any bugs please tell!

The links on the first post are changed!

Another problem: as you saw, the script can manage nearly 20 PETs... but if they doesn't change weapons / doesn't use skills then a lot more can be handled. (The most resource consuming task is the weapon swap between melee & ranged) The question is: What's better? A dozen of "reallike" warriors, or a horde of critters? (Or some mixture?)

If you have ideas, or found bugs, or just want to give me a happy day, please write!

Durwyn 12-28-2011 12:01 PM

I will test your new versions right now. first by letting AIs destroy themselves (and see if it crashes) and then i will take part in the combat as a commander.

The recommended number of PETs is still around 5?

Is it possible to change the waypoints to garrisons?
If the garr is closer to enemy MAIN base than others, regroup at x,y garrison

Maybe you can add a new scroll with real-like warriors <--> horde of newbies? xD
Thank you for your work, its pleasant during the work! :)

- on Duskwood, Humans siege dont move from the stronghold (Or only if enemys are in their sight, then they move)

Holleau 12-28-2011 01:21 PM

Re: testing
Thanks for the voluntary testing! I really appreciate your help. The answers for your questions:
- The recommended number for pets is a sum of 10. But for testing purposes I usually max out everything (20 Pets on both sides, and 10 sec commander reaction_time)

- It's possible to change waypoints to garrisons, but I'd suggest to move the spawning positions to the nearest garrison. It seems to be easier. I'm planning to do it, if the crash & lag bugs are permanently fixed. (Last night I've tried a LAN game, and for some reason it was unstable.)

- I like the idea of separate "heroes" (who use abilities and changes weaponry) and "critters" (who use only one weapon). Maybe i'll use some different skins for the weaklings (one melee and one ranged per side). So players can fight in epic (50+ enemies) battles.

- I'll take a look on the Duskwood map today, and find out what the problem is.

P.S.: Is there any signs of the crush bug yet?

P.S.II.: If only I could make the PETs obeying the commander's orders.

All times are GMT. The time now is 01:33 PM.