How to make a puzzle about walking into newroom

Started by uswin, Sun 27/03/2005 20:33:39

Previous topic - Next topic

uswin

I mean.. i want to create a puzzle ..
there are 3 doors and i need to enter the door in the right order to reach the truth door .... please help me ! thanks !!

NiksterG

You can make three identical (or completely different, your choice) rooms, with the hotspot that brings the player to the next room over the right door in each room. Then, on the wrong doors, make a hotspot that brings them to a game over room (or whatever you want). This is what I would do.

**Note** There is probobly an easier way that uses variables, but, being the horrible scripter that I am, I have no idea how to go about it. However, it probably takes up less memory, too.Ã,  ;D
Check out my games! (Not all made with AGS)

strazer

If player has to go through door3, then door1, then door2:

Code: ags

// room script ("{}" button in Room settings pane)

int sequence; // define static variable that stores order



Code: ags

  // script for door3 (interact with hotspot/object, walk onto region, whatever you want)

  if (sequence == 0) sequence = 1; // if this is the first door chosen, set variable to 1
  else sequence = 0; // if wrong choice, reset variable

  NewRoomEx(character[GetPlayerCharacter()].room, 150, 150); // re-enter current room and position player at door3



Code: ags

  // script for door1

  if (sequence == 1) sequence = 2; // if this is the second door chosen, set variable to 2
  else sequence = 0; // if wrong choice, reset variable

  NewRoomEx(character[GetPlayerCharacter()].room, 50, 150); // re-enter current room and position player at door1



Code: ags

  // script for door2

  if (sequence == 2) NewRoom(THENEWROOM); // if this is the third door chosen, go to the next room
  else NewRoomEx(character[GetPlayerCharacter()].room, 100, 150); // if wrong choice, re-enter current room and position player at door2

  sequence = 0; // reset variable



uswin

thanks alot bro !!! i will try the script !  ;D

SMF spam blocked by CleanTalk