Building & Scripting > Building Board

Debugging scripts

(1/1)

erwin:
This thread will hopefully list common errors (in syslog), and how to find and fix them. The thread assumes that the errors are not because of nohassle / imm level > 50, so it's meant for errors that occur with players, or imms with nohassle off and level at 50 or below.

Anyone can post on this thread - hopefully with the parts: Error Message -> Examples -> Consequences of (not) fixing it

Hopefully this thread will be unneeded if there's a code upgrade which will show where the errors are (i.e. which lines in the script).

erwin:
Error: :: osend called without a message

This error comes about because there is nothing to be sent, so here are two examples of where this error comes about:

First example:

This usually occurs when copying and pasting scripts in the client where there is a colour code. Eg, suppose you wanted a line break, and you actually had:


--- Code: ---%echo% {cx
%send% %actor% {cx
%echoaround% %actor% {cx
--- End code ---

However, copying and pasting this in a client would lead to copying and pasting just


--- Code: ---%echo%
%send% %actor%
%echoaround% %actor%
--- End code ---

Hence an error.

Second example:

When a variable hasn't been defined yet, and you want to send / echo it. Suppose you had a quest with dynamically generated passwords, and the variable %password% could be something random, eg


--- Code: ---set password %random.5%
--- End code ---

and later


--- Code: ---%send% %actor% The password is:
%send% %actor% ...
%send% %actor% %password%
--- End code ---

If the second snippet is run first, and %password% hasn't been defined, then the error will occur.

Consequences of this error in syslog: For the first example, not really game-breaking, since it's more of a cosmetic issue (do line breaks look nice?) But for the second example, it might break a quest or two..

How to spot this error: Just search for lines that are of the form:


--- Code: ---%send% %actor%
%echoaround% %actor%
%echo%
%echo% %blahblah%
%send% %actor% %blahblah%
--- End code ---

etc

Navigation

[0] Message Index

Go to full version