SCRIPTING: If hostpot has been interacted before? (SOLVED!)

Started by Albino-I, Fri 25/11/2005 19:50:39

Previous topic - Next topic

Albino-I

I need some help with my script.

I want the script to display some text and do some other interactions IF the hotspot hasn't been interacted with before. But if the hotspot has been interacted with, the same actions won't happen again. What kind of script should I use?

Ishmael

Put into the beginning of the room script:

int var;

Then into the interaction script something like:

  if (var == 0) {
    //first interaction, scripts here
    var++;
  } else {
    //second and following interactions
  }
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Albino-I

Umm.. this might sound dumb, but what do you mean by this 'var'? Yes, I am new to this.

Could you be more precise with your instructions please? Step to step?

Ashen

That pretty much is step by step. What Ishmael means is, you have to use variables. var is just the example name he's has given the variable - it could just as easily been hasbeenclicked or interacted or anything - the important bit is the int in the first line, and the if / else parts.

For more details on using variables, read the BFAQ, or read the AGS Tutorial (scroll about half way down the page for variables).
I know what you're thinking ... Don't think that.

Albino-I

Yeah I just noticed my own stupidity.

Reading the scripting tutorial helped me understand couple of small things. My main problem was that I didn't know where to put the 'int variable' script (I was trying to put it under the 'first time player enters the screen' tag).

Thanks for all your help. I finally uderstand the use of variables now too  :)

SMF spam blocked by CleanTalk