SRPG Engine MV - Plugins for creating Tactical Battle System

RK DracoRoy

Fire Emblem RPG Gamer
When gaining HP from dealing damage, it can also be based on the amount of HP the target has.

Code:
``````<Before Eval>
target._health = Math.max(1, parseInt(target.hp * 0.50));
</Before Eval>

<Post-Damage Eval>
if (target.result().hpDamage > 0 && user.hp / user.mhp < 1.00) {
user.gainHp(Math.min(Math.max(parseInt(value * 0.50), 1), target._health, user.mhp - user.hp));
}
</Post-Damage Eval>

<After Eval>
target._health = undefined;
</After Eval>``````

If I do 36 critical damage and the target had 9 HP left, I get 4 HP absorbed from that.
If there's 1 HP remaining, I get 1 HP absorbed.

TheLastYuriSamurai

TheLastYuriSamurai
When gaining HP from dealing damage, it can also be based on the amount of HP the target has.

Code:
``````<Before Eval>
target._health = Math.max(1, parseInt(target.hp * 0.50));
</Before Eval>

<Post-Damage Eval>
if (target.result().hpDamage > 0 && user.hp / user.mhp < 1.00) {
user.gainHp(Math.min(Math.max(parseInt(value * 0.50), 1), target._health, user.mhp - user.hp));
}
</Post-Damage Eval>

<After Eval>
target._health = undefined;
</After Eval>``````

If I do 36 critical damage and the target had 9 HP left, I get 4 HP absorbed from that.
If there's 1 HP remaining, I get 1 HP absorbed.
May I ask how your battle damage formula looks? Or a screenshot of the skill? This sounds awesome

RK DracoRoy

Fire Emblem RPG Gamer
@TheLastYuriSamurai
It's based on Fire Emblem where attacks usually have the same pattern, the usual attack - defense / magic - resistence. I either equip a weapon with a meta tag like "<hpDrain>" and add to the condition or I can just roll the chance to activate a skill effect when attacking.

YEP_X_ActionSequences
--------------------------

Code:
``````<setup action>
display action
immortal: all alive, true
if (user.isStateAffected(x) && !target.isStateCategoryAffected('Nihil') && user.hp / user.mhp < 1.00 && user._solSkill <= user._solActivation)
animation x: user
wait for animation
end
</setup action>

<target action>
motion attack: user
wait: 12
action animation: target
wait: 2
action effect: target
</target action>

<finish action>
wait: 23
move user: return, 12
wait for movement
immortal: all alive, false
clear battle log
</finish action>``````

YEP_BuffStatesCore (Eli_CustomParameters and VE_PassiveStates involved)
----------------------

Code:
``````<Custom Action Start Effect>
var action = user.currentAction();
//Insert meta tag on any skill that's for attacking like <offense> for it to work.
if (action && action.isSkill() && action.item().meta.offense) {
user._solSkill = Math.randomInt(100) + 1;
user._solActivation = Math.min(user.skl, 30);
}
</Custom Action Start Effect>

<Custom Conclude Effect>
if (this.isSkill() && this.item().meta.offense) {
user._solSkill = Math.randomInt(100) + 1;
user._solActivation = Math.min(user.skl, 30);
}
</Custom Conclude Effect>

<Custom Action End Effect>
user._solSkill = undefined;
user._solActivation = undefined;
</Custom Action End Effect>``````

YEP_SkillCore
----------------

Code:
``````<Post-Damage Eval>
var weapon = user.equips()[0];
if (target.result().hpDamage > 0 && user.hp / user.mhp < 1.00) {
//Nosferatu and Sol Effect
if (weapon && weapon.meta.hpDrain && user.isStateAffected(x) && user._solSkill <= user._solActivation) {
user.gainHp(Math.min(Math.max(parseInt(value * 0.50) + parseInt(value * 0.50), 1), target._health, user.mhp - user.hp));
//Nosferatu or Sol Effect
} else if (weapon && weapon.meta.hpDrain || user.isStateAffected(x) && user._solSkill <= user._solActivation) {
user.gainHp(Math.min(Math.max(parseInt(value * 0.50), 1), target._health, user.mhp - user.hp));
}
}
</Post-Damage Eval>``````

