[SOLVED] Making Attack Button to Untouchable Until Attack Animation Finished

ParsSOParsSO Member, PRO Posts: 16
edited May 2015 in Working with GS (PC)

Hello;

I'm trying to make close fighting system(with sword) and i need help about this. How to making button untouchable until my animation is finished? I want this because when i press two times to attack button, animations are snarling. (I have 3 type of attack animations.)

My attack button;

When the button is pressed;

  1. Change Attribute: attack to true (attack is a global attribute. It's type is integer.)
  2. Change Image: To my button's hover style. (Its another image.)
  3. Change Attribute: AttackAnimation to AttackAnimation +1 (I have 3 type of attack animation, that's why this improves. When the AttackAnimation is 3, the value of AttackAnimation changes to 0)

I was try to timer but, it's not working. After this button i will try to make close fighting system with sword. May anyone help me about this problem please? Thanks.


And let me know please if my problem question is confusing. If its confusing, i'll try to edit this post. :)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2015

    You can tell if an animation has completed by checking to see if self.Image equals the name of the last image in the Animate sequence.

  • ParsSOParsSO Member, PRO Posts: 16
    edited May 2015

    @tatiang said:
    You can tell if an animation has completed by checking to see if sel.Image equals the name of the last image in the Animate sequence.

    Thank you. I'll try this. :) But how to disable button's function when the my first image(actor's default) is not seen? Should i create new rule and move all functions to new rule's inside?

    Edit: I did it! When the self.image contains my breathing animation imageses name, button does nothing.

    Thank you for help. :)

  • BigDaveBigDave Member Posts: 2,239

    @tatiang bäm! never thought about that. I always ad internal variable ticking down(integr) once it reached 0 again global variable Cooldown active was set to false again.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @tatiang, great tip!

Sign In or Register to comment.