Last Updated: 2012.01.30
Download Link
Github Link
FOR ADVANCED USERS
Lunatic mode effects have always been a core part of Yanfly Engine scripts. They exist to provide more effects for those who want more power and control for their items, skills, status effects, etc., but the users must be able to add them in themselves.
This script provides the base setup for state lunatic effects. These effects will occur under certain conditions, which can include when a state is applied, erased, leaves naturally, before taking damage, after taking damage, at the start of a turn, while an action finishes, and at the end of a turn.
—
Lunatic States allow allow states to trigger various scripted functions throughout certain set periods of times or when certain conditions trigger. These effects can occur when a state is applied, when a state is erased, when a state leaves naturally, before damage is taken, after damage is taken, at the beginning of a turn, while the turn is occuring, and at the closing of a turn. These effects are separated by these eight different notetags.
<apply effect: string> - Occurs when state is applied. <erase effect: string> - Occurs when state is removed. <leave effect: string> - Occurs when state timer hits 0. <react effect: string> - Occurs before taking damage. <shock effect: string> - Occurs after taking damage. <begin effect: string> - Occurs at the start of each turn. <while effect: string> - Occurs after performing an action. <close effect: string> - Occurs at the end of a turn.
If multiple tags of the same type are used in the same skill/item’s notebox, then the effects will occur in that order. Replace “string” in the tags with the appropriate flag for the method below to search for. Note that unlike the previous versions, these are all upcase.
Should you choose to use multiple lunatic effects for a single state, you may use these notetags in place of the ones shown above.
<apply effect> string string </apply effect> <erase effect> string string </erase effect> <leave effect> string string </leave effect> <react effect> string string </react effect> <shock effect> string string </shock effect> <begin effect> string string </begin effect> <while effect> string string </while effect> <close effect> string string </close effect>
All of the string information in between those two notetags will be stored the same way as the notetags shown before those. There is no difference between using either.
—
Add-Ons
- Punishment Package
- Undead HP, Undead MP, Backfire Physical, Backfire Magical, Stat Slip Damage, Stat Slip Healing, Drain HP, Drain MP
- Protection Package
- Damage Cut, Damage Barrier, Damage Shelter, Damage Block, Heal Boost, Heal Bonus, Persist
Use your Lunatic Effects wisely!
— And that’s all, folks! —
2011.12.15 – Punishment Package Added
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/lsp-punishment/
finally it’s back :x
Pingback: YSA Battle Add-on – Party Combo Counter « Yami World
2011.12.17 – Protection Package Added
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/lsp-protection/
Is it possible to deal unhealable damage? For example, by decreasing HP as well as maximum HP at the same time by the amount of damage dealt? I mean, you can have MORE damage, you can have FAST damage and you can have CERTAIN damage with your skill, but what about UNHEALABLE damage? :)
2011.12.19 – Fixed Death State stacking error.
I have a question. There are states that are removed when the battle ends. Does the “erase” effect covers that too?
From my experiments the answer should be “No” as the effect I want doesn’t gappen after the battle ends (though it works fine if the state is removed during battle), but maybe I’m just doing something wrong…?
Well, no idea.
The “erase effect” still doesn’t work upon battle end for some reason, even though I fail to detect anything wrong with the script…
That’s because when they’re removed at the end of battle, it’s no longer considered in-battle. Lunatic State effects only occur in-battle.
Pingback: XP Battlebacks « .:: Tieris Illia ::.
Pingback: Ramiro + RMVXA = ♥
v1.02 – Compatibility Update: Ace Battle Engine
Hm… what can I use to display an animation (in a react effect, for example)?
(The line of code, I mean)
@animation_id = x
Oh, thanks.
…how could I’ve missed that D:
Haha, even experienced scripters miss the simplest of things at times. Don’t feel bad about it.
I’ve tried with:
@animation_id = 117
Neither seem to work, I put these in the note-box of the state.
But I can’t seem to make it work, what am I doing wrong?
Ack, what I meant to say was:
@animation_id = 117
and
(react effect)
@animation_id = 117
(/react effect)
and
(react effect: @animation_id = 117)
I just realized that the reply system doesn’t like the “” symbols.
Can you show me a little example , really i need .
thanks .
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/lsp-punishment/
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/lsp-protection/
yeah , yeah …
i see , mmm… (=.=”)
it’s my fault , thanks .
I’m sorry that I need to ask this and it might be a stupid question, but for some reason I don’t really understand what I need to replace “string” with. If I want to make a “death sentence”-state for example, the owner of the state should die after a set number of turns, which could be achieved by using the “”-command. The problem that I have is that even after hours of trial and error, I still don’t know what I need to write instead of “string” in that case. Is there a list of commands that I didn’t see for some reason or does the sentence “but the users must be able to add them in themselves” mean that I need to edit the script with my own commands? Maybe I’m just thinking too complicated…
I would really appreciate any kind of help, since I’m kind of desperate trying to find out what to do.
Well i want to increase a variable x while being attacked if stat is on.
thougth it would work like this :
But basicly nothing happens. what is wrong about the string? When i do “$game_variables[x] += 1” to an events comment it counts the variable correctly.
i meant “$game_variables[x] += 1” into an shock effect
sorry for doublepost
Does anyone know how to make a state deal a precise amount of elemental damage? I hate working with the health slip % and want to make it a static number.
I’m sure I can use to make a state automatically be applied when another one is removed, for example like a Doom spell that applies KO when it’s over, but I can’t figure out the syntax.
I think I’m pretty much at the level where I can use the Lunatic stuff now. =O Looking at what you can do with this, I’m just so happy to see this now.
Oh Yanfly, how I love your specific preferences for setting up scripts to make battles more unique and interesting instead of just visually appealing~ <3
Is it possible to use this script to create doom and auto-life states using a script call in the notetag? I’m no scripter by any means, but here is an example of what I was thinking.
add_new_state(state ID)
Something like this would be placed in the note box of the doom state so that after the set number of turns were up and the doom state is removed, it will then add the state associated to state ID.
remove_state(state ID)
actor_MHP = x%
Something like this could be used to make an auto-life state. The character has auto-life on, when said character dies the state is erased which triggers the specified state (which would be Death) to be removed, and the player to have x% of max HP restored.
As I said, I am definitely not a scripter, but if there is a way to do this, or some other method in existence, could you help me get on the right track? Any help would be greatly appreciated.
*Note*
I have looked into the add-ons developed by pillanious, but they do not work.
Sorry for the double post. My examples were supposed to contain the “” tags like this:
“”
add_new_state(state ID)
“”
and
“”
remove_state(state ID)
actor_MHP = x%
“”
Have you had any luck making either of these work?
Can I turn a switch on while the state is on effect and off while it’s out using apply and erase effect? What is the command, please?
Better…can I make a minimum Current HP while the state is on effect? (like an immortal effect; the standard used on VX Ace sucks, when a character reaches 0 HP it cannot perform ANY action, althought it won’t die ¬¬)
I’m having the same problem as Skywad for playing an animation for the state, have tried both
@animation_id = 7
and
could you tell me what I’m doing wrong?
apparently brackets mess everything up so correction:
I’ve tried both (apply effect: @animation_id = 7) and
(apply effect)
@animation_id = 7)
(/apply effect)
you are applying it at the wrong place
Thanks for another informative web site. Where else
could I get that type of information written in such an ideal
manner? I’ve a challenge that I’m simply now operating on, andd
I have been at the glance out for such information.
Is there any way to get a system where it’s something like that:
Mp OR Hp = 0 causes death?
Howdy! Do you use Twitter? I’d like to follow you if that would be ok.
I’m absolutely enjoying your blog and look forward to new posts.
Very soon this site will be famous amid all blog people, due to it’s fastidious articles or reviews
Thanks for your marvelous posting! I quite enjoyed reading it,
you happen to be a great author.I will be sure to bookmark your blog and definitely will come
back from now on. I want to encourage you to ultimately continue
your great posts, have a nice weekend!
Ahaa, its pleasant discussion on the topic of this
article at this place at this blog, I have read all that, so now me also commenting at this place.
What’s up, I check your blogs regularly. Your humoristic style is awesome, keep
it up!
Could one use this script to create a two-turn skill, like Jump from the Final Fantasy games or Dig and Fly from Pokemon?
Eg: use the skill Jump, which adds the Airborne state to the user, and when the user leaves the state on the next turn, they automatically attack an enemy.
Is this doable?
I’m thinking it should be possible to set up an entire party as the state origin (so for example an attacker could inflict an HP drain that heals her entire party instead of just herself) but I’m unsure how to implement it. I’m looking in
# new method: change_state_origin
and
# new method: state_origin?
and pretty certain that is where it would need to be added (plus I made up a new Party Drain effect in the Punishment Package, “when /PDRAIN HP”).
ATM it works, but still only heals the caster.
@XPhater: I have been working on something similar, the concept being this:
An actor has a shield which lets you, when attacked, have a chance at activating an ability, which would restore every party member’s HP by a small amount. I have tried with equipment that, when attacked, has a chance to cast a state on the targeted actor themself, but I can’t seem to be getting those to work. I’m using the Passive States script in conjunction with Lunatic States for this:
c=rand(101)
if c>=10
self.add_state(69)
end
I couldn’t be assed to write it all in one line, and I don’t know how Ruby’s Syntax works THAT well. Can anyone with experience tell me what I am doing wrong, with this effect? ( … The state_id there is purely coincidential. I swear. D: )
Yanfly, I don’t know if you still monitor this, but there are two major bugs in this script that you might want to be aware of:
1) On line 505 you have for state in states, then it calls the extension, which then also has a for state in states! What this does is it loops through the states n^2 times, where n is the number of states present! This causes weird effects with your other scripts, which you can see by adding two other states (pick any two) then add a state with . What will happen is it will end up blocking 75 damage, as the damage block state is applied n times due to the double loop! You might want to fix it by deleting the for at line 505 and line 508
2) Where is the eval line in this script? I find no eval line, so any time I try to add a custom condition it does nothing. If you examine the code, what happens is all it does is calls the lunatic condition, which dumps it to the extension, which then does nothing! I managed to fix this by adding an eval line to all of the common conditions (with a rescue “” line for those non-lunatic states).
As it is, this script by itself does not work due to bug #2, and only the add-ons work at all.
Thank you so much, that was so helpful!
Pingback: Thorn Aura – ADDON | Alistair Engine
Pingback: Lose MP – ADDON | Alistair Engine
Pingback: Transfer Damage to Hero | Alistair Engine
Pingback: Recover all – ADDON | Alistair Engine
Pingback: Attacker State – ADDON | Alistair Engine
Pingback: Devotion – ADDON | Alistair Engine
Hi, I’m wondering if you could use this to make a state that vanishes after the affected target evades an attack?
I don’t know if anyone still watches this, but when I use this script all of the sudden all characters and enemies state they are unaffected by all attacks. Not sure what is up with that, but I NEED this script. ._.
Edit:
If anyone is reading this, there is a conflict somewhere in Yami’s battle damage popups and this script. Cause’s yami’s script to say that all damage is unaffected, even though damage is being applied. I am going to see what I can find between the two.
And, lastly, turns out it (and it’s addons) need to be placed before Yami’s battle pop ups.
I can’t seem to get this script to do… ANYTHING. These are to be used in the states notebox, right? It would seem obvious but… Why can’t I get it to do -anything- at all? Do I need another script to run this one? Is the github one an old version? I’ve tried multiple script calls, tried having this script at the start of my script order, at the middle, at the end… I don’t know what else to try.
Forget your shitty bands like Mayhem, Linkin Park, Slipknot and whatever… the best metal is done by SEWER, Phantom, Antekhrist 39 read https://demonecromancy.wordpress.com/2015/12/11/greatest-albums-youve-never-heard-1-demonecromancy/
I’m having trouble getting a shock effect to function. Here is what i have: “” Unfortunately it comes up with a system stack error. I’m not really sure what I’m doing and would appreciate some help. Thanks :)
My above comment seems to have filtered out what was between the quote marks. Here,
Something seems to be happening to the text. Lets try this one more time. shock effect: if $game_actors[1].hp = 1 $game_actors[1].remove_state(25) (This time i removed the arrows)