Lich mapping reference: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
Line 62: Line 62:


==== Example ====
==== Example ====
The first room in the log below doesn't have a room ID. This could either be unmapped or missing a description. To find out, we'll visit a neighboring room and check its exits using the 'ids' alias. If the exits point to the missing room then we know its room ID and just have to update the description. When we know the room ID we walk back and use the 'ad ####' alias to update the given roomid with the description of the room we are standing in.
The first room in the log below doesn't have a room ID. This could either be unmapped or missing a description. To find out, we'll visit a neighboring room and check its exits using the 'ids' alias. If the exits point to the missing room then we know its room ID and just have to update the description. When we know the room ID we walk back and use the 'ad ####' alias to update the given roomid with the description of the room we are standing in. To verify it was updated, we re-enter the room and see that it now has a room id.


<pre>
<pre>

Revision as of 07:25, 3 March 2017

Introduction to Mapping

The map is a database that is downloaded to your lich directory each time you login to the game. The database consists of rooms. All rooms need to have a wayto and a timeto. A wayto describes the movement to get to the room. The timeto describes how long it takes to get there (0.2 seconds is the default). ;automap handles adding this data automatically in most cases. If you map a room manually without ;automap then you need to be sure that you include both the timeto and the wayto, forgetting one will break ;go2's ability to navigate to that room.

Refreshing Your MapDB

To fetch the latest version of the map database run these commands:

;repository download-mapdb
;e Map.reload

Referencing Rooms

Rooms can be referenced in two ways: Map.list[room_id] or Room[room_id]. There are some idiosyncrasies between the two, but in most cases either will work fine.

Room.current refers to your current room.

Room[room_id] refers to some other room with the given id. It could be your current room if you give your current rooms id.

Useful Aliases

If you are using the Dependency suite of scripts, please run ;setupaliases to install these some of these useful mapping aliases. If you are not, then please add the following aliases.

 ;alias add lr = ;e echo Room[Room.current.id].inspect
 ;alias add ad = ;e Room[/?].description.push(XMLData.room_description) # Usage: ad roomnumber
 ;alias add snip = ;e Room.current.timeto.delete("\?")\r;e Room.current.wayto.delete("\?"); # Usage: snip roomnumber
 ;alias add ids = ;e echo "#{Room.current.id}:#{Room.current.wayto}"

Useful commands

;e echo Room.current.inspect # This is the lr alias
;e echo Room.current.wayto

Common Mapping Techniques

Delete a room

Go to each surrounding room and perform the following, where "roomid" is the id of the room you are going to delete. It must be enclosed in quotation marks. This is the same as the 'snip' alias above.

;e Room.current.wayto.delete("roomid")
;e Room.current.timeto.delete("roomid")

Finally, remove the room. Roomid is NOT quoted here. Enter it as a number.

;e Map.list[roomid] = nil

Complex Movements

Complicated actions ones which require multiple movements to get to the target room. A complex action is not just go, move, climb, etc... but involving searching to discover the path, or pushing an object to open a door. Use a stringproc to add these. Note: these actions require approval from the mapdb admin, and will lock the mapdatabase until they are approved/rejected. Do not add them without testing them.

;e Room.current.wayto['1220'] = StringProc.new(“fput 'search'; move 'go path'”)

Update Rooms with multiple descriptions

Go2 uses room descriptions part of determining what room you're in. If the room has multiple descriptions, the room you are in may appear to be unmapped during some seasonal/time change. To correct this, add the room description to the correct room. Do not remap the room.

This assumes you are standing in the target room with its new description and you know the roomid.

;repo checkout-mapdb
;e Map.list[1263].description.push(XMLData.room_description)
;repo upload-mapdb

Example

The first room in the log below doesn't have a room ID. This could either be unmapped or missing a description. To find out, we'll visit a neighboring room and check its exits using the 'ids' alias. If the exits point to the missing room then we know its room ID and just have to update the description. When we know the room ID we walk back and use the 'ad ####' alias to update the given roomid with the description of the room we are standing in. To verify it was updated, we re-enter the room and see that it now has a room id.

