Mapper In/Out Exit Stubs
Mapper In/Out Exit Stubs
So, it was brought to my attention recently that my generic mapping script has issues with in/out exits (I was unaware because the game I play doesn't use them). Upon further testing, I determined that the issue actually lies with the setExitStub function, which returns an error if I give it 11 or 12 as an argument, and it insists that the exit stub value must be between 1 and 10. The current release (3.0.0 iota) allows me to add exit stubs in the in/out directions via the mapper GUI, and obviously I can also set actual exits in those directions as well, including using the setExit function. Is this a known problem, and if so, is there a workaround in place, aside from me hacking something together as a stand-in?
Re: Mapper In/Out Exit Stubs
It was explained to me by the Slyster that it is a known issue with the underlying code in Mudlet for now, and it should be fixed in the next release.
I got around it by, as you mentioned, just hacking the script so it didn't create or look for in/out exit stubs.
I got around it by, as you mentioned, just hacking the script so it didn't create or look for in/out exit stubs.
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Mapper In/Out Exit Stubs
If you want to quickly hack the source code you need to change the code in the TLuaInterpreter::setExitStub function defined at around line 1835 (it may not be on that precise line as it depends on the version of code you are looking at) in the ./src/TLuaInterpreter.cpp file:
to:and then recompile if that is an option for you...
Code: Select all
if(dirType>10 || dirType < 1)
{
lua_pushstring( L, "setExitStub: dirType must be between 1 and 10" );
lua_error( L );
return 1;
}
Code: Select all
if(dirType>12 || dirType < 1)
{
lua_pushstring( L, "setExitStub: dirType must be between 1 and 12" );
lua_error( L );
return 1;
}
Re: Mapper In/Out Exit Stubs
Thanks. I opted to store the data related to in/out exit stubs in room user data, and made it work that way. That way, I don't have to push out a modified version of Mudlet to the people who want to use the script successfully. I look forward to a more polished release where I can take out my work arounds and just use the built in functions for things like exit stubs, doors, and such.
Re: Mapper In/Out Exit Stubs
I've applied the patch above as https://github.com/Mudlet/Mudlet/pull/406 and https://github.com/Mudlet/Mudlet/pull/407.