Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Storing Damage done in variable

RvdD

Member

Im looking for a way to store the damage done by an attack made my an actor into a variable.

I want to use this value to call a common event which deals damage to all enemies equal to 10% of the damage done.

ie a skill that has an additional 10% AoE damage effect.

I thought this was the easiest way to do this seeing a skill can call a common event, but I cant seem to find a way to store the damage into the variable.
Ive tried putting $game_variables[1] = self.damage into Battler_3 under the def skill_effect part (right under the part it subtracts HP) but the additional AoE effect remains 0 damage no matter where I put the code.

Anyone got any other way of doing this?
 

RvdD

Member

Nobody got an idea?

I also tried using Force Action into the Commen Event called by the skill, but this does nothing. Its like the Force Action command aint even there.
 

RvdD

Member

Thnx for the help but it doesnt work unfortanutely :(.

The variable stays 0 seeing the damage done by the Deal Damage event is 0.

I dont get it :S.

My common event looks like this:

Show Battle Animation: Entire Troop
Control Variables: [0001: DamageDone] /= 10
Deal Damage: Entire Troop, Variable[0001: Damage Done]

And the skill calls that common event. It shows the animation, deals the damage, only the damage is 0... :(

Tried putting the $game_variables[1] = self.damage part @ a lot of places inside attack_effect and skill_effect but nothing seems to work.
 

RvdD

Member

That last thing u said did the trick :)

Using a custom side view battle system and I never thought about looking there!
Ended up putting the command line in a lot of places as my battle system uses a lot of definitions to define its damage, but its working now! :D:D
Should have thought of that really... ah well :P.

Thnx a lot for the help :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top