Closed Shandaxa closed 7 years ago
Effect conditions allow you to specify custom conditions that must be met before an effect will be applied.
Let's say Potion Lore is stored in variable 12, and you have 3 effects defined on the item.
<effect condition: 1>
v.value(12) == 1
</effect condition
This condition requires that variable 12 be equal to 1.
<effect condition: 2>
v.value(12) > 1
</effect condition
This requires that variable 12 is greater than 1.
<effect condition: 3>
v.value(12) >= 3
</effect condition
This requires that variable 12 greater than or equal to 3.
Some more examples can be found here: http://himeworks.com/wiki/index.php?title=MV_Formula_Library/Conditional_Formulas
Thank you, that is exactly what I needed, but I just couldn't for the life of me figure out how to write out the formula before lol. Thank you for explaining it clearly, and also for pointing me to the appropriate wiki page. 😁
Thank you, that is exactly what I needed, but I just couldn't for the life of me figure out how to write out the formula before lol. Thank you for explaining it clearly, and also for pointing me to the appropriate wiki page. 😁
Ok, so I just tested it. I put:
//Adds an extra 24 HP when var 1 is >= 1 <effect condition: 2> v.value(1) >= 1 </effect condition> //Adds an extra 36 HP when var 1 is >= 2 <effect condition: 3> v.value(1) >= 2 </effect condition> //Adds an extra 48 HP when var 1 is >= 3 <effect condition: 4> v.value(1) >= 3 </effect condition>
The problem is it still applies all 4 conditions, no matter what value the variable has. Can you please look it over and point out where I am going wrong?
Sorry, I formatted the code wrong in the last comment.
//Adds an extra 24 HP when var 1 is >= 1
<effect condition: 2>
v.value(1) >= 1
</effect condition>
//Adds an extra 36 HP when var 1 is >= 2
<effect condition: 3>
v.value(1) >= 2
</effect condition>
//Adds an extra 48 HP when var 1 is >= 3
<effect condition: 4>
v.value(1) >= 3
</effect condition>
So the problem appears to be on my end. I recently switched to a new text editor on my phone, and it does not preserve the formatting of the plugin. I just opened the file in Sublime Text 3 and noticed when I changed the extension to .js, it put everything on 2 lines. Hopefully switching to my old text editor will preserve the original format and fix the problem.
Problem solved! Google Chrome's mobile browser does not preserve the formatting of your code. If anyone else is having this issue, opening the page in Opera mini worked like a charm for me.😁 Thanks again for your help understanding the formulas as well.
Could you please explain the condition formulas to me in a little more detail? I'm having difficulty understanding how to set up the formulas beyond the example you gave, particularly using variables.
For example, I was thinking this plugin would be perfect for duplicating the Lore system from ff12. Essentially, it would require one variable for each type of lore (potion lore, ether lore, ECT.), that boosts the effect of the item by a set amount. It would function along the lines of:
Potion: Without lore - +120 HP With Potion Lore 1 - +24 HP With Potion Lore 2 - +36 HP With Potion Lore 3 - +48 HP
The effects are cumulative, so I would only need to check if the variable was above 0, 1, or 2 respectively for each lore level.
My question is how would I check if the variable is greater than the desired value in the condition formula?
Note: Sorry, l messed up the formatting on my original post, and it was difficult to read.