What do you mean by dot? Current position indicator? If so -> centerview(roomID)
For goto scripts checkout the getPath() function that sets 2 lists (tables) with the room IDs and command list that you need to use to get to your desired location. You basically setup a timer and use the command list from start to end until you arrive at your destination. You can use the roomID list to verify if you're still on the correct path when entering a new room while auto walking.
The mapper draws rooms at their x,y,z position. If the position isn't correct, then you're script doesn't calculate the position correctly. Usually, people mess up their variables -> use plenty of debug echos when parsing the roomID and calculating the new room position. It's usually a good idea to only calculate room positions for new rooms once and leave existing room positions alone. Otherwise you can't use the visual map editor effectively.
Mudlett mapper. How to make it work?
-
- Posts: 97
- Joined: Wed Jul 25, 2012 12:35 pm
Re: Mudlett mapper. How to make it work?
I used you advice to create allias and i will use it with
i get errors like:
(a boolean value)
(a nil value)
can you give me an example of working script?
specially something to walk by existing exits not by create new location
or
i get errors like:
(a boolean value)
(a nil value)
can you give me an example of working script?
specially something to walk by existing exits not by create new location
-
- Posts: 97
- Joined: Wed Jul 25, 2012 12:35 pm
Re: Mudlett mapper. How to make it work?
I don't know why but:
getRoomExits(roomID)
is not working at all :/ I think that causes most problems
Edit:
That is because i don't have proper room exits table?
Where/How I can get one?
getRoomExits(roomID)
is not working at all :/ I think that causes most problems
Edit:
That is because i don't have proper room exits table?
Where/How I can get one?
Re: Mudlett mapper. How to make it work?
Is roomID a valid room you've created in the mapper?
Re: Mudlett mapper. How to make it work?
You need to look closely at the Lua runtime errors -> red ! button in trigger editor. This will show you the errors in your script at runtime -> aka bad variable initialization/useage
e.g. you need to be careful what type of variable you are using: matches[2] is always a string value, not a number -> tonumber(matches[2])
There's plenty of examples of working scripts -> sticky mapper topics. If you need more help you need to post more specific information i.e. screenshot of the error view and the corresponding script.
e.g. you need to be careful what type of variable you are using: matches[2] is always a string value, not a number -> tonumber(matches[2])
There's plenty of examples of working scripts -> sticky mapper topics. If you need more help you need to post more specific information i.e. screenshot of the error view and the corresponding script.
-
- Posts: 97
- Joined: Wed Jul 25, 2012 12:35 pm
Re: Mudlett mapper. How to make it work?
Not in that case becausee.g. you need to be careful what type of variable you are using: matches[2] is always a string value, not a number -> tonumber(matches[2])
is working propertly
-------------------------------------------------------------------
The compass (grey square and green ones near him) is working unrelated to mapper. Maybe i can use that code to create exits table? I really don't know what to do :/
Re: Mudlett mapper. How to make it work?
Impossible. centerview(id) expects a number, not a string value - and matches[2] is invariably a string value. Note that the string "2" does not equal the number 2.azure_glass wrote:Not in that case becausee.g. you need to be careful what type of variable you are using: matches[2] is always a string value, not a number -> tonumber(matches[2])
is working propertly
-
- Posts: 97
- Joined: Wed Jul 25, 2012 12:35 pm
Re: Mudlett mapper. How to make it work?
I swear it really works anyway..
What information do you need to help me?
Maybe i can upload some .xml with scripts... be right back
script:
http://wklej.to/PfvFr
What information do you need to help me?
Maybe i can upload some .xml with scripts... be right back
script:
http://wklej.to/PfvFr
Re: Mudlett mapper. How to make it work?
It "works" if Lua is able to cast the string matches[2] into an integer value - same thing as the echo() functions, but it will break in all cases where Lua can't e.g. if matches[2] < 5 then ... end
This is why you should generally use explicit casting to the proper data type when using the matches table. This helps make things more straightforward and avoids errors.
Your problem was that somewhere in your scripts you are messing up some variables of yours and thus calculate "wrong" room coordinates. To solve these issues you need to use variable tracing to find out where in your scripts you mess up your variables, room coordinates etc..
roomExits() doesn't contain any special exits -> getSpecialExits(roomID)
These functions return a table. You can use the function display(t) to see what the table contains.
If you want more specific answers, you need to post more specific questions as I don't have the time to look at your script.
This is why you should generally use explicit casting to the proper data type when using the matches table. This helps make things more straightforward and avoids errors.
Your problem was that somewhere in your scripts you are messing up some variables of yours and thus calculate "wrong" room coordinates. To solve these issues you need to use variable tracing to find out where in your scripts you mess up your variables, room coordinates etc..
roomExits() doesn't contain any special exits -> getSpecialExits(roomID)
These functions return a table. You can use the function display(t) to see what the table contains.
If you want more specific answers, you need to post more specific questions as I don't have the time to look at your script.
-
- Posts: 97
- Joined: Wed Jul 25, 2012 12:35 pm
Re: Mudlett mapper. How to make it work?
Okay
One specyfic question
Why when I rigt-click on location there are few existing exits and i can't recive table of them by roomExits()?
One specyfic question
Why when I rigt-click on location there are few existing exits and i can't recive table of them by roomExits()?