how to make random stuff happen?

Started by Jury_Rigged107, Sat 22/08/2015 20:31:03

Previous topic - Next topic

Jury_Rigged107

I am not sure if this simple or not
but I want a effect of when you enter a room it might be the room it might be some random other place.
kind of like the insanity effect in trilby's note.
also how do you switch playable characters?

Grok

If you use the Help function at the top of the editor you will find the answers to many question of this sort. :)
---------------------------
Random
Random (int max)

Returns a random number between 0 and MAX. This could be useful to do various effects in your game.
NOTE: The range returned is inclusive - ie. if you do Random(3); then it can return 0, 1, 2 or 3.

Example:

int ran=Random(2);
if (ran==0) cEgo.ChangeRoom(1);
else if (ran==1) cEgo.ChangeRoom(2);
else cEgo.ChangeRoom(3);

will change the current room to room 1,2 or 3 depending on a random result.


----------------

cMan.SetAsPlayer();

SMF spam blocked by CleanTalk