Help with javascript for Notetags

Issac7

Villager
Member
Joined
Feb 27, 2016
Messages
9
Reaction score
0
First Language
Portuguese
Primarily Uses
Hi


So what I need to know is how to use javascript in the lunatic mode to make certain changes to an item.


For example in Yanfly's Tips and Tricks "Duplicity Augments" he uses this line


"item.params[0] += 200;"


to increace the param 0 (Max HP) by the value of 200.


What I need to know is how traits, other than base parameters can be modified in a similar way,


for example how to change a weapon's attack element, how to give an armor resistance against a certain state, etc.


I think that those traits are probably stored in an array in a similar way to the "params array" but I can't seem to figure it out.


If anyone can help me, I would really appreciate it.
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
If you go into you folder/data youll find your games database. Go to items.json and you can see what all of it's traits are labeled.
 

Issac7

Villager
Member
Joined
Feb 27, 2016
Messages
9
Reaction score
0
First Language
Portuguese
Primarily Uses
If you go into you folder/data youll find your games database. Go to items.json and you can see what all of it's traits are labeled.
I'm already working on that but thanks anyway.


Ok I got it. To apply a trait we use the command


"item.traits.push({"code": x, "dataId": y, "value": z})"


To remove it we need to use to lines:


"var index = this.getMatchingTraitIndex(item, 32, 4, 10.0);" - to find the trait in the array


"item.traits.splice(index, 1);" - to remove the trait


My question is solved.


Thank you anyway. :)
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

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,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top