Hi,
How do I enable script Logs output? eg: in AI.bsf i see calls to Log() and i'd like to read the log.
I tried changing vars like "DebugMode" in TWEAKS.TXT but the game overwrites the file at startup.
Do I have to modify another file or add arguments to the exe like -debug ?
I use Steam if that makes any difference.
Thanks.
Enable scripts Log
-
roguedjack
- Administrative Corporal - SdKfz 251/1

- Posts: 129
- Joined: Wed Oct 18, 2017 1:40 pm
Enable scripts Log
"Rise Of AI" AI mod for Field Of Glory II
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
-
pipfromslitherine
- Site Admin

- Posts: 9886
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Enable scripts Log
You should make changes to the tweaks in your USER.TXT file in My Documents/My Games/FieldOfGlory2. You should never change files in the installation folder.
DEBUGMODE 1
is the correct setting to add.
Cheers
Pip
DEBUGMODE 1
is the correct setting to add.
Cheers
Pip
follow me on Twitter here
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Enable scripts Log
In /Documents/My Games/FieldOfGlory2roguedjack wrote:Hi,
How do I enable script Logs output? eg: in AI.bsf i see calls to Log() and i'd like to read the log.
I tried changing vars like "DebugMode" in TWEAKS.TXT but the game overwrites the file at startup.
Do I have to modify another file or add arguments to the exe like -debug ?
I use Steam if that makes any difference.
Thanks.
there is a file called User.txt
Shut the game down before editing it, or the game will overwrite your edited version when it closes.
Add the line
DEBUGMODE 1
Richard Bodley Scott


-
roguedjack
- Administrative Corporal - SdKfz 251/1

- Posts: 129
- Joined: Wed Oct 18, 2017 1:40 pm
Re: Enable scripts Log
Thanks!!
"Rise Of AI" AI mod for Field Of Glory II
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
-
roguedjack
- Administrative Corporal - SdKfz 251/1

- Posts: 129
- Joined: Wed Oct 18, 2017 1:40 pm
Re: Enable scripts Log
I tried but I dont see Log() outputs in any file. I couldn't find a log.txt for instance, and it doesnt output to error.txt. I suspect Log() just prints to stdout or was disabled in the release?
Its no big deal, I found a workaround.
For anyone else wondering, to output debug stuff from your scripts to error.txt
1) Add the var as explained above in User.txt
DEBUGMODE 1
2) Then in your scripts...
...to output a const string use harcoded
...to output a string and a few int vars use defined in Functions.bsf.
The lines will output in error.txt prefixed with "SCRIPTDEBUG: "
Might be usefull to people scripting campaigns and what not.
Happy script debugging!
Its no big deal, I found a workaround.
For anyone else wondering, to output debug stuff from your scripts to error.txt
1) Add the var as explained above in User.txt
DEBUGMODE 1
2) Then in your scripts...
...to output a const string use harcoded
Code: Select all
DebugLog()...to output a string and a few int vars use
Code: Select all
DebugLogX() DebugLogY()The lines will output in error.txt prefixed with "SCRIPTDEBUG: "
Might be usefull to people scripting campaigns and what not.
Happy script debugging!
"Rise Of AI" AI mod for Field Of Glory II
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
-
pipfromslitherine
- Site Admin

- Posts: 9886
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Enable scripts Log
IIRC Log just outputs to the battle log (toggle using F6 IIRC). DebugLog (as you point out) sends a string to the error.log file and to any attached debug stream.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
-
roguedjack
- Administrative Corporal - SdKfz 251/1

- Posts: 129
- Joined: Wed Oct 18, 2017 1:40 pm
Re: Enable scripts Log
Log outputs to the battle log. Thanks again for the help!
"Rise Of AI" AI mod for Field Of Glory II
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
http://www.slitherine.com/forum/viewtopic.php?f=477&t=102040
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Enable scripts Log
Not the combat log.roguedjack wrote:Log outputs to the battle log. Thanks again for the help!
Press f6 to make the Log() log appear.
Richard Bodley Scott

