Weird issue with my random map generator. I'm checking pairs of adjacent rooms to see if I should add exits between them. But first, I want to see if there's already an exit there.
The code I have is:
ex = GetExitByName(loc, d)
if (ex <> null) {
debugmsg ("shuffle", " Exit "+ex+" already exists")
}
else {
... lots of code here ....
}
That looks pretty sensible. But…
Error running script: Error compiling expression 'ex <> null': CompareElement: Operation 'NotEqual' is not defined for types 'Double' and 'Null'
What am I doing wrong?
OK ... server timeout, have to reload the editor… and that code now works fine. I haven't changed it.
Really hate those kind of bugs :p
Is it possible you used e instead of ex? e is a constant, 2.71828182845905, which is a double, and would give that error.
Hmm… the last thing I did was change the variable name. If it's somehow not saved the very last keypress when I hit "play", that would make sense.
Thanks :)
Surprised that something like Quest has a constant for e… can't think of a case where it would be used in a game.
I think it must be built in to something Quest uses. I have been messing with Quest for 6 years and I do not think I have even used double (but I have called an exit e before, and it took a long time to work out what was going on).
Actually it will throw an error if it is an integer (or double, which was the issue) whether you use <> or =.