Home   Help Search Login Register  

Author Topic: Error debug  (Read 1216 times)

0 Members and 1 Guest are viewing this topic.

Offline Jh62

  • Members
  • *
Error debug
« on: 15 Aug 2012, 22:23:51 »
Hi.

There a way to see errors from scripts or functions properly?

I mean, I have some errors sometimes off-screen and I can't see what's wrong.

Thanks.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Error debug
« Reply #1 on: 15 Aug 2012, 22:30:46 »
It depends a lot on what scripts and commands you're using.

I'll put an example here:

Code: [Select]
if (not CreateDialog "SELECT_DIFFICULTY") then {hint"Problem opening Dialog";DifficultySelected = true}

Basically what this does is tell me if there is any problem in loading up the dialog that I have created. If a problem is detected, then a hint is made which tells me so. This is one example.

You could do something like this:

Code: [Select]
if DeBug then {player sidechat format["overcast level = %1; max. level = %2  rain level = %3",_overcast,_currentMax,RainLevel]}

Here, 'Debug' is a global variable, and if it is made true at point during the mission, I can make hints or in this case, sidechats appear which tell me what's going on in the script, and what data is being created, etc.

In this particular example, I've used the sidechat command to tell me the values of other global and local variables.

This is basically how you can error trap.

Hope this helps

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline faguss

  • Members
  • *
    • Faguss' Website
Re: Error debug
« Reply #2 on: 18 Aug 2012, 02:15:45 »
Interesting problem.

On a widescreen you can see a bit more of the message but that may not be enough.

However, it's possible to retrieve it from the memory. Such option will be included in the next Fwatch version.

Edit:  On a 16:9 you can see 149 characters. I can extract 512 from memory. Don't know how to get more.
« Last Edit: 18 Aug 2012, 12:56:39 by faguss »

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Error debug
« Reply #3 on: 18 Aug 2012, 09:05:26 »
Oh, so you're having problems seeing errors that are so long you can't see them on the screen?

My mistake. I thought you meant something else. Sometimes a script won't work properly and no errors are given.

Post an example of a command that's giving you errors and perhaps we can see what's wrong...




Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba