Mudlet-2.0-test4 released

Post Reply
User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Mudlet-2.0-test4 released

Post by Heiko »

UPDATE: Mac app bundle uploaded

This will hopefully be the last test release. Chris Mitchell has contributed a nice new shared module system that allows to share a single package instance across profiles e.g. you can write a single mapper script for all your characters and you don't have to update all of the profiles if you do script updates. The drawback compared to regular packages is that the profile is no longer fully self contained. In any case this is a feature that has been eagerly awaited by many. Chris has also added a few new functions to Mapper and to Geyser, but it's better if he explains this himself.

The settings window now also fits in netbooks.

Apart from these new features, there's the usual bug fixes. There are only few known bugs left so Mudlet-2.0 final will be coming soon.

http://sourceforge.net/projects/mudlet/files

Daagar
Posts: 89
Joined: Fri Feb 19, 2010 2:42 am

Re: Mudlet-2.0-test4 released

Post by Daagar »

Very exciting to have all the updated mapper changes available in a Windows version! Thank you.

User avatar
Vadi
Posts: 4844
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet-2.0-test4 released

Post by Vadi »

Git needs to be properly tagged, please.

User avatar
Vadi
Posts: 4844
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet-2.0-test4 released

Post by Vadi »

It seems centerview doesn't work anymore once you use the area scroller to select another area, so walking about after it leaves the mapper in a 'broken' state. While resetting to the current room wasn't optimal, because you couldn't view another area while speedwalking somewhere, the current solution has no 'reset' button to have it be tracking you again...

Maybe a 'track position' toggle should be introduced that gets auto-disabled when you select other areas to view manually?

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

I'll fix that Vadi, I could have swore I had it setup to snap back to your location on centerview.

Here's a list of the changes incorporated from my end:
A New module system:
This allows you to share a package across multiple sessions, which works great for things like mapper scripts or chat windows. Only general aspects of the script that are universal (ie, not profile specific) should be in a module. There is a versioning system for automatically backing up modules, which resides in the folder above your mudlet profiles. Priorities also exist, which is the loading order of the modules (in case a module depends on another one, such as a module containing convenience functions with lua, you can make sure all the needed methods exist). Two methods exist to set them from the command line (in addition to setting them from the module manager window), getModulePriority, and setModulePriority.


Mapper Changes:
2D/3D Mapper pans with the mouse. Use control+click to use the old functionality of left clicking on the map where a light grey box can select multiple rooms. Double click on a room as always to speedwalk.
searchRoomUserData(key, query) function to search the user data of all rooms
Zone list in the mapper is alphabetical
Labels respect the z axis and don't show up everywhere. This also means you now need to add a z component to the add label function.
Area switching places the view field of the mapper in the first room of the area now.
Right-click menu to set player location on map
Fixed setCustomEnvColor to provide the alpha channel as well. New syntax: setCustomEnvColor(id, r, g, b, alpha) This was the reason there were inconsistencies in the color scheme from custom colors.
Incorporated Vadi's loadMap function
getSpecialExits(id) has been changed to output a table of tables. The new format is: roomid = {exit name, exit lock status).
new method: updateMap() to cause the map view to update
new method: getMapLabel(area #, label or id #). Returns a table with x,y,z,height,width, and text of label. If multiple labels exist with same text, returns them all.
change: searchRoom returns room id as key

Built in exit stubs in mapper:
direction in the following cases corresponds to their numerical mapping (ie 1=north)
setExitStub(roomid, direction, status) -status 1 or 0 to turn off/on
getExitStubs(roomid) - table with all exit stubs (value is stub direction, key is just iterator)
connetExitStub(roomid, direction) - searches for closest room in given direction, if it finds a matching exit stub on that room, automatically removes stubs and creates exit.
connectExitStub(roomid, toroom, direction) - will connect a stub from roomid to toroom in the given direction.
The mapper will show your stubs as incomplete links.

Access to mapper internals
The user can now interface with some of the mapper internals. There is limited support for manipulating a couple of variables (roomid, zooms, view coordinates, etc.). use the method getMapVar() to list all available variables and some variables are specific to the map mode (2D map in particular). Use getMapVar(var) to get the value of that variable returned, and getMapVar() to see the value and name of all variables currently accessible. Use setMapVar(var, value) to change a variable. Here is a small example of what is possible in an alias/label where you can set up your map scroller:
Code: [show] | [select all] lua
setMapVar("XView", getMapVar("XView")+1)
updateMap()
Other changes:
tempComplexRegexTrigger added to make triggers from a script/command line that can be multilined, etc.
Two new label callbacks: setOnEnter and setOnLeave to call a given function when a label is entered/left with the mouse. Here's an example code for using this:
example code for a label, labels[tab]
Code: [show] | [select all] lua
labels[tab]:setOnEnter("onEnter", tab)
function onEnter(tab)
  display("entered!")
end
Bug fix: tempTrigger and a few other methods now return their trigger id instead of pattern, thus killTrigger can work.

Nestable Labels in Geysey
Added a lua change within Geyser, you can nest labels much easier. One nuance: You cannot put a nested label within a container (it must be its own container).
Here's a trivial example:
Code: [show] | [select all] lua
b = Geyser.Label:new({name="testa", x=400,y=50,height=100,width=100,nestable=true, h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="CLICK ME!"})
c = {}
for i=1,20 do
	c[i] = b:addChild({name="test"..tostring(i),height=30,width=60, layoutDir="BH", flyOut=true,h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="test"..tostring(i)})
end
d = {}
for i=21,40 do
	d[i]=c[5]:addChild({name="test"..tostring(i),height=30,width=60, layoutDir="RV", flyOut=true,h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="test"..tostring(i)})
end

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

In TLuaInterp::centerview, this gets the wanted functionality back for me. If you don't want to update the position, you can use the setMapVar("RoomId", x) to do it without causing centerview to jump to your position. I can add a getMapVar("ViewArea") as well so you can script it so you won't update with centerview if you so choose to not do so while in another area.

if( pHost->mpMap->mpM )
{
pHost->mpMap->mpM->update();
}
if( pHost->mpMap->mpMapper)
{
pHost->mpMap->mViewArea=0;
if (pHost->mpMap->mpMapper->mp2dMap)
pHost->mpMap->mpMapper->mp2dMap->update();
}

User avatar
Vadi
Posts: 4844
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet-2.0-test4 released

Post by Vadi »

Excellent, thanks.

Gauroth
Posts: 22
Joined: Tue Sep 07, 2010 2:44 pm

Re: Mudlet-2.0-test4 released

Post by Gauroth »

I noticed something with the addSpecialExit() function in this release that I had never seen before: When executing something like addSpecialExit(1,2,"enter portal") the first character of the "enter portal" string is removed, so you wind up with a link from roomID 1 to roomID 2 with the command "nter portal"

Not sure if this was introduced with the release, but like I said, I've never noticed it before.

Oh, and fiddling around some more I found this:

1: run addSpecialExit(1,2,"enter portal")
2: command is shown as "nter portal"
3: run addSpecialExit(1,2,"enter portal") again
4: command is now shown as "enter portal"

and

1: run addSpecialExit(1,2,"enter portal")
2: command is shown as "nter portal"
3: run clearSpecialExits(1)
4: run addSpecialExit(1,2,"enter portal") again
5: command is shown as "nter portal"

So it only appears to happen when creating a new link, not when overwriting an existing one

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

It's because the exits are stored as a single string with the exit lock status prepended. In the getSpecialExit or whatever call, I remove the first character(the lock status) and return a table with the lock status and the exit name. Lock and unlock the exit and it should be fixed. This might be because the test release didn't have my changes to addSpecialExit which default to unlocking the exit, which resolves this inconsistency.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

I actually misspoke, the exit is indeed assigned to be false, so the value should be prepended. However, I think the bug might be here in TRoom.cpp:
void TRoom::addSpecialExit( int to, QString cmd )
...
// it doesnt exit -> add
QString _cmd;
if( cmd.startsWith('0') || cmd.startsWith('1') )
{
_cmd = cmd;
}
else
{
_cmd.prepend("0");
_cmd.append( cmd );
}
other.insertMulti( to, cmd );
There is one, if not two bugs here. One, other.insertMulti( to, cmd ); should be:
other.insertMulti( to, _cmd );

Also, since _cmd is not initialized, I'm not sure that prepend will work. I won't be able to test this until Sunday/Monday, can someone change the code to:

// it doesnt exit -> add
QString _cmd;
if( cmd.startsWith('0') || cmd.startsWith('1') )
{
_cmd = cmd;
}
else
{
_cmd = cmd ;
_cmd.prepend("0");
}
other.insertMulti( to, _cmd );

and see if that resolves everything?

Post Reply