Hello. Thanks and apologies in advance for requiring your time to help me.
As my first language is Spanish I will try to explain myself as best I can, to avoid misunderstandings, so please forgive any language errors you may find. 😢
The problem is very mathematical, and I am wondering if it will be possible to do it in javascript to check in conditional branch.
For example, let's say an item "x" has a standard value of 100.
I would like to calculate the range of that variable in 10%, for example or x%.
That is, check if the range is between values of "90-110". I don't know if I'm explaining myself well.
If the percentage is 20%, range 80-120... and so on. Both positive and negative. Calculate it.
That percentage can be modified in the game, so it would also be stored in a variable.
Something like...
A= $gameVariable(1) [original or standard price of the selected item, Database]
B= $gameVariable(2) [Price selected input by the item selected]
C= $gameVariable(2) [percentage +- of A [10, 25... 50...%]
D= $gameVariable(3) [ID of the item selected to show in the counter]
How would you know if the selected custom price (A) for item(D) is not more than x% (C) (both negative and positive) than the original price (A)? True or false result check is ok.
True if the input is inside that values. False if not.
Please, someone can help me?
As my first language is Spanish I will try to explain myself as best I can, to avoid misunderstandings, so please forgive any language errors you may find. 😢
The problem is very mathematical, and I am wondering if it will be possible to do it in javascript to check in conditional branch.
For example, let's say an item "x" has a standard value of 100.
I would like to calculate the range of that variable in 10%, for example or x%.
That is, check if the range is between values of "90-110". I don't know if I'm explaining myself well.
If the percentage is 20%, range 80-120... and so on. Both positive and negative. Calculate it.
That percentage can be modified in the game, so it would also be stored in a variable.
Something like...
A= $gameVariable(1) [original or standard price of the selected item, Database]
B= $gameVariable(2) [Price selected input by the item selected]
C= $gameVariable(2) [percentage +- of A [10, 25... 50...%]
D= $gameVariable(3) [ID of the item selected to show in the counter]
How would you know if the selected custom price (A) for item(D) is not more than x% (C) (both negative and positive) than the original price (A)? True or false result check is ok.
True if the input is inside that values. False if not.
Please, someone can help me?