@@ -20,72 +20,85 @@ local revdir = Mapper.revdir("ne")
20
20
## The Map Object
21
21
22
22
*** Map.new(name)***
23
+
23
24
Creates a new map (prefer to use ` Mapper.create(name) ` )
24
25
25
26
- Returns the ` Map `
26
27
27
28
*** Map: add_area (name)***
29
+
28
30
Adds a new area to the map and places 'you' inside the first room of that area.
29
31
30
32
- ` name ` The name of the area
31
33
- Returns an ` Area ` or ` nil ` on conflicting names.
32
34
33
35
*** Map: replace_area (name)***
36
+
34
37
Does the same as ` Map:add_area ` with reverse conditions
35
38
36
39
- ` name ` The name of the area
37
40
- Returns an ` Area ` or ` nil ` if no name conflict was found.
38
41
39
42
*** Map: track (dir)***
43
+
40
44
Moves your position on the map. This is what you would call in sync with your
41
45
movement in the actual game world to keep the map tracking your position.
42
46
43
47
- ` dir ` The direction to track
44
48
- Returns the ` Exit ` used or ` nil ` if directions isn't mapped.
45
49
46
50
*** Map: go_back ()***
51
+
47
52
Moves you back to the last room you were in. Good to use when tracking and
48
53
accidentally walking into a closed door or non-existing exit.
49
54
50
55
- Returns the new current ` Room `
51
56
52
57
*** Map: set_position (id)***
58
+
53
59
Attempts to find a room in the map based on ` id ` and places you in that room.
54
60
55
61
- ` id ` A ` Room ` id
56
62
- Returns a boolean representing success
57
63
58
64
*** Map: find_room (id)***
65
+
59
66
Find a ` Room ` in the map based on ` id `
60
67
61
68
- ` id ` A ` Room ` id
62
69
- Returns ` Room ` and ` Area.name ` or nil
63
70
64
71
*** Map: get_area ()***
72
+
65
73
Returns your current ` Area ` or ` nil `
66
74
67
75
*** Map: get_room ()***
76
+
68
77
Returns your current ` Room ` or ` nil `
69
78
70
79
*** Map: move (dir)***
80
+
71
81
Move your position on the map and create/link rooms as needed.
72
82
73
83
- ` dir ` The direction you are moving in
74
84
- Returns the new ` Room `
75
85
76
86
*** Map: unmove ()***
87
+
77
88
Undo the last move you did (deleting the room and resetting the exit).
78
89
This is most useful when you accidentally walk into a closed door when
79
90
mapping.
80
91
81
92
- Returns the new current ` Room `
82
93
83
94
*** Map: drop_last_exit ()***
95
+
84
96
Deletes the last exit created in the current room. This can be used in
85
97
conjunction with ` Map:unmove() ` when you accidentally created a non-existing
86
98
exit.
87
99
88
100
*** Map: save (path, [ suffix] )***
101
+
89
102
Saves the map to file. The filename is generated based on the map name.
90
103
91
104
- ` path ` The path to save to (eg. ` /home/user/maps/ ` )
0 commit comments