If Shaz reads this, you might realize this is indirectly related to that whole @ungray issue, but this is something else.
This is the next thing on my script-related TO-DO list. Basically I have a skill running on a switch restriction from Yanfly Skill Restriction that is based off Game_Timer turning a switch ON/OFF during battles when @count hits certain values. (Timer is active and working while actor-turn-making is happening)
When this skill is usable (switch is OFF), and choosing enemy targets (Slime A, Slime B, etc.aka Window_BattleEnemy), I'm trying to make it so that when the switch turns ON while this window is active, Window_BattleEnemy deactivates back to the BattleSkill/SkillList window ONLY IF THIS SPECIFIC SKILL (or other specifics that also function in the same style) ARE BEING USED. I need to do this because if you try to use the skill after the switch turns ON, it naturally becomes non-usable and you waste a turn due to skill failure.
Example:
Sadly one thing I noticed is that Window_BattleEnemy doesn't have an update of any kind... (I think?) Anyways I guess the main place to look is Scene_Battle.
Edit 1: Okay so far I managed to set a global variable $deactivate to turn True when the timer reaches 3 seconds (in Game_Timer), then it does the following in Scene_Battle
if @enemy_window.active if $deactivate @enemy_window.hide.deactivate command_skill $deactivate = false endendNow the only thing I need to figure out is how to check what Skill ID is selected when entering @enemy_window, and then add (right after "if $deactivate"):
This is the next thing on my script-related TO-DO list. Basically I have a skill running on a switch restriction from Yanfly Skill Restriction that is based off Game_Timer turning a switch ON/OFF during battles when @count hits certain values. (Timer is active and working while actor-turn-making is happening)
When this skill is usable (switch is OFF), and choosing enemy targets (Slime A, Slime B, etc.aka Window_BattleEnemy), I'm trying to make it so that when the switch turns ON while this window is active, Window_BattleEnemy deactivates back to the BattleSkill/SkillList window ONLY IF THIS SPECIFIC SKILL (or other specifics that also function in the same style) ARE BEING USED. I need to do this because if you try to use the skill after the switch turns ON, it naturally becomes non-usable and you waste a turn due to skill failure.
Example:
- Window_BattleSkill list is open
- When the timer hits 5 seconds of @count, I can select the skill Retribution
-----------------------------The following is what I want ----------------------------------------------- - I am now choosing the enemy to target with Retribution. However timer reaches 3 seconds of @count and the window force-deactivates
- I now have to choose another skill / actor command / etc.
Sadly one thing I noticed is that Window_BattleEnemy doesn't have an update of any kind... (I think?) Anyways I guess the main place to look is Scene_Battle.
Edit 1: Okay so far I managed to set a global variable $deactivate to turn True when the timer reaches 3 seconds (in Game_Timer), then it does the following in Scene_Battle
if @enemy_window.active if $deactivate @enemy_window.hide.deactivate command_skill $deactivate = false endendNow the only thing I need to figure out is how to check what Skill ID is selected when entering @enemy_window, and then add (right after "if $deactivate"):
Code:
if @enemy_window.active if $deactivate if selected_skill_ID == 223 #<--- I need to figure out this part, pseudocode @enemy_window.hide.deactivate command_skill $deactivate = false end endend