Force-update the Skill List window in battles?

Status
Not open for further replies.

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I have a skill that is only usable upon a switch that goes ON/OFF during certain times in battles. However the skill isn't selectable until the selection window is re-opened, even if that switch is ON, which is a very crucial issue for my case.  Is there a way to keep the skill list updated at all times (per frame) ? Or a scripted method to force-update it at any time that can be called from something like Game_Timer?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I think you can call a redraw during the update part... I know it can be done since on the ATB system that I'm using (Yami's Classical), the skill list updates correctly for me in real time. I opened it with not enough MP so the skill is greyed out, then when I got enough [without closing the skill list], it became selectable...
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I think you can call a redraw during the update part... I know it can be done since on the ATB system that I'm using (Yami's Classical), the skill list updates correctly for me in real time. I opened it with not enough MP so the skill is greyed out, then when I got enough [without closing the skill list], it became selectable...
That's exactly what I need. I think i'll take a look at that section of Yami's Classical (if I can find it via google) and see if I can just take that one section) See what I can do with it.

Thread still open to other solutions for now.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
BTW, are you using any battle scripts that alter the way things flow?

you can try this:

Code:
class Scene_Battle < Scene_Base  def update    super    if BattleManager.in_turn?      process_event      process_action      if @skill_window.visible?         @skill_window.refresh      end    end    BattleManager.judge_win_loss  endend
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You should just be able to do @skill_window.refresh (from Scene_Battle - which means if you're not calling the refresh from Scene_Battle you'll either need to add a method you can call to do it, or add skill_window as an attr_reader).


I would DEFINITELY not do the update once per frame. I would look at where that switch is toggled, and add the refresh in there.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I would DEFINITELY not do the update once per frame. I would look at where that switch is toggled, and add the refresh in there.
yeah, not unless he has some other things that needs the update too...

anyway, I added a script on the above post in case you're willing to do a per frame update on the skill list
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I tried your snipplet but to no avail. The skill becomes selectable but it remains grayed out. Upon using the skill like so the game crashes because of

@skill_window.refresh if @skill_window.visible?The .visible? makes it crash. (undefined method of Window_BattleSkill)
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
oh wait, remove the ?

as for graying out, it might be something with the way that you handled how it checks for the switch...
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I changed @skill_window.visible? to @actor_window.active? and it no longer crashes. However the skill is still grayed out.

(Pulled that out out by looking at Yami Classical ATB move_info_viewport)
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
well yeah you can do that too if that window is active during the time that the skill window is shown... as for the .visible, I think it shouldn't have a ?...

as for graying out, it might be something with the way that you handled how it checks for the switch...
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
well yeah you can do that too if that window is active during the time that the skill window is shown... as for the .visible, I think it shouldn't have a ?...

as for graying out, it might be something with the way that you handled how it checks for the switch...
class Game_Timer def time_section_check if @working && @count > 0 if @count > 180 && @count < 240 $game_switches[83] = false else $game_switches[83] = true end end endendThe switch checking is nothing special, something small I whipped up.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
can we see the part where you check if the switch is on?
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
The switch check for skill usage is using Yanfly Skill Restriction, but I don't use any other feature other than the switch checker. I'll do a double-check just in case.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
hmm... wait... you can click it but it is still greyed out right? it's weird... the color should update too upon redraw... and yanfly's script uses the default enable? check too to set the color...
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
A greyed out skill indicates that you don't have enough MP or TP to use it. Check the requirements, and what the actor has available. It's nothing to do with adding a new skill or refreshing the window.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
oh wait, he said selectable... I thought he said it can be clicked at it works... XD... so yeah maybe he just doesn't have enough MP or TP...
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
The skill has no costs set in the database.It's definitely usable but the color doesn't change. The reason why it's grayed out is because of Yanfly Skill Restriction since the switch needed is initially off until it gets turned on via timer.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
hmmm... maybe the refresh didn't catch it? can you actually click it and it uses the skill?

coz if you can now use the skill, then it means that it simply doesn't recolor

but if you still can't, then it means that the refresh part doesn't fire yanfly's checks
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Yes that's what i've been saying for the past few responses lol.  The skill is usable but it doesn't recolor.

Edit: I realized that the script snipplet never wanted to work no matter how I change it up and try new things. It's not dynamic in any sense really, simple as that. Even though it's a Frame Update, that doesn't apply at all unless the current window is closed.

Edit 2: I tried Yami Classical ATB in a new project and you lied to me. The skill list didn't update for me when I had it open while another actor used a potion. It stayed grayed out. I am going to make a script request for this situation.
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
On-purpose double post because I solved it!

It was so FREAKING SIMPLE! LOL!!!! We were messing with the wrong Update Frame the whole time!

#-------------------------------------------------------------------------- # * Update Frame (Basic) #-------------------------------------------------------------------------- def update_basic super @skill_window.refresh $game_timer.update $game_troop.update @spriteset.update update_info_viewport update_message_open endThe skill properly un-grays when turned on, and then re-grays itself when turned off without closing the Skill List window!

Here's how it looks like:



This thread can be locked!
 
Last edited by a moderator:
Status
Not open for further replies.

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

Latest Threads

Latest Posts

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,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top