kelpykelps

Villager
sorry if its been addressed before but i can't seem to grasp how to change a spawned event via (galv or yanfly event spawner) into an enemy or actor ive tried setting \$gameMap._lastSpawnEventId as a variable then calling the variable instead of event Id during turn end, spawned event appears but dosnt become an enemy or actor, any assistance to help me understand would be greatly appreciated

dopan

Regular
sorry if its been addressed before but i can't seem to grasp how to change a spawned event via (galv or yanfly event spawner) into an enemy or actor ive tried setting \$gameMap._lastSpawnEventId as a variable then calling the variable instead of event Id during turn end, spawned event appears but dosnt become an enemy or actor, any assistance to help me understand would be greatly appreciated
the script to transform Events into Units can be found in the srpg-core help info..
JavaScript:
``````  this.addActor(EventID, ActorID); // # Make the event with the specified ID the actor.
this.addEnemy(EventID, EnemyID); // # Make the event with the specified ID the enemy.``````
or you could read this again #2,502

Last edited:

kelpykelps

Villager
the script to transform Events into Units can be found in the srpg-core help info..
JavaScript:
``````  this.addActor(EventID, ActorID); // # Make the event with the specified ID the actor.
this.addEnemy(EventID, EnemyID); // # Make the event with the specified ID the enemy.``````
or you could read this again #2,502
( a post which you liked yestairday )

Sidenote:
if a spawned event that has the correct event notes doesnt get transformed into an unit, than this is because these things happen at battle start by default.. so we could aswell use the script that does this,.. but i am to lazy at the moment to search this specific script (again) in the srpg core,.. like most people are to lazy to search the answers which were allready given several times in this thread
thanks for the reply i understand how to add.actors or enemies to events already placed on the map, what im having trouble with is events spawned in with galvz event spawner not becoming enemies they spawn but dont function but thanks for a point in the right direction

Got it sorted was just a typo

Last edited:

RK DracoRoy

Fire Emblem RPG Gamer
One thing I don't get with the SRPG Gear is that only on Battle Prepare, the actor faces show but the enemy faces somehow don't until clicked a 2nd time or when you're done with the prepare scene.

xabileug

Regular
One thing I don't get with the SRPG Gear is that only on Battle Prepare, the actor faces show but the enemy faces somehow don't until clicked a 2nd time or when you're done with the prepare scene.
i get these too haha, i dont know how to fix it. the status window is image empty on first select and only updates on the second. i will try to ask it on twitter

Last edited:

dopan

Regular
thanks for the reply i understand how to add.actors or enemies to events already placed on the map, what im having trouble with is events spawned in with galvz event spawner not becoming enemies they spawn but dont function but thanks for a point in the right direction

Got it sorted was just a typo
ok than i missunderstood, but however, i am happy its solved

RK DracoRoy

Fire Emblem RPG Gamer
Galeforce
-----------
Code:
``````<Custom SRPG Phase Start Effect>
user._SRPGActionTimes = 1;
user._galeforceSkill = undefined;
</Custom SRPG Phase Start Effect>

<Custom Conclude Effect>
//Applies only for the unit who started the battle.
if (user === \$gameSystem.EventToUnit(\$gameTemp.activeEvent().eventId())[1]) {
if (target.hp / target.mhp <= 0 && user._galeforceSkill !== 1) {
user._SRPGActionTimes += 1;
if (user._SRPGActionTimes > 2) {
user._SRPGActionTimes = 2;
}
user._galeforceSkill = 1;
} else if (user._galeforceSkill === 1) {
user._SRPGActionTimes -= 1;
if (user._SRPGActionTimes <= 0) {
user._SRPGActionTimes = 1;
}
}
}
</Custom Conclude Effect>``````

