RANDOM EVENTS?

Posts

Pages: 1
Like, im making a little side project here.. where you investigate myths and stuff..
What I want to do is:
-When you enter a map random events appear to help you or to make your life harder (Fallout style) like finding blood, bodies, some dude with information...
I am a visual learner, soo you might want to take pics or just explain step by step :P
Thanks in advance!
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Do you want the events to change each time you walk out and back in, or just to be different each time you start the game over?

If the former, it's much easier. You can just set a variable to a random number between 1 and 10 each time you walk into the map. And have an event that is triggered when the variable is equal to 10. That gives it a 10% chance of occuring.

If the latter, you will probably want to plan out some things ahead of time. Some events you will only want to happen once per game, but you'll want to randomize which room they happen in. Other events you might want to have happen several times. You might want to make sure the player gets a certain number of "good" and "bad" events. Describe what you're thinking of doing (or describe one of the things you're thinking of doing) and it will be possible to at least steer you on the right path.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Oh, then yeah. Easy. Compared to the other one, at least.

Don't have the software with me to make screenshots for you, but hopefully you can follow me. If not, ask for clarification.

Making the event itself:
1) Make an event, like a dead body on the ground.
2) The condition for that event to occur should be a variable.
3) Specifically, the condition should be that the variable is at least a certain number. Let's make it 10 for the example. If you require the variable to be at least 10, it will be a 10% chance that it happens each time you walk in. If you require at least 9, it will be a 20% chance. If you require at least 8, it will be a 30% chance. Etc.
4) If you have several events in the same room, each one will need its own variable. However, when you start putting events in the next room, you can reuse the same variables that you used in this room.

Causing the event to randomly happen:
1) Go back to the previous room. The room that leads into this room.
2) Find the door that teleports the player into the room that has the random event.
3) Add another line to the event commands in that door, right before it teleports the player. Have it change a variable.
4) It's going to change the variable you set as the event condition earlier. Set it equal to a random number between 1 and 10.
5) If you have several random events in the room, they each have their own variable for a condition, so you need to do that for all the variables. A bunch of "Change Variable" commands right in a row before the player gets teleported.
6) If you can get into the room more than one way, make sure all the doors do that.
Holy Moley! This helped me alot! Thanks to you this game will become reality!
I am already thinking of all the myths i can add, thank you Mr LockeZ!
I know, it's coming late but thanks. I needed to thank you for that. Nobody was able to explain it that simple. I couldn't find any answers to that problem with the random events. I tried to import a lottery ticket into my game so that you have a sligt chance to doube your gold (if u bought it for 50g than you get 100g).
Pages: 1