(RMXP) HOW DO MAKE A VARIABLE RANDOM?

Posts

Pages: 1
I'm trying to do a shopping mini-game where a person comes in, asks you what he/she wants, and you go get the items for him/her. To keep it from being TOO monotonous, I'm trying to make where the people who come in are random. How on earth do I do that with variables?
Rhyme
Tear Harvester Rhyme
7582
Shouldn't be too different from VX :x

With this you should get a random number between 1-100

Once that's set, all you need to do is to make the people come in based on what the variable returns. :O
Why, thank you. Thank you so much.

EDIT: The only difference is color.
Now I have another problem with variables. The randomness of the variable works, but there's no pause between it. I'm trying to make it where it goes like this:

Shopkeeper: Welcome. What would you like?
Customer A: A sword.
Shopkeeper gets the sword, and gives it to customer A
Customer A says thanks, walks to the door, vanishes, and two or three seconds later customer B appears, and does a similar conversation up front, thus beginning a long cycle.

Well, RPG Maker processes commands at your CPU's speed. If you want to introduce an artificial delay, you have to use the "Wait" command (it operates in milliseconds, so 1000ms in Wait time would be equal to 1 second, 3000ms to 3s, etc.).
So basically it's pretty damn impossible to do a shopping game?
Uh, what do you mean? If you are trying to delay the time between Customer A's departure and Customer B's arrival, then Wait should be just fine for what you want.
But the problem is I tried that, and it still randomly switched prematurely.
Could you post a screenshot of your event code, or write them down in detail?
http://rpgmaker.net/games/2367/images/12612/

Bear in mind, the event is not finished yet. I'm going to have more stuff to make sure the character doesn't leave after you talk to him without the item needed, but first I need to fix the problem of him just randomly changing into someone else!
Yeah... I hate to say it, but I'm not sure of what exactly is going wrong there. Could another event page be interfering with that one? Sorry about this. :(

Also to correct myself, RPG Maker XP bases its wait time on frames, not milliseconds. So 30 frames would be equal to 1 second in real-time.
You were correct. There was another event page interfering. I got the problem all solved now. I'm so happy! I can finally make a minigame!
Yay! =D

It's an interesting idea, too. Best of luck to you with that.
Now I have another problem (More pertaining to the minigame, but variables related). I'm trying to make it where after 20 sales, you end the minigame. Therein lies the problem. I don't know how to do that, and the randomness of the whole thing makes it even more of a challenge because I can't make it where customer 1 makes variable finish go to 1, customer 2 makes variable finish go to 2. If I tried to do it like that, you might get the guy who turns the variable to 20, meaning an instant win.

EDIT: Oh duh. The add button on the variable menu. I'm an ass.
KrimsonKatt
Gamedev by sunlight, magical girl by moonlight
3326
Click on control variables. Then, click "random." Then select the numbers you want it to go between. The variable would ten be randomized to be one of the numbers between those two numbers. Then you can use conditional branches to determine random chance. Like, if you want a 25% chance of something happening, you create a variable for "random chance," have to go to a number from 1 to 100, and then have a conditional branch that plays an event if the variable is less than or equal to (<=) 25. Hope this helped!
Pages: 1