Warm greetings.
I'm hoping someone will know what to do with this. Umm...I'm not sure if this is definitely a topic for this section but I thought it could be so I'm posting it here.
I got an idea of making an item gain different from a common way everpresent in jrpg. I'd like to know if anyone has an idea and could try making a script that would, upon player opening a chest, randomly select items he could gain. For example from 0 to 10 items at once with a specific rarity and so, perhaps based on a call script event (since that way it is easier to manipulate with). Something like a Diablo II item gain style. If something rings you a bell, give it a go. I'd try it myself but I have absolutely no idea (or knowledge) of advanced scripting at this matter, no clue what to do.
If you think there's no way, or have a specific opinion or solution, just type it down.
Alright, I'll leave you be now... :lol:
Thatd be great for reply value :) Im not sure if theres a script for this, but you can do it with events...lots of conditional branches and triggers... I'll try to do this and post the events page for you soon ;D
[edit] here you go:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi92.photobucket.com%2Falbums%2Fl14%2Fitalianstal1ion%2FRandomEventHappenings.jpg&hash=223492c43967d7cce31fa5e1ea0e44fe11b8a5fd)
If you had something like an item that gets "more rare" items, Im not really thinking but just add another page with the same thing, thats only activated if "Rare Amulet" is equipped, and fill it with more rare items blah blal blah.
Or if you wanted to have a rare item in the mix, but with a lower percentage then the other *bulk* in the chest, the only way i can think of is make a conditional branch random variable inside the random variable...if you get what I'm saying :P
I'm sure theres easier/more clever ways of doing that, I just cant think of them right now ;9
Oi, thanks for helping. Hmmm...I'm not sure if I got it right but with this I'm still supposed to write down every possible item one could get, no?
If yes, then, you see, I want to avoid that. The closest what I'd like to do would be something like, for example, setting a random gain from item 001 to 070 and 1 to 10 of them, for example. Let's say these are common potions and herbs item. So you walk to a chest, hit action, and the event rolls (or calls for script) a random of, say, 3 items: item 002, 010 and 045 -> Potion of Lesser Restortation, Axe of Spades and blueforge mushroom, for example - but I did not write a possible branch, you see, it selected it completely by itself. That's why I thought script would be useful because then you don't have to bother with bunch of conditional branches...
Or, the answer is no, and I misunderstood it. :lol:
For the "lower percentage" problem:
Well, with very basic scripting you can specific intervalls in events.
Let's create, say, 70%-20%-10%.
Variable: [0001] = Random (1..10) => the same randomizing, as above
Open a conditional branch, look for the entry "script" at the fourth page. Enter this:
( $game_variables[1] >= 1 ) && ( $game_variables[1] <= 7 )
Second condittion:
( $game_variables[1] >= 8 ) && ( $game_variables[1] <= 9 )
Third one:
$game_variables[1] == 10
Now, what does all this mean?
"$game_variables[1]" - the script "word" for the first variable, the [0001]. If you wanted to use [0006], write 6 in the brackets, and so on.
"$gamevariables[1] >= 1 " >= Easy. Greater than one.
( ) && ( ) --> "&&" means "and". The effect will be triggered only when both condition is met. This is the main reason for the script. There's no "and" in normal events (or just I didn't notice it... :-\)
Adding all these elements together, we wrote:
"If variable [0001] is between 1 and 7"
"If variable [0001] is between 8 and 9"
"If variable [0001] is 10"
About scripting it:
As far as I know, in the basic system, there's no "treasure chest". It's just an event. You could script it, but you had to place it, trigger it, all the things events already can do. So you probably started with "Game_Event" as a parent class, then writing exactly the same thing what you wrote, just in methodes, and script language.
Of course, if you do "ohmygod, that's awfull much!!!" number of chests (like 2-3000 :D ), it's worth doing it. Otherwise, it's pretty pointless.
Okay, sorry, you posted the above, while I was typing.
With events, your request goes like this, with items 1,2,3 (70%-20%-10%), and a random times between 1-10. (Attached)
Oh, and by the way: get some time and read the sripting tutorials. They are pretty nice. It's not that hard, trust me. ;)
Quote from: Lord on January 05, 2007, 10:03:21 AM
For the "lower percentage" problem:
Well, with very basic scripting you can specific intervalls in events.
Let's create, say, 70%-20%-10%.
Variable: [0001] = Random (1..10) => the same randomizing, as above
Open a conditional branch, look for the entry "script" at the fourth page. Enter this:
( $game_variables[1] >= 1 ) && ( $game_variables[1] <= 7 )
Second condittion:
( $game_variables[1] >= 8 ) && ( $game_variables[1] <= 9 )
Third one:
$game_variables[1] == 10
Now, what does all this mean?
"$game_variables[1]" - the script "word" for the first variable, the [0001]. If you wanted to use [0006], write 6 in the brackets, and so on.
"$gamevariables[1] >= 1 " >= Easy. Greater than one.
( ) && ( ) --> "&&" means "and". The effect will be triggered only when both condition is met. This is the main reason for the script. There's no "and" in normal events (or just I didn't notice it... :-\)
Adding all these elements together, we wrote:
"If variable [0001] is between 1 and 7"
"If variable [0001] is between 8 and 9"
"If variable [0001] is 10"
Lol, sorry for being dumb...I'm seeing what you're pointing at but I'm still confused...mainly because I didn't understand how to alter the percentage chances. do you think you could make an exact example, as if how would you do it? With actual example you'll fully help me.
For example: Lets say you make an event on chest. When character activates it, lets say there is a random item gain of 3 items from range itemID 001 to 020. 5% for each item, I guess that's how it would work. What do you do?
Easy, just make it look like this:
Variable Operation:
variable[0001] = Random (1..100)
Enter this event code:
> if var[0001] > 0
> if var <= 5
> gain item with ID 001
> end
> end
> if var[0001] > 5
> if var <= 10
> gain item with ID 002
> end
> end
etc.
Just play around with numbers and continue it like this. There is no need to script, you can make it all with conditional branches. You can make it a little bit different although:
> if var[0001] > 0
> if var[0001] > 5
> if var[0001] > 10
> if var[0001] > 15
...
> else
> gain item with ID 003
> end
> else
> gain item with ID 002
> end
> else
> gain item with ID 001
> end
That appears useful but I don't understand what is exactly going on.
I'm also not sure what do you mean by "enter this event code". I can't enter this. O.o
I meant use the event commands like conditional branch and stuff (mainly conditional branch).