Starting Skirmish via Script and a Error Question

Discuss the future of Warzone 2100 with us.
garlicPasta
New user
Posts: 3
Joined: 10 Jun 2013, 12:26

Starting Skirmish via Script and a Error Question

Post by garlicPasta »

Hello guys

i startet writing an AI for Warzone for a project at university.
I was wondering if somebody knows a script to start a skrimish battle for 2 player, because i get really annoyed by making the settings over and over...

Also i get this error

Code: Select all

10.06.13 15:05:01	[0x0-0x31031].net.wz2100.Warzone[1029]	error   |03:05:01: [callFunction:109] 0 : <anonymous>()@multiplay/skirmish/garlicBot.js:135
10.06.13 15:05:01	[0x0-0x31031].net.wz2100.Warzone[1029]	info    |03:05:01: [callFunction:112] Uncaught exception calling function "eventDroidBuilt" at line 135: undefined
The bot runs normally like he should. But i wonder why i get these errors.
How can i caught exceptions???

Thx for help
garlicPasta
New user
Posts: 3
Joined: 10 Jun 2013, 12:26

Re: Starting Skirmish via Script and a Error Question

Post by garlicPasta »

Oh the error disapperad after adding some try and catch in front of 1 of my function calls....
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Starting Skirmish via Script and a Error Question

Post by NoQ »

The bot runs normally like he should. But i wonder why i get these errors.
How can i caught exceptions???
We cannot answer without looking at the code you write.
If you do try..catch, it changes nothing, only suppresses the error, but i'm sure it still doesn't do what you think it does.
In fact, for example, NullBot has no try..catch statements at all throughout ~4000 lines of code, and still throws no exceptions (unless some bug i'm not aware of is found).

Also, hint: always look at the first error, not at what keeps repeating later. It usually makes much more sense.
I was wondering if somebody knows a script to start a skrimish battle for 2 player
Probably you can make a saved game and load it with --savegame command line switch (i didn't try it; see --help for more options). Then you can substitute the AI script, but you won't be able to change the early initialization without re-creating the game anew (unless you eg. explicitly delay the AI startup by 5 seconds and save before it starts).
garlicPasta
New user
Posts: 3
Joined: 10 Jun 2013, 12:26

Re: Starting Skirmish via Script and a Error Question

Post by garlicPasta »

Yes i found the error. thx or the answer:)