Help getting a variable from $game_map.events[x] using Sapphire Action System

Status
Not open for further replies.

molster

Villager
Member
Joined
Apr 23, 2013
Messages
7
Reaction score
2
Primarily Uses
Hello everyone!

Quick question I hope. Using Sapphire Action System - and i would like to get the HP of an enemy. Because enemies are just events.

I figured I should be able to pull any information I need right from said event. When called $game_map.events[14] I do get an output of the following:



You can see in red and blue - there are two HP values. I need both.

how would I go about accessing them (all methods I have tried have failed sadly)

UPDATE:

I just made a function inside the script

def get_enemy_hp()return @enemy.hpendthat returns the hp (so thats good) - so this is a good enough work around for now. But still - if I did not make this functions, what would have been my solution?
 
Last edited by a moderator:

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
class Game_Event < Game_Character attr_accessor :hpendPublic Instance Variable?
 

molster

Villager
Member
Joined
Apr 23, 2013
Messages
7
Reaction score
2
Primarily Uses
class Game_Event < Game_Character attr_accessor :hpendPublic Instance Variable?
Hey! I dont think you understood ( I might not have explained it well enough).

But my solution is working okay enough. So all is good anyway:)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top