Page 2 of 7

Re: New ubersound work-around!

Posted: Fri Jul 18, 2003 11:24 pm
by WarTech
jv_map wrote:Woohoo no more messing with TIKIs 8-)

I found an easier way which seems to work on both client and server directly from the map script.

Here's how I did it (put this above level waittill spawn):

Code: Select all

local.master = spawn ScriptMaster
local.master aliascache soundalias wavfile soundparms numbers channel loaded maps "mapname"
local.master remove
You can add a great number of aliases this way :).

If there is a demand for it I can probably make a global script for it.
Yes can you create a global for those like my self that have no clue what all this means and guess working like no tomorrow LOL. :lol:

Posted: Fri Jul 18, 2003 11:26 pm
by Alcoholic
yeah i didnt make a global file, im just gonna make a unique one for each map named "mapname_soundcache" and ill just exec it from the main script.

Posted: Fri Jul 18, 2003 11:34 pm
by WarTech
Alcoholic wrote:yeah i didnt make a global file, im just gonna make a unique one for each map named "mapname_soundcache" and ill just exec it from the main script.
Let me have it so I can use it as a learning tool. BTW,, I would like to learn more about this scripting stuff. Anything you can suggess?

Thanks. :D

Posted: Sat Jul 19, 2003 12:04 am
by Alcoholic
uhh you can look at some user made maps and see look for all the common stuff you see in the scripts. i wouldnt recommend looking in the main game scripts because there all super-long and messy. my soundcache script isnt finished though i only did about 6 sounds but ill pm it to you. http://gronnevik.se/rjukan/ had a great tutorial that explains the basics of scripting.

Server crashes, weird but fixed (hopefuly)

Posted: Mon Jul 21, 2003 5:25 pm
by Valoche
Aloha,

Just tested jv's tip, it works like a charm, but... it keeps crashing the server :evil:

I declared 14 customs sounds using mp3's, and when you restarted the map (console restart or one team wins, so restart), the game server crashed, both Windows server (@ home), and leased Linux server.

I first tried to put the aliases declarations in the XXXX_precache.scr file, didn't work.
I finally removed the last line:
local.master remove
and now the server does not crash anymore.
How weird is that ?

Valoche

Posted: Mon Jul 21, 2003 5:27 pm
by jv_map
Hmm interesting :?

I didn't have any 'restart problems' myself, but if you say so....

Thanks for the info btw ;)

Posted: Mon Jul 21, 2003 6:39 pm
by Valoche
Okay,

I've tested a little more, now I have an exact test case which you can reproduce as you will:
Create ANY map with the following precache script. You do not need to fix the paths whatsoever :?
Launch a game (objective in my case, so g_gametype 4), restart the map, and voil?: server crash :shock:


// TFBunker_precache
// SCRIPTING: Valoche

// Sons custos
local.master = spawn ScriptMaster
// Sons amor?age
local.master aliascache axis_planting1 sound/TFBunker/planting1.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting2 sound/TFBunker/planting2.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting3 sound/TFBunker/planting3.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting4 sound/TFBunker/planting4.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting5 sound/TFBunker/planting5.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting6 sound/TFBunker/planting6.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_planting7 sound/TFBunker/planting7.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting1 sound/TFBunker/planting1.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting2 sound/TFBunker/planting2.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting3 sound/TFBunker/planting3.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting4 sound/TFBunker/planting4.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting5 sound/TFBunker/planting5.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting6 sound/TFBunker/planting6.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_planting7 sound/TFBunker/planting7.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"

// Sons d?samor?age
local.master aliascache axis_defusing1 sound/TFBunker/defusing1.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing2 sound/TFBunker/defusing2.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing3 sound/TFBunker/defusing3.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing4 sound/TFBunker/defusing4.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing5 sound/TFBunker/defusing5.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing6 sound/TFBunker/defusing6.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache axis_defusing7 sound/TFBunker/defusing7.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing1 sound/TFBunker/defusing1.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing2 sound/TFBunker/defusing2.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing3 sound/TFBunker/defusing3.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing4 sound/TFBunker/defusing4.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing5 sound/TFBunker/defusing5.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing6 sound/TFBunker/defusing6.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master aliascache allies_defusing7 sound/TFBunker/defusing7.mp3 soundparms 1.5 0.0 1.0 0.0 10000 10000 dialog streamed maps "obj/TFBunker"
local.master remove
iprintlnbold "Pr?parez-vous !"


If you comment the local.master remove line, you can do as many restarts as you want. You can even be a serial restarter :lol:

So the final fix for "the ubersound workaround from magnificient jv_map"(c)(tm) is: remove that stupid line :wink:

Valoche

Posted: Mon Jul 21, 2003 7:24 pm
by jv_map
Yeah I guess. However, the lines weren't intended to be placed in the precache script but in the regular map script instead. That might explain the crash.

Moreover I think 'maps' should only say "obj".

But well, I don't know, I don't know if the remove line has any memory saving use either :?

Merci for your research :wink:

Posted: Mon Jul 21, 2003 7:47 pm
by Valoche
To place the lines in the precache or in the script does not change anything.
I placed them in the precache while I was trying to figure out what happened. It's the same sh*t if you place them in the main script.
I just left them in the precache because it's more consistent IMHO.

