Forum

Random Cd music

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Random Cd music

Postby Cobalt » Fri May 11, 2012 6:47 pm

I dont think anyone else has discovered this before. This code will let you override the .sounds float found in the map header that determine what cd track is to be played for a given map. Its written to write the newly selected track to the console via localcmd.


Code: Select all
/// placed in worldspawn ()
world.sounds = rint (random () * 16) + 2;
local string d;
 d = ftos (world.sounds);
localcmd ("echo SOUNDS: ");
localcmd (d);
localcmd ("\n");


I have been using it in my mod for a while now, and I like hearing different quake maps with different cd music. Others may not prefer this, and rather hear the traditional music played for the loaded map, but having played it for so long they all fit rather well together for the ultimate quake experience , IMO. Have fun !
User avatar
Cobalt
 
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest