Jump to content
Sign in to follow this  
Cougar_DK

Debugging a script

Recommended Posts

Is there some way to make a log.txt file or the like? Hint is good for simple scripts, but I have a script that runs for each AI (about 80) and would like to see something about them, so hint is not an option.

So is it possible to make an external log file by scripting in ArmA?

Share this post


Link to post
Share on other sites

I haven't found a way myself. There are these commands as "debugLog" and "echo" but they seem to be disabled in the retail version. Luckily I guess, since the potential for abuse in rogue missions would be high.

I typically use the sideChat command but this only allows you to monitor a few variables. A good alternative -even though a bit manual- would be Stra's Debug Console which allows you to interrupt the game at any time and monitor any variables.

To be found here: http://str.rival.cz

Victor

Share this post


Link to post
Share on other sites

The error Log file is reported to a file called ArmA.Rpt in "local prefs/ArmA" as default (hidden folder to make visible in extra options of ur explorer) .... if this is what u r looking for.

Share this post


Link to post
Share on other sites
The error Log file is reported to a file called ArmA.Rpt in "local prefs/ArmA" as default (hidden folder to make visible in extra options of ur explorer) .... if this is what u r looking for.

Can I put data in this file?

Share this post


Link to post
Share on other sites
I haven't found a way myself. There are these commands as "debugLog" and "echo" but they seem to be disabled in the retail version. Luckily I guess, since the potential for abuse in rogue missions would be high.

I typically use the sideChat command but this only allows you to monitor a few variables. A good alternative -even though a bit manual- would be Stra's Debug Console which allows you to interrupt the game at any time and monitor any variables.

To be found here: http://str.rival.cz

Victor

Thanx Victor. I will take a look.

Share this post


Link to post
Share on other sites

So perhabs i failed the point.Do you want 2 c where error are reported to?Or do u need a debug console like that we had by VB in OFP times?...and no u cant put files in the file .... why don´t u take a look at that ArmA.RPT?! whistle.gif

Share this post


Link to post
Share on other sites

Nephris,

I think this is not about game errors to be traced back - Cougar just wants to dump variables and values from his mission into some file to analyze them later. And I can't see a way to do this.

Victor

Share this post


Link to post
Share on other sites
So perhabs i failed the point.Do you want 2 c where error are reported to?Or do u need a debug console like that we had by VB in OFP times?...and no u cant put files in the file .... why don´t u take a look at that ArmA.RPT?! whistle.gif

Sorry for looking as a total noob (I'm am in OFP/ArmA edting, but everyone has to start somewhere) and have no clue as of what ArmA.RPT is....

And yes I want to debug my script. I want to create my own log file with debug data in it (like i do everyday in my proffesional life as a software developer). I was just wondering if it was possible. I saw at the Wicki that the debugging commands was disabled but not echo, even though it seems that.

Share this post


Link to post
Share on other sites

One debug trick is to dump the variable information into a chat.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? (debug):_mes = Format["Name: %1, Index: %2, Cost: %3, Group: %4",unitNames Select _unitType,_unitType,_buildTime,_group]

player GlobalChat(_mes)

In MP you can then use the / chat key and page back and look at the globalchat messages. Not sure if this works in SP mode.

The RPT file will only show you if you've screwed up the syntax.

Share this post


Link to post
Share on other sites

Ok thanx hoz. To bad we can't dump info to a text file. I will try the chatmessages. And like you, I'm not sure they can be used in SP.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×