I'm Back With a Question

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

I'm Back With a Question

Postby cpkspikyhair » Wed Dec 24, 2008 6:28 pm

Hey people!

My computer broke about three months ago, so I haven't had the opportunity to return to the forums. But now I have a new one!

Let's cut to the question, though. I am using this randomization code:

Code: Select all
randomize
i = int( RND * 100 ) + 1
if i < 50 then action.GoToFrame "1stARTq1fr1"
if i >= 50 then action.GoToFrame "1stARTq2fr1"


I am using this code many different times in my game (to different frames, of course), and I have been experiencing redundancy problems. If the first time I use the code results in "i < 50", all of the rest of the times will also result in "i < 50". Is this just crazy coincidence, or do I need to change the variable "i" to something else?
PSPPC GameMaker!! Where you can find PSP and PC games up for download!
User avatar
cpkspikyhair
Games Page Administrator
 
Posts: 425
Joined: Thu Jun 28, 2007 1:49 pm
Location: On Mars (Yes There Is Water :) )

Postby mercedes » Wed Dec 24, 2008 6:35 pm

Hi there..Welcome back!..:D and Merry Christmas..

For your question..Actually i would lower the randomization...the higher u put..the less chance of it going to one of the frames..Normally what i do is put for random the amount of actual frames..or whatever it is u are using..If is messages..then if i have 5 messages..my random is 5..

I don't know that seems to work for me..I hope I understood what you meant..:)


Peace
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Wed Dec 24, 2008 9:30 pm

You know, random numbers are not THAT random... they are created using an algorithm... so they can drive you crazy. It would be better to minimize the range. let's say for 2 events:

Randomize
rndnumber1=int(rnd*2)
if rndnumber1=0 then
'Actions
else
'other actions
end if
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby cpkspikyhair » Thu Dec 25, 2008 9:33 pm

Ok thank you both! I will minimize the range of numbers.
PSPPC GameMaker!! Where you can find PSP and PC games up for download!
User avatar
cpkspikyhair
Games Page Administrator
 
Posts: 425
Joined: Thu Jun 28, 2007 1:49 pm
Location: On Mars (Yes There Is Water :) )


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests