CreateBiExits() broken?
mrangel
25 Aug 2017, 08:25I was debugging a script for a hour yesterday. I had the statement CreateBiExits (dir, location, nextloc)
… and it kept on telling me that 'dir' is undefined. I tried putting msg (dir)
before and after, and it displayed what it should have done.
Then I tried a simpler test, in a simpler script.
CreateBiExits ("north", roomA, roomB)
Again, the error message that variable 'dir' is undefined. I haven't got a variable 'dir' this time, so I know the problem isn't in my script.
I check CoreFunctions.aslx, and find:
<function name="CreateBiExits" parameters="direction, from, to">
create exit (dir, from, to)
create exit (ReverseDirection(dir), to, from)
</function>
So there's the problem. Has anyone else had this issue? I couldn't find mention of it searching the forum. But, in case anyone else spends an hour trying to solve that issue, here's my solutions. If you're using the offline version of Quest, open up CoreFunctions.aslx, find that line, and change it to parameters="dir, from, to"
. I suspect that sooner or later, one of the developers will fix this properly.
For people who are using the web version (like me; I'm on linux, can't get Quest to run under WINE, but I downloaded it anyway so I can read the core functions where their documentation is incomplete), the easiest way is probably just to create a function of your own. I called mine MakeBiExits, gave it the arguments dir, from, and to, and pasted in the two lines of code from above.
Hoping that helps someone in future.