Help with random loot chest, please

 I'm trying to make a chest that awards random loot. After some digging I came up with:

Spoiler
RLoot.png





 I want to know if there is a way to make it say the item that was awarded by reading the variable instead of having to make conditional branches. I'd hate to have to make 20+ conditional branches per different loot chest.
Have you tried actually using \v[8] in the message window? If it contains an item, it should read as an item.
not really no.  You'll have to use conditional branches because its basically an if statement.

Once you do the prep work its not hard to replicate.  I just created a chest in a few minutes that awards random loot based on a random list that is changed depending on the average party level.  I can show you how to do that if you want.

but you will always have to use conditional branches unless you make a plugin out of it, at which point you'll be using If statements instead (which are the same thing)
Oh I completely misunderstood the question.  You want it to display the message.  The variable will only post the value if you use \v[8] or whatever so that wont work.  Just add in a text in each conditional that says what item it gets.  Like this SS

Screenshot (6).png

Screenshot (7).png

Screenshot (8).png
Have you tried actually using \v[8] in the message window? If it contains an item, it should read as an item.



 Actually, yes. I did try that lol

not really no.  You'll have to use conditional branches because its basically an if statement.

Once you do the prep work its not hard to replicate.  I just created a chest in a few minutes that awards random loot based on a random list that is changed depending on the average party level.  I can show you how to do that if you want.

but you will always have to use conditional branches unless you make a plugin out of it, at which point you'll be using If statements instead (which are the same thing)



 I see, thank you. If you don't mind, i would indeed like to learn about your level'd loot. I want to learn all I can 🙂
lithkast, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I'm sure there's a way with just a small little scriplet to make the \v[8] display the item name. I'd know how to do it in Ruby, but not Javascript ... so perhaps you should ask in the plugin requests/support?
That would be my bad.  I am sorry if I broke any forum rules or anything.  all I'm trying to do is help and nothing more.  Again, sorry.
If variable 8 contains your item id, use another variable to get the name of the item (I'll use 9):


Control Variables [0009: Item Name] = Script: $dataItems[$gameVariables.value(8)].name


If that gives you an error, try putting () at the end.  But I don't think it's needed, as name is a property and not a function.


Then use \v[9] in your text message, and it should replace it with the name of the item.
lithkast, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I'm sure there's a way with just a small little scriplet to make the \v[8] display the item name. I'd know how to do it in Ruby, but not Javascript ... so perhaps you should ask in the plugin requests/support?



 That's what I want to know. For this, I want to try not to use a plugin. If it's possible to do without one I'd rather do that as I plan on doing a lot of diffent chests with different random loot types.


 I have a random loot plugin, but that only allows to make a range of Weapons, armor and items. I want to have several per type instead of just one.


 Thank you for the info. Looks like I'm going to make some conditional branches now.


---EDIT---


 Shaz. I'm going to try that . I'm a total noob to java and RM. I'll com back with my results... or more questions lol


---EDIT 2---


 THAT WORKED!! Thank you, thank you, thank you!!
If variable 8 contains your item id, use another variable to get the name of the item (I'll use 9):


Control Variables [0009: Item Name] = Script: $dataItems[$gameVariables.value(8)].name


If that gives you an error, try putting () at the end.  But I don't think it's needed, as name is a property and not a function.


Then use \v[9] in your text message, and it should replace it with the name of the item.



This is giving me an error, regardless of using () 😛


Definitely what OP is looking for though!


Edit: nvm, works like a charm. I was getting the error due to getting an item with no name.
whew!
congrats on getting it to work 😀   good job Shaz

Original thread: https://forums.rpgmakerweb.com/threads/help-with-random-loot-chest-please.63966/