Save-Point

Full Version: How to check if actor has certain stat(s) with RGSS?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to check if actor has certain stat(s) with RGSS? ^^

I didn't get further than

if $game_actor[1]

..lol. ^^
My dear, I am glad you asked.

You can access values like this

$game_actors[index].name ... the actual character name
$game_actors[index].character_name ... the characterset used
$game_actors[index].character_hue ... the 'adjusted' hue of the characterset
$game_actors[index].class_id ... the class ID value
$game_actors[index].weapon_id ... the ID of the weapon
$game_actors[index].armor1_id ... the ID of the shield
$game_actors[index].armor2_id ... the ID of the helmet
$game_actors[index].armor3_id ... the ID of the body armor
$game_actors[index].armor4_id ... the ID of the accessory
$game_actors[index].level ... the level
$game_actors[index].exp ... the experience points
$game_actors[index].skills ... a hash array of your skills.
$game_actors[index].hp ... the current HP for your character
$game_actors[index].sp ... the current SP for your character
$game_actors[index].maxhp ... the maximum HP for your character
$game_actors[index].maxsp ... the maximum SP for your character
$game_actors[index].base_str ... the strength (based on all equipment n etc)
$game_actors[index].base_dex ... the dexterity score
$game_actors[index].base_agi ... the agility score
$game_actors[index].base_int ... the intelligence score
$game_actors[index].base_atk ... the attack strength
$game_actors[index].base_pdef ... the physical defense value
$game_actors[index].base_mdef ... the magical defense value
$game_actors[index].base_eva ... the evasion value

Others are available, just by looking at the def/methods in Game_Actor, be it battle animation ID values or state effects or the like.
Hehe. ^^

Well, I got that far, but there are 5 different things with "state" in them. Which one would I need, and what rgss command? I'm guessing ".include?(2)" wouldn't work, for, say, poisoned?
Something like...
$game_actors[index].states.include?(3)

3 is the ID number for 'Venom' in the database.

At least, I think you would be using the ID numbers
Cool, it works. ^^ Thanks!