[ACE] (Yanfly Field States) Calling a field state with a script call instead of just a skill?

● ARCHIVED · READ-ONLY
Started by Arsist 5 posts View original ↗
  1. https://github.com/Archeia/YEARepo/blob/0594589252f87fe6cfac7c1770b066918d6ac290/Gameplay/Field_State_Effects.rb

    I assume somewhere in this script there is a part where a skill activates a field state. Normally, only skills can activate them.

    I would like to know how to replicate that with a script call,

    instead of having to use up a skill slot then having to condition which enemy or actor exists and is alive, then force one of them to use the skill that activates the field state.

    I know that

    BattleManager.add_field_state(x)didn't work.
  2. You must call the whole method if you want the script call to take effect, including the refresh at the end.

    So, in order, try this:

    Code:
    BattleManager.clear_field_states# use this only if you want to clear the field states.BattleManager.remove_field_state(state_id)# use this only if you want to remove a field state.BattleManager.add_field_state(state_id)# use this only if you want to add a field state.BattleManager.change_field_state_turns(state_id, turns)# use this to set up the turns for the field state you applied.BattleManager.sort_field_states# use this to show the changes visually.all_members = $game_party.battle_members + $game_troop.battle_membersall_members.each { |battler| battler.refresh }Scene_manager.scene.status_window.refresh# no idea if this works, especially the last line, but when you are done with the field state setup, # you must refresh these if you want to see the changes in the status window and on the battle members.
    See if doing all this will work for you.
  3. It didn't understand that. 

    My call was

    BattleManager.add_field_state(2)BattleManager.sort_field_statesall_members = $game_party.battle_members + $game_troop.battle_membersall_members.each { |battler| battler.refresh } Scene_manager.scene.status_window.refreshI changed 'battle_members' to 'members' as it didn't comprehend that part but then it gave me the error:

    Script 'Game_Interpreter' line 1418: NameError occurred.uninitialized constant Game_Interpreter::Scene_managerBy erasing the last line, the error doesn't occur, but I neither see the state nor is the state applied (I conditioned to see if it was)
  4. Bump.
  5. Not to necropost, but the error was that the call should've been

    SceneManager.scene.status_window.refreshand not 

    Scene_manager.scene.status_window.refreshreally simple mistake now that I look back on it.