How to check if actor has certain stat(s) with RGSS?
#1
How to check if actor has certain stat(s) with RGSS? ^^

I didn't get further than

if $game_actor[1]

..lol. ^^
Reply }
#2
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.
Reply }
#3
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?
Reply }
#4
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
Reply }
#5
Cool, it works. ^^ Thanks!
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Personal graph by actor zlsl 4 5,080 10-23-2021, 06:43 AM
Last Post: zlsl
   RGSS scripting dissections and explinations Siletrea 97 106,838 03-18-2019, 06:46 AM
Last Post: Siletrea
   Help iwth script (RGSS Player crash) Whisper 3 8,623 06-17-2017, 05:03 PM
Last Post: Whisper
   Actor names in Quest Script jreagan406 5 8,798 03-07-2017, 08:06 AM
Last Post: JayRay
  How can I use the cmd of "require" in rgss superegp 2 5,984 11-03-2015, 06:16 AM
Last Post: kyonides
   Actor Graphic/Reflection Refuses to Update/Refresh penguwin 6 9,962 11-06-2014, 09:51 PM
Last Post: penguwin
  Attack from an enemy to a actor as condinitional branch Djigit 7 10,180 07-05-2014, 06:58 PM
Last Post: Djigit
Question  RGSS stoped to work Chaos17 5 7,851 02-14-2013, 05:13 PM
Last Post: DerVVulfman
   Ruby, RGSS & General Code Discussion Kain Nobel 6 11,062 12-22-2012, 05:11 AM
Last Post: MechanicalPen
   [Request] Tut. for RGSS Eldur 9 12,063 12-07-2012, 04:27 AM
Last Post: DerVVulfman



Users browsing this thread: 1 Guest(s)