Fixing scripts

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
matt_moh
Sergeant
Posts: 65
Joined: Sat Feb 08, 2003 12:04 am

Fixing scripts

Post by matt_moh »

Is there any tool that can find and pinpoint errors in a script? It gets very annoying running a map and not having the script work because of a syntax error, and then having to look over the entire script to find the problem.
Random
Moderator
Posts: 401
Joined: Sun Jun 01, 2003 11:00 pm

Post by Random »

Well i cant say i know alot about scripting but i have noticed in the script editor that comes with Mohaa Tools that a color system is used. If you use the wrong "syntax?" than you will have the wrong color. Sorry i cant be much more pinpoint than that but it has helped me once or twice.

Hope this helps somehow.

Random
Moderator
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Just watch your console (~ key). Scroll up a lot and it'll tell you exactly what's wrong with your script.

Make sure you have enabled console in advanced options :wink:
Image
Random
Moderator
Posts: 401
Joined: Sun Jun 01, 2003 11:00 pm

Post by Random »

jv_map wrote:Just watch your console (~ key). Scroll up a lot and it'll tell you exactly what's wrong with your script.

Make sure you have enabled console in advanced options :wink:
Um yeah that works too sometimes i guess :oops:
Moderator
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

log

Post by tltrude »

You can make a log of the console too. Just type this in the console before you load the map.

logfile 1

It will make a file named qconsole.log in main, and it can be opened with notepad. Script errors will be near the top of the page.
Tom Trude,

Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post by The Jackal »

I got a not so funny story about scripting and debugging with Notepad.

I had compiled a series of scripts into one scr file, that was about 3 pages long. One of the threads was for landsharkers. Somehow I inadvertently pressed a SPACE while copying the scripts over, and inserted a space between one of the YZ origins.

I swear, I went crazy trying to figure out what was wrong with the file. Because of this error the entire script file was a dud. I ran though each thread checking my syntax. Everything was perfect. Or so I thought.

I think it took me 2 days of insane searching before I finally found it. I am still under-going therapy for that trauma.

A pal of mine send me a C++ script debugger. I am dumb as to how to use it. Does anyone know how to debug the debugger? :lol:
matt_moh
Sergeant
Posts: 65
Joined: Sat Feb 08, 2003 12:04 am

Post by matt_moh »

Ok thanks guys, that should make scripting alot easier.
Post Reply