PDA

View Full Version : Question to Shogun or Mike regarding -ai parameter



player1
07-27-2005, 18:58
Q: MikeB mentioned an auto-run feature that can be used to run a game without player intervention. This would be very useful for mod testing. Is there any way we can activate it now? If not, will we be able to in the future?

A: MikeB was very naughty to mention that and will shortly be fighting the company bear to pay for his mistake. :) This is a feature we use internally for debugging. Autorun is not something that we've openly advertised for released versions, and it's not normally something that a player would want to do, simply because they are *playing* the game rather than *watching* stuff happen. However, there's a -ai command line option that turns autorun on in release builds after the 1.2 patch. This doesn't work with earlier versions of the game.

Any way to pause or temoraly disable ai autorun?
Currently if I start game with -ai, it goes and goes and never stops.

And if I save game, and load it (after removing -ai), it still goes and goes...
No way to stop it.

And stoping is crucial, if I (and other moders) need to examine AI player game.


Mike, Shogun?
Please?

Colovion
07-27-2005, 20:16
post pics of the bear :2thumbsup:

ShellShock
07-27-2005, 21:52
I might be able to add support in RomeSage (http://www.twcenter.net/downloads/db/?mod=448) to disable the -ai switch in the save file, assuming it is simply a few bytes that are affected, but I won't be able to do anything until the weekend.

Duke John
07-27-2005, 22:00
That is an answer that doesn't bode well for the modding community. Do they actually realize that people are modding their game?

player1
07-27-2005, 23:12
I might be able to add support in RomeSage (http://www.twcenter.net/downloads/db/?mod=448) to disable the -ai switch in the save file, assuming it is simply a few bytes that are affected, but I won't be able to do anything until the weekend.

Better then nothing. ~D

player1
07-28-2005, 12:39
Here is a replay from Shogun at TWC:

@Player 1
Just asked around and the two console commands you need are halt_ai and run_ai, which do exactly what the names suggest on the campaign map screen. You open the console by hitting the ~ key during play. Hope that helps!

Unfortunately, it seems that this command is disabled in console, at least in 1.2
Not like it is first time, since some other commands can only be accessed by scripts and not console.

So, I'm again stucked...
:cry: :cry: :cry:

Epistolary Richard
07-28-2005, 12:49
The halt_ai command certainly works through a script because Myrddraal uses it in his Hot Seat mod. Don't know about the run_ai one though.

player1
07-28-2005, 14:22
Unfortunately I can't seem to run any script (nor starting nor, "show me") when -ai is turned on.

Epistolary Richard
07-28-2005, 16:07
Hmmm... that's strange, not even a campaign script huh? They should be referenced automatically.

player1
07-28-2005, 16:50
I was wrong.
Campaign starting script works.
I just tested it with simple toggle_fow script.

And later I tried one with halt_ai at start and it didn't started autoai even with -ai enabled.


EDIT:
Although I'm not sure would script that lasts more then 1 turn would work. I think I had some problems with that.
My plan was to make script that would stop autorun after 10-20 turns and start it again after pressing end of turn.

If it could work, it could be great tool for moders.

player1
07-28-2005, 17:53
I succeeded in making small script to run AI for X turns (2 years in this case). After that game is stoped and can't be continued (since AI is disabled).


script
suspend_during_battle on
while I_TurnNumber < 4
end_while
console_command halt_ai
end_script

ShellShock
07-30-2005, 10:27
Does anyone still want me to try and add support to RomeSage for toggling the ai switch? I don't want to put in the effort if no one is going to use it ~;)

player1
07-30-2005, 11:39
Yes,
Because whatever scripting stuff I do to stop it, every time I load saved game, it starts auuoruning again.