Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Superior GSC Debugging
#1
Don't know about the ingame script debugger, I can't get that sh*t to work (The mysterious readme located at "raw/scriptdebugger"). But anyways, I found out how to display better syntax errors.

In order for this to work, you need to have the Black Ops Mod Tools installed

Basically you can turn this:
[Image: P82kQ.jpg]

into this:
[Image: pzVuI.jpg]

When you link your fastfile, be sure to include a cfg file that whitelists the "developer" dvar and "developer_script" dvar. If you have the mod tools, you can copy the myWhitelist.cfg from the mod examples into your mod directory and include it in your mod.csv table as
Code:
rawfile,myWhitelist.cfg
If you can find the copy, you can make it from a blank text file with the following contents:
Code:
setmoddvar developer
setmoddvar developer_script

After linking your fastfile, the mywhitelist.cfg will be linked and you execute the config file in game to enable the dvars in the console using
Code:
/exec myWhitelist.cfg

Then actually enable them by setting them to "1":
Code:
/developer 1
/developer_script 1

If you don't want to be bothered by setting the dvars all the time, you can change the contents of the whitelist config to include the assignments like this:
Code:
setmoddvar developer
setmoddvar developer_script
seta developer 1
seta developer_script 1

Hope that helps. Also a small caveat, small passive errors in your scripts that are never detected will be detected in developer mode, such as comparisons and assignments on differing data types like strings, integers and undefines.

If you want to this with no hassle of messing with whitelisting and such and would rather log everything to a file, forget the above and do "/logfile 1"
Reply

#2
good tutorial, even though most modders know this, it will help the newbz find errors.


[Image: b_560_95_1.png]
Reply

#3
(09-11-2011, 04:56)Nukem Wrote: good tutorial, even though most modders know this, it will help the newbz find errors.



Well runtime script errors will slap you in the face immediately, no need to santa clause your log files to find the errors. Besides, if I had the in game script debugger working, I wouldn't be posting this Tongue
Reply

#4
You could just use /logfile 1, it will also show the errors ingame like developer. And you should fix the run time errors anyway. Also the ingame scriptdebugger is just for 3arc. They also stripped it from the exe.


Nice tutorial though ! Smile
[Image: MaEIQ.png]
Reply

#5
Well bummer lol. Let me X out the entire original post Tongue Oh there seems to be a distinction between "/developer 1" and "/developer 2", probably just more added channels for debug information.
Reply

#6
(09-11-2011, 08:10)Pozzuh Wrote: You could just use /logfile 1, it will also show the errors ingame like developer. And you should fix the run time errors anyway. Also the ingame scriptdebugger is just for 3arc. They also stripped it from the exe.


Nice tutorial though ! Smile

The orifinal gsc's contain run time errors. 3arc should fix those!
Reply

#7
(09-11-2011, 09:52)SuperNovaAO Wrote:
(09-11-2011, 08:10)Pozzuh Wrote: You could just use /logfile 1, it will also show the errors ingame like developer. And you should fix the run time errors anyway. Also the ingame scriptdebugger is just for 3arc. They also stripped it from the exe.


Nice tutorial though ! Smile

The orifinal gsc's contain run time errors. 3arc should fix those!

I never get any...
[Image: MaEIQ.png]
Reply

#8
I get them when I load a map a certain way, with the dreaded 3arc test client.
Reply

#9
(09-11-2011, 10:12)ChazZeromus Wrote: I get them when I load a map a certain way, with the dreaded 3arc test client.

probably because you have to wait till _load.gsc is finished running... Like when you make a hud elem with setpoint() it will bug out unless you put a wait .05; in front if it
[Image: MaEIQ.png]
Reply

#10
I know exactly why setpoint fails, hud init for some reason occurs on a thread, just make the main code wait on a custom barrier using notifies. Or just call _hud::init, it's safe to execute it twice. Well that's what I did. Also, the supplied gsc's in the beta tools are outdated, im getting original gsc code errors on lines that don't even exist.
Reply



Forum Jump:


Users browsing this thread:
5 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.