Renaming exits names

I'm building a game in Quest, 2nd so far, and I got a problem.
Some of the stuff is working but this one has me beat...

A round room
You are in 20 foot circular room that you are calling room 2. There are 3 exits going to what you think is rooms 1, 3 and 10.
You can go E1, E2 or E3.

here is the problem...
(in bold are variables...)
A round room
You are in 20 foot circular room that you are calling room 2. There are 3 exits going to what you think is rooms 1, 3 and 10.
You can go E1, E2 or E3.

E1, E2, and E3 are variables, but I can't make them say 1, 3, 10
I know it would be part of exit Alias, but what???
{player.E1} does not work...


E1, E2, and E3 are variables...

What sort of variables? If you mean local variables, then the text processor will have no access to them. However, you could use attributes of the player object instead, then {player.E1} would work.

If they are objects or exits, you should be able to do {E1.alias}.

If that does not make sense, paste the code where you set E1, E2 and E3, so we have a better idea of what they actually are.


Room description:
![CDATA[You are in 20 foot circular room that you are calling room {player.CR}. There are 3 exits going to what you think is rooms {player.E1}, {player.E2} and {player.E3}.
{player.m1} {player.m2} {player.m3}]]

player.E1, player.E2 and player.E3 are generated exits:
player.E1 = ToInt(StringListItem(player.Exit1, player.CR))
generated from this list:
player.Exit1 = Split(" 0; 2; 1; 2; 3; 1; 5; 6; 1; 8; 2;10; 3;12; 4; 6;15; 7; 9;11;13",";")
same with E2 and E3

Does this help???


The old version that set the exit was this:
if (player.CR=1) {
player.E1 = 2
player.E2 = 5
player.E3 = 8
}
player.CR is the player's current room
there are 3 exits going to rooms 2,5 & 8
selecting one of the links E1, E2 and E3 takes you to the nest room and the exits are re-figured.


How would I post a picture here?


Or is this the part you need?

<object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
      <statusattributes type="stringdictionary" />
    </object>
<exit to="E1">
      <runscript type="boolean">false</runscript>
      <script type="script">
      </script>
    </exit>
    <exit to="E2" />
    <exit to="E3" />
  </object>
  <object name="E1">
    <inherit name="editor_room" />
    <usedefaultprefix type="boolean">false</usedefaultprefix>
    <enter type="script">
      player.CR = player.E1
      MoveObject (player, room)
    </enter>
  </object>
  <object name="E2">
    <inherit name="editor_room" />
    <enter type="script">
      player.CR = player.E2
      MoveObject (player, room)
    </enter>
  </object>
  <object name="E3">
    <inherit name="editor_room" />
    <enter type="script">
      player.CR = player.E3
      MoveObject (player, room)
    </enter>
  </object>

So I think what you want is a list of rooms that are connected to the current room. T do that, you will need to create a list, and then add to it the name of each room that is at the end of an exit from this room. You can then join all the room names together. In code:

list = NewStringList()
foreach (exit, ScopeExits()) {
  list add (list, exit.to.name)
}
msg("You can get to rooms: " + Join(list, ", "))

Will that make the room links clickable?
I may have another idea that I will try also...
Even if I can't get the room names working, I will release this as a work in progress...
(That may help you see what I'm trying to do better...)


Try:

list = NewStringList()
foreach (exit, ScopeExits()) {
  list add (list, "{exit:" + exit.name + "}")
}
msg("You can get to rooms: " + Join(list, ", "))

Each exit will need a name, and will display the alias, which I guess you would set to be the name of the destination.


Hunt the Wumpus is posted, there you can see what I mean...
Also, my "you died" rooms are shown twice... (???!!!)


If a room is shown twice, that is often because you moved the player in one of the scripts on the Scrips tab of a room. The player arrives in one room, then goes to another, so Quest thinks two room descriptions are required, and does both for the current room. If this is the case, see if code can be moved to the exit, rather than the room.


Too bad Quest does not have a Step command.
So that someone could step the program, one line (command) at a time to see the program in action, step by step...
(or does it???)
Oddly, I think I fixed that problem, 2 room descriptions, but now, after you die, it still shows you the room you are in, as if the game is still running...
But, the links do not respond when clicked.


OK, New problem is solved...
I was checking for you entering a hazard in "Before entering room", where the rest of my scripts is...
But, I needed the hazard, and dying, script in "After entering room"
Now it works!!!


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

Support

Forums