- Joined
- Feb 23, 2017
- Messages
- 14
- Reaction score
- 2
- First Language
- Swedish
- Primarily Uses
- RMMV
Hi all! 
I have some question about JavaScript code;
1. How to get a random number instead to use in-game variables?
Is there any script code to get a random number instead of using one of the in-game variables?
2. How to add % chance for both var line?
Like each number decrease chance to get, so item ID 410 would be 1% chance to get, meanwhile 400 would be 100%.
3. * Sorry... I got this questions when I did start posting here, and now I did forget my third questions
My code that I use for my test project;
(Value 1 = random 400-410 ( = item ID beteween 400-410).
(Value 2 = random number 1-5 ( = how many item you can get ).
''''
My point for this script;
I trying to make a common event that will be available 1 times for every in-game month and will be there until 2-3 days, after that you can't access that until next month.
Inside that Common Event would be that script code.
You can then roll for a random item/weapon/armor from the database from x to y % + chance for extra loot!.
x = higher chance to get that loot
y = lower chance to get that loot
__________________________________________________________________________________________________
How to best setup that Common Events are my next problem
Right now I want to focus on how to get best possible Script code.
(If you have good idea/tips about the common event, please
, not necessary because this topic focuses on my script setup.)
I have some question about JavaScript code;
1. How to get a random number instead to use in-game variables?
Is there any script code to get a random number instead of using one of the in-game variables?
2. How to add % chance for both var line?
Like each number decrease chance to get, so item ID 410 would be 1% chance to get, meanwhile 400 would be 100%.
3. * Sorry... I got this questions when I did start posting here, and now I did forget my third questions
My code that I use for my test project;
Code:
var item = $gameVariables.value(1);
var nr = $gameVariables.value(2);
$gameParty.gainItem($dataItems[item], nr)
(Value 2 = random number 1-5 ( = how many item you can get ).
''''
My point for this script;
I trying to make a common event that will be available 1 times for every in-game month and will be there until 2-3 days, after that you can't access that until next month.
Inside that Common Event would be that script code.
You can then roll for a random item/weapon/armor from the database from x to y % + chance for extra loot!.
x = higher chance to get that loot
y = lower chance to get that loot
__________________________________________________________________________________________________
How to best setup that Common Events are my next problem
Right now I want to focus on how to get best possible Script code.
(If you have good idea/tips about the common event, please

