Permanent state script is not showing state icons.

FourthDimension

Villager
Member
Joined
Mar 31, 2019
Messages
14
Reaction score
1
First Language
English
Primarily Uses
RMVXA
This was originally a response to the following topic:
in which scripts were being used for permanent states not removed by KO, resting at inns, etc.

In it, the following script is linked:
http://www.himeworks.com/2013/03/10/permanent-states/


Hi everybody. I've just implemented the above script as one of my characters uses different 'stances' that emphasise different stats and unlock the use of different abilities in combat. I've done this by creating each one as a state, with commands that apply and remove the states as necessary. Each one has an icon to make it clear which stance is active. Without the script there was a huge bug whereby allowing him to be KO'd and then revived removed all stances and unlocked all abilities.

From what I can tell, the script has worked in that death and inns do not remove the states, but for some reason the state icons are not appearing next to the character in the menu whereas they were before I put the script in. Any idea why this may be? Is there something in the script that disables permastate icons? Or is it conflicting with something else in my scripts (I'm using Yanfly's battle engine)?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
545
Reaction score
222
First Language
english
Primarily Uses
RMMV
from reading the comments in that link the permastates being invisible is a known thing.
copy/paste hime said:
You would need to modify the status windows to include permastates, since permastates are separate from states.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,517
Reaction score
14,249
First Language
English
Primarily Uses
RMVXA

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

FourthDimension

Villager
Member
Joined
Mar 31, 2019
Messages
14
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Hmmmmm. So I see. I wouldn't know how to go about that though. Presumably it would be a case of finding the line that draws the state icon in the default script(s) and adding a command to add the appropriate icons from the permastate script, but I can't see anything that leaps out in Hime's script that would reference a permastate icon, and I'm under no illusions that it would actually work anyway.

May have to look for something else unless anyone with more scripting know-how can see something that I can't?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,159
Reaction score
821
First Language
Hungarian
Primarily Uses
RMVXA
You could try this little snippet:
Code:
class Game_BattlerBase

  def state_icons
    icons = (states+permastates).collect {|state| state.icon_index }
    icons.delete(0)
    icons
  end

end
Disclaimer: I did not test this. At all. :D
 

FourthDimension

Villager
Member
Joined
Mar 31, 2019
Messages
14
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Hey thanks very much! Where would I put that? Would it go into the permastate module itself, and if so whereabouts?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,159
Reaction score
821
First Language
Hungarian
Primarily Uses
RMVXA
You should be able to put it in a new script slot anywhere below the default scripts but above the Main script slot.
 

FourthDimension

Villager
Member
Joined
Mar 31, 2019
Messages
14
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Thanks very much indeed! The icons are displaying perfectly now.
 

FourthDimension

Villager
Member
Joined
Mar 31, 2019
Messages
14
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Had some issues with the states last night but tested it today and everything is working perfectly.

Thanks Sixth for a great fix! I'll add you to the credits.
 

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

Latest Threads

Latest Profile Posts

I think I've created a monster.
...and I love it. <3
Today represents my one year anniversary of throwing out the tile map. :LZSexcite: One year ago my game looked like...


And now for those that don't know, it looks like..


What a year, what a year indeed. RIP Tile Map, nobody misses you. :LZSwink:
There is now a demo released for [Beyond the Mirror]! Check the team recruitment thread to learn more!
'Tis the season to see shipping prices and go 'Yikes'.

Forum statistics

Threads
105,696
Messages
1,015,680
Members
137,379
Latest member
ytviews123
Top