How to use Lunatic Parameters Properly

Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
Hello folks,

I come today asking the proper usage of Lunatic Parameters, find it here: https://github.com/Archeia/YEARepo/blob/master/Battle/Lunatic_Parameters.rb

#==============================================================================# ▼ Introduction# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# 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. # # Lunatic Parameters allows parameters to get custom temporary gains during# battle. These parameter bonuses are applied through custom lunatic traits# given to actors, classes, weapons, equips, enemies, and states. Once again,# keep in mind that these gains are applied only in battle.#  I am making a skill that is called "Fighter Tactics". Where the fighter gains a percentage 0.02 * the skill level of the skill * their magic (mat). 

It looks like this: 

#---------------------------------------------------------------------- # Empower Effect No.10: Battle Tactics # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # This will increase the battler's stats # # Recommended notetag: # <custom param: fighter tactics> # <custom param: fighter tactics> # # Replace param with one of the following: # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, or ALL # #---------------------------------------------------------------------- when /FIGHTER TACTICS/i rate = self.skill_levels(185) * 0.02 total += base * rateThe problem is anywhere I put the tag <custom luk: fighter tactics> it doesn't actually raise stats, for a matter of a fact ANY of the defined effects don't increase. 

I was curious on what I need to do, if I need to do anything to make it work

Thanks for the advice!
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Is skill_levels(185) the level of the skill you mentioned? If so, it looks ok. Might want to test and make sure the command is actually running, and what it thinks the rate is.

One way you can test to make sure the code is actually going to the custom command is add a msgbox_p() command. Maybe you could do msgbox_p(rate), right between the rate and total line? This way you would know if the code is even getting here or not, and what it thinks the rate is? Might help for debugging.
 
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
Is skill_levels(185) the level of the skill you mentioned? If so, it looks ok. Might want to test and make sure the command is actually running, and what it thinks the rate is.

One way you can test to make sure the code is actually going to the custom command is add a msgbox_p() command. Maybe you could do msgbox_p(rate), right between the rate and total line? This way you would know if the code is even getting here or not, and what it thinks the rate is? Might help for debugging.
Correct, skill_levels(185) returns the skill_level (an int) of that specific skill. It comes from another script.

Yeah that is the first thing I tried. It didn't even popup. :c

EDIT: Basically if I put this in the correct places, actors, classes, weapons, equips, enemies, and states. It doesn't do anything.
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
That's odd. Do any of the other skills (options 1 - 9) work for you? Do you have any other scripts that affect your params? If you do those might conflict.

Also, I'm not sure it matters, but try LUK instead of luk. I doubt caps would be the reason (as that usually matters with Yanfly's scripts), but you never know. After all, I've learned that Yanfly's Lunatic scripts are pretty buggy (double loops when one was all that was needed, a missing eval command negating the ability to use the script without an add-on, and so on), so I wouldn't be surprised if it does matter.
 

Jachan

Veteran
Veteran
Joined
May 23, 2015
Messages
94
Reaction score
4
First Language
Sign Language
Primarily Uses
RMMV
Forgive me for the off-topic but I can't help to post this as non-nerd RGSS3 girl... Is that how you write this way? I mean to form the final formula with multiple totals from few formulas? Like this?

Base1 = form the formula of hero's attack power here

Base2 = form the formula of enemy's defense power here

Base3 = some formulas that could be useful of special effects (like, boosted damage if slime-type, for example)

Total = Base1 * Base3 - Base2

Right? if so, then the off-topic question is that it's alright to create some unexisted results (Base#) until hit the final result (Total)? I want to know it, so I don't have to form the whole in just one line. If there is any important tip for me to understand (like, do not input the certain sign in it or something), i would like to know this too. Thanks.

To get back on this topic, I wish I could help you out but like you, I could like to know how to use all of Yanfly's lunatic scripts to understand how to use. *reading the Parameter one* I see... so it allows people's stat be changed temporary, only in battle as if it's like "raise / lower DEF in battle"? If not, then what am I missing about this lunatic?
 
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
That's odd. Do any of the other skills (options 1 - 9) work for you? Do you have any other scripts that affect your params? If you do those might conflict.

