st# ModularScript
Other important Rentry links:
https://rentry.co/modularlua
https://rentry.co/letheenums
Batch Structure
- Batches are separated by forward slashes (
/). - A batch can include Main Functions, Consequence Functions, and IF Statements.
- Consequence Functions and IF Statements can co-exist in the same batch.
Valid Batch Examples
/TIMING:WinDuel//IF(VALUE_1<VALUE_2):healsp(Self,-7):IF(VALUE_1>VALUE_2):healsp(Self,7)//healsp(Self,-7)//IF(VALUE_1<VALUE_2):VALUE_1:math(VALUE_1+10)//setdata(Self,2,10)/VALUE_0:getdata(Self,2)/buff(Self,Enhancement,VALUE_0,0,0)/
Invalid Batch Example
/TIMING:WinDuel:healsp(Self,-7)//VALUE_1:55:LOOP:EveryAlly//LOOP:EveryAlly:TIMING:WinDuel/
(MAIN functions need to be alone in their own batches)
Execution Order
- Batches are executed in the order they appear.
Main Functions
TIMING Function
Sets the timing for effect activation. Only the last timing in the list will apply if multiple timings are defined.
Example
LUA Function
Allows a .lua file to be loaded from the modular_lua folder. Note: Two .lua file names should not be named the same, otherwise it will cause this function to break.
LUAMAIN Function
Specifies which .lua function that Modular should call. This allows the same .lua script to be used for multiple timing's. For example: "Modular/TIMING:RoundStart/LUA:passiveRoundStart/LUAMAIN:test_main" would call test_main() in passiveRoundStart.lua. If you wish to pass parameters, do it like so: "LUAMAIN:myfunction(5,true,hello)". These values will turn into .lua values, going in the order in which they are passed. ("5" becomes 5, "true" becomes true, and "hello" stays as "hello")
LOOP Function
This is performance intensive. Only use it if absolutely necessary.
LOOP iterates the script over a list of units, overriding the Target argument as the current iteration's target. See Multi-Target for all possible arguments.
When using the LOOP function in a .lua file, instead of using Target, use MainTarget, as Target is an inline modular feature, however, MainTarget does basically the same thing, and is compatible with both .lua and inline modular scripts.
Example
RESETWHENUSE Function
Used for passives, on odd timings like WinDuel or BeforeAttack. Resets the scale, final, base, clash, dmg, and dmgmult adders for that particular Modular Script when a skill is used. Prevents such power increases from sticking around when using more than 1 Skill per turn.
Example
CLEARVALUES Function
Sets all VALUEs to 0 every time the script is enacted. (Note: By Default, VALUES arent cleared when the script is activated twice, while that doesn't cause too many issues usually since they'd typically get overwritten by next declaration of the value, this can be useful in some situations)
EXPECTED Function
Enables Expected Power calculations for this Modular Script. Used with certain timings like FakePower and ExpectedBasePower.
DAMAGE_SOURCE_TYPE
- COMBAT
- BUFF
- PASSIVE
- SKILL
- EVENT
- EGO_GIFT
- STAGE
- SYSTEM
- SYSTEM_ABILITY
- FORCED
- NONE
Defense Cycling

