How to debug pawnscript?
#1

Is there any way to debug my Gamemode written in pawn?
I already gave some research but is hard to find ... I took a look at the IDE but I think she does not debug the gamemode.

Thanks.
Reply
#2

in how far you want to debug it?
The only effective way to test your gamemode for bugs is (after ofc compiling it to find syntax errors and such --> does not mean that it will do what you expected it to do) is to test it.. And remember, testing can only prove that there was a bug. It can't prove that there isn't a bug.

If you explore things that are not working, the easiest debug method is to write prints into the script, to check where it stopped running
e.g. "print("called 1");" and "print("called 2");"
place those functions into the script parts that you think could cause the failure, the more you add the higher is your chance to find the failure line and the faster you will find it (but the more you'll have to remove afterwards)...


Ofc this will not always make you find the mistake as some scripts are running completely fine, but the result still isn't the one that you expected. Therefor it could help to make your server print the relative values while calculating or whatever, therefor you can see at which point you're having a math failure or whatever...


I'm not even sure if this helps you any further. As I said, you need to specify "debug the gamemode" more.
Reply
#3

I would like to know where to debug some variables and functions are called .... I do not want to see the code being executed.
Reply
#4

There is no debugger for Pawn like there is for high level languages like C# and consorts. The only way to debug Pawn code is adding print statements and commenting code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)