[Boar Clan, Split-Log Path]
The sounds of the forest permeate the palisade wall and wash over the sleeping village.  Each breath of wind rustles the trees that stir the night air and conduct the arboreal symphony.  Chirping insects and the deep throaty calls of frogs keep the rhythm while high-pitched animal cries weave a soprano's song with a melody only nature could compose.
Obvious paths: northeast, west.
>ne
You stroll northeast.                                                                                                                                                                                             
[Boar Clan, Split-Log Path]                                                                                                                                                                                       
A tall palisade wall of thick iron-banded tree trunks embraces the small village of thatched longhouses and bark-covered huts.  Split log walkways snake between the structures.  One rutted dirt path leads from the gate to a squarish building with deep eaves that shelters stacks of crates and barrels piled outside the door.  You also see a palisade gate, the stable doors and a long log nestled underneath a nearby tree.                                                                                                                                                                                                           
Obvious paths: northeast, southwest.                                                                                                                                                                              
Room Number: 4106                                                                                                                                                                                                 
>;repo checkout-mapdb                                                                                                                                                                                             
--- Lich: repository active.                                                                                                                                                                                      
[repository: success;  running download-mapdb now...]                                                                                                                                                             
[repository: map database is up-to-date]                                                                                                                                                                          
[repository: done]                                                                                                                                                                                                
[repository: edit your map database and     ;repository upload-mapdb     within 24 hours.]                                                                                                                        
--- Lich: repository has exited.                                                                                                                                                                                  
>ids                                                                                                                                                                                                              
--- Lich: exec1 active.                                                                                                                                                                                           
[exec1: 4106:{"4105"=>"go gate", "4107"=>"southwest", "4109"=>"northeast"}]                                                                                                                                       
--- Lich: exec1 has exited.                                                                                                                                                                                       
>sw                                                                                                                                                                                                               
You stroll southwest.                                                                                                                                                                                             
[Boar Clan, Split-Log Path]                                                                                                                                                                                       
The sounds of the forest permeate the palisade wall and wash over the sleeping village.  Each breath of wind rustles the trees that stir the night air and conduct the arboreal symphony.  Chirping insects and the deep throaty calls of frogs keep the rhythm while high-pitched animal cries weave a soprano's song with a melody only nature could compose.                                                                 
Obvious paths: northeast, west.                                                                                                                                                                                   
>                                                                                                                                                                                                                 
Your body below the waist is dripping with water.  Pools of it are forming all around you.                                                                                                                        
>                                                                                                                                                                                                                 
You've gained a new rank in your knowledge of sorcery.                                                                                                                                                            
>ad 4107                                                                                                                                                                                                          
--- Lich: exec1 active.                                                                                                                                                                                           
--- Lich: exec1 has exited.                                                                                                                                                                                       
>ne                                                                                                                                                                                                               
>sw                                                                                                                                                                                                               
You stroll northeast.                                                                                                                                                                                             
[Boar Clan, Split-Log Path]                                                                                                                                                                                       
A tall palisade wall of thick iron-banded tree trunks embraces the small village of thatched longhouses and bark-covered huts.  Split log walkways snake between the structures.  One rutted dirt path leads from the gate to a squarish building with deep eaves that shelters stacks of crates and barrels piled outside the door.  You also see a palisade gate, the stable doors and a long log nestled underneath a nearby tree.                                                                                                                                                                                                           
Obvious paths: northeast, southwest.                                                                                                                                                                              
Room Number: 4106                                                                                                                                                                                                 
>                                                                                                                                                                                                                 
You stroll southwest.                                                                                                                                                                                             
[Boar Clan, Split-Log Path]                                                                                                                                                                                       
The sounds of the forest permeate the palisade wall and wash over the sleeping village.  Each breath of wind rustles the trees that stir the night air and conduct the arboreal symphony.  Chirping insects and the deep throaty calls of frogs keep the rhythm while high-pitched animal cries weave a soprano's song with a melody only nature could compose.                                                                 
Obvious paths: northeast, west.                                                                                                                                                                                   
Room Number: 4107                                                                                                                                                                                                 

Adding a new map image

Lets add a new map image!

Copied from lrn2map:

Step 6: Add to narost (if needed or wanted)

6a. Add the image to the map database. Narost will only display images that are already in the map database. If the image is already in the map database because it's used by other rooms, move on to 6b. If not, save the image in the lich\maps directory, go to a room that will use the image, and type ;e Room.current.image = 'filename' # substitute the actual filename of the image, including the file extension, but without the path.

6b. Start narost in fix mode (;type ;narost fix)

6c. Bring up the image in narost. Right-click in the narost window, click on “view map” in the popup menu, and click on the image name that you'll be adding to.

6d. Move the image around to find where your current room goes.

6e. Hold down the Shift and Ctrl keys, click on the top left and bottom right corners of the room on the image, let go of Shift and Ctrl.

6f. If there are more rooms to add, move to the next room in game, go to step 6d.

6g. Save the map database (type ;e Map.save). While the mapmap script saves the map database every time it closes, narost does not. You can save the map database as often as you like if you are worried about losing your progress.