It'll happen once per turn, and it's up to you whether or not to refresh Galeforce with Dance.

Code:
``````<After Eval>
target._srpgTurnEnd = false;
target._galeforceSkill = undefined; //Refreshes the effect
target._SRPGActionTimes = 1;
</After Eval>``````

xabileug

Regular
Just sharing. So I was trying to get back on which of the demos was my latest Fire Emblem compilation - mixing Shoukang, dopan, boomy, Takumi's...

I have triacontane's PictureCallCommon to make the AutoBattle Button, here's the code
Code:
``````\$gameTemp.setTurnEndFlag(true);
\$gameTemp.setAutoBattleFlag(true);``````

I also have common events to display the start turn

You can use MPP_MiniMap to display a map. In Fire Emblem GBA, when you press Start A map is shown.

Other Notable Plugins for Fire Emblem

FeLevelUpMV.js
KZR_EnemyLevel.js
LevelUpCommonEvent.js

EDIT:

Any body have idea how to do the fog of war thing on map, then have torch item light up stuff? or block unit visions

Last edited:

TheLastYuriSamurai

TheLastYuriSamurai
I'm curious if anyone ever managed to make an exploding barrel of some kind. Whether it be an enemy with 1 hp that upon death attacks or an object that upon destruction releases an aoe attack. It could be interesting for gameplay purposes.

xabileug

Regular
I'm curious if anyone ever managed to make an exploding barrel of some kind. Whether it be an enemy with 1 hp that upon death attacks or an object that upon destruction releases an aoe attack. It could be interesting for gameplay purposes.
use the summon or object, i forgot which one from shoukangs demo. but i was able to have auras appear when ever an enemy unit is killed like in jeanne d arc..

what i have not yet seen are push skills knockback, and coop or combo attacks. coop is same in FFTA combo attacks, all units with enough range of the attacker's target will do normal attack. well these are features present in tomoaky's srpg in VX

dopan

Regular
what i have not yet seen are push skills knockback, and coop or combo attacks. coop is same in FFTA combo attacks, ..
i am pretty sure knockback could be possible, perhaps with the nrp plugins, but dont ask me for spezific advice, cose i didnt do it myself yet.. knockback could also be possible with complex skill-common events..

coop and combo atts are as far i know only possible with my force action plugin, which still need some updates to be finished and easier to handle..

TheLastYuriSamurai

TheLastYuriSamurai
use the summon or object, i forgot which one from shoukangs demo. but i was able to have auras appear when ever an enemy unit is killed like in jeanne d arc..

what i have not yet seen are push skills knockback, and coop or combo attacks. coop is same in FFTA combo attacks, all units with enough range of the attacker's target will do normal attack. well these are features present in tomoaky's srpg in VX
ah, but nothing that say causes damage upon attacking?

xabileug

Regular
Not sure. But there are objects, i know you can do death effects.
Well in tomoakys VX there are destructible objects just with HP, they dont appear as enemy or ally.
ah, but nothing that say causes damage upon attacking?

RK DracoRoy

Fire Emblem RPG Gamer
To turn attacks that would miss into gauranteed hits:

First, if you haven't, read back to Fire Emblem calculations as it's required: #2,934

YEP_BuffStatesCore (Passive States)
----------------------
Code:
``````<Custom Action Start Effect>
var action = user.currentAction();
if (action && action.isSkill()) {
user._divinePulseSkill = Math.randomInt(100) + 1;
user._divinePulseActivation = Math.min(user.luk, 50);
}
</Custom Action Start Effect>

<Custom Conclude Effect>
if (this.isSkill()) {
user._divinePulseSkill = Math.randomInt(100) + 1;
user._divinePulseActivation = Math.min(user.luk, 50);
}
</Custom Conclude Effect>