Allows units to cycle through different Defense Skills before returning to attack skills.
Cycling Defense Skills can be done either through the method above, or by using the DefenseCycle TIMING.
Only use one or the other, as it can cause skill order issues.
Skill Timings
| .........Timing......... | Corresponding Locale |
Notes |
|---|---|---|
RoundStart |
[Turn Start] | Runs if the skill is in the bottom 2 slots of the dashboard |
StartBattle |
[Combat Start] | |
StartBattleOnDashboard |
[Combat Start] | Activates on all Skills on the 2 up-down Dashboard slots, even if not chained. |
EndBattle |
[Turn End] | |
WhenUse |
[On Use] | |
BeforeAttack |
[Before Attack] | |
BeforeUse |
[Before Use] | Goes before On Use, it's kinda special like that. |
DuelClash |
Clash Count | Triggers On Each Individual Clash in a Duel (Clash) |
AfterDuelClash |
After Parry | Sets VALUE_9 to -1 if Parry Lose, 1 if Parry Win, 0 for Draw. |
StartDuel |
[Clash Start] | |
WinDuel |
[Clash Win] | |
DefeatDuel |
[Clash Lose] | |
WinParrying |
Coin Clash Win | Triggers on each "Coin clash win" in a Duel (Clash)/When this skill breaks a coin in a clash |
DefeatParrying |
Coin Clash Lose | Triggers on each "Coin clash lose" in a Duel (Clash)/When this skill gets one of it's coins broken in a clash |
EndSkill |
[After Attack] | |
OnSucceedAttack |
[On Hit] | Can be shortened to OSA. |
BeforeSA |
Not In Vanilla | Triggers right before the hit connects. Can be shortened to BSA. |
SkillStaggerVictim |
On Skill Target Stagger | Victim becomes the staggered unit. Uses SkillModel and Action. |
OnSucceedEvade |
[On Evade] | Target becomes the attacker. |
OnDefeatEvade |
[Failed Evade] | Target becomes the attacker. |
OnDiscard |
"if this Skill is Discarded" at the end of the line | |
BeforeBehaviour |
[Before Use] | |
StartBehaviour |
[BeforeAttack] | Before attack but better. OnStartBehaviour |
EndBehaviour |
[After Attack] | OnEndBehaviour |
EnemyKill |
[On Kill] | |
CanDuel |
Not In Vanilla | Has Target, Victim, and opposing action as the opponent's BattleAction that you're checking to clash with. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable Clashing. Not in EGO Passives. |
IsIgnoreDefense |
Not In Vanilla | Victim is the one with the defense skill. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable Defense on target. Not in EGO Passives. |
IsIgnoreSupportiveDefense |
Not In Vanilla | Victim is the main target, Killer is the one who wants to steal your targeting with Assist Defense. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable the Assist Defense. Not in EGO Passives. |
OnVisualUse |
Not In Vanilla | Triggers on the visual start of a Skill being used. (Used mainly for the sound consequence, with things like VFX, and dialogue lines) StartVisualSkillUse |
OnVisualCoinToss |
Not In Vanilla | Triggers on the visual start of a Coin being tossed. (Mainly used for the sound consequence, with things like voice lines) StartVisualCoinToss |
VisualEndBehaviour VisualEndBhv |
Not In Vanilla | visual endskill i think |
OnCoinToss |
When a coin starts its attack | Activates each time a coin is tossed for an attack. |
OnCoinAfterAttack |
When a coin ends its attack | Activates when a coin finishes its attack, similar to how bleed works. |
BeforeAnyFlip |
- | Combination of DuelClash and OnCoinToss. |
ChangeAttackDamage |
- | Changes outgoing SKILL damage. VALUE_9 is set to current damage. Manually change VALUE_9 to change damage given. Works with all modular sources except Support-Passive. "Target" and "Victim" are both the current Target. |
EGOCostMP |
Checking SP Cost for EGO | VALUE_9 is set to the current SP cost. Modify it with math (or set it to 0 for funny 0 cost) |
FakePower |
Prediction Phase | (Used for prediction, only for base(), final(), scale(), and clash(). Don't use any other consequences) |
ExpectedBasePower |
Prediction Phase, when calculating Base Power. | Make sure to enable EXPECTED.Used for prediction, only for base(), final(), scale(), and clash(). Don't use any other consequences. This is more reliable than FakePower, and is recommended over it, especially for Abnormality usage. |
SpecialAction |
Most Complete Certainly NOT In Vanilla | Unique Timing triggered when you ctrl+LMB the portrait of the Unit on the dashboard, for Skills the Skill with the script MUST be slotted in actively. |
DefenseSwitch |
Most Complete Certainly NOT In Vanilla | Activates when a defense skill is slotted into the dashboard. Use changeskill() and refreshallslotvisual() to do the wanted shenanigans. |
ChangeMotion |
Triggers when any motion is applied | V_9 is set to the motion index (i.e coin idx), starting at 0 as per usual. This can be overridden with a different index.V_8 is "overkill", 1 or 0. You can override this for different animations that trigger on kill.V_7 is the MOTION_DETAIL enum in int form. This is for display only, nothing will happen if you change it. Use it as reference only.Use changemotion() to change the MOTION_DETAIL inside the ChangeMotion timing. See lethe enums and write it correctly. |
Coin Timings
OnCoinTossOnCoinAfterAttack
Passive Timings
| ...........Timing........... | Corresponding Locale |
Notes |
|---|---|---|
RoundStart |
[Turn Start] | |
EncounterStart |
[Encounter Start] | |
AfterSlots |
[Turn Start] | A special RoundStart timing that triggers after Slots are formed. Used for skillslotreplace() |
StartBattle |
[Combat Start] | |
StartBattleOnDashboard |
[Combat Start] | Activates on all Skills on the 2 up-down Dashboard slots, even if not chained. |
EndBattle |
[Turn End] | |
WhenUse |
[On Use] | |
BeforeUse |
[Before Use] | Goes before On Use, it's kinda special like that. |
BeforeAttack |
[Before Attack] | |
DuelClash |
Clash Count | Triggers On Each Individual Clash in a Duel (Clash) |
AfterDuelClash |
After Parry | Sets VALUE_9 to -1 if Parry Lose, 1 if Parry Win, 0 for Draw. |
StartDuel |
[Clash Start] | |
WinDuel |
[Clash Win] | |
DefeatDuel |
[Clash Lose] | |
WinParrying |
Coin Clash Win | Triggers on each "Coin clash win" in a Duel (Clash)/When this skill breaks a coin in a clash |
DefeatParrying |
Coin Clash Lose | Triggers on each "Coin clash lose" in a Duel (Clash)/When this skill gets one of it's coins broken in a clash |
OnRetreat |
On Retreat | |
OnFieldedFromBackup |
Substitution (Unit wasn't initialized) | No special considerations. |
OnReturnFromRetreat |
Substitution (Unit was retreated) | VALUE_9 becomes the round in which this unit retreated. |
EndSkill |
[After Attack] | |
OnSucceedAttack |
[OnSucceedAttack] | Can be shortened to OSA. |
BeforeSA |
Not In Vanilla | Triggers right before the hit connects. Can be shortened to BSA. |
OnDiscard |
"if this Skill is Discarded" at the end of the line | |
StartBehaviour |
[BeforeAttack] | |
EndBehaviour |
[After Attack] | OnEndBehaviour |
EnemyKill |
[On Kill] | |
FakePower |
Prediction Phase | (Used for prediction, only for base(), final(), scale(), and clash(). Don't use any other consequences) |
ExpectedBasePower |
Prediction Phase, when calculating Base Power. | Make sure to enable EXPECTED.Used for prediction, only for base(), final(), scale(), and clash(). Don't use any other consequences. This is more reliable than FakePower, and is recommended over it, especially for Abnormality usage. |
WhenHit |
[When Hit] | 'Target' becomes the unit BEING HIT, 'Self' becomes the unit who USED THE ATTACK. Can be shortened to WH. |
BeforeWhenHit |
[Before Getting Hit] | 'Target' becomes the unit BEING HIT, 'Self' becomes the unit who USED THE ATTACK. Can be shortened to BWH. |
BeforeDefense |
Not In Vanilla | Triggers before a defense skill is used |
OnDie |
Not In Vanilla | Triggers when This Unit dies. |
OnOtherDie |
Not In Vanilla | Triggers when another Unit dies. ("Target" becomes the dead unit unless LOOP is involved) |
OnBreak |
Not In Vanilla | Triggers when This Unit gets staggered. ("Target" becomes the staggered unit unless LOOP is involved) |
OnOtherBreak |
Not In Vanilla | Triggers when another Unit gets staggered. ("Target" becomes the staggered unit unless LOOP is involved) |
SkillStaggerVictim |
On Skill Target Stagger | Victim becomes the staggered unit. Uses SkillModel and Action. |
OnSucceedEvade |
[On Evade] | Target becomes the attacker. |
OnDefeatEvade |
[Failed Evade] | Target becomes the attacker. |
EnemyStartBehaviour |
Not In Vanilla | Triggers when the enemy's skill starts its attack and has this unit in its AOE Target List (Uses Victim for Self). |
EnemyEndSkill |
Not In Vanilla | Triggers when the enemy's skill used on you Ends. Target is victim. |
CanDuel |
Not In Vanilla | Has Target, Victim, and opposing action as the opponent's BattleAction that you're checking to clash with. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable Clashing. Not in EGO Passives. |
IsIgnoreDefense |
Not In Vanilla | Victim is the one with the defense skill. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable Defense on target. Not in EGO Passives. |
IsIgnoreSupportiveDefense |
Not In Vanilla | Victim is the main target, Killer is the one who wants to steal your targeting with Assist Defense. Sets VALUE_9 to 1(true) or 0(false). Manually change it to enable or disable the Assist Defense. Not in EGO Passives. |
OnImmortal |
Not In Vanilla | They trigger when the unit gets dropped to 0 HP. DURING THAT SCRIPT, if you use setimmortal(1), the unit about to be killed will remain alive and its HP will be set to 1. Immortal |
OnOtherImmortal |
Not In Vanilla | They trigger when the unit gets dropped to 0 HP. DURING THAT SCRIPT, if you use setimmortal(1), the unit about to be killed will remain alive and its HP will be set to 1. Target is the victim. ImmortalOther |
OnCoinToss |
When a coin starts its attack | Activates each time a coin is tossed for an attack. |
OnCoinAfterAttack |
When a coin ends its attack | Activates when a coin finishes its attack, similar to how bleed works. |
BeforeAnyFlip |
- | Combination of DuelClash and OnCoinToss. |
StartBattleSkill shortened to SBS |
Combat start, activates once for every skill chained | activates on combat start multiple times, the amount of times being dictated by the amount of chained skills, example: Modular/TIMING:SBS/VALUE_0:getskilldeftype/IF(OR,VALUE_0=1,VALUE_0=2,VALUE_0=3):buff(Self,Protection,1,0,0) = For every Guard, Evade, or Counter chained, gain 1 prot |
SpecialAction |
Most Complete Certainly NOT In Vanilla | Unique Timing triggered when you ctrl+LMB the portrait of the Unit on the dashboard |
DefenseSwitch |
Most Complete Certainly NOT In Vanilla | Activates when a defense skill is slotted into the dashboard. Use changeskill() and refreshallslotvisual() to do the wanted shenanigans. |
DefenseCycle |
Most Complete Certainly NOT In Vanilla | Sets VALUE_9 to the current Defense Skill. Modify VALUE_9 to another defense skill ID to change it. Set to -1 once the cycling is over to reset the slot back to its original state. |
IgnorePanic |
On Panic | Mainly used with ignorepanic consequence |
IgnoreBreak |
On Stagger | Mainly used with ignorebreak consequence |
OverwriteGiveBufOverwriteGainBuf |
Not In Vanilla | GiveBuf has a "Victim", and GainBuf has a "Killer", representing the one who gains the buf and the one who applies it, respectively.V_6 = ABILITY_SOURCE_TYPE enum.V_7 = Stack, overwritable.V_8 = Turn, overwritable.V_9 = Keyword int. Cross-check using bufkeywordtoint. Can be Overwritten with another keyword int. |
OnGainBuff |
Not In Vanilla | Triggered when a unit gains a buff |
OnUseBuf |
Not In Vanilla | Triggered when a unit "spends" or "consumes" a buff. Check for acquirers and consequences that interact with this. |
BufMaxStackAdderBufMaxTurnAdder |
- | VALUE_9 is set to 0. Manually set VALUE_9 to a positive or negative int to change the max stack or turn of the buf. Use updatemaxbuf() regularly on affected units. |
VisualEndBehaviour VisualEndBhv |
Not In Vanilla | visual endskill i think |
AfterChangeShield |
Triggers when Shield changes. Sets VALUE_9 to the diff. | |
AfterChangeHP |
Triggers when HP changes. Sets VALUE_9 to the diff. | |
OverwriteMPDMG |
Triggers when SP is about to get damaged. | Sets VALUE_9 to the current incoming SP damage, and can be manually changed to a different amount. VALUE_8 is 0 if NOT "Sanity Tab" SP damage, and above 0 if it does come from the Sanity Tab. VALUE_7 is Buf Keyword, and can be matched with bufkeywordtoint() ("None" is a valid keyword, for example). VALUE_6 is 0 if Ability is Null, 1 if Valid. ActionOrNull is fed to the Modular Script. |
OverwriteChangeMP |
Triggers before SP changes. | V_9 is the incoming SP value. Use mpcheck to calculate the diff. |
AfterChangeSanity |
Triggers when SP changes. | Sets VALUE_9 to the diff. |
ChangeTakeDamage |
- | Triggers whenever this unit takes damage from any source. During this script, if you use the consequences setdmgtaken, you can change how much damage you take. |
ChangeAttackDamage |
- | Changes outgoing SKILL damage. VALUE_9 is set to current damage. Manually change VALUE_9 to change damage given. Works with all modular sources except Support-Passive. "Target" and "Victim" are both the current Target. |
EGOCost |
Checking Resource Cost for EGO | Activates once per Sin type. VALUE_9 is set to -1~6 for sin type, VALUE_8 is Current Cost for the current Sin we're checking, and is meant to be manually modified with the new amount you want. |
OnGainBuff(opt_1)
Add this to filter all keywords out except the one you want. If you want all keywords to trigger, either remove this extra parameter and parenthesis, or set it to (None).
If None, all bufs will trigger this. Use ongainbufiskeyword to filter out unneeded ones.
- Arguments:
opt_1: Any Buff Keyword | E.X:OnGainBuff(Laceration)-> Only triggers when the unit gains Bleed.
SpecialAction(opt_1)
- Arguments:
opt_1: Any Unity Keycode (The key to be held that will trigger Special Action)
Keycodes correspond to keys on the keyboard
If left blank, defaults to CTRL
A list of Keycodes can be found here
E.G.O. Passive Support
Do note that all passive timings work on E.G.O. Passives as well
Support Passive Support
Support Passives act out like regular passives except every unit alive has said passive, its sort of like LOOP: but instead of target as the unit the loop is going through its self (which matches the idea its a normal passive that every unit has)
Some timings like OnOtherDie have some odd semantics where self is the killer and target is the dead guy
Reliable
RoundStart, AfterSlots, StartBattle, EndBattle,
WhenUse, BeforeAttack, StartDuel, WinDuel,
DefeatDuel, EndSkill, OnDiscard,
StartBehaviour, EndBehaviour
Unreliable
BeforeDefense, OnDie, OnOtherDie, OnBreak,
OnOtherBreak, OnImmortal, OnOtherImmortal,
DuelClash, OnSucceedAttack, BeforeSA,
WhenHit, BeforeWhenHit, EnemyKill,
EnemyEndSkill, OnCoinToss, FakePower,
StartBattleSkill
Not Supported
SpecialAction
Value Assignment
You can set any VALUE (from VALUE_0 to VALUE_9) to any integer. Values beyond VALUE_9 are not allowed.
Examples
/VALUE_0:5/→VALUE_0 = 5/VALUE_1:-5/→VALUE_1 = -5/VALUE_2:getsp(Self)/→ Result depends on SP value/VALUE_3:math(VALUE_0*VALUE_0)/→VALUE_3 = 25(5*5)
Math Symbols (Integers Only)
| Symbol | Operation | Example |
|---|---|---|
+ |
Add | VALUE_0 + VALUE_1 |
- |
Subtract | VALUE_0 - VALUE_1 |
* |
Multiply | VALUE_0 * VALUE_1 |
% |
Divide | VALUE_0 % VALUE_1 |
! |
Min value between two numbers | 15!10 → 10 |
¡ |
Max value between two numbers | 1¡3 → 3 |
? |
Modulo | VALUE_0 ? VALUE_1 |
credit: None.
abs(var_1)
Returns the absolute value of the given integer.
- var_1: ValueOrInt
In-Consequence Math:
Prefixing a consequence's integer input with m turns it into a math equation. - turns the input negative.
VALUE_0:15/healhp(Self,10) → Heal 10 HP
VALUE_0:15/healhp(Self,-10) → Lose 10 HP
VALUE_0:15/healhp(Self,VALUE_0) → Heal 15 HP
VALUE_0:15/healhp(Self,-VALUE_0) → Lose 15 HP
VALUE_0:15/healhp(Self,VALUE_0*2) → Invalid
VALUE_0:15/healhp(Self,mVALUE_0*2) → Heal 30 HP
VALUE_0:15/healhp(Self,m-VALUE_0*2) → Invalid math
VALUE_0:15/healhp(Self,-mVALUE_0*2) → Lose 30 HP
Target Arguments
- Single-Target
SelfSelfCore(If the target is an abnormality PART, get the core instead)Target(Functionally the same as MainTarget unless you're using LOOP)TargetCore(If the target is an abnormality PART, get the core instead)MainTargetVictim(Used for OnDie, OnOtherDie, and EnemyKill TIMINGs)Killer(Used for OnDie, OnOtherDie, and EnemyKill TIMINGs)id#####(Fill ##### with a unit ID or a VALUE_X)inst#####(Fill ##### with a unique instance ID or a VALUE_X)adjLeft(Adjacent unit to the left)adjRight(Adjacent unit to the right)
- Multi-Target
SelfSelfCore(If the target is an abnormality PART, get the core instead)SelfParts(Only works if the user is an abnormality, applies to all of the users abnormality parts)Target(Functionally the same as MainTarget unless you're using LOOP)TargetCore(If the target is an abnormality PART, get the core instead)TargetParts(Only works if the target is an abnormality, applies to all of the target's abnormality parts)MainTargetEveryTargetSubTargetVictim(Used for OnDie, OnOtherDie, and EnemyKill TIMINGs)Killer(Used for OnDie, OnOtherDie, and EnemyKill TIMINGs)id#####(Fill ##### with a unit ID or a VALUE_X)inst#####(Fill ##### with a unique instance ID or a VALUE_X)adjLeft(Adjacent unit to the left)adjRight(Adjacent unit to the right)All(Every fielded unit)
Custom Targeting:
- Starter Sorting Tag (Mutually exclusive, must go first)
- Slowest
- Fastest
- HighestHPRatio
- LowestHPRatio
- HighestHP
- LowestHP
- HighestMaxHP
- LowestMaxHP
- HighestSP HighestMP
- LowestSP LowestMP
- Sorting Tag (Mutually exclusive)
- Random
- Deploy
- Reversedeploy
- Special Tags (Mutually exclusive)
- Lives (Picks all live units, does nothing on its own.)
- Deads (Picks all dead units)
- Retreats (Picks all retreated, alive units (Not including un-initialized backup))
- Grab Tags (Mutually exclusive, Picks a group of units. Can filter with
LivesorDeadsfrom Special Tags.)- SkillTargets (Picks all skill targets)
- SkillSubTargets (Picks all skill subtargets)
- Team Tags (Mutually exclusive)
- Ally (Removes all enemies from list)
- Enemy (Removes all allies from list)
- Exclusion Tags (Mutually exclusive)
- AbnoOnly
- NoAbnos
- Exclusion Tags (Mutually exclusive)
- NoCores
- NoParts
- Inclusion Tags
- Assist (Includes Assistants to the list, otherwise excluded)
- Exclusion Tags (Can be stacked)
- ExceptSelf (Removes Self from list)
- ExceptTarget (Removes Target from list, if it exists)
- Amount Tag (Multi-Target only)
- Any number from 1 to 999 (VALUE_X can be used)
- Ending getbuff Tag (Must be at the end, only ONE can be used)
- $Keyword (example: $Enhancement)
Value Acquisition Functions
Retrieve specific values for calculations. These functions return integers.
credit: Divorce
gethp(var_1, var_2) hpcheck
Gets HP value based on the arguments.
- Arguments:
var_1: See Multi-Targetvar_2:normal|%|maxnormal: Remaining HP%: Percentage of remaining HP (rounded down, e.g., 349/350 = 99)max: Max HP valuemissing: Missing HP valuemissing%: Missing HP percentage
credit: None.
getdefaultmaxhp(var_1)
Gets Default Value for Max HP (Why didn't we just put it as an argument on gethp? I'm gonna kms).
- Arguments:
var_1: See Single-Target
credit: None.
gethpincrement(var_1)
Gets the amount of HP gained per Level (Returned 1 = 0.01).
- Arguments:
var_1: See Single-Target
credit: Divorce.
getsp(var_1) mpcheck
Gets SP value based on the argument.
- Arguments:
var_1: See Single-Target
credit: Divorce.
getbuff(var_1, var_2, var_3, opt_4, opt_5) bufcheck
Returns an integer based on the buff mode.
- Arguments:
var_1: See Multi-Targetvar_2: Buff keyword (e.g.,Enhancement,Agility)var_3:stack|turn|+|*|consumedstack: Potency (0 if no buff)turn: Count (0 if no buff)+: Potency + Count*: Potency * CountstackConsumed: Stack of the buff consumed throughout the encounter (0 if the buff doesn't track the amount)turnConsumed: Turn of the buff consumed throughout the encounter (0 if the buff doesn't track the amount)
opt_4:main|mainandsub|mainandsubandcategory|onlycategory(Default = "mainandsub")main: Main Keyword Only.mainandsub: Main and Sublist keyword. (This is the Default)mainandsubandcategory: Checks all. Enables opt_5. Does not work with spent bufs.onlycategory: Checks only Category. Enables opt_5. Does not work with spent bufs.
opt_5: buf Category (enabled if checking for category in opt_4)
credit: None.
bufkeywordtoint(var_1)
Returns an integer corresponding to the buf keyword enum. Useful for matching other keywords.
- Arguments:
var_1: Buff keyword (e.g.,Enhancement,Agility)
credit: None.
onusebufstack() | onusebufturn()
Returns an int for the Stack | Count Consumed on OnUseBuf.
credit: None.
bufmaxstackadderiskeyword(var_1,var_2,opt_3)
bufmaxturnadderiskeyword(var_1,var_2,opt_3)
Will return 1 if matching. "main" will return 1 if main keyword matches. "sub" will return 1 if main OR sublist keywords match. "category" will return 1 if ANY keyword matches, be it main, sub, or category.
var_1: Buff keyword (e.g.,Enhancement,Agility)var_2:main|mainandsub
ORvar_1: Buff keyword (e.g.,Enhancement,Agility)var_2:categoryopt_3: Category keyword (e.g.,VIBRATION_CONVERTED)
credit: None.
ongainbufiskeyword(var_1,var_2)
Returns 0(false) or 1(true) if the keyword given matches the keyword gained on OnGainBuf.
var_1: Buff keyword (e.g.,Enhancement,Agility)var_2:main|mainandsub
onusebufiskeyword(var_1,var_2)
Returns 0(false) or 1(true) if the keyword given matches the keyword consumed on OnUseBuf.
var_1: Buff keyword (e.g.,Enhancement,Agility)var_2:main|mainandsub
credit: Divorce.
getdmg
Returns the damage. Only usable with OnSucceedAttack, ChangeTakeDamage and WhenHit
credit: Divorce.
getround round
Returns the round.
credit: Divorce.
getwave wave
Returns the wave.
credit: Divorce.
getactivations activations
Returns the amount of times this script has been triggered before. First time = 0.
credit: Divorce.
getunitstate(var_1, opt_2) unitstate
Returns:
-1 if the unit doesn't exist
0 if the unit is dead
1 if the unit is alive
2 if the unit is staggered
- Arguments:
var_1: See Single-Targetopt_2:stagger(Add this to change the return values into the following: 0 if dead, 1 if Staggered, 2 if Forcefully Staggered)
credit: None.
isactionable(var_1)
Returns:
-1 if the unit doesn't exist
0 if the unit is unable to act.
1 if the unit can act.
- Arguments:
var_1: See Single-Target
credit: Divorce.
ispart(var_1)
Returns 1 if Abno_Part, returns 0 if Core or Non-Abno.
- Arguments:
var_1: See Single-Target
credit: Divorce.
partdestroy(var_1,var_2)
Checks state of Part.
- Arguments:
var_1: See Single-Targetvar_2:isdestroyed|isdestroyable|isregeneratable|isregenerating(returns 1 if true, 0 if false)
ORvar_2:getregenerateturn(returns the number of rounds before regeneration (???))
credit: Divorce.
getid(var_1)
Returns the unitID of the target.
- Arguments:
var_1: See Single-Target
credit: Shane.
getcharacterid(var_1)
Returns the characterID of the target (Sinners only)
- Arguments:
var_1: See Single-Target
credit: Divorce.
getinstid(var_1) instid
Returns the unique instance ID of the target.
- Arguments:
var_1: See Single-Target
credit: Divorce.
getspeed(var_1,opt_2) speedcheck
Returns the speed of the target.
- Arguments:
var_1: See Single-Targetopt_2:VALUE_#| any integer (checks a specific slot index's speed)
credit: Divorce.
getpattern(var_1)
Returns the pattern index (integer) of the target.
- Arguments:
var_1: See Single-Target
credit: Divorce.
getdata(var_1,var_2)
Gets encounter-persistent data from the target.
- Arguments:
var_1: See Single-Target (Can also be "Encounter" for global stage data)var_2:VALUE_#| any integer (The Data ID)
credit: Divorce.
othermodsavalue(var_1,var_2,var_3)
Allows you to grab a VALUE_X from a different Modular Script in the same Skill, Passive, or Buf.
- Arguments:
var_1: "skill" | "passive" | "buf" (Necessary to determine the pool of scripts)var_2: modsa index (0 idx)var_3: value index (0~9)
credit: Divorce.
getdeadallies(var_1) deadallies
Gets number of target's dead allies.
- Arguments:
var_1: See Single-Target
credit: Divorce.
random(var_1,var_2)
Returns a random integer between min and max
- Arguments:
var_1:VALUE_#| any integer (Minimum value inclusive)var_2:VALUE_#| any integer (Maximum value inclusive)
credit: Divorce.
getshield(var_1)
Returns the amount of shield on target.
- Arguments:
var_1: See Single-Target
credit: Divorce.
areallies(var_1,var_2) areallied
Returns 1 if both units are allied. Returns 0 if they are enemies.
- Arguments:
var_1: See Single-Targetvar_2: See Single-Target
credit: Divorce.
getskillid(opt_1,opt_2) / getopposkillid
Returns the ID of the skill being used. Does not work on TIMINGs that have no Skills being used.
getopposkillid Gets the opponent's Skill ID in a Clash. Returns -1 if non-existent.
- Arguments:
opt_1:replaced: (If used with a Defense Skill: Provides the Skill ID of the covered Skill)top: (Top Skill in Skill Slot)bottom: (Bottom Skill in Skill Slot)ready: (Upcoming Skill)
opt_2: Slot Index (Leftmost = 0. Do not include this variable if you want it to use the same Skill Slot a Skill is in, in case of TIMINGs that trigger with a valid Skill instance.)
credit: None.
isignoredefense(var_1)
Returns 1 if the current BattleAction ignores defense on the unit chosen. Useful for WhenHit and EnemyEndSkill timings, for example.
- Arguments:
var_1: See Single-Target
credit: Divorce.
haspassive(var_1,var_2)
Checks if the unit has the passive id. Returns 1 if they do, returns 0 if they don't.
- Arguments:
var_1: See Single-Targetvar_2: Passive ID
credit: Divorce.
getcurrentpower(var_1)
Gets the resulting power of the skill. Please verify if this works correctly and report it (you can use log()).
- Arguments:
var_1:Self|Target("Target" is only available when there is a clash)opt_2:coin|clash(use 'clash' when you're trying to get clash power during parrying. It's a bit inaccurate, but it should suffice.)
credit: Divorce.
getcoincount(var_1,var_2)
Gets the coin count of the skill. Returns -1 if var_1 not found.
- Arguments:
var_1:Self|Target("Target" is only available when there is a clash)var_2:cur|og(Current coin count and Original coin count respectively)
credit: Divorce.
coinindex(var_1)
Gets the index of the current coin that's being used.
If var1 is "idx", will return -1 if null, otherwise it will return the coins index.
If "isLastCoin", returns 1 if last coin, 0 if false.
- Arguments:
var_1:idx|isLastCoin
credit: Divorce.
coinstate
Returns the state of CURRENT coin. Returns -1 if invalid, 0 if Tails, 1 if Heads.
credit: None.
iscrit
Returns 1 if this attack is Critical, 0 if not.
credit: None.
getallcoinstates(var_1,var_2) allcoinstate
Returns the state of the coins. Returns -1 if var_1 not found.
- Arguments:
var_1:Self|Target("Target" is only available when there is a clash)var_2:full|headcount|tailcount(Selecting "full" will return 0 if mixed, 1 if all Heads, 2 if all Tails)
credit: Divorce.
getresonance(var_1) resonance
Returns the resonance of the given type
- Arguments:
var_1:highres(Returns the highest resonance of any type)highperfect(Returns the highest absolute resonance of any type)?????|perfect?????(Specifies highest type of resonance. If prefixed with "perfect", only returns the highest absolute resonance of that type)
Examples:
/VALUE_0:getresonance(perfectAZURE),/VALUE_0:getresonance(INDIGO),/VALUE_0:getresonance(highperfect)
credit: Divorce.
getresource(var_1,opt_2) resource
Returns the amount of sin resources.
var_1:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLET
ORvar_1:int(Value from 0~6)
ORvar_1: See var_1 in resourcegetenumopt_2:Enemy(Add this optional argument to affect the enemy team)
credit: None.
resourcegetenum(var_1,opt_2)
Returns an int corresponding to the correct sin resource type (0 = CRIMSON).
By default it tries all 7 sintypes.
Sintypes can be chained to make your own custom list of resources instead of using the default.
var_1:highestrandom|highestsorted|lowestrandom|lowestsortedvar_1: Resources can be chained using+. Examples:highestrandom+CRIMSON+SCARLET+AZUREhighestsorted+AMBER+SHAMROCK+INDIGOlowestrandom+CRIMSON+SCARLET+AZURE+SHAMROCK+VIOLETlowestsorted+VIOLET+CRIMSON
opt_2:Enemy(Add this optional argument to affect the enemy team)
credit: Divorce.
haskey(var_1, var_2, var_3~X)
Returns 1 if the selected unit has the keyword, 0 if not. If Multi-Target, returns the amount of units that pass the check.
- Arguments:
var_1: See Multi-Targetvar_2: AND | OR (AND means it needs to have every keyword added to return 1, OR means it needs just one keyword to return 1)var_3~X: Any string that could be a unitKeyword or association in the json data of a unit. More than 1 can be added, separated by commas.
credit: Divorce.
getskillbase(var_1) skillbase
Returns skill base power.
- Arguments:
var_1:Self|Target
credit: Divorce.
getskillatkweight(var_1) skillatkweight
Returns attack weight.
- Arguments:
var_1:Self|Target
credit: Divorce.
getcoinscale(var_1,var_2) onescale
Returns one coin's Coin Power.
- Arguments:
var_1:Self|Targetvar_2:VALUE_#| any integer (Coin Index, starts at 0. If the index is out of range, checks the last coin instead.)
credit: Shane.
getskillatklevel(var_1,var_2) skillatklevel
Returns skill's offense level modifier
- Arguments:
var_1:Self|Target
credit: Shane.
getskilllevel(var_1)
Returns the unit's offense level + skill offense level
- Arguments:
var_1Self|Target
credit: None.
getskillatk(var_1) skillatk
Returns skill atk type, 0 = Slash, 1 = Pierce, 2 = Blunt, 3 = None
- Arguments:
var_1:Self|Target
credit: None.
getskillattribute(var_1) skillattribute
Returns skill sin, Wrath = 0, Lust = 1, Sloth = 2, Gluttony =3, Gloom = 4, Pride = 5, Envy = 6, White = 7, Black = 8, Red = 9, Pale = 10, Neutral = 11.
- Arguments:
var_1:Self|Target|replaced(replaced: If used with a Defense Skill: Provides the Skill ID of the covered Skill)
credit: None.
getskilldeftype(var_1) skilldeftype
Returns Defense Type, None = 0, Guard = 1, Evade = 2, Counter = 3, Attack = 4, Non_Action = 5. (Non_action is only used once and by the panic skill)
- Arguments:
var_1:Self|Target
credit: Divorce.
getskillrank(var_1) skillrank
Returns the tier of the target's skill
- Arguments:
var_1:Self|Target|replaced(replaced: If used with a Defense Skill: Provides the Skill Tier of the covered Skill)
credit: None.
getskillegotype(var_1) skillegotype
Returns Ego Type, Skill = 0, Awaken = 1, Corrosion = 2, Corrosion Unstable = 3, Corrosion Stable = 4, Upgrade = 5, 6 = None.
- Arguments:
var_1:Self|Target
credit: None.
egorisk(var_1)
Returns the Ego Risk Level Enum in the form of an int. Returns -1 if invalid.
Check Lethe Enums.
- Arguments:
var_1:Self|Target
credit: Divorce.
getattackamount(var_1) amountattacks
returns how many skills are attacking the specified unit
- Arguments:
var_1; See Single-Target
iscoinbroken() coinisbroken
if the coin this script is on is broken return 1, otherwise return 0
credit: Divorce.
getskillskillslot(var_1) skillslotcount
Returns the index of the Skill Slot of this Skill (Leftmost = 0).
- Arguments:
var_1: Self | Target
credit: None.
getskillslotcount(var_1,opt_2) skillslotcount
Returns the number of slots of the target
- Arguments:
var_1: See Single-Targetopt_2:perm(can be optionally added to count permanent skill slots only)
credit: Divorce.
isfocused()
Returns 1 if the battle is a Focused Encounter, 0 if it is a Regular Encounter
credit: Divorce.
getdmgtaken(var_1,var_2)
Returns the amount of damage taken by the target
- Arguments:
var_1: See Single-Targetvar_2 option:prev(Returns the amount of damage taken last turn)var_2 option:current(Returns the amount of damage taken this turn)
credit: Divorce.
getbuffcount(var_1,var_2)
Returns the amount of buffs on the target (e.g if the target has Bleed and Rupture on them, return 2), specify either negative or positive.
- Arguments:
var_1: See Single-Targetvar_2 option:neg(Returns the amount of positive buffs on self)var_2 option:pos(Returns the amount of negative buffs on self)
credit: Divorce.
getunitcount(var_1) unitcount
Returns the amount of units based off Target, (Example: getunitcount(NoParts99) would return the amount of enemies alive.)
- Arguments:
var_1: See Multi-Target
credit: Divorce.
getbreakcount(var_1) breakcount
Returns the amount of stagger bars on the target
- Arguments:
var_1: See Single-Target
credit: Divorce.
getbreakvalue(var_1) breakvalue
Returns the point of the target's stagger bar
- Arguments:
var_1: See Single-Targetvar_2: Stagger index (eg: 0 = first stagger bar)
credit: Froggo.
gettime(var_1,opt_2) gettime
IM GOING TO KILL MYSELF WHY DOES THIS EXIST
Returns the time according to the parameter.
- Arguments:
var_1 option:dayofweek(Returns 0-6, starting from sunday at 0 and saturday at 6, depending on what day of the week it is)var_1 option:dayofmonth(Returns 1-31, depending on what day of the month it is)var_1 option:dayofyear(Returns 1-366, depending on what day of the year it is)var_1 option:hours(Returns 0-23, depending on what hour of the day it is)var_1 option:minutes(Returns 0-59, depending on what minute of the hour it is)var_1 option:seconds(Return 0-59, depending on what second of the minute it is)var_1 option:milliseconds(Returns 0-999, depending on what millisecond of the second it is, if you use this unironically i hope you die.)var_1 option:ticks(Returns ??-??, what the fuck is a limbus company tick why would you ever use this just why please god answer my pleas)var_1 option:month(Returns 1-12, depending on what month of the year it is)var_1 option:year(Returns 1-9999, depending on what year it is right now)var_1 option:isleapyear(If the year inputted viaopt_2is a leap year, returns 1, otherwise returns 0)opt_2:VALUE_X| any integer (the year, needed for isleapyear)
credit: Divorce.
getstat(var_1,var_2)
Returns certain stats of the specified unit based on the parameters
- Arguments:
var_1: See Single-Targetvar_2 option:deployment(Returns the deployment order of the selected unit)var_2 option:deadAllyCount(Returns the number of dead allies this unit has)var_2 option:res????(Returns the resistance of the unit in the hundreds example if the unit had 1.5x on a resistance it would return 150, input the name of the atk or sin resistances. EG: resSLASH, resCRIMSON)var_2 option:panicType(Returns the panic type id of the selected unit)var_2 option:isRetreated(returns 1 if the unit is retreated)var_2 option:speedMin|speedMax|speedMinOG|speedMaxOG(Checks speed ranges, both current and original)var_2 option:hasMp(Returns 1 if the unit has SP. returns 0 if not)var_2 option:deflevel(Returns Defense Level of the unit)
credit: Divorce.
iscoinrerolled coinrerolled
Returns 1 if a coin has been rerolled; otherwise, returns 0
credit: Divorce.
stageextraslot()
Gets the stage extra slot
credit: Jere(?).
getbloodfeast(var_1)
Returns bloodfeast based on the variable given
- Arguments:
var_1 option:available(Returns currently available bloodfeast)var_1 option:spent(Returns shared consumed bloodfeast)
credit: Divorce.
stagebuf(var_1,var_2)
Changes your available stage buf (Do Not use with Bloodfeast specifically)
- Arguments:
var_1: Buff keyword (e.g.,Enhancement,Agility)var_2:stack(Only stack is available for now. Futureproofed in case PM wants to do turn too)
credit: Shane.
getlevel(var_1)
Returns the unit's level
- Arguments:
var_1: See Single-Target
credit: Shane.
isunbreakable(var_1)
Returns if a Coin is unbreakable (Only usable with timing's that use Coins)
- Arguments:
var_1: Self | Target (1 if unbreakable, 0 if not)
credit: Shane.
isusableinduel(var_1)
Returns if a Coin is usable in a duel (Only usable with timing's that use Coins)
- Arguments:
var_1: Self | Target (1 if uncracked, 0 if cracked)
credit: Divorce.
issameunit(var_1, var_2) sameunit
Returns 1 if the 2 inputs result in the same unit, otherwise returns 0. Returns -1 if any of the entries are null.
- Arguments:
var_1: See Single-Targetvar_2: See Single-Target
credit: Divorce.
isbackupenabled(var_1)
Returns 0 if null or backup disabled. Returns 1 if enabled.
- Arguments:
var_1: Ally | Enemy
credit: Divorce.
countbackup(var_1, var_2)
Counts the amount of un-initialized Backup units in a team.
- Arguments:
var_1: Ally | Enemyvar_2: normal | current (Just use "normal", it'll work fine. We don't know what "current" does.)
credit: None.
isduel
Returns 1 if the Skill has a Clash Opponent, 0 if not (useful for One Sided Attack).
credit: Divorce.
getskillcanduel(var_1) skillcanduel
Returns 1 if the Skill can Duel, 0 if not.
- Arguments:
var_1: See Single-Target
credit: Divorce.
getskillteamkill(var_1) skillteamkill
Returns 1 if the Skill can kill allies, 0 if not.
- Arguments:
var_1: See Single-Target
credit: Divorce.
getskillfixedtarget(var_1) skillfixedtarget
Returns 1 if the Skill has a fixed target, 0 if not.
- Arguments:
var_1: See Single-Target
credit: Divorce.
gethpdmg
Returns the amount of damage that this unit has taken
credit: None.
getcoinoperator(var_1,var_2) coinoperator
Returns an integer to represent the Coin's operator.
1 is ADD
2 is SUB
3 is MUL
- Arguments:
var_1: Self | Targetvar_2: Coin Index | 0 is the first Coin
credit: Divorce.
getbufftype(var_1) bufftype
Returns an integer to represent the Buff's type.
0 is Neutral
1 is Positive
2 is Negative
- Arguments:
var_1: Keyword | (E.X: Combustion, Protection)
credit: None.
getatkres(var_1,var_2)
Returns an integer that represents the resistance value. (Does not work on Abnormalities.)
x0.75 -> 75
- Arguments:
var_1: See Single-Targetvar_2Atk Type:SLASH|PENETRATE|HIT
credit: None.
getsinres(var_1,var_2)
Returns an integer that represents the resistance value. (Does not work on Abnormalities.)
x0.01 -> 1
- Arguments:
var_1: See Single-Targetvar_2: Sin Affinity:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLET
credit: None.
isbaseskill(var_1,var_2,var_3)
Returns 1 if skill is a base skill in the given unit.
- Arguments:
var_1:This| See Single-Target (UseThisto access the BattleUnitModel in this ModularScript.)var_2:This| IntOrValue (SkillID. UseThisto access the SkillModel in this ModularScript.)var_3: (Check Mode)CheckSkillList: Tries to find the SkillID in this unit's .GetSkillList()IsDefaultSkill: Only accepts "This" Skill. Checks if the SkillModel is a Default Skill on the unit.
credit: None.
diduseskilllastturn(var_1)
Returns:
-1 if the unit doesn't exist
0 if no skills were used last turn.
1 if the unit used at least one skill last turn.
- Arguments:
var_1: See Single-Target
credit: None.
hasuseddefense(var_1) useddefaction
Returns 1 if the unit used a defense action this turn, otherwise, returns 0
- Arguments:
var_1: See Single-Target
credit: Divorce.
getunitfaction(var_1) unitfaction
Returns an integer representing the unit's faction.
Returns 1 for the Sinners/Assistants
Returns 0 for any enemy
- Arguments:
var_1: See Single-Target
credit: Divorce.
getchainstatus(var_1) chainstatus
Returns an integer representing the status of the chain of Skills on the Dashboard.
Returns 0 if Skills cannot be found
Returns 1 if only attack and counter Skills are chained
Returns 2 if only guard and evade Skills are chained
Returns 3 if any mix of attack and defense Skills are chained
- Arguments:
var_1: See Single-Target
credit: Divorce.
getsinsindashboard(var_1, var_2, opt_3)
Returns an integer representing the amount of sins in the Dashboard
-
Arguments:
var_1 option: Sin Affinity:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLET
(If you put in a sin, it returns how much of it there is in the dashboard)var_1 option:HIGHEST|LOWEST
(If you put inHIGHEST, it returns the sin with the most of it in dashboard, if you put inLOWEST, it returns the sin with the least of it in the dashboard, starting with wrath at 0, similar to getskillattribute)var_2: Dashboard Layer to count from:TOP|BOTTOM|BOTH|NEITHERopt_3: Include Prediction Layer?1|0(off by default)
note: If usingHIGHEST/LOWESTand there are 2 or more sins that are tied, it will always pick the sin with the lower enum value (wrath takes priority because its "0" and so on)
credit: Divorce.
getchainatktype(var_1, var_2, opt_1)
Returns an integer representing the amount of an attack type on the Dashboard
- Arguments:
var_1:AllyorEnemyvar_2:Attack Type|PENETRATE,SLASH, orHITopt_1:Abs| Return the Absolute Resonance value instead of the total value
credit: Shane.
getskillamountondash
Returns an integer representing the amount of total Skill Slots on the Dashboard (sinners only)
OnGainBuff exclusive acquirers
credit: None.
gbsource
Returns an integer representing the source of the buff
Check Lethe Enums.
credit: None.
gbstack
Returns an integer representing the amount of the buff gained
credit: None.
gbturn
Returns an integer representing the amount of the Count gained
credit: None.
gbactiveround
Returns an integer representing the ActiveRound of the buff
ChangeTakeDamage exclusive acquirers
credit: None.
ctdsource
Returns an integer representing the source of the damage
Returns 0 for combat
Returns 1 for a buff
Returns 2 for a passive
Returns 3 for a skill
Returns 4 for an event
Returns 5 for an E.G.O. gift
Returns 6 for a stage
Returns 7 for system
Returns 8 for a system ability
Returns 9 for forced
Returns 10 for none
Consequence Functions
These functions define the effects that occur based on conditions or values.
credit: Divorce.
log(var_1, opt_2)
Prints a line in the Bepinex Log with the provided VALUE
- Arguments:
var_1: Any string (spaces will be automatically deleted; try not to use special characters)opt_2:VALUE_#| any integer
credit: Divorce.
bonusdmg(var_1, var_2, var_3, var_4)
Deals bonus damage.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integervar_3:-1(true damage) |0(slash) |1(pierce) |2(blunt)var_4:-1(true damage) |0~6(sin types)
note: here's a list of the numbers corresponding to every sin type:
- Wrath: 0
- Lust: 1
- Sloth: 2
- Gluttony: 3
- Gloom: 4
- Pride: 5
- Envy: 6
- White: 7
- Black: 8
credit: Divorce.
bonusdmgbybuff(var_1, var_2, var_3, var_4)
Deals bonus damage through buffs.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integervar_3:-1(true damage) |0(slash) |1(pierce) |2(blunt)var_4:-1(true damage) |0~6(sin types)var_5: Determines the mode. Variables may change depending on the mode chosen.
- Mode:
Magic(No specific source, may have some uses)var_6: See Single-Target (ATTACKER UNIT, can be "Null")var_7: DAMAGE_SOURCE_TYPE (If Attacker is Null and Source is SKILL, the victims will not become staggered by damage.)var_8:NullAction|UseAction(Determines whether you want to force the use of Actions and Coins, if present. For example, with OnSucceedAttack TIMINGs.)var_9: Buff Keyword. Defaults toEnhancementif invalid.
- Mode:
BuffGiveDmg(Requires idx=0 Valid BuffAbility)var_3: Invalidated. Does not accept Attack Type, only Sin Type.var_6: DAMAGE_SOURCE_TYPE (If Attacker is Null and Source is SKILL, the victims will not become staggered by damage.)
- Mode:
BuffTakeDmg(Requires idx=0 Valid BuffAbility)var_1: Invalidated. Forced targeting on Buff Owner.var_6: See Single-Target (ATTACKER UNIT, can be "Null")var_7: DAMAGE_SOURCE_TYPE (If Attacker is Null and Source is SKILL, the victims will not become staggered by damage.)var_8:NotByStack|ByStack(Unclear what this does. Use NotByStack if you're unsure. Tests pending.)
credit: Divorce.
bufactivate(var_1, var_2, var_3, opt_4, opt_5, opt_6)
Activates a buf. This is unreliable because the buf needs to have an internal, hard-coded method for this to work. The main debufs work, for example. By default: Burn, Bleed, Sinking, Rupture.
This does NOT reduce Count. You have to reduce it yourself if you want it.
- Arguments:
var_1: See Multi-Targetvar_2: See Single-Target (ATTACKER UNIT, can be "Null")var_3: Buf Keyword.opt_4:VALUE_#| int (Activation Times. Default = 1)opt_5:-1(true damage) |0~6(sin types) (Default = -1)opt_6:VALUE_#| int (Overwrite amount of damage, instead of using the buf Stack. Default = 0)
credit: Divorce.
healsp(var_1, var_2, opt_3) mpdmg
Will either apply SP healing or SP Damage
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (If the number is positive, it will heal SP. If it's a negative value, it will apply SP damage)opt_3: See Single-Target (SOURCE UNIT for SP damage)
credit: Divorce.
buff(var_1, var_2, var_3, var_4, var_5, opt_6) buf
Inflicts buffs by keyword, potency, and count. Negative values consume the buff.
- Arguments:
var_1: See Multi-Targetvar_2: Buff keyword (e.g.,Enhancement,Agility)var_3:VALUE_#| any integer (potency/stack)var_4:VALUE_#| any integer (turn/count)var_5:VALUE_#| any integer (active round, 0 is this turn, 1 is next turn, etc)opt_6:use(Adding it and setting it to "use" will attempt to "consume" the buff instead of removing it. Mostly used for the 7 main buffs and things like Gegagorr's Fuel.)
buf2(var_1, var_2, var_3, var_4, var_5, var_6, var_7, opt_8~X)
Version 2 of buf inflictor. More advanced and complex.
Arguments:
var_1: See Multi-Targetvar_2: See Single-Target (Giver of the buf or source in general. Can be "NULL")var_3: Code-wise applier of buf. Use this accordingly. Options:coin|skill|buf|passive|unit("unit" is default)
var_4: Buff keyword (e.g.,Enhancement,Agility)var_5: stackvar_6: turnvar_7: activeRound (Can be chained with + signs. For example: "0+1+2")opt_8~X: Chain other misc options with commas from here on. Misc options:use: Tries to spend the buf.nullaction: Forcibly sets the actionmodel to null for infliction.oppoaction: Uses "opponent action" for infliction.
credit: Divorce.
shield(var_1,var_2,opt_3)
Applies Shield.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Add a % to the end to use the percentage of max HP of the target. Example: "20%", "VALUE_0%")opt_3:perm(Adding this optional variable makes the shield not decay after the round ends)
credit: Divorce.
healhp(var_1, var_2, opt_3)
Heals HP to the Targets by the specified value, putting in a negative Value makes it take away HP similar to Bleed (True Damage that doesn't cause staggers)
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Add a % to the end to heal by percentage of max HP of the target. Example: "20%", "VALUE_0%")opt_3:+core(Add this to also heal target's Core. Has internal checks, you don't have to worry about misfiring heal targets.)
credit: Divorce.
burst(var_1, var_2) explosion
Tremor Burst.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (The amount of times it triggers Tremor Burst)
credit: Divorce.
breakdmg(var_1, var_2, opt_3)
Raises or Lowers the first stagger bar.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Positive values deal stagger damage, negative values "heal" stagger)opt_3:VALUE_#| any integer (The amount of times it triggers)
credit: Divorce.
break(var_1, opt_2)
Staggers the target immediately
- Arguments:
var_1: See Multi-Targetopt_2:natural|force|both(Type of Stagger)
credit: Divorce.
breakrecover(var_1,opt_2)
Recovers the target from Stagger
- Arguments:
var_1: See Multi-Targetopt_2:force(Add this second variable to also recover from Forced Stagger)
credit: Divorce.
partdestroy(var_1,var_2)
Destroys or regenerates a Part.
- Arguments:
var_1: See Multi-Targetvar_2:destroy|undestroy|regenerate
credit: Divorce.
breakaddbar(var_1, var_2)
Adds a Stagger Threshold to the target. Setting it above the target's Max HP causes a stagger on the next hit.
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Exact HP Value to add the threshold. Add '%' to have it scale with max HP. Example: '25%')
credit: Divorce.
scale(var_1,opt_2)
Gains coin power (similar to vanilla for negative coins).
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts coin power)var_1:ADD|SUB|MUL(Changes the operatorType of the coins)opt_2: any integer (Sets the index of the coin to be affected. WIP, tests are in order. 0 means first coin, 4 means fifth coin) (NOT usable in EXPECTED scripts)
credit: Divorce.
base(var_1)
ADDER. Gains base skill power.
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts power)
credit: Divorce.
final(var_1)
ADDER. Gains final power.
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts power)
credit: Divorce.
clash(var_1)
ADDER. Gains clash power.
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts power)
credit: Divorce.
dmgadd(var_1)
ADDER. Gains +Damage (this functions as if you are adding Final Power to a Skill Before Attack for the purposes of damage calculation
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts)
credit: Divorce.
dmgmult(var_1)
ADDER. Gains +Damage%.
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts)
credit: None.
headschance(var_1)
ADDER. Gains +value Heads Chance.
- Arguments:
var_1:VALUE_#| any integer (Adds or subtracts)
credit: Divorce.
pattern(var_1)
Sets the pattern index to the user (WIP).
- Arguments:
var_1:VALUE_#| any integer (Pattern index)
credit: Divorce.
setdata(var_1,var_2,var_3)
Sets encounter-persistent data to the target.
- Arguments:
var_1: See Multi-Target (Can also be "Encounter" for global stage data)var_2:VALUE_#| any integer (The Data ID. Make this unique so it does not conflict with other mods, e.g: Skill ID + 10 or similar)var_3:VALUE_#| any integer (The value to be set)
credit: Divorce.
changeskill(var_1)
Changes the skill mid-combat to another skill in this unit's arsenal.
- Arguments:
var_1:VALUE_#| any integer (The Skill ID)
credit: None.
recalctargets(var_1,opt_2)
Recalculate Sub-Targeting
- Arguments:
var_1: Mode selection:Normal: Rechecks Sub-Targets as if Attack Weight has changed.BegoneSubTargets: Destroys Targeting for SubTargets.Remove: Removes all units inopt_2from SubTarget List.Add: Adds all units inopt_2from SubTarget List.
opt_2: See Multi-Target
credit: Divorce.
shine(var_1)
Enables or Disables Skill Shine like Ring Rodya's Defense Skill. Most often used with EXPECTED scripts.
- Arguments:
var_1:true|false
credit: Shane (colonized from MT though).
dashboardeffect(var_1,var_2,var_3,var_4,opt_1)
Adds a VFX to the specified Skill Slot on the Dashboard. Most often used with EXPECTED scripts.
- Arguments:
var_1: See Multi-Targetvar_2: Slot Number | (0 for first slot, 1 for second slot, etc.)var_3: Active? |TrueorFalsevar_4: VFX Name | See the list of names below this consequenceopt_1: Top or Bottom Skill Slot? |toporbottom, defaults tobottom
List of VFX eligible for dashboardeffect:
- Names:
- OVERCLOCK_STABLE: Corrosion stable effect (CAN'T BE APPLIED TO TOP SLOT)
- OVERCLOCK_UNSTABLE: Corrosion unstable effect (CAN'T BE APPLIED TO TOP SLOT)
- BINAH_EGO: Superbia EGO effect (CAN'T BE APPLIED TO TOP SLOT)
- INDEX_FINGER: Mark of the Prescript effect
- RING_FAVUISM_TEST: Ring fauvist effect (ring rodya critique shiny effect thing)
credit: Shane.
setslotalarm(var_1,var_2,var_3,var_4)
Adds an effect to a unit's UI Skill Slot (the Skill Slot that hovers over the unit in the actual combat area)
- Arguments:
var_1: See Multi-Targetvar_2: Active? |activeordeactivevar_3: Slot Number | (0 for first slot, 1 for second slot, etc)var_4: Alarm Name | See the list of names below this consequence
List of VFX eligible for setslotalarm:
- Names:
- SPEED | Untested
- INDEX_FINGER_TARGET | The blue flower that appears on index targets
- INDEX_FINGER | Untested
- AGGRO | Presumably the current Aggro adder
- CONCENTRATEDATTACK | A mini blue crosshair (from Cinq Meur)
- LOW_AGGRO | Aggro variant
- PINKY_FINGER_GLITCH | Same as Shiomi Yoru (presumably)
- YESDRAGON_SELF_REFRACTION | Yinglong's slot effect
credit: Divorce.
refreshallslotvisual()
Visually updates the skill icons on the screen, in case they've changed after Round Start.
credit: Divorce.
refreshsinresourcevisual()
Visually updates the Sin Resource Stock.
credit: Divorce.
reusecoin(var_1,var_1...)
Reuses any number of coins
- Arguments:
var_1:VALUE_#| any integer (The index of the coin to be reused. You can input as many indexes as you need. -1 for coin scripts to target themselves)
credit: Divorce.
aggro(var_1, var_2, opt_3, opt_4)
Adds Aggro to one or all slots
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Aggro amount)opt_3:this|next(default: 'next') (Same turn or next turn Aggro)opt_4:VALUE_#| any integer (slot application)
Slot application:
-2 = Used slot. If no skill is involved, or if used on someone other than Self, defaults to slot 0.
-1 = All slots (spreads equally from left to right)
0 or higher = slot index, 0 being the leftmost
credit: Divorce.
skillreuse(var_1)
Reuses currently used skill against all targets given.
- Arguments:
var_1: See Multi-Target
credit: Divorce.
skillsend(var_1, var_2, var_3, opt_4,opt_5)
Sends an attack from a unit to another. The selected skill must exist in the attacker's arsenal.
NOTE: If you want your Guards and Evades to queue for the first attack received on Combat Start, set var_2 to Self
- Arguments:
var_1: See Single-Target (ATTACKER)var_2: See Multi-Target (VICTIM)- The victim targets can be chained by using "+" up to the Skill's max atk weight. For example:
skillsend(Self,Target+RandomEnemyNoCores99,S1). It is recommended to add "RandomEnemyNoCores99" and other similar clauses to the end as a fallback, in case the main targets do not exist.
- The victim targets can be chained by using "+" up to the Skill's max atk weight. For example:
var_3: Any Skill ID | S# | D# (# being the tier or index of the Skill on the attacker's arsenal. Example: S2, D1)opt_4: atk | def (Default: atk. If your skill isn't activating for some reason, try adding "def". Guards and Evades need this.)opt_5: first | late (If used on Combat Start, it'll determine order for your own unit's skills. If used during combat, it'll activate either first or as late as possible.)
credit: Divorce(?).
tagforsort(var_1)
Only usable on Combat Start.
Only usable on Modular that has access to a Skill Action.
Works exactly like the "ranged" and "late" scripts for Action Sorting, tagging the selected action for sorting.
- Arguments:
var_1: ranged | late
credit: Divorce.
skillslotreplace(var_1,var_2,var_3)
Replaces all skills in the designated Skill Slot index.
Will log an error if index is invalid. Will log an error if Self is invalid (no targeting argument is allowed)
- Arguments:
var_1:All|VALUE_#| any integer (Slot Index, starts at 0. 'All' affects all slots instead)var_2:VALUE_#| any integer (Skill ID that will be lost) | 'All' affects every skill instead.var_3:VALUE_#| any integer (Skill ID that will be given)
credit: Divorce(?).
insertskill(var_1,var_2,opt_3)
Creates and inserts a Skills in the designated place, replacing whatever is there.
- Arguments:
var_1: SkillIDvar_2:top|bottom(top or bottom slot in Skill Slot)opt_3: Slot Index (Leftmost = 0. Do not include this variable if you want it to use the same Skill Slot a Skill is in, in case of TIMINGs that trigger with a valid Skill instance.)
credit: Divorce.
setslotadder(var_1,var_2,opt_3)
Sets maxActionSlotNum to the value given (Abno only)
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| any integer (Amount of Slots)opt_3:add| put this third argument in if you want it to add or substract instead of setting
credit: Divorce.
resource(var_1,var_2,opt_3)
Gives or Removes Sin Resource from a team.
- Arguments:
var_1:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLET
ORvar_1:int(Value from 0~6)
ORvar_1: See var_1 in resourcegetenumvar_2:VALUE_#| any integer (Amount of resource generated. Can be negative to remove resource)opt_3:Enemy(Add this optional argument to affect the enemy team)
credit: Divorce.
discard(var_1,var_2)
discards skills based on parameters
- Arguments:
var_1:DESCENDING(Highest skill available) |ASCENDING(Lowest skill available) |RANDOM(A random skill)var_2:VALUE_#| any integer (Amount of skills to be discarded)
credit: Divorce.
passiveadd(var_1,var_2, var_3)
adds a passive into the selected units
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| Passive idvar_3:nodupeoryesdupe| Default = 'yesdupe'. If "nodupe", does not add duplicate passives if the unit already has the passive.
credit: Divorce.
passiveremove(var_1,var_2)
removes a passive From the selected Units
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| Passive id
credit: Divorce.
endstage
ends the stage instantly
credit: Divorce.
endbattle
ends that turn's battle, skips to next turn
credit: Divorce.
skillcanduel(var_1)
Sets the "canDuel" Variable on the skill to true/false, best used with RoundStart Timing on a skill
- Arguments:
var_1:True|False
credit: Divorce.
passivereveal(var_1,var_2)
Reveals the passive of the target
- Arguments:
var_1: See Multi-Targetvar_2: Passive ID | VALUE_X |all
credit: Divorce.
skillreveal(var_1,var_2)
Reveals the skill of the target
- Arguments:
var_1: See Multi-Targetvar_2: Skill ID | VALUE_X |all
credit: Divorce(?).
resistreveal(var_1,var_2)
Reveals the resistances of the target
- Arguments:
var_1: See Multi-Targetvar_2: Body Part ID | VALUE_Xvar_3: res (CRIMSON,HIT, etc)var_4:type|attribute(put in type if var_3 was an attack type, put in attribute if var_3 was a sin)
credit: Divorce.
appearance(var_1,var_2)
Changes the appearance of the target
- Arguments:
var_1: See Multi-Targetvar_2: appearance ID
Notes: Due to the way visuals are handled in game, this will always activate at combat start but only if the conditions are met, since the game calculates everything at combat start, e.g: if you made it that on lose duel, the appearance changes, if the game predicted a clash will be lost, it will change appearance at combat start, otherwise it won't
credit: Divorce.
coincancel(var_1,var_1...)
Cancels any number of coins (similar to when you try to use a coin that needs ammo without ammo)
- Arguments:
var_1:VALUE_#| any integer (The index of the coin to be Cancelled on X. You can input as many indexes as you need.)
credit: Divorce.
skillslotgive(var_1)
Adds a skill slot to the unit (Works on Sinners only)
- Arguments:
var_1: See Multi-Target
credit: Shane.
skillslotremove(var_1,var_2)
Removes a skill slot from a unit (Works on Sinners only?)
Note: This does not remove the slot from the UI, however, the game forces it to be untargetable and it is unusable.
- Arguments:
var_1: See Multi-Targetvar_2Slot Index | (Starts from 0)
credit: Divorce.
summonassistant(var_1,var_2,var_3)
Summons an Assistant Next turn after activation (Don't use with RoundStart timing as it breaks the game, you can use EndBattle to Achieve the same effect)
- Arguments:
var_1: Assistant ID | VALUE_X (Determines the Assistant to be Summoned)var_2: Assistant Level | VALUE_X (Determines the Level of the Assistant Summoned)var_3: Assistant Uptie | VALUE_X (Determines the Uptie of the Assistant, Assistants dont use Uptie unless you make them use it, so just default it to 1)
credit: Divorce.
summonenemy(var_1,var_2,var_3,var_4,opt_5)
Summons an Enemy or Abnormality Next turn after activation (Don't use with RoundStart timing as it breaks the game, you can use EndBattle to Achieve the same effect)
- Arguments:
var_1: Enemy ID | VALUE_X (Determines the Enemy to be Summoned)var_2: Enemy Level | VALUE_X (Determines the Level of the Enemy Summoned)var_3: Enemy Uptie | VALUE_X (Determines the Uptie of the Enemy, Enemies dont use Uptie, so just default it to 1)var_4: Wave Index | VALUE_X (Determines the Wave the Enemy is summoned in)opt_5: enemy (Adding this Optional Parameter in Makes it specifically spawn regular encounter enemies, otherwise spawns Abnos)
credit: Divorce.
summonunitfromqueue()
Summons the units from the subunitList
credit: Divorce.
gnome(var_1)
gnome.
- Arguments:
var_1: Multi-Target
credit: Divorce.
vibrationswitch(var_1,var_2,opt_3)
Tremor Conversion
- Arguments:
var_1: See Multi-Targetvar_2: Buff keyword (e.g.,Enhancement,Agility)opt_3:superpos(Add this optional argument for superposition)
credit: Divorce.
setimmortal(var_1)
Used with OnImmortal and OnOtherImmortal TIMINGs.
If used with var_1 as 1, the unit about to be killed will remain alive and its HP will be set to 1.
- Arguments:
var_1:1|0
credit: None.
changemap(var_1,var_2)
Changes the Map/Background
- Arguments:
var_1: Map Namevar_2:VALUE_#| any integer (Map Size)
credit: Nylon.
battledialogline(var_1,var_2)
Makes a unit show a dialog bubble.
- Arguments:
var_1: See Multi-Targetvar_2: String (Dialog to be displayed. Use "_" instead of spaces.)
Note: By using the target exclusive to this functionupperyou can make it set text to appear on the top of the screen (like in the unique cutscenes of the canto 7 or 8 where the lyrics are displayed on top of the screen like in the superbia quick time event)Example:Modular/TIMING:RoundStart/battledialogline(Self,Yes_hello_<sprite_name=\"Combustion\">)
credit: Divorce(?) & Nylon(?).
effectlabel(var_1, var_2, var_3, var_4)
This makes a VFX of choice appear around your target
- Arguments:
var_1: See Multi-Targetvar_2: String | (VFX to be played)var_3: 'VALUE_#' | active or not, int, Inactive if 0, Active if 1.var_4: String | effect layer type, one of: NONE, DIRECTION, ONCE, BACK, SKIN, MASKINGopt_5: isSetOverrideDie | Untested what this does, set tofalseby defaultopt_6: isCenter | Untested what this does, most likely centers the VFX,falseis the defaultopt_7: scale | Untested, most likely scales the VFX size | E.X: 100 - > 1.0 (Scaling is in decimals)opt_8: isAddScript | Untested,falseby default
credit: Nylon & Shane.
sanchoshield(var_1, var_2)
This creates a swirling blood shield appear around your target (Note: only works for 8380_SanchoAppearance, 1079_Sancho_BerserkAppearance, might not work for 10310_Donquixote_DarkSanchoAppearance)
- Arguments:
var_1: See Multi-Targetvar_2: 0 - 1 | Inactive if 0, Active if 1.
credit: None.
retreat(var_1, var_2)
Queues a unit for retreating. All retreats happens at the end of the turn.
- Arguments:
var_1: See Multi-Targetvar_2: Buff Keyword (What appears on the unit when they retreat, like Overwatch Assignment on FullStop Heathcliff)
credit: Shane and Nylon.
sound(var_1, var_2)
Play a given SFX, BGM, Voice line, or Announcer line.
- Arguments:
var_1: bgm | sfx | voice | announceropt_2: GUID of the BGM/SFX/Voice line (I.e {8d76b7dd-1de4-463e-946f-b02a75cad4aa} or 7SV-062 for voice lines)opt_3: Announcer ID, voice line to be played (I.e 20, announcer_round_takebigdmg_20_1)
credit: Divorce.
deluge(var_1, var_2) surge
Triggers a Sinking Deluge
- Arguments:
var_1: See Multi-Targetvar_2:VALUE_#| Amount
credit: Jere.
addability(var_1, var_2, var_3, var_4, var_5)
Adds a unique system ability
- Arguments:
var_1: See Multi-Targetvar_2: See The List of System Abilitiesvar_3:VALUE_#| Stackvar_4:VALUE_#| Turnvar_5:VALUE_#| activeRound
EXAMPLE: addability(Self,MaxSpeedAdder,2,3,1) -> Unit gains +2 max speed for 3 turns next turn
credit: Jere.
removeability(var_1, var_2)
Removes a unique system ability
- Arguments:
var_1: See Multi-Targetvar_2: See The List of System Abilities
credit: Nylon.
lyrics(var_1, var_2)
Displays lyrics, like how Mili songs do for the final canto bosses.
- Arguments:
var_1: Hex code colour for the text to display (currently doesn't work, instead, put "reserved")var_2: Text to be shown
credit: Nylon.
uppertext(var_1,var_2)
Displays text at the top of the screen.
- Arguments:
var_1: Hex code colour for the text to displayvar_2: Text to be shown
credit: Divorce.
makeunbreakable(var_1,var_1...)
Makes a regular coin unbreakable
- Arguments:
var_1:VALUE_#/all| any integer (Index of the coin you want to make unbreakable. Index starts at 0, use -1 if this script is inside of a coin and you want to target that same coin.) / targets all coins within a skill
credit: Divorce.
stageextraslot(var_1,opt_2)
Sets the stage extra slot to a specific value
- Arguments:
var_1:VALUE_#| Intopt_2:add(Optional "add" argument to add slot capacity instead of setting it)
credit: Divorce.
stagebuf(var_1,var_2,...)
Changes your available Bloodfeast by either adding, removing, or spending it
- Arguments:
var_1: Buff keyword (e.g.,Enhancement,Agility)var_2: Activation Mode- Mode:
init(Initialize Stage Buf)var_3: See Single-Target (Link Buf to Unit)
- Mode:
add(more buf pls)var_3:stack|turnvar_4: ValueOrInt (Can be negative to substract)
- Mode:
spend(Initialize Stage Buf)var_3:stack|turnvar_4: ValueOrInt (Amount to spend)var_5: See Single-Target (Spender)
- Mode:
credit: Shane.
critchance(var_1)
Adds a chance to deal a Critical Hit.
- Arguments:
var_1:VALUE_#| Any integer, the % chance to deal a Critical Hit (i.e 15 -> 15% chance)
credit: Divorce.
critratio(var_1)
Critical Hit Resistance Weakening adder (Does not work on Coin Modular).
- Arguments:
var_1:VALUE_#| Any integer, the decimal adder for the crit resistance reduction (i.e 25 -> +0.25 res)
credit: Nylon & Shane.
assistdefense(var_1,var_2,var_3)
Defends a unit based on the parameters. (Note: The defender Skill must have the Skill ability "SupportiveDefense", must be in the unit's defense skill list, and the unit defending must have the a buff with the ability "SupportProtect" (Mao Faust assist defense)
- Arguments:
var_1: Defender | See Multi-Targetvar_2: Defended | See Multi-Targetvar_3: Skill ID to be used by the Defender
credit: Divorce, Shane, Nylon.
ignorepanic(var_1)
Used with the IgnorePanic timing (But can be used on other timings)
If used with var_1 as 1, the affected unit's panic state will be completely disabled.
- Arguments:
var_1:1|0
credit: Divorce, Shane, Nylon.
ignorebreak(var_1)
Used with the IgnoreBreak timing (But can be used on other timings)
If used with var_1 as 1, the affected unit's Stagger state will be completely disabled.
- Arguments:
var_1:1|0
credit: Nylon.
changemotion(var_1)
Changes a Skill's "MOTION_DETAIL" based on the parameters.
Only usable in the Skill's ChangeMotion TIMING.
- Arguments:
var_1: MOTION_DETAIL (Check Lethe Enums)
credit: Divorce.
skillviewer(var_1)
Used for visual timings.
- Arguments:
var_1:isParrying: 1 if parrying, 0 if not.isLastCoin: 1 true 0 falsecoinidx: returns current coin indexcoinamount: returns successful number of coins that made it into the visual phase
credit: Nylon & Shane.
changeaffinity(var_1)
Best used with the StartBehaviour timing (But can be used on other timings?)
Changes the Sin Affinity of a Skill on usage of said Skill.
- Arguments:
var_1: Sin Affinity | (i.e AZURE, AMBER, BLACK, WHITE, etc.)
credit: None.
ovwatkres(var_1,var_2,var_3,opt_1)
Overrides an attack's resistance value.
- Arguments:
var_1: See Multi-Targetvar_2: atkType:SLASH|PENETRATE|HITvar_3: newValue: Any integer from0to200| E.X: 200 -> 2.00opt_1: add: If this opt exists, addsnewValueto the unit's resistance instead of overwriting their resistance
credit: None.
ovwsinres(var_1,var_2,var_3,opt_1)
Overrides an attack's resistance value.
- Arguments:
var_1: See Multi-Targetvar_2: sinType:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLETvar_3: newValue: Any integer from0to200| E.X: 200 -> 2.00opt_1: add: If this opt exists, addsnewValueto the unit's resistance instead of overwriting their resistance
credit: None.
refreshspeed(var_1)
Refreshes a unit's Speed. Mainly used if you use MaxSpeedAdder and MinSpeedAdder system abilities.
- Arguments:
var_1: See Multi-Target
credit: Divorce.
adddefaultskillbyid(var_1,var_2)
Adds a Skill to the Default Skillset of any unit.
- Arguments:
var_1: See Multi-Targetvar_2: Skill ID
credit: None.
addskilltopool(var_1,var_2,opt_3)
Adds a Skill to the pool of drawn Skills for the Dashboard. Must be in the Default Skillset to work.
- Arguments:
var_1: See Multi-Targetvar_2: Skill IDopt_3: Skill Amount (int, 1 by Default)
credit: Divorce.
dropskill(var_1,opt_2)
Converts the Incoming Skill on the Dashboard to the selected Skill by ID. Must be in the Default Skillset to work.
Only works on Target: Self.
- Arguments:
var_1: Skill IDopt_2: Skill Slot Index (0 by Default)
credit: None.
giveskillscript(var_1,var_2,etc)
Applies a temporary Skill Script to the selected Skill during combat. Depending on the mode chosen, the variables required after var_2 may change.
- Arguments:
var_1: Self | Targetvar_2: Mode Selection (int)
- Mode 0: Script that applies Skill Final Power.
var_3: Power (int)
- Mode 1: Script that applies Skill Clash Power.
var_3: Power (int)
- Mode 2: Applies a Modular Script chosen from the Skill this Consequence is being called from. The script must have the segment "Modular/TIMING:" removed from the json file.
var_3: Ability Index for the chosen Modular Script.
credit: Divorce.
appearancelocalscale(var_1,var_2,var_3)
Changes the xyz local scale for appearance on Self.
- Arguments:
var_1: x (int)var_2: y (int)var_3: z (int)
credit: Divorce.
appearancelocaleuler(var_1,var_2,var_3)
Changes the xyz local rotation for appearance on Self (Used for unsquishing identities by using 0,0,0).
- Arguments:
var_1: x (int)var_2: y (int)var_3: z (int)
credit: None.
updatemaxbuf(var_1)
Updates Max Stack and Turn of all bufs on given units.
- var_1: See Multi-Target
credit: None.
destroybuff(var_1,var_2,var_3,opt_1,opt_2)
Destroys a buff based on the parameters. The opt parameters are only to be used if var_2 is NOT keyword
- Arguments:
var_1: See Multi-Targetvar_2:Keyword|Buff Type|Buff Categoryvar_3: activeRound:0for same turn |1for next turn |2for this turn and next turnopt_1: amount: Any integer greater than 0 (or = 0)opt_2: includeNonDispellable: If this opt exists, include buffs that have the propertycanBeDispelled = false
credit: None.
deactivebreak(var_1, var_2, var_3, opt_1)
Deactivate a unit's Stagger Threshold based on the parameters.
- Arguments:
var_1: See Multi-Targetvar_2: Sort:true|false
- Iftrue, sort the active Stagger Thresholds in descending order.var_3: breakIndex: Index of the Stagger Threshold. Index starts at0. If set to-1, deactivates all Stagger Thresholds.opt_1: reverseIndex: If this opt exists, the active Stagger Threshold list is reversed. (E.X: Index 0 -> lowest Stagger Threshold)
credit: None.
buffcategory(var_1, var_2, var_3, var_4, var_5, var_6, var_7) bufcategory
Change different properties of different effects sharing the same category.
- Arguments:
var_1: See Multi-Targetvar_2:Buff Categoryvar_3:Stackvar_4:Countvar_5:activeRound|0,1, or2.var_6:isRespective?| If > 0, returnstrue| If true, addsstackandcountto every buff targetted by this consequence | If false, does 2 things depending on if it has count or not. If the effect does not have count, addsstack+countto the potency of the effect. If the effect does have count, randomly distribute thestackandcount.var_7:amount| The amount of buffs affected by this consequence
credit: None.
setdmgtaken(var_1)
Sets how much damage you take whenever you take damage, used in conjunction with the ChangeTakeDamage timing. Important note: This sets how much damage you take from an attack to that amount, it does not add that much. It's reccomended to combo this consequence with the getdmg acquirer
- Arguments:
var_1:VALUE_#| any integer
credit: None.
changeatktype(var_1)
Changes the Skill's attack type (E.X Slash) into the value specified in var_1. This allows for you to mimic rien's changing damage types for example.
- Arguments:
var_1: Attack Type |HIT,PENETRATE, orSLASH
credit: None.
atkweight(var_1)
adds/removes a skill's atkweight, positive numbers increase attack weight, negatives reduce. (CAN'T BE DONE MIDCOMBAT WITH TIMINGS LIKE WHENUSE)
- Arguments:
var_1:VALUE_#| Amount | Do keep in mind that if you remove too much attack weight your skill will have no targets and therefore will not work
credit: Shane.
playcustomsound(var_1, opt_1, opt_2)
Plays a custom sound from the custom_sounds folder of a mod, registered from it's Audio.json
- Arguments:
var_1:Sound Name| The name entered into thenamefield of theAudio.jsonopt_1:Volume| 1 - 100opt_2:Loop?| Consideredtrueif this argument was added | Mainly used for BGM. Recommended to register the audio with it'sstreamflag set to true.
credit: Shane.
stopcustomsound()
Stops playing all custom sound tracks.
credit: Shane.
stopsound()
Stops playing all vanilla sound tracks.
credit: Divorce.
gatesp(var_1,var_2,opt_3)
Once applied, SP can be gated to certain values. Has four different methods of use
- gatesp(target, Min, X) -> SP can't go below X (ceiling unchanged)
- gatesp(target, Max, X) -> SP can't go above X (floor unchanged)
- gatesp(target, Clear) -> remove the gate
- gatesp(target, min, max) -> set both bounds
- Arguments:
var_1: See Multi-Targetvar_2:"Min"|"Max"|"Clear"|VALUE_#or any integer | (If var_2 is set to Min or Max, opt_3 needs to be set to a number. If var 2 is set to Clear, opt_3 is unneccesary and no variable should be set. If var_2 is set to a number, var 2 becomes a number and opt_3 is required and must be set to a number)opt_3:VALUE_#or any integer
Buff Supporting Functions
- Buff Scripts Currently don't support every modular function
This is the list of timings it currently supports:
RoundStartEncounterStartWhenUseBeforeUseStartDuelWinDuelDefeatDuelWinParryingDefeatParryingStartBehaviourEndBattleOnSucceedAttackWhenHitOnDieEnemyStartBehaviourEnemyEndSkillSkillStaggerVictimOnSucceedEvadeOnDefeatEvadeCanDuelIsIgnoreDefenseIsIgnoreSupportiveDefenseOnCoinTossOnCoinAfterAttackBeforeAnyFlipOnBurstStartBattleStartBattleOnDashboardOnDiscardEndSkillEndBehaviourAfterChangeShieldAfterChangeHPOverwriteGiveBufOverwriteGainBufOverwriteChangeMPOverwriteMPDMGAfterChangeSanityChangeTakeDamageOnUseBufWhenGainedBufActivate(VALUE_9 is set to overwriteDmg, VALUE_8 to sintype -1~6)SpecialAction
Exclusive Buff Script Acquisition Functions
credit: Divorce.
stack()
Exclusive to Scripts in Buffs, returns the stack of the buff
credit: Divorce.
turn()
Exclusive to Scripts in Buffs, returns the count of the buff
Exclusive Buff Script Consequence Functions
credit: Divorce.
stack(var_1)
Exclusive to Scripts in Buffs, Adds the Specified Amount to the Stack of the buff, removes if negative
- Arguments:
var_1: Amount | VALUE_X
credit: Divorce.
turn(var_1)
Exclusive to Scripts in Buffs, Adds the Specified Amount to the Count of the buff, removes if negative
- Arguments:
var_1: Amount | VALUE_X
Condition Functions
credit: Divorce.
IF Statements
Defines conditional effects.
- Format:
/IF(condition):effect/|/IFNOT(condition):effect/
Can compare<,>, and=
credit: Divorce.
CONTINUEIF
If False, stops the execution of the rest of the script. if LOOP is involved, skip to the next iteration of the loop instead.
- Format:
/CONTINUEIF(condition)/
Can compare<,>, and=
Example
You can chain IF statements separated by commas. Additionally, the first element can specify the type of comparison.
Examples:
IF(AND,VALUE>5,VALUE<10)
IF(OR,VALUE>5,VALUE<10)
IF(XOR,VALUE>5,VALUE<10)
Embedding Acquisition
You can Embed Acquisition functions into consequence functions to directly get the number, embedded acquisitions use {} instead of () and - instead of , to distinguish them and must begin with "G"
Example: "Modular/TIMING:WhenUse/bonusdmg(Target,Ggethp{Self-normal},-1,-1)"
STAGESCRIPT ONLY
- Batch Arguments:
extraslot:#(Acts as if there are that many more free slots in battle)instantslot(Instantly fills all possible skill slots)
Example
"Modular/extraslot:4/instantslot"
This stage script makes it so up to 4 sinners gain extra slots, depending on max participant limit.
LUA SECTION
In order for a .lua file to be compatible with Modular, it must be placed into the modular_lua folder. In order for these .lua files to be loaded by a Modular script, they must be placed like so:
"Modular/TIMING:StartBattle/LUA:hello_world"
Each mod folder has their own modular_lua folder, however, no two .lua files should have the same name even if they are from different mods. It is best to prefix your .lua files with the name of your mod, and the author. (i.e wei_ShaneLitterateur)
In order to use consequence functions and accquisition functions, you'd call them the same as you normally do in Modular. The following is an example of a .lua file doing this exact same thing.
As you can see, you can use functions in .lua files, making your modular scripts 10x cleaner. The .lua files also support using normal programming language features (i.e loops, if/else statements, etc.) meaning that you can revolutionize your Modular scripts. Yipee!
There are a few unique functions specific to the .lua files.
Exclusive .lua Functions
credit: Shane & Nylon.
setldata(var_1, var_2, var_3)
Sets encounter-persistent data from the target.
- Arguments:
var_1: See Single-Targetvar_2: String (The Data ID)var_3: Any .lua value (The value to be set)
credit: Shane & Nylon.
getldata(var_1, var_2)
Gets encounter-persistent data from the target (Lua version)
- Arguments:
var_1: See Single-Targetvar_2: String (The Data ID)
credit: None.
clearvalues()
Clears the value of a Modular script
credit: None.
resetadders()
Clears the adders of a Modular script
credit: Shane & Nylon.
require("XXXX")
Loads the content of another .lua file in the modular_lua folder. (i.e require("killallzenos")). Act's like normal inheritance.
credit: Shane & Nylon.
selecttargets(var_1)
Takes a multi-target selector string and returns an table of selected targets. (i.e ["inst12", "inst34"]). Inst selectors are recognized by Modular, meaning you can pass them into consequence/value acquirers that accept target selectors.
- Arguments:
var_1: See Multi-Target
credit: Nylon.
listfiles(var_1)
Lists the files of a given directory. This function does NOT list folders. This function is restricted to the "Plugins" folder and any sub-folders. This function returns a .lua array.
- Arguments:
var_1: Path of the directory (i.e "Lethe")
credit: Nylon.
readfile(var_1)
Reads a given files contents. This function is restricted to the "Plugins" folder and any sub-folders. This function returns a .lua string.
- Arguments:
var_1: Path of the file (i.e "Lethe/modularcodesecrets.txt")
credit: Nylon.
listdirectories(var_1)
Lists the folders of the directory specified. This function does not list files, and is restricted to the Plugins folder and any sub-folders. This function returns a .lua array.
- Arguments:
var_1: Path of the directory (E.X:"Lethe")
credit: Nylon.
jsontolua(var_1)
Converts a string representing JSON's into a lua table. (Use with readfile(), listfiles(), and listdirectories())
- Arguments:
var_1: Any string
credit: None.
listbuffs(var_1)
Returns a .lua array containing all the keywords a unit has.
- Arguments:
var_1: See Single-Target
credit: Nylon.
setgdata(var_1,var_2)
Sets a global .lua value, which is only cleared upon a total game refresh.
- Arguments:
var_1: String (The data ID)var_2: luaValue: a .lua value
credit: Shane.
addresource(var_1, var_2, var_3)
Gives or Removes Sin Resource from a team.
- Arguments:
var_1:CRIMSON|SCARLET|AMBER|SHAMROCK|AZURE|INDIGO|VIOLETvar_2:VALUE_#| any integer (Amount of resource generated. Can be negative to remove resource)opt_3:Enemy(Add this optional argument to affect the enemy team)
credit: Nylon.
getgdata(var_1)
Returns a global .lua value.
- Arguments:
var_1: String (The data ID)
credit: Nylon.
clearallgdata()
Clears all currently loaded .lua global values.
Math Functions (.lua only)
Refer to this website
credit: None.
gbkeyword
Returns a string representing the buff keyword gained (Only works with OnGainBuff timing)
LUAMAIN Function
LUAMAIN is a Main Function that lets you trigger a specific LUA function in a lua file
See This Part of the Documentation
LEGACY NAMES
Function and timing names that have been changed in favor of new names
these still technically exist and are usable and are no different from the original, they merely exist still for the sake of backwards compatibility
while you can still use these versions, it's not recommended over the new names, (literally the exact same, they are 2 labels of the same function, meaning if one gets changed so does the other)
Old Timing Names
| Old name | Renamed to |
|---|---|
OnStartBehaviour |
StartBehaviour |
OnEndBehaviour |
EndBehaviour |
StartVisualSkillUse |
OnVisualUse |
StartVisualCoinToss |
OnVisualCoinToss |
Immortal |
OnImmortal |
ImmortalOther |
OnOtherImmortal |
Old Acquisition Function Names
| Old name | Renamed to |
|---|---|
hpcheck |
gethp |
mpcheck |
getsp |
bufcheck |
getbuff |
round |
getround |
wave |
getwave |
activations |
getactivations |
unitstate |
getunitstate |
instid |
getinstid |
speedcheck |
getspeed |
deadallies |
getdeadallies |
areallied |
areallies |
allcoinstate |
getallcoinstates |
resonance |
getresonance |
resource |
getresource |
skillbase |
getskillbase |
skillatkweight |
getskillatkweight |
skillatklevel |
getskillatklevel |
skillatk |
getskillatk |
skillattribute |
getskillattribute |
skilldeftype |
getskilldeftype |
skillrank |
getskillrank |
skillegotype |
getskillegotype |
skillslotcount |
getskillslotcount |
skillcanduel |
getskillcanduel |
skillteamkill |
getskillteamkill |
skillfixedtarget |
getskillfixedtarget |
onescale |
getcoinscale |
amountattacks |
getattackamount |
coinisbroken |
iscoinbroken |
unitcount |
getunitcount |
breakcount |
getbreakcount |
breakvalue |
getbreakvalue |
timeget |
gettime |
coinrerolled |
iscoinrerolled |
sameunit |
issameunit |
coinoperator |
getcoinoperator |
bufftype |
getbufftype |
useddefaction |
hasuseddefense |
unitfaction |
getunitfaction |
chainstatus |
getchainstatus |
Old Consequence Function Names
| Old name | Renamed to |
|---|---|
mpdmg |
healsp |
buf |
buff |
explosion |
burst |
surge |
deluge |
bufcategory |
buffcategory |
Old Custom Targeting Names
| Old name | Renamed to |
|---|---|
HighestMP |
HighestSP |
LowestMP |
LowestSP |