Also, I'm not sure it matters, but try LUK instead of luk. I doubt caps would be the reason (as that usually matters with Yanfly's scripts), but you never know. After all, I've learned that Yanfly's Lunatic scripts are pretty buggy (double loops when one was all that was needed, a missing eval command negating the ability to use the script without an add-on, and so on), so I wouldn't be surprised if it does matter.
Sorry for the delayed reply. I just tried LUK and it still fails. and nope none of the other options works for me. I'm using these scripts because it allows me to do skills with buffs without doing it in the custom formula, where it shows no damage along with the buff... Hopefully I can figure out why this is happening
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You sure you have no other scripts that overwrite how params are done? Check by doing CTRL+SHIFT+F, then type param and see if it finds another instance of def param(param_id) in your game in a script that is below this one (above will not overwrite it, so don't worry about it).

I know in my game I have one by Dekita that totally redoes how params work. For that reason, this script is (currently) doing nothing, though I imagine with a reorder of my scripts that would be fixed. Let me test it in a clean project.

Edit: Tested in a clean project with the following:

<custom ATK: low HP +500%>, and used an event to lower someone's HP to 100 (of 500). The menu still said they had 25 ATK, but when I went into battle they did over 50,000 damage (before they were doing maybe 70 with my damage formula). Seems the stats are applying, just not showing in the menu. I have Yanfly's ACE Menu engine too, surprised Yanfly never caught this or fixed this.
 
Last edited by a moderator:
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
You sure you have no other scripts that overwrite how params are done? Check by doing CTRL+SHIFT+F, then type param and see if it finds another instance of def param(param_id) in your game in a script that is below this one (above will not overwrite it, so don't worry about it).

I know in my game I have one by Dekita that totally redoes how params work. For that reason, this script is (currently) doing nothing, though I imagine with a reorder of my scripts that would be fixed. Let me test it in a clean project.
I did a quick CRTL SHIFT F like you said, (i totally forgot about that) and found that I have a lot of references to param(param_id) but none that overwrite it. :o I will try it in a blank project too.
 
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
You sure you have no other scripts that overwrite how params are done? Check by doing CTRL+SHIFT+F, then type param and see if it finds another instance of def param(param_id) in your game in a script that is below this one (above will not overwrite it, so don't worry about it).

I know in my game I have one by Dekita that totally redoes how params work. For that reason, this script is (currently) doing nothing, though I imagine with a reorder of my scripts that would be fixed. Let me test it in a clean project.

Edit: Tested in a clean project with the following:

<custom ATK: low HP +500%>, and used an event to lower someone's HP to 100 (of 500). The menu still said they had 25 ATK, but when I went into battle they did over 50,000 damage (before they were doing maybe 70 with my damage formula). Seems the stats are applying, just not showing in the menu. I have Yanfly's ACE Menu engine too, surprised Yanfly never caught this or fixed this.
Oh wow! I didn't know that it still works. Even with Target Info? I feel really silly then.

Did you try it with a state though? maybe I'll make the numbers outrageous just to see.
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Nope, I had it on an actor. But yes, try really silly numbers and see (somehow) if it works. You may need to give that actor a damage formula based on luck though to test it, as luck isn't used much in the game.
 

Jachan

Veteran
Veteran
Joined
May 23, 2015
Messages
94
Reaction score
4
First Language
Sign Language
Primarily Uses
RMMV
Just in case anybody didn't noticed, my post had been late approved (it was my second post since i just created this account like two nights ago) to show up... So I would like to know the answer from my questions up here... Pretty please? :D
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I'm not sure what the question is honestly, maybe I'm just too tired right now. But it would be a good idea to create a new topic for it, so as to not derail this post.
 
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
Just in case anybody didn't noticed, my post had been late approved (it was my second post since i just created this account like two nights ago) to show up... So I would like to know the answer from my questions up here... Pretty please? :D
It's a good idea to make another topic about it, but yes you can do something like that.

Here's some code to get you started

You'll need to insert this into your scripts Below Materials but Above Main

class Game_Battler < Game_BattlerBase #Time to define some custom damage def custom_damage_boost_def(a,b,boost) base1 = a.atk * 4 base2 = b.def * 2 damage = (base1 * boost) - base2 return damage end def custom_damage_boost(a, base1 = a.atk * 4 base2 = b.def * 2 boost = a*luk * 3 damage = (base1 * boost) - base2 return damage endendNow in your skill formula you can now write "a.custom_damage_boost_def(a,b,num)"*

or "a.custom_damage_boost(a,b)" up to you!

*Num is whatever you want it to be, an integer or a stat

Another good reference that helped me a lot is here:  http://cobbtocs.co.uk/wp/?p=271

Good luck!

 

I'm not sure what the question is honestly, maybe I'm just too tired right now. But it would be a good idea to create a new topic for it, so as to not derail this post.

 
Also thanks for the help! This topic can be closed
 
Last edited by a moderator:

Jachan

Veteran
Veteran
Joined
May 23, 2015
Messages
94
Reaction score
4
First Language
Sign Language
Primarily Uses
RMMV
It's a good idea to make another topic about it, but yes you can do something like that.

Here's some code to get you started

You'll need to insert this into your scripts Below Materials but Above Main

class Game_Battler < Game_BattlerBase #Time to define some custom damage def custom_damage_boost_def(a,b,boost) base1 = a.atk * 4 base2 = b.def * 2 damage = (base1 * boost) - base2 return damage end def custom_damage_boost(a, base1 = a.atk * 4 base2 = b.def * 2 boost = a*luk * 3 damage = (base1 * boost) - base2 return damage endendNow in your skill formula you can now write "a.custom_damage_boost_def(a,b,num)"*

or "a.custom_damage_boost(a,b)" up to you!

*Num is whatever you want it to be, an integer or a stat

Another good reference that helped me a lot is here:  http://cobbtocs.co.uk/wp/?p=271

Good luck!

 

 

Also thanks for the help! This topic can be closed
Thanks! I just did posted a new topic after read his post, so... I am going to guess that you just missed my new topic. XD

But thank you! Funny, I just thought it require += instead just =... oh well. Thanks again.
 
Joined
Jan 23, 2014
Messages
161
Reaction score
19
First Language
English
Thanks! I just did posted a new topic after read his post, so... I am going to guess that you just missed my new topic. XD

But thank you! Funny, I just thought it require += instead just =... oh well. Thanks again.
Actually I just posted in your topic too. Haha. Well anyway, good luck!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top