AI debug

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

AI debug

Post by rf900 »

Hi,

I am debugging AI actions to improve their effectiveness. I am using this right now:

Log("VP0",GetScriptGlobal("Slith_VictoryPoints", "VP_Team#0"));

Took it from the wiki, btw there is typo: http://www.slitherinebravo.net/GameWiki ... ing_ui_hot VPTeam#0 missing the underscore.

The thing is that this return a 1 if some team is targeting the VP, but I would prefer if it returned the list of team numbers attacking it.

Is there any other way to easily check what are the current orders of each team? I am using also GetTeamDestinationX(side, team) but would like to have a faster way of checking it. Is there a translation from coordinates to VP number?

Edit: Not sure if I am doing correctly the VP_Team call. Also I noticed a strange thing, I am changing the orders in turn7 for example, and after I write the log, the AI target does not change until its next turn (turn9). Why is this? Even setting the orders at the prebattlesetup I get a -1 for GetTeamDestinationX on turn1, in the StartTurn function, on turn3 it is then returned correctly.
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Re: AI debug

Post by pipfromslitherine »

The AI generates its movement orders during the start of its turn - that is, when you set something like a VP target, the AI will not immediately begin going there, it has to wait until the start of its turn until it looks at these orders and tries to action them.

I'll fix the typo. Thanks for spotting it!

There are several systems in play on the AI in the case you seem to be looking at. E.g. the VP plugin is sending orders to the AI teams that are set to attack VPs. The key information is indeed the team destination and you can also look at team data [0] to see if there are any 'orders' for that AI team.

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”