Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: lilinuyasha on Wed 22/12/2010 18:04:36

Title: Help with DoOnceOnly
Post by: lilinuyasha on Wed 22/12/2010 18:04:36
I'm a Noob, sadly, and can't manage to figure out how to get DoOnceOnly to work. i have only a very rudimentary knowledge of Java, (i'm assuming that's the scripting language) and am not very technical with this stuff. i wanted to get to know THE ENTIRE SCRIPT for something of a message to display when you first enter the room. i've read the tutorials but run into problems with the "Game" variable already being defined. this is driving me crazy to no end and i would like a complete script so i can use it for future purposes. i'm unsure where to put the whole "static bool..." thing, since "static" only refers to"member variables" or something like that. help a N006 out and i'll make it worth your while!
Title: Re: Help with DoOnceOnly
Post by: ThreeOhFour on Wed 22/12/2010 18:20:56
First, go to your room and select the Events pane (little lightning symbol).

Select the Enters room after fade in function, click the [...] button and alter the code to look like:


function room_AfterFadeIn()
{
 if (Game.DoOnceOnly("firstroom1"))
 {
   player.Say("Yeah baby!");
   Display("POTATO!");
 }
}


Hope this helps :)
Title: Re: Help with DoOnceOnly
Post by: lilinuyasha on Wed 22/12/2010 19:04:45
yes that does! i also found a little action for the room itself, for "first time in room", which was an easier way of doing what i wanted. excuse my noobiness for a little bit. but i'm currently working on a "drug adventure" game.
Title: Re: Help with DoOnceOnly
Post by: ThreeOhFour on Wed 22/12/2010 19:47:36
Yep, that is a useful function, but I decided to answer your question directly so you can use the DoOnceOnly function in the future (it's very handy!)

Good luck with your game, and just for future notice (though I am not a moderator), the best place for simpler questions like these is the Beginners Technical Questions (http://www.adventuregamestudio.co.uk/yabb/index.php?board=6.0) board :)
Title: Re: Help with DoOnceOnly
Post by: lilinuyasha on Thu 23/12/2010 08:08:56
great! how sahould i make it worth your while? should i include you in the ACID FUELED ADRENALINE RIDE THAT IS DRUG TRIP 2011???