Help with DoOnceOnly

Started by lilinuyasha, Wed 22/12/2010 18:04:36

Previous topic - Next topic

lilinuyasha

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!
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

ThreeOhFour

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:

Code: ags

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


Hope this helps :)

lilinuyasha

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.
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

ThreeOhFour

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 board :)

lilinuyasha

great! how sahould i make it worth your while? should i include you in the ACID FUELED ADRENALINE RIDE THAT IS DRUG TRIP 2011???
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

SMF spam blocked by CleanTalk