10-20-2006, 03:14 AM | #1 |
Join Date: May 2005
Location: Changes every few months
Posts Rated Helpful 0 Times
|
How do you generate a random number?
Wondering which entity in HL2 generates a random number. I want to pick a random command point (between 3) which players have to capture ever 120 seconds, and I can't figure out how to do it.
Any suggestions are more than welcome. Hugs and all that |
|
10-20-2006, 08:19 PM | #3 |
Join Date: Feb 2005
Location: Philadelphia, PA
Posts Rated Helpful 0 Times
|
Computers in general cannot create a "true" random number. Or at least thats what the Nevada State Gaming Commision says.
|
|
10-21-2006, 12:22 PM | #4 |
Join Date: Jun 2005
Posts Rated Helpful 0 Times
|
ask Caesium or sidd, they know a load of stuff when it comes to entities it seems
|
|
10-21-2006, 12:59 PM | #5 |
Join Date: Feb 2005
Posts Rated Helpful 0 Times
|
Correct, a computer cannot generate a "true" random number, however
Its random enough for most things, so you really don't need to worry about it basically, you use your logic_case and set up your command points, and then have it pick a random one on map load Last edited by o_fjorn; 10-21-2006 at 01:05 PM. |
|
10-21-2006, 02:32 PM | #6 |
Join Date: Aug 2005
Location: Portsmouth, England
Posts Rated Helpful 0 Times
|
It's more random than a number you think of.
|
|
10-21-2006, 04:35 PM | #7 |
Join Date: May 2005
Location: Changes every few months
Posts Rated Helpful 0 Times
|
Thanks, Boojum and everyone - i figured it out and it works beautifully. I'm really excited to unveil this new map once I get the skybox in order..
|
|
10-23-2006, 04:17 AM | #8 |
Retired FF Staff
|
I shake my 8-ball up and it's like random->randomInt( 0, infinity ) and always generates 11 because it knows that's my favorite number and that's what I want to see.
__________________
Head of the Orca Revolution (TM) |
|
10-23-2006, 05:45 AM | #9 |
Join Date: Mar 2005
Location: The Peoples Republic of Harmfull Free Radicals
Posts Rated Helpful 0 Times
|
If you didn't trust your computer to come up with a random number you could put a lot of invisible triggers in the map that each advance a counter, and then query that counter when you want your number. I guess this wouldn't work if you needed the number right when the map spawns, but it's how I got random numbers in this one TFC map...
|
|
10-29-2006, 03:49 AM | #10 | |
Join Date: May 2006
Location: Idaho
Posts Rated Helpful 0 Times
|
Quote:
|
|
|
10-29-2006, 04:07 AM | #11 | |
Join Date: Jul 2006
Location: Austin, Texas
Posts Rated Helpful 0 Times
|
Quote:
|
|
|
10-29-2006, 11:48 AM | #12 |
Join Date: Feb 2005
Location: Finland
Posts Rated Helpful 0 Times
|
You guys have 8 balls?
(Yes, I just had to) |
|
10-29-2006, 08:49 PM | #13 |
Useless
Retired FF Staff
|
Roll a die.
__________________
Look at all those dead links. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|