Thank you, I'll try that as well.
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.
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.
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.
🙂
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.
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.)
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
?
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.
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?
A combination. If they have AP remaining after their initial action they re-determine available actions. If none are found they pass their turn.
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?
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