This is class from manipulationg with map. Actualy gam can have only one map in memory. If you want tomanipulate with global values you ca use
index.class
or
party.class
classes.
Map items is 3dimensional area. First 2 dimensions are x,y cordinates. Last is part of square. It can becalled by number of by name or by letter:
0 n north
1 e east
2 s south
3 w west
4 f floor
5 c ceiling
6 o object
7 r oorientation
or it can be called dynamically to actual party orientation by: l left
r right
i front
b back
[] - Actual square on map.
[x,y] - Square x,y on map.
ceilings - Ceilings definitions on map.
clickedDir - Direction of wall on which was clicked. Direction of wall on which was clicked. It can be different from actual direction,
clickedW - Defines which wall was really clicked for directionY coordinate.
clickedX - Defines which wall was really clicked for X coordinate.
clickedY - Defines which wall was really clicked for Y coordinate.
dir - actual direction of group on map
doNext (x, y, element) - Change texture on square x,y and direction dir to that, which is entered in square next.
execEvent (name, x, y, wall) - execute event name from field x,y
floors - Floors definitions on map.
get (x, y, dir) - returns id value of map[x,y,dir]
getParam (paramName, defValue) - Get param for this map. These values are accessible only for this map.
getPart (x, y, dir) - returns object placed on map[x,y,dir]
getWall (x, y, dir) - returns walls placed on map[x,y,dir]
height - height of map
items - Items on map.
mapping (x, y, sensitivity) - update mapping on x,y to actual values on map
monsters - Monsters on map.
objects - Objects definitions on map.
param (paramName) - returns id value of map parameters (entered in editor)
set (x, y, part, what) - Change value of x,y,dir on map to what.
setParam (paramName, value) - Set param for this map. These values are accessible only for this map.
square - Actual square on map. Similar to []
walls - Walls definitions on map.
width - width of map
x - actual x postion of group on map
y - actual y postion of group on map
[] Actual square on map.
Returns
[x,y] Square x,y on map.
Returns
ceilings Ceilings definitions on map.
Returns
clickedDir becuase you can click on left or right wall. This value allways return direction which was clicked from viewpoint of party. Please read info for clickedX and clickedW.
see
clickedW
clickedX Defines which wall was really clicked. In engine are allways two wall making wall between two squares. When you click on wall from field x,y,dir if there is no wall, but you have wall in x+1,y,2-dir, this wall is clicked. But then you can't call, for example map.doNext(map.x,map.y,map.dir), because there is no wall. But when you call map.doNext(map.clickedX,map.clickedY,map.clickW), you get right code.
see
clickedY
dir actual direction of group on map
doNext (x, y, element) This function is short for command
map:set(x,y,dir,map:walls:get(map:getWall(x,y,dir):next):id)
This is main function for handling things like switches, etc. For example if you want to do basic switch create two items in library of walls. Let's first name swUp and second swDown. For swUp enter new parameter "next" with value "swDown" and to event onClick enter code map:doNext(map:clickedX,map:clickedY,map:clickedW);
. Do same for swDown, except that value of "next" will be "swUp". Now you have switch, which is moving up and down when you click on it. If you want to open something with this switch, create doorsOpen and doorClose similary to switch except, clicking event, if you don't want them to open automatically. Now place switch and door somewhere in dungeon. On switch's onClick event enter code doNext(x,y,dir)
where x,y & dir are postion of doors, which my open. Easy!
Actual version of game dosn't support autoload of next values, so you must place all required "next walls" on map.
Parameters x - x pos on map
y - y pos on map
element - element on map
see
execEvent (name, x, y, wall) Execute event name from field x,y .
map.exec("onSearch")
execureturns walls placed on map[x,y,dir]. Difference from getPart is that x,y,dir are not required.
Parameters name - name of event
x - x pos on map - def map.x
y - y pos on map - def map.y
wall - wall on map - not required
floors Floors definitions on map.
Returns
get (x, y, dir) returns id value of map[x,y,dir]
Parameters x - x pos on map
y - y pos on map
dir - direction on map
Returns
getParam (paramName, defValue) Get param for this map. These values are accessible only for this map.
Parameters paramName - name of parameter
defValue - default value of parameter
Returns
getPart (x, y, dir) returns object placed on map[x,y,dir]
Parameters x - x pos on map
y - y pos on map
dir - direction on map
Returns
getWall (x, y, dir) returns walls placed on map[x,y,dir]. Difference from getPart is that x,y,dir are not required.
Parameters x - x pos on map - not req.
y - y pos on map - not req.
dir - direction on map - not req.
Returns
height
items
mapping (x, y, sensitivity) update mapping on x,y to actual values on map
Parameters x - x pos on map
y - y pos on map
sensitivity - of mapping (0-100) - default party mapping skill - not required
monsters
objects Objects definitions on map.
Returns
param (paramName) returns id value of map parameters (entered in editor)
Parameters paramName - name of parameter
Returns
set (x, y, part, what) Change value of x,y,dir on map to what. Don't use fixed numbers in what, because it can change by saving wall. Use getId of valid
grList.class
. Changes on map are saved automatically in save file, so you don't need to care about it.
Parameters x - x pos on map
y - y pos on map
part - part on map
what - id of new object
setParam (paramName, value) Set param for this map. These values are accessible only for this map.
Parameters paramName - name of parameter
value - value of parameter
square Actual square on map. Similar to []
Returns
walls Walls definitions on map.
Returns
width
x actual x postion of group on map
y actual y postion of group on map
Generated by Hideoshi's Documentation Tool on 28.10.2003 20:08:54