Help, RPG hitpoint adjusted by timer that doesn't work

rab127rab127 Member, PRO Posts: 47
edited November -1 in Working with GS (Mac)
Hi

I am trying to set up where when a character hits an enemy that the amount of hitpoints the enemy has deducted is controlled by three factors.

game.playerlevel, integer, 1
weapon's attack hitpoints, integer, game.stab attack 20
attack factor, integer, 100 (when the player attacks I want it to take 2 seconds before the weapon is fully ready again)

hitpoints are determined by game.playerlevel*game.stabattack*game.attackfactor/100

I am having trouble with the attack factor on two fronts.
One:
To get the number to reduce and reset I have been handling it by
when attack one is touched
Change attribute game.attackfactor to 0
then I created a rule
if game.attackfactor < 100
Timer every .2 seconds game.attackfactor+10

The problem I have found is that the attack factor goes to 0 and will increase by 10 but never increase up to 100 over 2 seconds.

Is there a better way to try to set this up?

Second I have an actor that acts as a visual indicator for the attack factor that I attached through a change attribute self.Size.width to game.attackfactor but while it displays the 100 value it never gets smaller when the attackfactor value gets smaller.

Any suggestions?

Comments

  • JamwithnoJamwithno Member Posts: 312
    I think that tshirtbooth has a video on this.
  • rab127rab127 Member, PRO Posts: 47
    Thanks Jam took a look

    but he had some videos on score counter but not what I am trying to do.
Sign In or Register to comment.