Command for RANDOM in game events?

Started by Nacho, Wed 04/06/2003 23:02:56

Previous topic - Next topic

Nacho

Is there a command for making events aleatory? It should be a great step for making RPG games... I mean... Imagine I want to do a game like Pirates! by Sid Meyer. I would put a command that should work for calculate the result of a sea battle considering the cannons, the size of the ship, the skills of the capitan... Can that be done?

I also remember a room of Indy4 where Sophia must guess the fingers of the hand that Dr. Trottier hides. And it´s aleatory because i´ve saved the game and tested 1,2,3,4 & 5 and that didn´t work.

And, if this has been asked before, sorry, I´m not very into script.
Are you guys ready? Let' s roll!

miguel

#1
I would like to know something like that as well, I remember the RANDOM comand from the spectrumBASIC wich was not trully random, it went more like a timer. :-\
but a comand like that would be really helpfull for me as well
Working on a RON game!!!!!

scotch

Ags has a random function
Random(number);
gives a number between 0 and number
so if you wanted to do the 5 fingers picked randomly thing you could do
int fingersup = Random(4)+1;
and then ask the player for their guess and compare them
if (playerguess==fingersup) {Do the stuff for if they got it right;} else {do the stuff for if they got it wrong;}

it'd work something like that anyway

miguel

got it, I'll try to use it,
thanks scotch
Working on a RON game!!!!!

Mr Jake

How would I use this (if I could at all) to give a NPC 3 coords to randomly walk between?

Spyros

IN REP. EXEC
if (character[NAME].walking==0) {
   MoveCharacter(NAME,Random(319),Random(199));
}

SMF spam blocked by CleanTalk