I have managed to get a randomized function working via a script on an event.
I wanted to have a chest that pulls from the list of items randomly.
I run this script at the beginning of the event.
var weapon = Math.floor(Math.random() * (3 - 1 + 1)) + 1
$gameParty.gainItem($dataWeapons[weapon],1);
That will give me a weapon randomly from Weapon ID's 1-3.
I am now trying to get the message dialogue to reflect the item that I had received randomly, but I am unsure how to get the two to communicate.
Any scripters know how I could get the random number that I pulled to be inserted into Yanfly's Message core so that I can have the message box say
You have found \iw[weapon]!
Where weapon was the number pulled from that script and needs to be recognized in the Message Core Script.
I am new at scripting and just understand the basics so what I am asking may not be possible with my setup.
I wanted to have a chest that pulls from the list of items randomly.
I run this script at the beginning of the event.
var weapon = Math.floor(Math.random() * (3 - 1 + 1)) + 1
$gameParty.gainItem($dataWeapons[weapon],1);
That will give me a weapon randomly from Weapon ID's 1-3.
I am now trying to get the message dialogue to reflect the item that I had received randomly, but I am unsure how to get the two to communicate.
Any scripters know how I could get the random number that I pulled to be inserted into Yanfly's Message core so that I can have the message box say
You have found \iw[weapon]!
Where weapon was the number pulled from that script and needs to be recognized in the Message Core Script.
I am new at scripting and just understand the basics so what I am asking may not be possible with my setup.