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?
Force-update the Skill List window in battles?
RGSSx Script SupportI 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.
BTW, are you using any battle scripts that alter the way things flow?
you can try this:
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
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.
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
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)
@skill_window.refresh if @skill_window.visible?The .visible? makes it crash. (undefined method of Window_BattleSkill)
oh wait, remove the ?
as for graying out, it might be something with the way that you handled how it checks for the switch...
as for graying out, it might be something with the way that you handled how it checks for the switch...
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)
(Pulled that out out by looking at Yami Classical ATB move_info_viewport)
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...
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.
can we see the part where you check if the switch is on?
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.
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...
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.
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...
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.
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
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
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.
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.
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!
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!
Original thread: https://forums.rpgmakerweb.com/threads/force-update-the-skill-list-window-in-battles.17923/