hi,
i recently did a search here, to see how to add background music from the game onto my server,
all worked well in that department, i added the code that was shown to my mohdm2.scr file.
also in there was a code to give all weapons on the waittill_spawn line.
when i added the music it stopped giving all weapons, any idea's why?
i've also tried adding the all weps code in the prespawn line, but that also does nothing.
my mohdm2.scr file looks like this
// DESTROYED VILLAGE
// ARCHITECTURE: NED
// SCRIPTING: NED
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Destroyed Village"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm2"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
thread give_all
end
give_all:
$player wuss
wait 2
thread give_all
local.STUFFSTRING = "tmstartloop sound/music/mus_NorthAfrica_01d.mp3; seta s_volume 2.974486; seta s_musicvolume 2.936625"
while(1)
{
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.p = $player[local.i]
if(local.p.music_handled != 1)
{
local.p.music_handled = 1
local.p stufftext local.STUFFSTRING
}
}
waitframe
}
end
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm2.scr
exec global/ambient.scr mohdm2
exec maps/dm/fix1.scr
level waittill spawn
thread give_all
end
give_all:
$player wuss
wait 2
thread give_all
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
any idea's why the "thread give_all
end
give_all:
$player wuss
wait 2
thread give_all "
has now failed?
// DESTROYED VILLAGE
// ARCHITECTURE: NED
// SCRIPTING: NED
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Destroyed Village"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm2"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm2.scr
exec global/ambient.scr mohdm2
exec maps/dm/fix1.scr
level waittill spawn
thread give_all
thread music
end
music:
local.STUFFSTRING = "tmstartloop sound/music/mus_NorthAfrica_01d.mp3; seta s_volume 2.974486; seta s_musicvolume 2.936625"
while(1)
{
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.p = $player[local.i]
if(local.p.music_handled != 1)
{
local.p.music_handled = 1
local.p stufftext local.STUFFSTRING
}
}
waitframe
}
end
give_all:
while(1)
{
$player wuss
wait 2
}
end
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
quick looko through i found a few things
1. your threads go below level waittill spawn
2. thread the music and weapons separately
3. your give all has no end so it keeps threading stuff below it which u dont want
what i did is removed one of the give all's and moved them both below level waittill spawn as separate threads. then threaded each one before the end after level waittill spawn
change the give all to a loop so that the tread never ends removing the need to rethread it.
looks like a quite sloppy copy and paste.
another tip
dont put an end above level waittill spawn ever.
instead of
give_all:
$player wuss
wait 2
thread give_all "
you should use
give_all:
while(1)
{
for ( local.i = 0 ; $player.size; local.i++)
{
$player[local.i] wuss
}
wait 1
}
end
also move the
thread give_all
to after waittill spawn and move the time code to another thread because its blocking the rest of the code there.
// DESTROYED VILLAGE
// ARCHITECTURE: NED
// SCRIPTING: NED
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Destroyed Village"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "mohdm2"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
thread time
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm2.scr
exec global/ambient.scr mohdm2
exec maps/dm/fix1.scr
level waittill spawn
thread give_all
end
give_all:
while(1)
{
for ( local.i = 0 ; $player.size; local.i++)
{
$player[local.i] wuss
}
wait 1
}
end
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
time:
local.STUFFSTRING = "tmstartloop sound/music/mus_NorthAfrica_01d.mp3; seta s_volume 2.974486; seta s_musicvolume 2.936625"
while(1)
{
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.p = $player[local.i]
if(local.p.music_handled != 1)
{
local.p.music_handled = 1
local.p stufftext local.STUFFSTRING
}
}
waitframe
}
end
thread to the new thread time at prespawn
maybe better to use playmp3 so ppl know how to stop it more also best not to mess with player cvars like volume, they might get mad
Thank you so much thats worked fine!
even thogh i've had the game 6 months i've only just started messing with things.
thanks again for your help and advice