Sorry windows. I am a slave to the microsoft corporation.
Advertisement
Radomizing mapcycle
#13
Posted 09 September 2008 - 01:27 AM
At the beginning of every map, the game server reads the mapcycle file, finds the line corresponding to the map just played, and chooses the next line as the new map, or the first line of the mapcycle file if either:
a) the map just played is the last in the list or
b) the map just played is not in the list
a) the map just played is the last in the list or
b) the map just played is not in the list
#14
Posted 09 September 2008 - 01:32 AM
The first thing you need for a mapcycle shuffler is a utility that will take the existing mapcycle and shuffle it. I wrote a ruby script for UNIX that does this:
Assuming the script is named "shuffle", you would use it like this:
[tt]cat mapcycle_old.txt | shuffle > mapcycle_new.txt[/tt]
What I ended up doing is storing my mapcycle in alphabetical order in a file called mapcycle-master.txt, so the command I want to execute periodically is:
[tt]cat mapcycle-master.txt | shuffle > mapcycle.txt[/tt]
I have a cron task that calls this every day.
#!/usr/local/bin/ruby
abort "Usage: cat <text file> | shuffle" if ARGV.size != 0
lines = readlines()
lines.size.times do
print lines.delete_at(rand(lines.size))
end
Assuming the script is named "shuffle", you would use it like this:
[tt]cat mapcycle_old.txt | shuffle > mapcycle_new.txt[/tt]
What I ended up doing is storing my mapcycle in alphabetical order in a file called mapcycle-master.txt, so the command I want to execute periodically is:
[tt]cat mapcycle-master.txt | shuffle > mapcycle.txt[/tt]
I have a cron task that calls this every day.
Advertisement
#18
Posted 10 September 2008 - 08:53 AM
Oh I have issues with MS too, but there is no human intervention. I run excel in the background, which randomises via macro every 75 seconds. So the mapcycle is randomised continuously, and that means each time the map cycles the resultant map is a random one. I'm playing on my PC, running the dedicated server, and running the excel app in the background. The only intervention I have is whn my bullets intervene up my opponents ass.
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement