Hi,
I'm experimenting with "dice-rolling" like D&D. As a result of the dice rolling, I want it to affect the "traits" for getting percentage multipliers on ATK, DEF, MAT, MDF, SPD and LUK. So for example if you were to roll 3d6 (three six-sided dice) for stats, this will result in a 30% to 180% multiplier for each of the stat.
The protagonist (actor 1) already has traits for each of the parameters set, at 100%. So after staring at the script call reference, I thought that the following might work:
$dataActors[1].traits[0].value1 = ((Math.randomInt(6)+1) + (Math.randomInt(6)+1) + (Math.randomInt(6)+1)) / 3;
(the idea being that it results in a value between 0.3 and 1.8);
It doesn't... or, more precisely, it does update the values because console.log shows the results of the dice rolls for $dataActors[1].traits[0].value1 ~ $dataActors[1].traits[5].value1... it just isn't the traits I was thinking. Any idea how the numbering of the traits is done internally?
I'm experimenting with "dice-rolling" like D&D. As a result of the dice rolling, I want it to affect the "traits" for getting percentage multipliers on ATK, DEF, MAT, MDF, SPD and LUK. So for example if you were to roll 3d6 (three six-sided dice) for stats, this will result in a 30% to 180% multiplier for each of the stat.
The protagonist (actor 1) already has traits for each of the parameters set, at 100%. So after staring at the script call reference, I thought that the following might work:
$dataActors[1].traits[0].value1 = ((Math.randomInt(6)+1) + (Math.randomInt(6)+1) + (Math.randomInt(6)+1)) / 3;
(the idea being that it results in a value between 0.3 and 1.8);
It doesn't... or, more precisely, it does update the values because console.log shows the results of the dice rolls for $dataActors[1].traits[0].value1 ~ $dataActors[1].traits[5].value1... it just isn't the traits I was thinking. Any idea how the numbering of the traits is done internally?