Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Sat 11/12/2010 11:51:31

Title: Script for if player has been in various rooms
Post by: barefoot on Sat 11/12/2010 11:51:31
Hi

I am trying to script for 'if player has been in rooms'.

Im not sure on how to seperate them like with the && or ||...

Like this:


  if HasPlayerBeenInRoom 5, 6, 7, 8, 10, and 11... Else..

Im trying this (AGS acccepts it but fails):


  StopMusic();
   if(HasPlayerBeenInRoom(10) ==1) {
     if(HasPlayerBeenInRoom(11) ==1) {
       if(HasPlayerBeenInRoom(5) ==1) {
           if(HasPlayerBeenInRoom(6) ==1) {
             cChris.Say("ive got them all now");


:o

cheers for all help

barefoot

Title: Re: Script for if player has been in various rooms
Post by: Matti on Sat 11/12/2010 12:19:15

if (HasPlayerBeenInRoom(5) && HasPlayerBeenInRoom(6) && HasPlayerBeenInRoom(7) && HasPlayerBeenInRoom(8) && HasPlayerBeenInRoom(9) && HasPlayerBeenInRoom(10) && HasPlayerBeenInRoom(11)) {}
else {}
Title: Re: Script for if player has been in various rooms
Post by: barefoot on Sat 11/12/2010 15:41:20
cheers matti... i should have guessed

:=

barefoot