The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: shintashi on June 11, 2010, 03:10:23 AM

Title: Display enemy Element Table?
Post by: shintashi on June 11, 2010, 03:10:23 AM
is there a way to display/decrypt the enemy's element table so I can make comments on them or add them up numerically?

Like if the assignments are

fire A
ice C
thunder C
water B
...

etc.

How can I access what these values are, or possibly change them?
Title: Re: Display enemy Element Table?
Post by: tSwitch on June 11, 2010, 04:00:11 AM
read up on RPG::Enemy.element_ranks

jftr: I found that by searching the in-program help file for 'enemy' then going to the enemy class listing.
Title: Re: Display enemy Element Table?
Post by: shintashi on June 12, 2010, 12:44:00 AM
Quote from: NAMKCOR on June 11, 2010, 04:00:11 AM
read up on RPG::Enemy.element_ranks

jftr: I found that by searching the in-program help file for 'enemy' then going to the enemy class listing.

p $data_enemies[1].element_ranks

spat out some mess, so I tried this


p $data_enemies[1].element_ranks[9]
p $data_enemies[1].element_ranks[8]
p $data_enemies[1].element_ranks[10]


and got some pretty good results, like 1,3, and 3, which I presume mean A, C, and C?
In what ways can these values be changed? Like only in battle and then they reset, or is it permanent for the run time of the game until restart?


Title: Re: Display enemy Element Table?
Post by: cozziekuns on June 12, 2010, 12:48:28 AM
Should be permanent. You could always change it back later using the same code.
Title: Re: Display enemy Element Table?
Post by: shintashi on June 12, 2010, 12:54:31 AM
Quote from: cozziekuns on June 12, 2010, 12:48:28 AM
Should be permanent. You could always change it back later using the same code.

can I address player characters using this? or would I end up targeting their classes?
Title: Re: Display enemy Element Table?
Post by: cozziekuns on June 12, 2010, 12:55:28 AM
Like Nam said, just do a search of "element" in the help file index and see what happens.
Title: Re: Display enemy Element Table?
Post by: shintashi on June 12, 2010, 01:01:05 AM
Quote from: cozziekuns on June 12, 2010, 12:55:28 AM
Like Nam said, just do a search of "element" in the help file index and see what happens.

good point.

I've checked the outputs and what's in the helpfile is off by 1 point. This array uses 1-6, rather than 0-5. Something important to remember, as F should read 5 but actually reads as 6.
Title: Re: Display enemy Element Table?
Post by: tSwitch on June 12, 2010, 01:36:31 AM
the help files are, incidentally, very helpful.
I learned a lot about RGSS just by looking things up :)

I don't know if they can be changed, I've never tried.  Give it a shot.
Title: Re: Display enemy Element Table?
Post by: modern algebra on June 12, 2010, 01:56:12 AM
They can be changed, but they will be reset the next time the game loads the data objects, generally through Scene_Title after restarting unless you or someone else codes them in to reload somewhere else. But really NAM's right, if you want to know whether you can do something, just try it. If it works, it's a lot faster than asking us, and if it doesn't, you can always ask us after and see if there's another way.