RogueDeus - AP Combat System (A Yanfly Plugin)

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Roguedeus, Jul 7, 2015.

  1. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    I am glad you like the mechanic. I am hoping to have it converted into MV eventually. Until then I am using Yanfly's ATB.

    All I did was wrestle with his blog and translate everything I could into English. ;)

    It is still his script, I just moved the actors to the bottom using the offsets in the script and used the actors upward facing sprite instead of the side facing one.
     
    Last edited by a moderator: Dec 24, 2015
    #21
  2. KrekkaBlade

    KrekkaBlade Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    Croatian
    Thank you, I'll try that as well.
     
    #22
  3. Arsist

    Arsist Veteran Veteran

    Messages:
    140
    Likes Received:
    10
    I just mean that beyond the state turns, the idea is that if the enemy troop gave my party paralysis, they should get a chance to gang up on the party, but with this script, they will just wait around until a party member is able to act, if none have been able to act within the turn. The idea is that turns/rounds should work regardless of who gets to move, with the system merely skipping those who can't act and moving on to the next member in the action order.


    I don't use the action as durations, myself.
     
    #23
    Roguedeus likes this.
  4. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A


    If the issue you are describing is that no actors can act, thus the turn never ends, then that is indeed an unintentional bug.
     


    I will glance over the code and see if its obvious. If it doesn't require me play testing, it may get fixed. :)


    I have not touched VXAce in several months, and my brain is in Javascript mode... Coding does not come easily for me.


    Since I am no longer developing in that tool set, nor Ruby, it is unlikely that I will get around to fixing it otherwise. So I apologize for your frustration.

    Remember. the terms are, you can do what you like with the script. So if you can find someone willing to fix it before I get around to it. You are free to do so!
     
    #24
  5. Arsist

    Arsist Veteran Veteran

    Messages:
    140
    Likes Received:
    10
    I'm an amateur when it comes to all that, but I suppose I could look.


    You see, I want to make it like tabletops/Dungeons and Dragons.


    Turn order is based on relative Initiatives, which is based on one's speed stat plus a random number between 1 and 20 rolled only at the beginning of battle (this is easier to do). Each round ( features the game figuring out whether or not a battler gets to act during their turn, and if they aren't able to act, their turn is simply skipped. A round is just another way of saying RPGMaker's "turns".


    State duration is based on the number of turns that are started with a given member. So each time it is a battler's turn, whether their turn is skipped or not, [before? after? I forgot...] they would be able to get to act, their state turns are decreased by 1 (this is harder to implement). This means you don't have to worry about being faster than someone just for your 1-turn-lasting debilitating moves like Stun/Daze to matter (as if you daze someone after they get to act in the default battle system, it doesn't mean anything as the state will be removed at the end of the turn). I have the script call for setting/reducing/increasing state turns as I please using Yanfly's Buff & State manager.
     
    Last edited by a moderator: Feb 24, 2016
    #25
  6. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    I am pretty sure I figured out what the problem was. The bugfix version is 1.04.3 and should be available on the blog site.
    :)
     
    #26
  7. Arsist

    Arsist Veteran Veteran

    Messages:
    140
    Likes Received:
    10
    Yup. You fixed it.


    However, I ran into another problem.


    So, I made it so that defaultly, a battler has 5 base AP, and 7 possible max AP (aka MAX_AP_MULTI of 1.4). Normally, "standard" actions take up 3 points, "minor" actions take up 2 points, and "full" actions take up 5 points. So, normally, a battler can use one standard action and one minor action or an single full action.


    I made a slowing state that decreases AP by 2 using the note


    <ap_adjust: -2>


    and added at the start of battle. The actor had 5 red AP notes and 0 grey AP nodes, as opposed to the usual 5 red AP nodes and 2 grey AP nodes.


    I wanted to have it so that with that state, the actor would only have 3 red AP nodes, meaning that they could only use a standard or a minor action and not both, unless they were to skip their turn.


    So I figured that maybe I had to use the note


    <ap_max_adjust: -2>


    Same problem.


    And then, I noticed that when using the 


    <ap_adjust: -2>


    note along with that state and then passing my turn, it actually gave me 4 red AP nodes and 0 AP nodes, and then 


    having that all but instead with the


    <ap_max_adjust: -2>


    note didn't change anything visually-- Skipping my turn along with that state still left me with 5 red AP nodes and 0 grey AP nodes.


    So I'm a bit confused here.


    I tried tinkering with it, editing the script to


    def init_ap
    @passed_ap ||= 0
    init_value = determine_init_ap
    @ap = [init_value + @passed_ap, max_ap(init_value)].min
    @ap_used = 0
    @passed_ap = 0
    end
    def determine_init_ap
    value = 5
    if state?(26) then value -= 2 end
    self.feature_objects.each{|obj| value += obj.ap_adjust(self) }
    value
    end


    apparently the 


    self.feature_objects.each{|obj| value += obj.ap_adjust(self) }


    won't work for me at all for determine_init_ap when put on a state's notes (however, it will work when applied to an actor's notebox), and the 'if state?(26) then value -= 2 end' doesn't work at the start of battle, but will work once the battler has spent ap (to where the ap is updated again). Yet I made sure that the state was applied at the point of initially deciding ap by making the call


    if state?(26) then p "state applied" end


    for determine_init_ap.
     
    Last edited by a moderator: Feb 26, 2016
    #27
  8. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Have you tried doing this in a clean project with only this script?


    It sounds to me that if the note tag is working for the actor object, and not the state object, then there is another script interfering with states.


    Also, your initial solution for the effect you are trying to achieve was correct. It will only work with the <ap_adjust: xxxxx> note tag.


    The <ap_max_adjust: xxxxx> note tag can not reduce the battlers total AP below its minimum initial AP. Which if I understand you, is 5.


    (Removing max AP will only reduce your 7 cap to a 5 cap.)
     
    #28
  9. Arsist

    Arsist Veteran Veteran

    Messages:
    140
    Likes Received:
    10
    I tried it with your script being fresh and on a fresh project with just Yanfly Core, Yanfly Battle, Command Manager, and then your script.


    I would have the state (I used state to for this test) added at the start of battle but it would only apply once the battler used an action.


    I also tried


        if self.state?(2) then value -= 2 end
        if state?(2) then value -= 2 end


    for determine_init_ap justtt to make sure, and yet it still wouldn't register until the battler used an action.


    Perhaps it has something to do with 


    def ap
    init_ap unless @ap
    return @ap
    end


    ?
     
    #29
  10. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    That method only returns the current AP value of the battler.


    It seems the issue is that AP minimums are initialized at the beginning of battle and do not get re-checked, during battle. The state note tag, would only be considered if the state existed on the battler at the time that battle starts. Not if applied during battle.


    This was an oversight caused by the intention of an add-on that manipulated AP during battle. But never got written.


    I'll allow for AP to re-check feature objects each turn. :)


    Edit:


    Or maybe not... Seems that AP should be getting initialized at the end of every turn. Hmmm.


    Edit 2:


    Ok. The issue is bigger than I can fix simply. It will require a rewrite in the way that AP is initialized, which will touch several things. Doing so will require testing, and may break other things... etc... I can't justify the investment of time when I can barely find time to work on Prequel. So I'll have to apologize.
     
    Last edited by a moderator: Feb 27, 2016
    #30
  11. Arsist

    Arsist Veteran Veteran

    Messages:
    140
    Likes Received:
    10
    That is alright. I can try and fix things.


    I must ask: Enemies, with this script, are their actions decided mid-turn like the way actors get to, or are their actions decided at the start of the round before it is their turn to act? 
     
    #31
  12. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    523
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    A combination. If they have AP remaining after their initial action they re-determine available actions. If none are found they pass their turn.
     
    #32
  13. Crazy Rob

    Crazy Rob Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Had an issue where the script would cause items and skills to be unusable outside of battle, effectively sealing items and out of battle skills like heals until the player walked so many steps (exact amount unknown).

    The code in question starts at 1016. The original:
    def ap_conditions_met?(item)
    return false unless self.ap >= item.ap_cost(self)
    return true
    end
    end

    and my as-of-now "fix" (still seeing if any other issues arise)
    def ap_conditions_met?(item)
    if $game_party.in_battle
    return false unless self.ap >= item.ap_cost(self)
    return true
    else
    return true
    end
    end
    end

    I post this solely out of the fact it's a good script, but that detail might be annoying for some. Anyone else who used this have any similar issues or can verify?
     
    #33
  14. Jrrkein

    Jrrkein Veteran Veteran

    Messages:
    110
    Likes Received:
    7
    First Language:
    Indonesia
    Can you read the first post and especially with yellow text?! means he will not support the script anymore and it's been 2 years
     
    #34
  15. Ebanyle

    Ebanyle Veteran Veteran

    Messages:
    240
    Likes Received:
    128
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    This doesn't means that anyone who knows scripting can't help him
     
    #35
  16. Crazy Rob

    Crazy Rob Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    I was posting a fix I found for an issue. Learn to read before you berate someone.
     
    #36
  17. Jrrkein

    Jrrkein Veteran Veteran

    Messages:
    110
    Likes Received:
    7
    First Language:
    Indonesia
    whatever
     
    #37

Share This Page