And it *does* apply to every gamestyle (I just tested it).

De rien mon ami, it was a pleasure :)

Posted: Mon Jul 21, 2003 8:48 pm
by Alcoholic
cant you just hide the scriptmaster so it isnt sent to the clients?

Posted: Tue Jul 22, 2003 3:15 am
by small_sumo
So in obj maps its "mapname" = "obj" ?

I am trying it out today.

:)

Posted: Tue Jul 22, 2003 5:22 am
by small_sumo
My scr file looks like this so far. Would you do a standard "necissary for bots" alias list please.

Thanks for everything your a champion.

:)

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Save the"
setcvar "g_obj_alliedtext2" "Bridge"
setcvar "g_obj_alliedtext3" "..da"
setcvar "g_obj_axistext1" "Bombardieren"
setcvar "g_obj_axistext2" "Sie Br?cke"
setcvar "g_obj_axistext3" "..da"

setcvar "g_scoreboardpic" "obj_spr-final-scene"

exec global/DMprecache.scr

//jv's new sound workaround ..... here goes.

local.master = spawn ScriptMaster

local.master alias airplane3 sound/vehicle/M1_PlaneBy.wav soundparms 1.3 0.2 1.0 0.3 600 5000 weapon streamed maps "obj"
local.master alias tank_snd_idle sound/vehicle/veh_tank_idle1.wav soundparms 0.5 0.0 1.0 0.0 800 4000 auto streamed maps "dm obj"
local.master alias tank_snd_run sound/vehicle/veh_tank_run1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto streamed maps "dm obj"
local.master aliascache tank_snd_revup sound/vehicle/veh_tank_revup1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_revdown sound/vehicle/veh_tank_revdown1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_shift1 sound/vehicle/veh_tank_shift1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_shift2 sound/vehicle/veh_tank_shift2.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_shift3 sound/vehicle/veh_tank_shift3.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_on sound/vehicle/veh_tank_on1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_start sound/vehicle/veh_tank_on1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_off sound/vehicle/veh_tank_off1.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_stop sound/vehicle/veh_tank_off1.wav soundparms 1.0 0.0 1.0 0.0 1000 4000 auto loaded maps "dm obj"
local.master aliascache tank_tread_snd_dirt sound/vehicle/veh_tread_grass.wav soundparms 0.25 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_tread_snd_stone sound/vehicle/veh_tread_metal.wav soundparms 0.25 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_tread_snd_grass sound/vehicle/veh_tread_grass.wav soundparms 0.25 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_tread_snd_wood sound/vehicle/veh_tread_metal.wav soundparms 0.25 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_tread_snd_mud sound/vehicle/veh_tread_grass.wav soundparms 0.25 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_doorclose sound/mechanics/DoorHatchClose_02.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_snd_dooropen sound/mechanics/DoorHatchClose_02.wav soundparms 1.0 0.0 1.0 0.0 800 4000 auto loaded maps "dm obj"
local.master aliascache tank_vehicle_crash1 sound/null.wav soundparms 0.7 0.4 1.0 0.5 160 1600 auto loaded maps "dm obj"


local.master remove



exec global/exploder.scr



level waitTill prespawn ///////////////////////***********************************************************



level.script = maps/obj/obj_spr-final-scene.scr
exec global/ambient.scr mohdm1
$exploder solid
$sticky_poo notsolid
$bridge_bike notsolid


level waittill spawn ///////////////////////***********************************************************

level.jvbot_showavatar = 0
level.debug_light = 0
level.jvbot_respawning = 1 // uhm, better just leave at 1 for the beta
level.alliesbots = 1 // max number of bots
level.axisbots = 6
level.dmrespawning = 1 // respawn players, necessary!
level.dmroundlimit = 10
level.clockside = "allies" // allies win when timelimit is hit
level.defusing_team = "allies"
level.planting_team = "axis" // can be set per individual bomb as well by using the $plantteam key
level.bomb_damage = 128
level.bomb_explosion_radius = 128
level.jvbot_tasks_priority[follow] = 3
level.jvbot_weapon_priority["bazooka"] = 5
level.jvbot_weapon_priority["panzerschrek"] = 5
$bomb thread global/jv_obj_dm.scr::bomb_thinker
level.routelist[bomb] = river::bridge::wiggle
waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0 // enables bots
while !(level.roundstart)
wait 0.5
thread axis_win_check



end

axis_win_check:

while($bomb.exploded != 1)
wait 0.5

//while($bomb2.exploded != 1)
//wait 0.5

//while($bomb3.exploded != 1)
//wait 0.5

//while($bomb4.exploded != 1)
//wait 0.5

level.axiswin = 1
//level.dmroundlimit = (level.dmroundlimit + 18)
// thread camera_mover
//wait 18

teamwin axis


end

Posted: Tue Jul 22, 2003 6:46 am
by jv_map
Looks good, but make sure the remove line isn't making troubles.

The bots don't require any new aliases, all bot sounds (except bash sounds) are automatically loaded for mp maps :?

Posted: Tue Jul 22, 2003 9:53 am
by small_sumo
Should I do without it? is it any use? I did have a little crash one time but not shure if its related.

Posted: Tue Jul 22, 2003 10:43 am
by jv_map
Honestly I don't know :? :( :oops: