Perfectly Accurate Map Glitching

I have checked all the exits. None of them lead to the wrong room. All of the rooms are in the right place. All of the exits work perfectly most of the time, and then, for no clear or knowable reason, I press the north arrow and get asked which north I want to travel, or worse I press the south arrow, and my black map lines get all tangled up (I travel west instead of south) and I get an error message that says those coordinates are not in the dictionary.
Nothing about the placement of the rooms is wrong.

In fact, if there is a way to just not show error messages, I will take that path, because, they are not exactly useful in-game while playing, and the tangle of black lines, as wrong as it is, makes sense as a tangle of vines, since I am using the map as a plant, at this point.
Please help me, either find a true solution, or at least get rid of the error display!


I think the problem may be the timer I set up to make the rooms twinkle, flashing between one colour and the next. If someo ne can verify this for me, I borrowed the script to redraw the grid room every second (after recolouring them is how I used it) on the page Showing A Map.
Is there a solution other than locking the doors, if that's the case? I have locked all the doors. Could I "disable timer" "before entering? and "enable timer" "after entering"?
How well does "before entering" work? How does it work?


It's hard to say what causes something like that. If it's asking which north you want, it's unconnected to the map; it must mean there's multiple exits in the room somehow. But that's not easy to debug without looking at the game.


Is it not making two exits by redrawing the map?


I'd have to look at the script to be sure, but I can't think of any circumstance in which it makes sense to create more exits when you're redrawing the map.


I am starting over again, with all new rooms, in an all new game creation, just in case it is left over script that I didn't completely delete, by working in tabs. I have still not found anything visible to me.
If I did make various hidden errors of my own, this starting over will correct them.


I just meant I had thought, it might not be this way, that the game was reading the exit once for before the map was redrawn and once for after that, and the exit was used to close to the change, so maybe it had read the exit twice.


While I have ever made mistakes, deleting either of these functions, whichever was in the game at the time, cleared up all error messages while traveling through exits. Both functions work perfectly except for this happening to me, and maybe I am triggering it somehow. The second I wasn't sure where to paste, so I created a function name, looked up the location in the code section, and pasted right over top of the empty function.
The first one was from the page "Drawing a Map"
Create a new function, call it “VisitRoom”, and give it a single parameter, “room”. Paste in this code (the fourth line is commented out, if you remove the slashes at the start, the map will be fully visible from the start):

if (not GetBoolean(room, "genvisited")) {
room.genvisited = true
Grid_CalculateMapCoordinates (room, game.pov)
// Grid_DrawRoom (room, false, game.pov)
foreach (exit, AllExits()) {
if (exit.parent = room) {
VisitRoom (exit.to)
}
}
}
Then in the start script:


VisitRoom (game.pov.parent)
The second I borrowed from a game comments section. 
I dont know if I am supposed to accredit people in these cases.
<function name="GetListDisplayAlias" parameters="obj" type="string"><![CDATA[
if (HasString(obj, "listalias")) {
result = ProcessText(obj.listalias)
}
else {
result = GetDisplayAlias(obj)
}
containers = ListExclude(ListParents(obj), game.pov)
containers = ListExclude(containers, ListParents(game.pov))
foreach (c, containers) {
result = "&nbsp;&nbsp;&nbsp;" + result
}
if (obj.scenery or not obj.visible) {
return (null)
}
return (result)
]]></function>

SORRY


That seems to be two copies of the same script. And I can't see them leading to this problem, even if run twice. So it could be a problem with the other one?


The box just went around more than I pasted!
Anyway, I edited the post. I hadn't seen the double paste, earlier. Sorry about that.
And if it doesn't do something that makes the game (well, my game) glitch, it did disappear when the functions were erased, so I don't know what to think. The reason I deleted the second function (which has nothing to do with exits, so I wouldn't have otherwise) is that the error message included it. And deleting solved the problem, which is weird but all my exits were correct both times, so it's also weird that the string was getting tangled.


Hmm… I can't see the connection there.

On the other hand, after trying to figure out what that modification does, I think there might be a more efficient way to do the same thing:

<function name="GetListDisplayAlias" parameters="obj" type="string"><![CDATA[
  if (HasString(obj, "listalias")) {
    result = ProcessText(obj.listalias)
  }
  else {
    result = GetDisplayAlias(obj)
  }
  foreach (c, ListParents(obj)) {
    if (obj = game.pov or Contains (obj, game.pov)) {
      return (result)
    }
    result = "&nbsp;&nbsp;&nbsp;" + result
  }
  return (result)
]]></function>

Oh!
Thank you for the neater function script.
All right.
I guess I was wrong about the connection, though, either way. I think. Maybe. Because I did get scrambled again, without any functions, this time. The error message did say that a "function" could not be "read" because of the instance of an "s", but it isn't a function as in the function tab, because that is empty.
What happens is I press the arrow, and, instead of sliding into the next cell, I travel all over the map creating the long black lines that connect exits, going from unconnected room to unconnected room without pressing the arrow more than once. The error message, which is not ever exactly the same (whatever this says about me) this time says "s" cannot be found in the dictionary and the object cannot be transferred into string. I have 1. checked everything related to the rooms involved, which was 25, and 2. all the level script for that level, and also 3. everyuthing for an obvious looking out of place "s".
I can't find it.


It's a lot easier to debug things like this with the actual error message; especially if it includes the line of code causing the error.

I know Quest is sometimes weird with copy/paste; but you should be able to select the error message and then drag it into another window.


Ok. Next time I will.
By the way the code you wrote to be more efficient made my compass arrows disappear. I went back and looked at the exit, and it still said visible, and played the game again, and the compass arrow was still not there.
Did you think that the other line of code was part of my sojourn to find a method of using the keyboard instead of panes to navigate? That would have been wonderful to find, but the code I borrowed just indents objects, when they're inside containers.
(Do you know of a way to choose keyboard controls for the exits? I am still looking.)
As for the tangled paths, I am thinking of using a different system to create the rooms since I learned one in a lesson by another user that generates rooms with all correct exits and labels each room according to location with a lot less work, that would take that much less string to program all the rooms with similar random events.
I have to admit, the only cause I can think of for the glitching is me, but I have not found the mistake yet.


By the way the code you wrote to be more efficient made my compass arrows disappear. I went back and looked at the exit, and it still said visible, and played the game again, and the compass arrow was still not there.

That's weird, and I can't see how that could happen.

The code you posted works out how many times to indent each object by looking at how many containers the object is inside of, and checking which of those contain the player (so basically, making sure it only counts containers, not the player, the room, or any containers that are used to group rooms together).

The code I posted should do the same thing, but finishing early (if it finds that the object's immediate parent is the player, it knows the object doesn't need to be indented; there is no need to check and ignore any other objects further up the chain.

This was confusing me a lot, until I realised that GetListDisplayAlias is called by the internal function GetExitsListData.
So, to figure out where I'm going wrong… are the exits showing up (indented?) in the places and objects list when the compass buttons disappear? Is it indenting objects by the right amount?

I guess my version might be indenting exits by an extra level; although I can't see how that's happening. In any case, if the other script is working, may as well use that.

As for the tangled paths, I am thinking of using a different system to create the rooms since I learned one in a lesson by another user that generates rooms with all correct exits and labels each room according to location with a lot less work

Are you using a system to programatically generate rooms? If so, that's likely where the problem is. Such systems can often interact with the map in unexpected ways.


I was creating the rooms one at a time and each exit one at a time. The exits all seem accurate, and the error actually does not just send the yellow dot into the wrong room, but further travels into a dozen or so other rooms without my touching the arrow or doing anything else, creating a long tangled line of new direction exits. The game start script moves the character from one room to another about 16 rooms, but shouldn't wake up again after running in the level 1 game start, so it can't be that. I also have three entering rooms scripts, one for player, one for player object 2, and one for player object 3. They all create a random integer that changes the colour of each room on that level, but it looks clean to me. The exits, I have checked them and checked them, they look right.
I haven't already mass-generated rooms, but I can't see how that wouldn't be less complicated than doing them by hand. However, how was making them by hand, and adding basic scripts, complicated? That, I don't quite know. It isn't like I have a deadline. I'll figure it out eventually, I think.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums