Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 24/12/2003 12:06:39

Title: A reeeeealy dumb noob question
Post by: on Wed 24/12/2003 12:06:39
Ok ok i know it is a reealy big dumb question but please help me :'(

How can i let my char walk trough a door with a key????

thnx :D
Title: Re:A reeeeealy dumb noob question
Post by: santiago on Wed 24/12/2003 13:52:31
Although I'm a newbie too I solved it with some easy scripting. Can't remember the code now because I'm on another computer at the moment.

Consult the manual and all the answers will reveal themselves as bad cheese on an old sandwich.   ;D
Title: Re:A reeeeealy dumb noob question
Post by: DragonRose on Thu 25/12/2003 01:47:47
No need for scripting.  It can all be done in the interactions editor.

-make the door a hotspot,
-go to the interactions menu for that hotspot
-under "use inventory on hotspot" make a "conditional-if inventory item was used" event
-change the inventory item number to the one you have for the key
-change the "do nothing" event to "character-move character"
-make an event right after that using "player-go to a different room or "player-go to a different room (at specific co-ordinates)"
-select the room and (if applicable) the co-odinates you want your character to show up in
-Ta da!
Title: Re:A reeeeealy dumb noob question
Post by: on Fri 26/12/2003 13:50:00
Thanks!!!
Title: Re:A reeeeealy dumb noob question
Post by: Barcik on Fri 26/12/2003 13:56:21
Or if you do wish to use scripting....


SetGlobalInt(1,0);

if (character[GetPlayerCharacter()].activeinv==__) { //put the number of the key here
  if ((GetGlobalInt(1)==0) {
  SetGlobalInt(1,1);
  //script for door opening animtion here
  } else
  Display("The door is already open."); } else
  Display("This item doesn't fit."); }

//script for use door
if (GetGlobalInt(1)==1)
NewRoom(_); else //put the number of the room here
Display("You must open the door first.");