Izeck

Veteran
Veteran
Joined
Jun 18, 2016
Messages
54
Reaction score
15
First Language
English
Primarily Uses
 I'm trying to make a chest that awards random loot. After some digging I came up with:

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.
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,558
Reaction score
5,618
First Language
Dutch
Primarily Uses
RMMV
Have you tried actually using \v[8] in the message window? If it contains an item, it should read as an item.
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
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)
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
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
 

Izeck

Veteran
Veteran
Joined
Jun 18, 2016
Messages
54
Reaction score
15
First Language
English
Primarily Uses
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 :)
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,558
Reaction score
5,618
First Language
Dutch
Primarily Uses
RMMV
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?
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
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.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,005
Reaction score
16,818
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Izeck

Veteran
Veteran
Joined
Jun 18, 2016
Messages
54
Reaction score
15
First Language
English
Primarily Uses
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!!
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,558
Reaction score
5,618
First Language
Dutch
Primarily Uses
RMMV
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 () :p


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.
 
Last edited by a moderator:

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,005
Reaction score
16,818
First Language
English
Primarily Uses
RMMV

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
congrats on getting it to work :D   good job Shaz
 

Latest Threads

Latest Profile Posts

Am I the only one that thinks diablo 4's werebear form is atrocious o.0
Back from my short, self-imposed timeout with another picture of my collection of Snorlax mascots for my class. Another class starts on Friday.
Mascots.jpg
002_small.png
... and another one

Forum statistics

Threads
131,603
Messages
1,221,484
Members
173,310
Latest member
estevamgalvao
Top