10/14/2026 [01:07:48] GMT Home .:. Logout
Forums
Hardmaps.com :: Forums :: Map Making Forum :: Joint Operations
 
<< Previous thread | Next thread >>
Random Events
Moderators: Hardmaps Administrator, *HmS*Wedge, *HmS*grunt, *HmS*Trevor, *HmS*LongBow
Author Post
MichaBen
Wed Jul 23 2008
Registered Member #1336
Joined: Tue Jul 25 2006
Location: Netherlands (Rotterdam)
Posts: 267
I was trying to make some random events with a wac script to keep maps interesting even if you played it 5 times already. The random events would put some nasty bgs and grenade launchers in different spots each time. I made a test wac script that would generate a few random numbers between 1 and 11 on the start of the map. However, each time I started the map, it displays the numbers 5, 1, 5, 4, 11, 2 and 2, in the same order. I've been running the script about 5 times now, and it always gives me the same 'random' numbers.

I was hoping the number would be random each time the map starts, which you would expect from a random number, but it seems the game is not really generating random numbers after all. Does anybody knows how this random number is made? If this doesn't work I know some other ways to make the bgs more random (the random bgs are at waypoint Delta and Echo, so there is enough time to put some random scripts that are based on the player, like how many game ticks the team takes to reach Alpha, that would never the same), but the random command would be easier if it would work fine.

[ Edited Wed Jul 23 2008 ]
Back to top
NUT ACE
Wed Jul 23 2008
picard
Registered Member #1450
Joined: Wed Oct 11 2006
Location: The Netherlands
Posts: 635
Random in JO indeed isn't exactly random...

Why don't you show us what you got so far....(code wise that is)...

NUT ACE out...
Back to top
MichaBen
Wed Jul 23 2008
Registered Member #1336
Joined: Tue Jul 25 2006
Location: Netherlands (Rotterdam)
Posts: 267
The code I tried was simply random(10) and then printing out the value in the rnd variable. And that gave the same pattern each time I restarted the map.

But now I have a better code. I placed a counter that counts from 0 to 3 (when it's 4 it will reset to 0) all the time from the start of the map. When the blue team hits the area trigger near waypoint Charlie, the counter stops. The current value of the counter is then used to do the random events. Since people will never complete the first part of the map in the exact same time, the counter value when you reach Charlie is randomly between 0 and 3. I tried it out and the results are fine, much better then using random() which gives the same value each time.
Back to top
*HmS*Trevor
Wed Jul 23 2008

Registered Member #35
Joined: Tue Dec 30 2003
Location: Lincolnshire England
Posts: 2080
Is not that what me and Shad discussed a month ago?
Back to top
MichaBen
Wed Jul 23 2008
Registered Member #1336
Joined: Tue Jul 25 2006
Location: Netherlands (Rotterdam)
Posts: 267
I remember somebody discussed making the explosions in the Night Shadows map random in VT during one of the map tests. Since it sounds kind of evil doing that, I guess it must be you who came up with that. But I don't know what happened with that idea.

I never used random myself and never saw any complains about it, so I was surprised to see it generated the same numbers each time. However, the works around works perfectly and now it's really random.
Back to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
All trademarks are copyright their respective owners.
This site is best viewed using 1280-1024 screen resolution.
{THEMEDISCLAIMER}
Render time: 0.1167 sec, 0.0396 of that for queries.