How do I do this :

0 favourites
  • 3 posts
  • I'm creating a Turn based RPG . During combat , there is certain sprites that indicates what buff/debuff is affecting the player/enemy .

    There is a certain interaction , where the player activates a buff which makes him invulnerable , while the enemy has a chanelling spell that deals damage .

    If the player activates this buff right before the chanelling ends , he blocks the damage from the attack .

    Both habilities ( invulnerability and the channeling one ) are represented by the sprites mentioned in the first paragraph .

    This is my problem : The system checks if the channeling ability has done channeling , and if so , deals damage . It cheks if the ability has done channeling by the frame of the sprite .

    But , in this interaction , it needs to check the sprite 2 times :

    First Check -> If the invulnerability spell is active .

    Second Check -> If the chanelling spell has done chanelling .

    So it would look something like this :

    If spr_buff.Frame = 5 ( Invulnerability )

    If spr_buff.Frame = 8 ( Channelling spell )

    then

    <player takes no damage>

    But Construct 2 cannot check two instances of the same sprite with different frames .

    Any help ?

    PS : Sorry for my bad english , it's not my native language

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can refer to different instances by IID, but you will need to use "System Compare two values" action:

    System Compare two values sprite(0).AnimationFrame=5
    System Compare two values sprite(1).AnimationFrame=8
    

    Where 0 and 1 are IIDs of the sprite instances. You can find IIDs in the debug mode.

    Alternative method is to use a family. Add your sprite to a family, and then you can pick one instance of the sprite, and one instance of the family in the same event:

    Sprite Animation Frame=5
    Family Animation Frame=8
    
    
  • Thanks ! It worked .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)