Multiple clicks on a hotspot or object?

Started by FamousAdventurer77, Wed 08/06/2011 02:44:28

Previous topic - Next topic

FamousAdventurer77

How does one script for multiple clicks on a hotspot/object?

I mean this as in I want to implement an easter egg where you have to attempt interacting with a hotspot a few times (I'm thinking 4 or 5 times.) The first time you get a simple hint to click further, then "Are you sure?", followed by "OK, you asked for it!", the easter egg ensues, then every time after that you just get the same generic Display message whenever trying to interact with the hotspot.
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

Khris

Asked and answered a thousand times. Not that easy to find though.

Code: ags
int egg_clicks;

function hEgg_Interact() {

  egg_clicks++;

  if (egg_clicks == 1) {
    player.Say("What should I do with it?");
  }
  else if (egg_clicks < 5) {   // clicks 2, 3, 4
    player.Say("Are you sure?");
  }
  else if (egg_clicks == 5) {
    player.Say("Ok, you asked for it!");
    ...
  }
  else {
    player.Say("Nothing happens.");
  }
}

FamousAdventurer77

Excellent. Just tweaking the easter egg execution, but otherwise got it. Thanks!

I think the reason why it's not found easily is because it's odd to word..."multiple clicks" was the best description I could come up with.
If you want to know the Bible's contents, just watch Lord of the Rings or listen to the last 8 Blind Guardian albums. It's pretty much the same thing.

SMF spam blocked by CleanTalk