[RMVX ACE] EXTRA ENEMY ACTIONS
Posts
Pages:
1
So, as is, as far as I can tell, this...
large image
is my basic problem. In the DBS, the "Extra Actions" 'Trait' for players works as intended, but seems to do absolutely nothing for enemies. Is there a script that fixes this or a line or two of code anyone could point me to where I can fix it myself?
Probably useful info: I am using Yanfly's Ace Battle Engine & Visual Battlers scripts. Not currently using FTB battle system mode. (Action economy's important to my battle balance, so I'll have to switch to FTB if there's no other solution, as I know it allows for the possibility of multiple enemy turns.)
large image
is my basic problem. In the DBS, the "Extra Actions" 'Trait' for players works as intended, but seems to do absolutely nothing for enemies. Is there a script that fixes this or a line or two of code anyone could point me to where I can fix it myself?
Probably useful info: I am using Yanfly's Ace Battle Engine & Visual Battlers scripts. Not currently using FTB battle system mode. (Action economy's important to my battle balance, so I'll have to switch to FTB if there's no other solution, as I know it allows for the possibility of multiple enemy turns.)
sorry 4 bump, I have a strong feeling that this script is on this site somewhere but I am failing to find it. plz help if you have the time. thank you. : )
I was able to find Ace Battle Engine on-site, but not-so-much the Visual Battlers script. However, I did get a copy of Visual Battlers regardless.
A new project with those two scripts (Battle Engine Ace on top, then Visual Battlers), and an enemy with a "Action Times +100%" feature seems to take two actions. Delving a bit further into this, I didn't see/find any references to the "Action Times" feature in either script.
Out of curiosity, how much do those skills cost? I'm particularly interested in the cost for Rimefrost Breath and Venomous Byte, as those have the highest priority.
A new project with those two scripts (Battle Engine Ace on top, then Visual Battlers), and an enemy with a "Action Times +100%" feature seems to take two actions. Delving a bit further into this, I didn't see/find any references to the "Action Times" feature in either script.
Out of curiosity, how much do those skills cost? I'm particularly interested in the cost for Rimefrost Breath and Venomous Byte, as those have the highest priority.
Rimefrost breath costs 60 out of its 240 MP with a 3-Turn cooldown. Venomous bite costs no MP but has a 2-Turn cooldown.
Hmm...it could be the Ace Skill Restrictions script (also Yanfly) that enables the cooldowns that is messing things up somehow, but I'm not sure how. All I knows is I've never seen the enemy use two skills in a turn, any two skills.
Thank you for investigating, btw.
Hmm...it could be the Ace Skill Restrictions script (also Yanfly) that enables the cooldowns that is messing things up somehow, but I'm not sure how. All I knows is I've never seen the enemy use two skills in a turn, any two skills.
Thank you for investigating, btw.
I'm not sure. I just did a short test that included Skill Restrictions with those other two scripts active. I took the default Slime, and gave it 100 MP, Dual Attack (0 MP) with priority 9 and gave it a 3-turn cooldown. I also gave them Fire II (12 MP) with priority 8 and gave that skill a 4-turn cooldown. I swear one of the Slimes only performed a Fire II, and the other only performed a Duel Attack (Attack at priority 5 would be ignored, given those other numbers), but, I cannot seem to replicate that.
Inside the troops you can have an enemy use as many skills as you want. You can also randomize the skills using variables.
Kory I think you maybe got a little confused...we're trying to figure out how to get enemies to take two actions in one turn, we're already good with how to give them a pool of more than one skill to choose from.
One obvious workaround I haven't tried yet is using it as a trait tied to a status effect then giving the monster that status effect at the start of battle (either through eventing or maybe there's a trait that does that). Since the status effect trait of Extra Actions is what's working for PCs (none of the PCs innately have multiple actions, there's just one of them that can cast Haste), maybe it will work for monsters too.
One obvious workaround I haven't tried yet is using it as a trait tied to a status effect then giving the monster that status effect at the start of battle (either through eventing or maybe there's a trait that does that). Since the status effect trait of Extra Actions is what's working for PCs (none of the PCs innately have multiple actions, there's just one of them that can cast Haste), maybe it will work for monsters too.
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
I had this exact problem, and I think I can guess what the cause for yours:
When an enemy selects its actions for a turn, it selects all of them at once judging by the parameters is has at that moment. For example, if a battler only has 30 MP, it will select two skills that cost 30 MP to use for its actions because, at that exact moment, it can satisfy the requirements for both skills. However, when the second action comes during battle, it can't use the skill because the first action drained all of its available MP, and therefore does not perform the second action.
If you have a skill cooldown script, my guess is that the enemy is selecting the same skill twice. You only see one skill.
To solve it, you'll need to overwrite the process_action method in Scene_Battle to add a conditional branch to check if the move is still valid. If not, then switch to a different move. I set enemies to automatically guard if they don't have the MP to perform a skill, but you can do whatever you want.
EDIT: Fished out my code.
It works in a default project in Ace. If it tries to use a skill it doesn't have the requirements for anymore, it'll default to a basic attack. If THAT'S invalid, it'll switch to a guard (attacks cost MP in my game, so that's why I did what I did there). It'll output the skill the battler tried to use as well as the skill it ended up using in the debug line for you to see what went wrong.
How does that work?
When an enemy selects its actions for a turn, it selects all of them at once judging by the parameters is has at that moment. For example, if a battler only has 30 MP, it will select two skills that cost 30 MP to use for its actions because, at that exact moment, it can satisfy the requirements for both skills. However, when the second action comes during battle, it can't use the skill because the first action drained all of its available MP, and therefore does not perform the second action.
If you have a skill cooldown script, my guess is that the enemy is selecting the same skill twice. You only see one skill.
To solve it, you'll need to overwrite the process_action method in Scene_Battle to add a conditional branch to check if the move is still valid. If not, then switch to a different move. I set enemies to automatically guard if they don't have the MP to perform a skill, but you can do whatever you want.
EDIT: Fished out my code.
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Battle Action Processing #-------------------------------------------------------------------------- def process_action return if scene_changing? if !@subject || !@subject.current_action @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? @status_window.open execute_action elsif @subject.enemy? #Make sure it's an enemy messing things up, and not an ally! puts "INVALID ACTION!" if @subject.current_action.item puts "Tried to use: " + @subject.current_action.item.name.to_s else puts "nil action" end @subject.current_action.set_attack #performs basic attacks if it can't do a skill @subject.current_action.set_guard if !@subject.current_action.valid? #guards if you can't even do an attack puts "NEW ACTION: " + @subject.current_action.item.name.to_s @status_window.open execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action end end #Scene_Battle
It works in a default project in Ace. If it tries to use a skill it doesn't have the requirements for anymore, it'll default to a basic attack. If THAT'S invalid, it'll switch to a guard (attacks cost MP in my game, so that's why I did what I did there). It'll output the skill the battler tried to use as well as the skill it ended up using in the debug line for you to see what went wrong.
How does that work?
My method would give them more than 1 action a turn. Just put as many actions as you want.
For example:
Set Variables random number
Condition 1
Fire
Attack
Attack
Condition 2
Fire All
Fire
Guard
Condition 3
Attack All
Condition 4
Attack All
Fire All
Super Buff
For example:
Set Variables random number
Condition 1
Fire
Attack
Attack
Condition 2
Fire All
Fire
Guard
Condition 3
Attack All
Condition 4
Attack All
Fire All
Super Buff
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
author=StormCrow
Kory I think you maybe got a little confused...we're trying to figure out how to get enemies to take two actions in one turn, we're already good with how to give them a pool of more than one skill to choose from.
Two randomly determined actions != two actions determined by priority, according to what's programmed in the database. Though, I suppose the method you describe could attempt to emulate actions determined by priority?
However, I thought the whole idea was to allow Action Times +100% to do it's thing, and allow for two separate actions, and pull what actions are possible from the appropriate place in the database, rather than doing it though event-commands.
@Red_Nova: My first thought was that one of the two skills that it was trying to perform costed more MP than was available. However, the creature has 240 to start with, and the higher-priority attack (Rimefrost Breath) only costs 60MP. So, theoretically, it should be able to use that ability twice in succession. The other ability (Venomous Bite) doesn't cost any MP, so, unless it costs TP that it doesn't have, it should literally always be able to use that twice in succession.
*Edit: Though, if not enough TP was the case for Venomous Bite, the priority might pass back to Rimefrost Breath. And if Rimefrost couldn't be paid for in the first action, it should pass priority to Claw, Claw, Byte or Claw.
I think?
*Edit2: I totally forgot about the cooldowns! ;_;
So, no, it would not activate Rimefrost Breath twice. It could perform Rimefrost Breath then Venomous Bite, provided that Venomous Bite has no costs associated with it, other than cooldown. I don't know what the cooldowns on Claw, Claw Bite and Claw are, but, I must assume the idea is that it would use those while the other skills were on cooldown. Given their low priority, they might not have a cooldown.
However, I thought the whole idea was to allow Action Times +100% to do it's thing, and allow for two separate actions, and pull what actions are possible from the appropriate place in the database, rather than doing it though event-commands.
@Red_Nova: My first thought was that one of the two skills that it was trying to perform costed more MP than was available. However, the creature has 240 to start with, and the higher-priority attack (Rimefrost Breath) only costs 60MP. So, theoretically, it should be able to use that ability twice in succession. The other ability (Venomous Bite) doesn't cost any MP, so, unless it costs TP that it doesn't have, it should literally always be able to use that twice in succession.
*Edit: Though, if not enough TP was the case for Venomous Bite, the priority might pass back to Rimefrost Breath. And if Rimefrost couldn't be paid for in the first action, it should pass priority to Claw, Claw, Byte or Claw.
I think?
*Edit2: I totally forgot about the cooldowns! ;_;
So, no, it would not activate Rimefrost Breath twice. It could perform Rimefrost Breath then Venomous Bite, provided that Venomous Bite has no costs associated with it, other than cooldown. I don't know what the cooldowns on Claw, Claw Bite and Claw are, but, I must assume the idea is that it would use those while the other skills were on cooldown. Given their low priority, they might not have a cooldown.
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
author=Marrend
@Red_Nova: My first thought was that the two skills that it was trying to perform costed more MP than was available. However, the creature has 240 to start with, and the higher-priority attack (Rimefrost Breath) only costs 30MP. So, theoretically, it should be able to use that ability twice in succession. The other ability doesn't cost any MP, so, unless it costs TP that it doesn't have, it should be able to use that twice in succession. Thuogh, if not enough TP was the case, the priority might pass back to Rimefrost Breath?
The MP cost was just an example I made up to explain where the issue came from. StormCrow mentioned using a skill cooldown script, as well. That makes me think that it's possible the enemy could be selecting a skill that wasn't cooling down at the time of selection, but DID start cooling down by the time the action occurs.
To give an example using the cooldown method: If an enemy has two actions, and selections Fireball for both of them, that's perfectly valid at the time because, at the time, Fireball had no cooldown timer. During the action phase, the enemy uses Fireball for its first action and sets the cooldown for 2 turns. Now, when it uses Fireball again, it's currently cooling down and can't be used. This causes Fireball to no longer be valid, and therefore the enemy does nothing.
To determine if a skill can be used, battlers runs the valid? method right before performing an action.
if @subject.current_action.valid?
The method valid? can check for any number of conditions, including MP cost or cooldown. I don't know if that's the case. Plugging in my script snippet will print out the action the enemy TRIED to do, so we can determine how to fix it from there.
As I understand the default process, if an enemy finds than an action is not valid, it will simply do nothing for that action, rather than fall back to something else.
@Red_Nova: thank you, thank you, thank you! I think that's probably exactly what I need.
I'll plug that code in, in the next couple of days, and see if and how it works. I'll also experiment with multi-action enemies that don't also have cooldown/TP based skills, since cooldowns and TP are kind of tricky to track because they're invisible.
(Claw, Claw, Bite BTW is a physical attack that has a 75% chance to follow on with a second claw, which then has a 50% chance to follow up with a bite. (I am bad at maths what does that make the chance of the bite actually going off. Is it around 37.5% or am I high? )
I'll plug that code in, in the next couple of days, and see if and how it works. I'll also experiment with multi-action enemies that don't also have cooldown/TP based skills, since cooldowns and TP are kind of tricky to track because they're invisible.
(Claw, Claw, Bite BTW is a physical attack that has a 75% chance to follow on with a second claw, which then has a 50% chance to follow up with a bite. (I am bad at maths what does that make the chance of the bite actually going off. Is it around 37.5% or am I high? )
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
author=StormCrow
(Claw, Claw, Bite BTW is a physical attack that has a 75% chance to follow on with a second claw, which then has a 50% chance to follow up with a bite. (I am bad at maths what does that make the chance of the bite actually going off. Is it around 37.5% or am I high? )
Yeah, that's about right. However, if you've implemented follow-up skills, then make sure to have copies of those skills and remove their cooldown restrictions so that the battlers can always use them.
I think I'm very confused because my enemy just cast fire, attacked, and attacked again in a single turn (that's 3 actions if condition 1 is met.)
author=Red_Nova
I had this exact problem, and I think I can guess what the cause for yours:
When an enemy selects its actions for a turn, it selects all of them at once judging by the parameters is has at that moment. For example, if a battler only has 30 MP, it will select two skills that cost 30 MP to use for its actions because, at that exact moment, it can satisfy the requirements for both skills. However, when the second action comes during battle, it can't use the skill because the first action drained all of its available MP, and therefore does not perform the second action.
If you have a skill cooldown script, my guess is that the enemy is selecting the same skill twice. You only see one skill.
To solve it, you'll need to overwrite the process_action method in Scene_Battle to add a conditional branch to check if the move is still valid. If not, then switch to a different move. I set enemies to automatically guard if they don't have the MP to perform a skill, but you can do whatever you want.
EDIT: Fished out my code.
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Battle Action Processing #-------------------------------------------------------------------------- def process_action return if scene_changing? if !@subject || !@subject.current_action @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? @status_window.open execute_action elsif @subject.enemy? #Make sure it's an enemy messing things up, and not an ally! puts "INVALID ACTION!" if @subject.current_action.item puts "Tried to use: " + @subject.current_action.item.name.to_s else puts "nil action" end @subject.current_action.set_attack #performs basic attacks if it can't do a skill @subject.current_action.set_guard if !@subject.current_action.valid? #guards if you can't even do an attack puts "NEW ACTION: " + @subject.current_action.item.name.to_s @status_window.open execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action end end #Scene_Battle
It works in a default project in Ace. If it tries to use a skill it doesn't have the requirements for anymore, it'll default to a basic attack. If THAT'S invalid, it'll switch to a guard (attacks cost MP in my game, so that's why I did what I did there). It'll output the skill the battler tried to use as well as the skill it ended up using in the debug line for you to see what went wrong.
How does that work?
The code is definitely working. The Attack Chimera is now sometimes taking multiple actions in a turn. It doesn't always take both of its actions, still: strictly speaking, it should probably open the battle with Rimefrost Breath and Venomous Bite given the priorities given. I saw it use that combo a couple times, but towards the end of the battle. Its first turn, it just used Venomous Bite and then no other action and its second turn it just used Rimefrost Breath and then no other action, but I saw it combo those (and various other permutations) towards the end of the fight (I went in test play and just guarded until it killed me).
On Further Observation: As far as I can tell, on the first turn of combat is one time that the enemy consistently fails to take multiple actions.
Since "sometimes" is a huge improvement over "never" in terms of taking multiple actions, even if it's not "always", and since it turned out that Attack Chimera is the only enemy out of 17 for the first leg of the game that has multiple actions w/o casting Haste on itself anyway, I'm prepared to tentatively call this issue *RESOLVED* for the time being.
Thanks, Red_Nova!! Thanks everyone else for your input too.
Red_Nova
Sir Redd of Novus: He who made Prayer of the Faithless that one time, and that was pretty dang rad! :D
9192
Check your console output by checking the "show console" command under the Game tab. If it doesn't take an action, it should print out what it tried to do. What is it trying to do that is failing?
Also, if it doesn't take a second action, there's a chance it could be guarding instead.
Also, if it doesn't take a second action, there's a chance it could be guarding instead.
Pages:
1
















