Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

A secret passage

A topic by auraes created Sep 09, 2019 Views: 72 Replies: 1
Viewing posts 1 to 2
Submitted (1 edit)

I need a secret passage from room1 to room2 or room3, depending on a certain condition and by moving with the compass direction (east). I don't know if it's the easiest solution, but it's the one I found; If it helps.
What I did:
# room1 (>east)-> room2 (if flag or condition false)
# room1 (>east)-> room3 (if flag or condition true)

locations {
   room1 : location "You are in a room1" ;
   room2 : location "You are in a room2" ;
   room3 : location "You are in a room3" ;
}
connections {
   from, direction, to = [
     room1, east_oneway, room2,
   ]
}
barriers {
   block_secret : block_path {
      from = room1
      to = room2
      gosub = secret_passage
   }
}
booleans {
   is_001 : boolean "false" ;
}
subroutines {
   secret_passage : subroutine {
    : if (is_001 == false) {
         : print "You found a secret path to room 2" ;
         : goto "room2" ;
         : redescribe;
      }
      : else {
         : print "You found a secret path to room 3" ;
         : goto "room3" ;
         : redescribe;
      }
   }
}

Host

That's very inventive. Well done. There is a secondary method, but I like your method more than the other one.