In Adventuron. I am trying to chase it down now. I know what integer it is that triggers it when incremented, but there is a bunch of downstream stuff that happens after that, so I need to test everything.
Viewing post in Weird phantom direction bug...
Yes, that would trigger it. Please can I see the code that you are matching with s _ , and for what purpose you are doing it?
Adventuron scans inside the on_command {} table for what looks like matching of directions, and adds in those directions to the exit list dynamically. The scanning is aware of additional inner if statements like:
: match "s _" { : if (is_at "stream") { : goto "moor"; } }
In the above case, it would add a SOUTH exit to the stream location.
What I'm really interested in is why you overrode the south command and why it's not appropriate to list the exit.
I use it in a few places:
1. When I leave this room, I want a message to be printed and to reset a number of flags (I'm leaving a room where I've been snooping around, opening the safe, etc so I want to leave it as I found it:
: match "s _" {
: if (is_at "secretarys_office") {
: print "You make sure you leave the room as you found it!" ;
: pocket "keyring" ;
: door_operation door = "secretary_door" operation = "lock_close" ;
: if (safeopen) {
: set_false "safeopen" ;
}
: if (safeunlocked) {
: set_false "safeunlocked" ;
}
: if (draweropen) {
: set_false "draweropen" ;
}
: goto "corridor7" ;
: press_any_key ;
: redescribe;
2. When I leave this room, I want a message to printed the first time that happens:
: match "s _" {
: if (is_at "bobsroom") {
: if (bobstuff==6&&bobother==3) {
: print "leaving room information" ;
: increment "bobstuff" ;
: goto "corridor2" ;
: press_any_key ;
: redescribe;
3. Here there are some doors mentioned in the description (that are just there for scenery). I thought that rather than create a locked door in each location, I'd just do this:
: match "s _" {
: if (is_at "corridor5") {
: print "There was a locked door in the way." ;
...I'm also matching "n_" elsewhere, but that is not causing phantom norths...
There is definitely some connection with another counter that I am incrementing. This increments at certain points in the game, after which the game is set to a new state (the player is put in another room etc). Before that change happens: no phantom souths. They appear afterwards.
I fixed it!
The full offending match statement is below:
---
: match "s_" {
: if (is_at "secretarys_office") {
: print "MESSAGE" ;
: pocket "keyring" ;
: door_operation door = "secretary_door" operation = "lock_close" ;
: if (safeopen) {
: set_false "safeopen" ;
}
: if (safeunlocked) {
: set_false "safeunlocked" ;
}
: destroy "safe" ;
: if (draweropen) {
: set_false "draweropen" ;
}
: goto "corridor7" ;
: press_any_key ;
: redescribe;
}
: if (is_at "corridor5") {
: print "There was a locked door in the way." ;
}
**OFFENDING CODE BELOW**
: if (traptor==3){
: if (is_at "bobsroom") {
: if (bobtell==6&&bobask==3) {
: print "MESSAGE" ;
: increment "bobask" ;
: goto "corridor2" ;
: press_any_key ;
: redescribe;
}
}
}
}
---
I changed the offending bit to:
: if (is_at "bobsroom") {
: if (traptor==3) {
: if (bobtell==6&&bobask==3) {
: print "MESSAGE";
: increment "bobask" ;
: goto "corridor2" ;
: press_any_key ;
: redescribe;
}
}
}
And it works (of course, I have no idea why, but breathe a sigh of relief and carry on!)