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.

[XP]Show Battle Animation with Variable

Okay, I need a line(s) of script I can put in an event that will show an animation on an event depending on what a variable is set to.

What I mean is that in common events, when selecting 'Show Animation', you can only choose from the player, 'this event', and some listed event IDs. However, I'm doing sort of a small event-based battle system, and I need to be able to show animation on the particular enemy the player happens to be fighting. This is all on the map, so there are no 'targets' and whatnot.

What I need to be able to do is set a variable equal to an enemy's event ID, then show the animation on the event who's ID is equal to that variable. I know it has to be done with a script. Is there anyone who knows how to do that?
 
Code:
$game_map.events[event_id].animation_id = animation_id
for example, event_id would be the event's id which you damaged... But you want to use game_variables...well then
assign the event_id to a game_variable and use it instead of the event_id:
Code:
$game_map.events[$game_variables[id]].animation_id = damage_animation_id

If that's not it then explain with other words.

Later!
 
...Does this look right, because I'm getting an error. I think the line is so long that it's wrapping in the script box and it's reading the second line as a different one... No idea how to get around that.

Code:
$game_map.events[$game_variables[4]].animation_id = 4
 

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