A time old question... but bear with me

Started by Dr Lecter, Mon 08/08/2005 21:37:18

Previous topic - Next topic

Dr Lecter

I'm having a problem making a reloading script for my game, its pretty much an exact copy of that by Ponch, apart from using non-redundant code but I don't know why the timer won't expire. Yes, yes I know this has been asked before but nothing seems to make it work ??? heres the code:

Code: ags
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
if (IsTimerExpired(1) == 1) {   
 mouse.Visible = true;
}
}


Code: ags
function hotspot2_a() {
  // script for Hotspot 2 (Hotspot 2): Shoot hotspot
  // Reload
if (GetGlobalInt(1)>=1) { // If the player has a clip left
 SetGlobalInt(1, GetGlobalInt(1)-1);//lose one clip
 SetTimer(1, 90); // Set Reload Timer
 //AnimateObject - Reloading Graphic
 mouse.Visible = false; // so the player can't shoot while reloading
  } 
else { // the player is out of ammo
 Display ("I'm out of Clips!");
  }   
}

Once you shoot the hotspot, the mouse is disabled, but the timer won't expire and hence the mouse doesn't get re-enabled.

Ishmael

Can't you just make the reload animation blocking? Or would that interfere with something?
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.

Dr Lecter

#2
It wouldnt interfere with anything... but I have no animation... but I guess i know what I could use instead... don't worry, not only have I worked out to to do it, I've also worked out how to make timers work.

SMF spam blocked by CleanTalk