Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE

Passive powers

Ateo88
Tuesday, December 31, 2019 - 02:46

I would like a passive power to grant magic shield when you are below half health.

I have set up passive_trigger=on_halfdeath but the problem is once your character is below half health it would keep continously casting instead of simply casting it once only at the point when the halfway mark is crossed.

Can anyone help me with the config of this so that this will work as intended?

 

Happy new year!

  • Log in or register to post comments
Commander
joined 2 years 7 months ago
Tuesday, December 31, 2019 - 03:31
Commander's picture

insert new variable called "a".

a=0;

health=100;

*****

step will be:

 

if a=0 {

       if health>=50 then {exit;// if needed magic_shield_activation=false;}

   a=1;//this is the key
     // _____ here create that casting effect; ____ magic_shield_activation=true;   

          }

 "a" is crucial variable to block future effect.

******

//if health is recovered a=0 is again.

if health>=50{a=0;magic_shield_activation=false;}

 

all of this actually depends how that ship react in various situations, and code optimization with command "else" or use switch() command with plenty of breaks;

Don`t use many "if" per step, it is bad.

P.S ..don`t forget to destroy animation object  at shield animation end ..

in case that animation is a part of that character then you need additional timer variable.

 

 

 

  • Log in or register to post comments