odd substitute behavior

● ARCHIVED · READ-ONLY
Started by Countyoungblood 6 posts View original ↗
  1. so, I found an edit to substitute that i thought would suit my needs.. and most times it does but it acts strange sometimes.

    i changed it to this:

    Code:
    class Scene_Battle < Scene_Base
      #--------------------------------------------------------------------------
      # overwrite : Check Substitute Condition
      #--------------------------------------------------------------------------
      def check_substitute(target, item)
        (!item || !item.certain?) and target.state?(state_id) #replace state_id with state's id number
      end
    end

    i have a state called cover that is applied to the user of my attack also named cover..

    and i have a state called covered that is applied to the target of the attack.

    the attack formula itself is supposed to only apply these two states to pair the two characters together.. that is the one being covered and the one covering.

    as such:

    Code:
    a.add_state(11);b.add_state(12)

    the problem is that using cover behaves properly on the first usage applying the correct state and properly substituting for damage.. but the second time the attack is used both characters gain the covered state and the user somehow covers.. itself and takes no damage.

    i get no error messages so id assume its something ive assigned myself and didnt realize but i cant seem to find the problem. help is appreciated.



    update: so Ive found that the issue alternates working right then working wrong then back to right so now im thinking that using the spell is somehow toggling a variable
  2. Code:
    class Scene_Battle < Scene_Base
      #--------------------------------------------------------------------------
      # overwrite : Check Substitute Condition
      #--------------------------------------------------------------------------
      def check_substitute(target, item)
       (!item || !item.certain?) && target.state?(state_id) && item.id != your_skill_id  #<-- Your cover skill ID
      end
    end
    Might do the trick

    Edit:
    Or just set the skill to certain hit?
  3. I changed the states to both auto remove on action end and that seemed to do the trick. just changed the skill to certain hit to see if anything changed but its still working so far.

    thanks for the help
  4. On action end could be problem if your actor doesn't action at all like getting stunned/paralyzed. Because it wont remove the state. If you don't plan to make an enemy that restrict action, it should be fine.
  5. resolved thanks
  6. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.