<Custom Action End Effect>
user._divinePulseSkill = undefined;
user._divinePulseActivation = undefined;
</Custom Action End Effect>``````

YEP_X_ActionSequences
--------------------------
Code:
``````<setup action>
eval: user._hitChanceRoll = Math.randomInt(100) + 1;

if (user._hitChanceRoll <= user._hitChance)
eval: user._crtChanceRoll = Math.randomInt(100) + 1;

//Divine Pulse Effect if attack is missed
else if (user.isStateAffected(x) && user._divinePulseSkill <= user._divinePulseActivation)
eval: user._crtChanceRoll = Math.randomInt(100) + 1;
animation x: user
wait for animation
wait: 2
end

if (user._crtChanceRoll <= user._crtChance)
animation x: user
wait for animation
wait: 2
end
</setup action>``````

YEP_HitAccuracy
-------------------
The Divine Pulse code has to be placed first before anything else.

User Hit:
Code:
``\$gameSwitches.value(x) === true && user.isStateAffected(x) && user._divinePulseSkill <= user._divinePulseActivation ? 1.00 : \$gameSwitches.value(x) === true && user._hitChanceRoll <= user._hitChance ? 1.00 : \$gameSwitches.value(x) === true && user._hitChanceRoll > user._hitChance ? 0.00 : user.hit``

Code:
``\$gameSwitches.value(x) === true && user.isStateAffected(x) && user._divinePulseSkill <= user._divinePulseActivation ? 0.00 : \$gameSwitches.value(x) === true && user._hitChanceRoll <= user._hitChance ? 0.00 : \$gameSwitches.value(x) === true && user._hitChanceRoll > user._hitChance ? 1.00 : target.eva``

Want to really test it out? Give your actors the passive state (change the "DivinePulseActivation" to 100) and give enemies 1000 Evade.
You're definitely going to be hitting enemies with 0 Hit Rates (displayed hit rates).

Last edited:

Frelsigard

Glistening Hope
Hey @dopan, what is the script call to show the Item Slots scene from your UnitCore plugin? I tried: "SceneManager.push(Scene_ActorItemSlots);", but it didn't work, thanks.

dopan

Regular
Hey @dopan, what is the script call to show the Item Slots scene from your UnitCore plugin? I tried: "SceneManager.push(Scene_ActorItemSlots);", but it didn't work, thanks.
the name is correct, but you cant call the scene/function that way..

infact the plugin does use this exact scriptcall ..

-> "SceneManager.push(Scene_ActorItemSlots);"
.. but it calls it at a special situation.. the "Scene_ActorItemSlots" is called depending on which char is clicked on in the menu.. after using the "commandWindow.currentSymbol() === 'ActorItems'"
(which is the itemslots symbol in the menu in this example img)

if you try o call it otherways you will get the message :

i am am not sure what you try to do and if it can be done the way you would like to..

the simple way to describe the problem is:
that this scene is a scene which is part of scene menu and it also depends on which "menu actor" is used at that time..
or in other words not all scenes are always available..
-> sorry that i cant explain it better and more detailed at this point

edit.

another info on how to know in which scene you are currently (by using console F8 ) can be found here #2

Last edited:

Frelsigard

Glistening Hope
@dopan I'm trying to add it to a custom evented menu, you can't select the actors there

Latest Profile Posts

Approaching the Jam and the Cameo update on both games!
Lemme know what you need in the Cameo Update on its manual!
Perhaps some combo tips & tricks? Character Build Tips? or just general info?!
Alright.. now to get knee deep into Individual Items and Materia to create a MZ augment system. See ya'll in a week xD
BALDURS GATE 3 - GAME OF THE YEAR
mfw you spent 3 hours watching game awards and no elden ring DLC
Another day, another advent calendar addition. And now it's time to vote for what comes next! We've seen Strength with our adventurers and Charisma with our merchants, so which DnD stat would you like to see in the next NPC: Constitution or Wisdom?