Author Topic: Player play music  (Read 301 times)

0 Members and 1 Guest are viewing this topic.

Offline mini0013xx

  • - Original Poster (OP) -
  • Legless Crawler
  • Posts: 10
  • Country: us
  • Respect: 3
    • View Profile

Player play music

« on: August 03, 2017, 12:43:32 pm »
I am releasing a singleplayer map at the end of this month. I am wanting to put music in my level.


Code: [Select]
music()
{
play = getent("player", "targetname");
trig = getent("music1", "targetname");

trig waittill("trigger");
play playsound("mx_fubar");
}

Noted the player has the targetname "player" and there is a trigger named "music1".

This is the code that I was using to play the music. It works when I am playing audio from other entities (ie planes and tanks) but it is not working for when I want the music to play. Any idea why?

Any help will be appreciated.

Offline codmoddd1234

  • Perk Hacker
  • Posts: 371
  • Country: kh
  • Respect: 333
    • View Profile

Re: Player play music

« Reply #1 on: August 04, 2017, 01:47:06 am »
Music states is what i would use.
Look at the folder "option 1" instructions.txt. Its easy and works.
//
Then after testing look at "option 2" folder. It uses mostly the same files except you can use triggers in radiant and use script_noteworthy for playing different music in your map.

[You are not allowed to view external links. Register or Login to see them]

Offline mini0013xx

  • - Original Poster (OP) -
  • Legless Crawler
  • Posts: 10
  • Country: us
  • Respect: 3
    • View Profile

Re: Player play music

« Reply #2 on: August 11, 2017, 06:23:14 pm »
Music states is what i would use.
Look at the folder "option 1" instructions.txt. Its easy and works.
//
Then after testing look at "option 2" folder. It uses mostly the same files except you can use triggers in radiant and use script_noteworthy for playing different music in your map.

[You are not allowed to view external links. Register or Login to see them]

I have faith in this method! But so far it has not worked for me.

The script compiles but the music does not play. I will be giving you the scripts that I am using.

tokyo.gsc
The setmusicstate is in the Initial function.
Code: [Select]
#include maps\_utility; 
#include common_scripts\utility;
#include maps\tokyo_util;
#include maps\_music;
#include maps\_anim;
//#include maps\_drone;
#using_animtree( "generic_human" );


main()
{
level._effect["fx_ash_embers_light"] = loadfx("maps/see1/fx_fire_embers_patch2");
level._effect["fx_fire_campfire_small"] = loadfx("env/fire/fx_fire_campfire_small");
level._effect["fx_battlefield_smokebank_low_thin"] = loadfx("env/smoke/fx_battlefield_smokebank_low_thin");
level._effect["fx_fire_barrel_small"] = loadfx("env/fire/fx_fire_barrel_small");
level._effect["fx_smk_column_md_gray_dir"] = loadfx("env/smoke/fx_smk_column_md_gray_dir");
level._effect["fx_smoke_window_lg_gry"] = loadfx("env/smoke/fx_smoke_window_lg_gry");
level._effect["fx_smk_plume_xlg_slow_blk"] = loadfx("env/smoke/fx_smk_plume_xlg_slow_blk");
level._effect["fx_pollen_lg"] = loadfx("env/foliage/fx_pollen_lg");
level._effect["fx_elec_sparks_looping"] = loadfx("env/electrical/fx_elec_sparks_looping");
level._effect["fx_smoke_crater"] = loadfx("env/smoke/fx_smoke_crater");
level._effect["fx_fire_house_md_jp"] = loadfx("env/fire/fx_fire_house_md_jp");
level._effect["fx_mortarExp_dirt"] = loadfx("explosions/fx_mortarExp_dirt");
level._effect["fx_fire_barrel_d_light"] = loadfx("env/fire/fx_fire_barrel_d_light");
level._effect["mortarExp_water"] = loadfx("explosions/mortarExp_water");
level._effect["fx_fog_rolling_thick_slow"] = loadfx("env/smoke/fx_fog_rolling_thick_slow");
level._effect["fx_fire_column_creep_md"] = loadfx("env/fire/fx_fire_column_creep_md");
level._effect["fx_fire_150x150_tall_distant"] = loadfx("env/fire/fx_fire_150x150_tall_distant");





maps\_sherman::main("vehicle_usa_tracked_shermanm4a3", "sherman");

// Don't give the player the default loadout, we want to specify it for our custom made map
level.dodgeloadout = true;
// Sets up all of the FX in the level
maps\tokyo_fx::main();
// _load, sets up all of the basic entity behaviors
maps\_load::main();
// Sets the player's weapon loadout... This line should be right after _load::main(), and no waits/delays before it.
set_loadout();
// Sets up ambient sounds
maps\tokyo_amb::main();
// Sets up "canned" animations
maps\tokyo_anim::main();


all_sp_fx = getStructArray( "all_sp_fx", "targetname");
if (IsDefined(all_sp_fx))
{
array_thread( all_sp_fx, ::play_all_sp_fx );
}

loopfx = getStructArray( "loop", "targetname");
if (IsDefined(loopfx))
{
array_thread( loopfx, ::loop );
}

env = getStructArray( "loop_env", "targetname");
if (IsDefined(env))
{
array_thread( env, ::loop2 );
}

env2 = getStructArray( "loop_env2", "targetname");
if (IsDefined(env2))
{
array_thread( env2, ::loop3 );
}

maps\_banzai::init();
maps\_spawner::main();

//songcache();

// Get the bad guys( we should make them into a prefab so easier to implement in different maps )
level.Friendly_Spawns = getEntArray( "beach_ally", "targetname" );
assertex( isdefined( level.Friendly_Spawns ), "The required Allied NPCs are not in the map." );
/*
level.Friendly_Spawns2 = getEntArray( "city_ally", "targetname" );
assertex( isdefined( level.Friendly_Spawns2 ), "The required Allied NPCs are not in the map." );
*/
// Get our custom spawning system trigs
level.Friendly_Triggers = getEntArray( "beachtrig", "targetname" );
assertex( isdefined( level.Friendly_Triggers ), "There are no spawn triggers in the map." );
array_thread( level.Friendly_Triggers, ::spawnTrigThink );
level.Friendly_Triggers2 = getEntArray( "citytrig", "targetname" );
assertex( isdefined( level.Friendly_Triggers2 ), "There are no spawn triggers in the map." );
array_thread( level.Friendly_Triggers2, ::spawnTrigThink );

watersimenable (true);
water_settings();

flag_init("beachmusic");

thread music();
thread eastermusic();
thread shark();

thread obj1();

thread Initial();
allyspawn1();
beachencounter1();
extraally();
beachencounter2();
encounter3spawn();
swampspawn();
//killally1();
allyspawn2();
cityencounter();
docks();
end();
}
// Sets the custom weapon loadout
set_loadout()
{

if (level.script == "tokyo")
{
mptype\player_usa_marine::precache();

add_weapon("springfield");
add_weapon("colt");
add_weapon("fraggrenade");
add_weapon("molotov");

set_switch_weapon("springfield");
set_secondary_offhand("molotov");

PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );

set_laststand_pistol("colt");

set_player_viewmodel( "viewmodel_usa_marine_arms" );

level.campaign = "american";
//return;
}
/*
// Precache's / sets the list of weapons to give to the player when he spawns in
PrecacheItem( "colt" );
PrecacheItem( "m1carbine" );
PrecacheItem( "fraggrenade" );
PrecacheItem( "molotov" );
add_weapon( "colt");
add_weapon( "m1carbine" );
add_weapon( "fraggrenade" );
add_weapon( "molotov" );
// Sets the player's offhand throw weapon (aka smoke/flash)
set_secondary_offhand( "molotov" );
// Sets the player's default (if he does not have a pistol) laststand pistol.
set_laststand_pistol( "colt" );

// Sets the player's viewarms
set_player_viewmodel( "viewmodel_usa_marine_arms");
// Sets the player's viewarms when attacked by an enemy in a melee sequence or if a canned animation calls for them
set_player_interactive_hands( "viewmodel_usa_marine_player" );
// Switches the player's weapon once he spawns in
set_switch_weapon( "m1carbine" );
// Sets the campaign, which is used for battlechatter and other various scripts
level.campaign = "american";
// Precaches the 3rd person model (for when playing coop)
mptype\player_usa_marine::precache();
*/
}

Initial()
{
iprintlnbold( "Take the beach." );
set_vision_set("tokyo", 0.5);

wait(2);

setmusicstate("beachsong");


thread plane1move();
thread plane1rotate();
thread environment();
}

environment()
{
ocean1 = getent("ocean1", "targetname");
ocean2 = getent("ocean2", "targetname");
ocean3 = getent("ocean3", "targetname");
ocean4 = getent("ocean4", "targetname");
ocean5 = getent("ocean5", "targetname");
ocean6 = getent("ocean6", "targetname");
ocean7 = getent("ocean7", "targetname");
ocean8 = getent("ocean8", "targetname");
ocean9 = getent("ocean9", "targetname");

ocean1 playloopsound("calm_surf_r");
ocean2 playloopsound("calm_surf_r");
ocean3 playloopsound("calm_surf_r");
ocean4 playloopsound("calm_surf_r");
ocean5 playloopsound("calm_surf_r");
ocean6 playloopsound("calm_surf_r");
ocean7 playloopsound("calm_surf_r");
ocean8 playloopsound("calm_surf_r");
ocean9 playloopsound("calm_surf_r");


}

allyspawn1()
{
beach_ally = getent( "ally1spawn", "targetname" );
beach_ally waittill( "trigger" );
simple_floodspawn( "beach_ally" );
}

extraally()
{
beach_spawn2 = getent( "beach_spawn2", "targetname" );
beach_spawn2 waittill( "trigger" );
simple_spawn("beach2");
}


ag1_strat()
{

}

eastermusic()
{
trig = getent("eastermusic", "targetname");
radio = getent("radio", "targetname");

trig waittill("trigger");
radio playsound("hook");

}

shark()
{
shark1 = getent("shark1", "targetname");
shark2 = getent("shark2", "targetname");
shark3 = getent("shark3", "targetname");
shark4 = getent("shark4", "targetname");
shark5 = getent("shark5", "targetname");
shark6 = getent("shark6", "targetname");
shark7 = getent("shark7", "targetname");
shark8 = getent("shark8", "targetname");
shark9 = getent("shark9", "targetname");
shark10 = getent("shark10", "targetname");
shark11 = getent("shark11", "targetname");
shark12 = getent("shark12", "targetname");
shark13 = getent("shark13", "targetname");
shark14 = getent("shark14", "targetname");
shark15 = getent("shark15", "targetname");
shark16 = getent("shark16", "targetname");
shark17 = getent("shark17", "targetname");
shark18 = getent("shark18", "targetname");
shark19 = getent("shark19", "targetname");
shark20 = getent("shark20", "targetname");
trig = getent("shark", "targetname");

trig waittill("trigger");

shark1 movez(3100, 45);
shark2 movez(3700, 45);
shark3 movez(3160, 45);
shark4 movez(3350, 45);
shark5 movez(3220, 45);
shark6 movez(3450, 45);
shark7 movez(3130, 45);
shark8 movez(3830, 45);
shark9 movez(3701, 45);
shark10 movez(3630, 45);
shark11 movez(3450, 45);
shark12 movez(3900, 45);
shark13 movez(3850, 45);
shark14 movez(3810, 45);
shark15 movez(3360, 45);
shark16 movez(3550, 45);
shark17 movez(3430, 45);
shark18 movez(3950, 45);
shark19 movez(3620, 45);
shark20 movez(3350, 45);

wait(50);

shark1 delete();
shark2 delete();
shark3 delete();
shark4 delete();
shark5 delete();
shark6 delete();
shark7 delete();
shark8 delete();
shark9 delete();
shark10 delete();
shark11 delete();
shark12 delete();
shark13 delete();
shark14 delete();
shark15 delete();
shark16 delete();
shark17 delete();
shark18 delete();
shark19 delete();
shark20 delete();
}

music()
{
trig = getent("music1", "targetname");

trig waittill("trigger");
setmusicstate("mx_fubar_example");
}



/*
musictriggers()
{
musinit = getent("music1", "targetname");
musland = getent("music2", "targetname");
musbunker = getent("music3", "targetname");

set_flag_on_trigger( musinit, "beachmusic" );
set_flag_on_trigger( musland, "landbattle" );
set_flag_on_trigger( musbunker, "bunker");
}
*/

beachencounter1()
{

//allyguys = getentarray("allyspawn", "targetname");

beachtrig = getent( "beach_spawn1", "targetname" );
spawner = getentarray("e1", "targetname");
beachtrig waittill( "trigger" );

simple_floodspawn("e1", ::e1_strat);

//kill_aigroup("e1");

//wait(2);
//simple_spawn("e1_banzai", ::e1_banzai_strat);
//wait(3);
//simple_spawn("e1_top", ::e1_top_strat);

wait(4);
simple_spawn("e1b");


//level.player setFriendlyChain(getNode("allybeachnode1", "targetname"));
//beachally = getent("beach_ally", "targetname");
//set_color_chain("allybeachnode1");
//beachally setFriendlyChain(getNode("allybeachnode1", "targetname"));

//beachally waittill
//waittill_dead_or_dying(getaiarray("e1"));
//waittill_dead_or_dying(getaiarray("e1b"));
//set_color_chain("allybeachnode2");
//beachally setFriendlyChain(getNode("allybeachnode2", "targetname"));

//allynodebeach1
}

e1_banzai_strat()
{

self endon( "death" );

self.ignoreme = 1;

self.banzai_no_wait = 1;
self.grenadeawareness = 0;
self.ignoresuppression = 1;
self.script_max_banzai_distance = 2000;

self thread maps\_banzai::banzai_force();
self thread maps\_banzai::banzai();

wait( 1.75 + RandomFloat( 0.5 ) );

self.ignoreme = 0;
}

e1_strat()
{

}

e1_top_strat()
{

}

beachencounter2()
{
autosave_by_name( "e2save" );

beach1 = getEntArray("e1", "targetname");
beach1 die();

beachtrig2 = getent( "encounter2a", "targetname" );
beachtrig2 waittill( "trigger" );

//thread disablespawners(beach1);

//previous = getentarray("e1", "targetname");

//thread disablespawners(previous);

//music_switcher("mx_WildCard_loop_g");

beach2spawner = getent("e2_front", "targetname");

simple_floodspawn("e2_mg", ::e2_mg_strat);
simple_floodspawn("e2_front", ::e2_front_strat);
//simple_floodspawn("e2_frontb", ::e2_frontb_strat);
simple_spawn("e2_top");

//waittill_dead_or_dying(beach2spawner, 14)
simple_spawn("e2b");


}

e2_frontb_strat()
{

}

e2b_strat()
{

}

e2_banzai_strat()
{

self endon( "death" );

self.ignoreme = 1;

self.banzai_no_wait = 1;
self.grenadeawareness = 0;
self.ignoresuppression = 1;
self.script_max_banzai_distance = 2000;

self thread maps\_banzai::banzai_force();
self thread maps\_banzai::banzai();

wait( 1.75 + RandomFloat( 0.5 ) );

self.ignoreme = 0;
}

e2_front_strat()
{

}

e2_mg_strat()
{
//setTurretNode( node, type99_lmg );

beach_mg = getent( "beach_mg", "targetname" );


beach_mg MakeTurretUsable();

"e2_mg" canUseTurret( beach_mg );
type99user = beach_mg getTurretOwner();

self.ignoresuppression = 1;
}

encounter3spawn()
{
//beach2 = getentarray("e2_front", "targetname");
beach2 = getEntArray("e2_front", "targetname");
beach2mg = getEntArray("e2_mg", "targetname");

beach2 die();
beach2mg die();

enc3trigger = getent( "enc3", "targetname" );
enc3trigger waittill( "trigger" );

//thread disablespawners(beach2);

iprintlnbold( "Push to the bunker." );

thread plane2move();

autosave_by_name( "e3save1" );

simple_spawn("e3init");
simple_spawn("enc3_mgspawner1", ::e3a_strat);
simple_spawn("enc3_mgspawner2", ::e3a_strat2);
//wait(2);
//plane = getent( "planepass", "targetname" );
//plane moveX( 5032, 5, 0.1, 0.1 );
wait(10);
simple_floodspawn("e3a", ::e3mg_strat);
/*
enc3btrig = getent( "trig3b", "targetname" );
enc3btrig waittill( "trigger" );
simple_spawn("e3b");
simple_floodspawn("e3bside");
*/
}

swampspawn()
{
swamp1trig = getent( "swampspawner", "targetname" );
swamp1trig waittill ("trigger");
simple_floodspawn("swamp1", ::swamp1strat);

swamp2trig = getent( "mainswampspawn", "targetname" );
swamp2trig waittill ("trigger");
simple_spawn("swamp2init");
wait(16);
simple_floodspawn("swamp2");

swamp3trig = getent( "roadrunners", "targetname" );
swamp3trig waittill ("trigger");

autosave_by_name( "e3save2" );

simple_spawn("runners");
wait(6);
simple_spawn("encampment");

finalapp = getent( "behindbunker", "targetname" );
finalapp waittill ("trigger");
simple_spawn("backdefense");
//simple_floodspawn("backflood");

final = getent("last_beachai", "targetname");
final waittill ("trigger");
simple_floodspawn("e3bside");

killspawns();
swamp = getentarray("swamp1", "targetname");
swamp die();

autosave_by_name( "e3save3" );

bunkertrigger();
}

bunkertrigger()
{
trig = getent("music3", "targetname");
trig waittill("trigger");

//set_vision_set("ber2_darksubway", 0.5);
}



killspawns()
{
guys = getentarray("e3bside", "targetname");

trig = getent("kill", "targetname");
trig waittill ("trigger");

guys.count = 0;
//thread disableSpawners1();
//thread disablespawners(guys);
}

swamp1strat()
{

}

e3mg_strat()
{

}

e3a_strat()
{
//setTurretNode( node, type99_lmg );

bunker_mg = getent( "bunkermg2", "targetname" );


bunker_mg MakeTurretUsable();

"enc3_mgspawner1" canUseTurret( bunker_mg );
type99user = bunker_mg getTurretOwner();
}

e3a_strat2()
{
//setTurretNode( node, type99_lmg );

bunker_mg2 = getent( "bunkermg", "targetname" );


bunker_mg2 MakeTurretUsable();

"enc3_mgspawner2" canUseTurret( bunker_mg2 );
type99user = bunker_mg2 getTurretOwner();
}

allyspawn2()
{
city = getent( "cityallyspawn", "targetname" );
city waittill( "trigger" );
simple_floodspawn("city_ally");
set_vision_set("tokyo", 0.5);

thread plane_city();
thread plane_city2();
}

killenemy()
{
swamp = getentarray("swamp1", "targetname");
swamp2 = getentarray("swamp2", "targetname");
e3bside = getentarray("e3bside", "targetname");
beach1 = getentarray("", "targetname");
beach2 = getEntArray("e2_front", "targetname");
beach2mg = getEntArray("e2_mg", "targetname");
beachally = getentarray("beach_ally", "targetname");

i = 0;
while(i < 32)
{
//swamp[i].count = 0;
disablespawners(swamp);
swamp[i] thread self_delete();
kill_aigroup( swamp[i] );

//beachally[i].count = 0;
disablespawners(beachally);
beachally[i] thread self_delete();
kill_aigroup( beachally[i] );

//beach1[i].count = 0;
disablespawners(beach1);
beach1[i] thread self_delete();
kill_aigroup( beach1[i] );

//beach2[i].count = 0;
disablespawners(beach2);
beach2[i] thread self_delete();
kill_aigroup( beach2[i] );

//beach2mg[i].count = 0;
disablespawners(beach2mg);
beach2mg[i] thread self_delete();
kill_aigroup( beach2mg[i] );

//swamp2[i].count = 0;
disablespawners(swamp2);
swamp2[i] thread self_delete();
kill_aigroup( swamp2[i] );

//e3bside[i].count = 0;
disablespawners(e3bside);
e3bside[i] thread self_delete();
kill_aigroup( e3bside[i] );

i++;
}
}

cityencounter()
{

thread killenemy();
//swamp die();
//beachally die();

e4trig = getent( "cityenemyspawn", "targetname" );
e4trig waittill ( "trigger" );
/*
for( x = 0 ; x < level.Friendly_Spawns.size ; x++ )
{
level.Friendly_Spawns[x].count = 0;
}
*/
iprintlnbold( "Take the city." );

autosave_by_name( "e4save1" );

simple_floodspawn("city_floodspawn");
//waittill_dead_or_dying(getaiarray("cityenemyspawn"), 12);

wait(20);
simple_spawn("city_bait", "targetname");

e4btrigger = getent( "trigger_cityspawn2", "targetname" );
e4btrigger waittill ( "trigger" );
simple_floodspawn("city_floodspawn2");
/*
e4ctrig = getent( "buildingspawners", "targetname" );
e4ctrig = waittill ("trigger");
simple_floodspawn("buildinga");
*/
}

docks()
{
city1 = getentarray("city_floodspawn", "targetname");
city2 = getentarray("city_floodspawn2", "targetname");
city1.count = 0;
city2.count = 0;
city1 die();
city2 die();

iprintlnbold( "Take the docks!!" );

autosave_by_name( "e4save2" );

}

end()
{
endtrig = getent("end", "targetname");
endtrig waittill("trigger");
iprintlnbold( "Great job! You've landed a beach head in Tokyo!");

wait(10);

iprintlnbold("Thank you for playing!");

wait(2);

iprintlnbold("Mapped and scripted by Cayden Berry");
/*
for (i = 0; i < players.size; i++)
{
// fade to black
fadetowhite[i].x = 0;
fadetowhite[i].y = 0;
fadetowhite[i].alpha = 0;

fadetowhite[i].horzAlign = "fullscreen";
fadetowhite[i].vertAlign = "fullscreen";
fadetowhite[i].foreground = true;
fadetowhite[i] SetShader( "white", 640, 480 );

// Fade into white
fadetowhite[i] FadeOverTime( 0.2 );
fadetowhite[i].alpha = 1;
}
*/
wait(3);

iprintlnbold("Special thanks to ugx-mods.com user codmoddd1234 for helping me with the FX!");

wait(6);

iprintlnbold("Quit to return to the main menu");
nextmission();
}

e4_strat()
{

}







water_settings()
{
 /* Water Dvars    Default Values  What They Do
  ======================================================================
 r_watersim_enabled   default = true  Enables dynamic water simulation
 r_watersim_debug   default = false  Enables bullet debug markers
 r_watersim_flatten   default = false  Flattens the water surface out
 r_watersim_waveSeedDelay default = 500.0  Time between seeding a new wave( ms )
 r_watersim_curlAmount  default = 0.5  Amount of curl applied
 r_watersim_curlMax   default = 0.4  Maximum curl limit
 r_watersim_curlReduce  default = 0.95  Amount curl gets reduced by when over limit
 r_watersim_minShoreHeight default = 0.04  Allows water to lap over the shoreline edge
 r_watersim_foamAppear  default = 20.0  Rate foam appears at
 r_watersim_foamDisappear default = 0.78  Rate foam disappears at
 r_watersim_windAmount   default = 0.02  Amount of wind applied
 r_watersim_windDir   default = 45.0  Wind direction( degrees )
 r_watersim_windMax   default = 0.4   Maximum wind limit
 r_watersim_particleGravity default = 0.03  Particle gravity
 r_watersim_particleLimit default = 2.5  Limit at which particles get spawned
 r_watersim_particleLength default = 0.03  Length of each particle
 r_watersim_particleWidth default = 2.0  Width of each particle
 */
 
 SetDvar( "r_watersim_curlAmount",   1 );
 SetDvar( "r_watersim_curlMax",    1 );
 SetDvar( "r_watersim_curlReduce",   0.95 );
 SetDvar( "r_watersim_minShoreHeight",  -3.2 );
 SetDvar( "r_watersim_waveSeedDelay",  250.0 );
 SetDvar( "r_watersim_foamAppear",   20 );
 SetDvar( "r_watersim_foamDisappear",  0.775 );
 SetDvar( "r_watersim_windAmount",   0.4 );
 SetDvar( "r_watersim_windMax",    0.21 );
 SetDvar( "r_watersim_windDir",    340.0 );
}

/*
songcache()
{
song = [];
song[0] = "mx_fubar"; //Beach Encounter
song[1] = "mx_WildCard_loop_g"; //E3 & Swamp encounter2a
song[2] = "mx_zeros_alt_c"; // City encounter
song[3] = "mx_dog_wave_b"; //docks encounter
}
*/
/*
precachefx()
{
level._effect["beach_mortar_hole"] = loadfx("env/smoke/fx_smoke_crater");
}

runfx()
{
self.fx = PlayFX{level._effect[self.script_string], self.origin};
}
*/

// Handles user triggering for spawners
spawnTrigThink()
{
level endon( "reached_end" );

while( 1 )
{
self waittill( "trigger" );

eLocos = getStructArray( self.target, "targetname" );

if( !isDefined( eLocos ) )
{
continue; // No where to spawn :(
}

howManyToSpawn = eLocos.size;
howManyCanSpawn = 7;

if( !isDefined( howManyCanSpawn ) || howManyCanSpawn <= 0 )
{
continue;
}
for( x = 0 ; x < howManyCanSpawn ; x++ )
{
thread moveSpawners( eLocos[x] );
}
}

}

moveSpawners( eLoc )
{
for( x = 0 ; x < level.Friendly_Spawns.size ; x++ )
{
level.Friendly_Spawns[x].origin = eLoc.origin;
}
}

disableSpawners1()
{
for( x = 0 ; x < level.Friendly_Spawns.size ; x++ )
{
level.Friendly_Spawns[x].count = 0;
}
}

disablespawners(spawner)
{
for( x = 0 ; x < level.spawner.size ; x++ )
{
level.spawner[x].count = 0;
}
}

// This will precache and set the loadout rather than duplicate work.
add_weapon( weapon_name )
{
PrecacheItem( weapon_name );
level.player_loadout[level.player_loadout.size] = weapon_name;
}

// This sets the secondary offhand type when the player spawns in
set_secondary_offhand( weapon_name )
{
level.player_secondaryoffhand = weapon_name;
}

// This sets the the switchtoweapon when the player spawns in
set_switch_weapon( weapon_name )
{
level.player_switchweapon = weapon_name;
}

// Sets the player's laststand pistol
set_laststand_pistol( weapon )
{
level.laststandpistol = weapon;
}

// Sets the player's viewmodel
set_player_viewmodel( viewmodel )
{
PrecacheModel( viewmodel );
level.player_viewmodel = viewmodel;
}

// Sets the player's handmodel used for "interactive" hands and banzai attacks
set_player_interactive_hands( model )
{
level.player_interactive_hands = model;
PrecacheModel( level.player_interactive_hands );
}

play_all_sp_fx()
{
if( IsDefined(self.script_personality) && self.script_personality == "reverse_fx" )
{
playfx (level._effect[self.script_noteworthy], self.origin,AnglesToForward( self.angles ));
}
else
{
PlayFX( level._effect[self.script_noteworthy], self.origin );
}
}

loop()
{
playLoopedFX(level._effect[self.script_noteworthy], randomFloatRange(4.0,20.0), self.origin);
}

loop2()
{
playLoopedFX(level._effect[self.script_noteworthy], 0.1, self.origin);
}

loop3()
{
playLoopedFX(level._effect[self.script_noteworthy], 0.5, self.origin);
}



obj1()
{
obj1 = getent("obj1","targetname");
trig = getent("trig", "targetname");

objective_add(1, "active", &"Get_Off_Of_The_Beach", getent("obj1", "targetname").origin);
objective_current(1);
trig waittill("trigger");
objective_state(1, "done");
wait(2);
thread obj2();
}

obj2()
{
obj1 = getent("obj2","targetname");
trig = getent("music3", "targetname");

objective_add(2, "active", &"Get_Inside_The_Bunker", getent("obj2", "targetname").origin);
objective_current(2);
trig waittill("trigger");
objective_state(2, "done");
wait(2);
thread obj3();
}

obj3()
{
obj1 = getent("obj3","targetname");
trig = getent("3", "targetname");

objective_add(3, "active", &"Get_To_The_City", getent("obj3", "targetname").origin);
objective_current(3);
trig waittill("trigger");
objective_state(3, "done");
wait(2);
thread obj4();
}

obj4()
{
obj1 = getent("obj4","targetname");
trig = getent("4", "targetname");

objective_add(4, "active", &"Push_Down_The_Street", getent("obj4", "targetname").origin);
objective_current(4);
trig waittill("trigger");
objective_state(4, "done");
wait(2);
thread obj5();
}

obj5()
{
obj1 = getent("obj5","targetname");
trig = getent("5", "targetname");

objective_add(5, "active", &"Push_Through_The_Building", getent("obj5", "targetname").origin);
objective_current(5);
trig waittill("trigger");
objective_state(5, "done");
wait(2);
thread obj6();
}

obj6()
{
obj1 = getent("obj6","targetname");
trig = getent("dockspawn", "targetname");

objective_add(6, "active", &"Get_To_The_Other_Beach", getent("obj6", "targetname").origin);
objective_current(6);
trig waittill("trigger");
objective_state(6, "done");
wait(2);
thread obj7();
}

obj7()
{
obj1 = getent("obj7","targetname");
trig = getent("endallies", "targetname");

objective_add(7, "active", &"Clear_The_Docks", getent("obj7", "targetname").origin);
objective_current(7);
trig waittill("trigger");
objective_state(7, "done");
}

plane1move()
{
plane = getent("plane1", "targetname");
dest1 = getent("p1_1", "targetname");
dest2 = getent("p1_2", "targetname");

plane playsound("planeby_2");

plane moveto(plane.origin, 0.001);

wait(0.001);

plane moveto(dest1.origin, 14);

wait(13);

plane moveto(dest2.origin, 4);

wait(8);

plane delete();
}

plane1rotate()
{
plane = getent("plane1", "targetname");
dest1 = getent("p1_1", "targetname");
dest2 = getent("p1_2", "targetname");

plane rotateto(dest1.angles, 1);
wait(13);
plane rotateto(dest2.angles, 1);
}

plane2move()
{
plane = getent("plane2", "targetname");
dest1 = getent("p2_1", "targetname");
dest2 = getent("p2_2", "targetname");
dest3 = getent("p2_3", "targetname");

plane moveto(plane.origin, 0.1);
wait(0.1);
plane playsound("planeby_3");
plane moveto(dest1.origin, 1.5);
wait(1.5);
plane rotateto(dest1.angles, 0.1);
plane moveto(dest2.origin, 8);
wait(8);
plane rotateto(dest3.angles, 0.1);
plane moveto(dest3.origin, 2);
wait(5);

plane delete();

}

plane_city()
{
plane = getent("plane3_1", "targetname");
trig = getent("cityplane", "targetname");
dest1 = getent("p3_1a", "targetname");
dest2 = getent("p3_1b", "targetname");

trig waittill("trigger");

plane moveto(dest1.origin, 0.1);
plane rotateto(dest1.angles, 0.1);

wait(0.1);
plane playsound("planeby_3");
thread gunsfunction();
plane moveto(dest2.origin, 14);
wait(20);

plane delete();
}

plane_city2()
{
plane = getent("plane3_2", "targetname");
dest1 = getent("p3_2a", "targetname");
dest2 = getent("p3_2b", "targetname");
trig = getent("cityplane", "targetname");


trig waittill("trigger");

plane moveto(dest1.origin, 0.1);
plane rotateto(dest1.angles, 0.1);

wait(0.1);

plane playsound("planeby_2");
plane moveto(dest2.origin, 14);

wait(20);

plane delete();
}

gunsfunction()
{
plane = getent("plane3_2", "targetname");

wait(4);

plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
plane playsound("wpn_50cal_mn_dist");
wait(0.125);
}

plane_end()
{

}

tokyo.csc
Code: [Select]
// Test clientside script for tokyo

#include clientscripts\_utility;

main()
{

// _load!
clientscripts\_load::main();

thread clientscripts\_audio::audio_init(0);

thread clientscripts\tokyo_amb::main();

// This needs to be called after all systems have been registered.
thread waitforclient(0);

println("*** Client : tokyo running...");
}

tokyo_amb.csc
Code: [Select]
#include clientscripts\_utility; 
#include clientscripts\_ambientpackage;
#include clientscripts\_music;
#include clientscripts\_busing;


main()
{
declareMusicState("beachsong");
musicAliasLoop("beachsong", 4, 6);
}


Tokyo.csv (soundalias)
Code: [Select]
//This is the soundalias for Tokyo

beachsong,,,Stream\Music\Mission\oki2\mx_fubar.wav,,0.9,0.9,,,,,,,music,,,0,,,,,,,2d,streamed,,looping,,,,,,,,music,,,,,,,,,,,,100,100,0.25,1,,
landbattlesong,,,Stream\Music\Mission\Peleliu_1\final\mx_WildCard_loop_g.wav,,0.8,0.8,,,,,,,music,,,0,,,,,,,2d,streamed,,looping,,,,,,,,music_all,,,,,,,,,,,100,100,0.25,1

hook,sfx\music\hook.wav,,0.8,0.8,,,,,,,music,,,0,,,,,,,2d,streamed,,looping,,,,,,,,music_all,,,,,,,,,,,100,100,0.25,1


tokyo.csv (Zone file)
Code: [Select]
// NOTE: If you add a comment, put a space after the double forward slash or you will get issues
ignore,code_post_gfx
ignore,common

// map specific files
col_map_sp,maps/tokyo.d3dbsp
gfx_map,maps/tokyo.d3dbsp
rawfile,maps/tokyo.gsc
rawfile,maps/tokyo_amb.gsc
rawfile,maps/tokyo_anim.gsc
rawfile,maps/tokyo_fx.gsc
//rawfile,maps/createfx/tokyo.gsc
rawfile,clientscripts/tokyo.csc
rawfile,clientscripts/tokyo_fx.csc
rawfile,clientscripts/createfx/tokyo_fx.csc
rawfile,maps/createfx/tokyo_fx.gsc

// Weapons

weapon,sp/m1garand
weapon,sp/colt
weapon,sp/fraggrenade
weapon,sp/m8_white_smoke
weapon,sp/bar
weapon,sp/thompson
weapon,sp/type99_lmg
weapon,sp/type99_rifle
weapon,sp/type100_smg
weapon,sp/m1carbine
weapon,sp/type100_smg_aperture
weapon,sp/springfield
weapon,sp/napalmblob
weapon,sp/napalmbloblight
weapon,sp/molotov

//weapon,sp/type99_lmg_bipod
//weapon,sp/type92_bipod_stand
//weapon,sp/corsair_mg

// Viewarms
xmodel,viewmodel_usa_marine_arms
xmodel,viewmodel_usa_marine_player

// 3rd person model
include,common_player_us

// sfx
sound,character,,all_sp
sound,character,,all_mp
sound,weapons,,all_sp
sound,weapons,,all_mp
sound,common,,all_mp
sound,common,,all_sp
sound,us_battlechatter,,all_sp
sound,ja_battlechatter,,all_sp
sound,music,,all_sp
sound,music,,all_mp

sound,music,oki2,all_sp

rawfile,sound/stream/music/level/oki2/mx_fubar.wav
rawfile,sound/stream/music/level/oki2/mx_fubar


rawfile,sound,stream,music,level,oki2,mx_fubar.wav
sound,stream,music,level,oki2,mx_fubar

/*
sound, common, yourname_map, all_sp
sound, generic, yourname_map, all_sp
sound, voiceovers, yourname_map, all_sp
sound, requests, yourname_map, all_sp
sound, character, yourname_map, all_sp
sound, projectiles, yourname_map, all_sp
sound, music, yourname_map, all_sp
sound, yourname_map, yourname_map, all_sp
sound, physics, yourname_map, all_sp
sound, destructibles, yourname_map, all_sp
Sound, weapons, audio_test_tuey, all_sp
*/

//sound,oki2,,BlueSwede-HookedOnAFeeling
sound,oki2,,mx_fubar

sound,music,tokyo,all_sp

sound,Stream,Music,Mission,oki2,mx_fubar
sound,Stream,Music,Mission,Peleliu_1,final,mx_WildCard_loop_g
sound,sfx,music,hook

sound,oki2,,all_sp

SFX/Weapon/rifle/bar/Fire/wpn_BAR_st_f.wav
SFX/Weapon/rifle/bar/Fire/wpn_BAR_st_act.wav
SFX\Weapon\Rifle\BAR\Fire\mono_##
SFX/Weapon/Rifle/BAR/Fire/act_##
SFX/Weapon/dist/us/dist_us_bar.wav
SFX/Weapon/Rifle/BAR/Foley/bar_charge.wav
SFX/Weapon/Rifle/BAR/Foley/bar_mag_in.wav
SFX/Weapon/Rifle/BAR/Foley/bar_mag_out.wav
SFX/Weapon/Rifle/BAR/Foley/bar_tap.wav
SFX/Weapon/Rifle/BAR/Foley/bar_charge.wav
SFX/Weapon/Rifle/BAR/Foley/bar_mag_in.wav
SFX/Weapon/Rifle/BAR/Foley/bar_mag_out.wav
SFX/Weapon/Rifle/BAR/Foley/bar_tap.wav





sound,music,tokyo,all_sp






//Turret
// Type99
weapon,sp/type99_lmg_bipod
weapon,sp/type99_lmg_bipod_stand
weapon,sp/type99_lmg_bipod_crouch
weapon,sp/type99_lmg_bipod_prone
weapon,sp/type99_lmg_bipod_wet
weapon,mp/type100smg_aperture_mp
weapon,sp/sherman_tank_mg
weapon,sp/tiger_turret
weapon,sp/tiger_coaxial_mg
weapon,sp/sherman_turret
weapon,sp/see2_tiger_turret

//fx
fx,env/fire/fx_ash_embers_light
fx,env/fire/fx_fire_campfire_small
fx,env/fire/fx_fire_barrel_small
fx,env/smoke/fx_battlefield_smokebank_low_thin
fx,env/smoke/fx_smk_column_md_gray_dir
fx,env/smoke/fx_smoke_window_lg_gry
fx,env/smoke/fx_smk_plume_xlg_slow_blk
fx,env/foliage/fx_pollen_lg
fx,env/electrical/fx_elec_sparks_looping
fx,env/smoke/fx_smoke_crater
fx,env/fire/fx_fire_house_md_jp
fx,explosions/fx_mortarExp_dirt
fx,explosions/mortarExp_water
fx,env/fire/fx_fire_barrel_d_light
fx,env/smoke/fx_fog_rolling_thick_slow
fx,maps/see1/fx_fire_embers_patch2
fx,env/fire/fx_fire_column_creep_md
fx,env/fire/fx_fire_150x150_tall_distant


//MODEL


//VisionFiles
rawfile,vision/tokyo.vision
rawfile,vision/ber2_darksubway.vision
//BUNKER
//CITY














//Why not?

sound,Tokyo,Music,all_sp


Got any idea why it won't play? Any help will be greatly appreciated, thank you.

Offline codmoddd1234

  • Perk Hacker
  • Posts: 371
  • Country: kh
  • Respect: 333
    • View Profile

Re: Player play music

« Reply #3 on: August 11, 2017, 10:53:50 pm »
// one or both of these is wrong
sound,Tokyo,Music,all_sp
sound,music,tokyo,all_sp
// It should prob be
sounds,tokyo,tokyo,all_sp

// all your sp weapon sounds can be done with one line
sound,weapons,audio_test_tuey,all_sp

// make sure to put a space after // in your csv files otherwise it skips the next lines. There is alot of them in your zone_source/tokyo.csv
//weapon,sp/type99_lmg_bipod....wrong
// weapon,sp/type99_lmg_bipod....right

Im guessing its skipping over lots of stuff in your csv.

Offline mini0013xx

  • - Original Poster (OP) -
  • Legless Crawler
  • Posts: 10
  • Country: us
  • Respect: 3
    • View Profile

Re: Player play music

« Reply #4 on: August 12, 2017, 06:15:42 am »
// one or both of these is wrong
sound,Tokyo,Music,all_sp
sound,music,tokyo,all_sp
// It should prob be
sounds,tokyo,tokyo,all_sp

// all your sp weapon sounds can be done with one line
sound,weapons,audio_test_tuey,all_sp

// make sure to put a space after // in your csv files otherwise it skips the next lines. There is alot of them in your zone_source/tokyo.csv
//weapon,sp/type99_lmg_bipod....wrong
// weapon,sp/type99_lmg_bipod....right

Im guessing its skipping over lots of stuff in your csv.

So I added the spaces after all of the // (which makes sense now that I didn't think about it), however it isn't doing anything to get the music to play. I understand how music states are supposed to work after reading the scripts of the official levels, but it still isn't working so I must be doing something wrong. Either that or world at war isn't able to access my sound files for some reason or another.


here is the csv
Code: [Select]
// NOTE: If you add a comment, put a space after the double forward slash or you will get issues
ignore,code_post_gfx
ignore,common

// map specific files
col_map_sp,maps/tokyo.d3dbsp
gfx_map,maps/tokyo.d3dbsp
rawfile,maps/tokyo.gsc
rawfile,maps/tokyo_amb.gsc
rawfile,maps/tokyo_anim.gsc
rawfile,maps/tokyo_fx.gsc
// rawfile,maps/createfx/tokyo.gsc
rawfile,clientscripts/tokyo.csc
rawfile,clientscripts/tokyo_fx.csc
rawfile,clientscripts/createfx/tokyo_fx.csc
rawfile,maps/createfx/tokyo_fx.gsc

// Weapons

weapon,sp/m1garand
weapon,sp/colt
weapon,sp/fraggrenade
weapon,sp/m8_white_smoke
weapon,sp/bar
weapon,sp/thompson
weapon,sp/type99_lmg
weapon,sp/type99_rifle
weapon,sp/type100_smg
weapon,sp/m1carbine
weapon,sp/type100_smg_aperture
weapon,sp/springfield
weapon,sp/napalmblob
weapon,sp/napalmbloblight
weapon,sp/molotov

// weapon,sp/type99_lmg_bipod
// weapon,sp/type92_bipod_stand
// weapon,sp/corsair_mg

// Viewarms
xmodel,viewmodel_usa_marine_arms
xmodel,viewmodel_usa_marine_player

// 3rd person model
include,common_player_us

// sfx
sound,character,,all_sp
sound,character,,all_mp
sound,weapons,,all_sp
sound,weapons,,all_mp
sound,common,,all_mp
sound,common,,all_sp
sound,us_battlechatter,,all_sp
sound,ja_battlechatter,,all_sp
sound,music,,all_sp
sound,music,,all_mp

sound,music,oki2,all_sp

rawfile,sound/stream/music/level/oki2/mx_fubar.wav
rawfile,sound/stream/music/level/oki2/mx_fubar


rawfile,sound,stream,music,level,oki2,mx_fubar.wav
sound,stream,music,level,oki2,mx_fubar



// sound,oki2,,BlueSwede-HookedOnAFeeling
sound,oki2,,mx_fubar

sound,music,tokyo,all_sp

sound,Stream,Music,Mission,oki2,mx_fubar
sound,Stream,Music,Mission,Peleliu_1,final,mx_WildCard_loop_g
sound,sfx,music,hook

sound,oki2,,all_sp


sound,music,tokyo,all_sp






// Turret
// Type99
weapon,sp/type99_lmg_bipod
weapon,sp/type99_lmg_bipod_stand
weapon,sp/type99_lmg_bipod_crouch
weapon,sp/type99_lmg_bipod_prone
weapon,sp/type99_lmg_bipod_wet
weapon,mp/type100smg_aperture_mp
weapon,sp/sherman_tank_mg
weapon,sp/tiger_turret
weapon,sp/tiger_coaxial_mg
weapon,sp/sherman_turret
weapon,sp/see2_tiger_turret

// fx
fx,env/fire/fx_ash_embers_light
fx,env/fire/fx_fire_campfire_small
fx,env/fire/fx_fire_barrel_small
fx,env/smoke/fx_battlefield_smokebank_low_thin
fx,env/smoke/fx_smk_column_md_gray_dir
fx,env/smoke/fx_smoke_window_lg_gry
fx,env/smoke/fx_smk_plume_xlg_slow_blk
fx,env/foliage/fx_pollen_lg
fx,env/electrical/fx_elec_sparks_looping
fx,env/smoke/fx_smoke_crater
fx,env/fire/fx_fire_house_md_jp
fx,explosions/fx_mortarExp_dirt
fx,explosions/mortarExp_water
fx,env/fire/fx_fire_barrel_d_light
fx,env/smoke/fx_fog_rolling_thick_slow
fx,maps/see1/fx_fire_embers_patch2
fx,env/fire/fx_fire_column_creep_md
fx,env/fire/fx_fire_150x150_tall_distant


// MODEL


// VisionFiles
rawfile,vision/tokyo.vision
rawfile,vision/ber2_darksubway.vision
// BUNKER
// CITY














// Why not?

sound,Tokyo,Music,all_sp
sounds,Tokyo,Music,all_sp
sounds,Music,Tokyo,all_sp
sounds,tokyo,tokyo,all_sp

/*
sound, common, yourname_map, all_sp
sound, generic, yourname_map, all_sp
sound, voiceovers, yourname_map, all_sp
sound, requests, yourname_map, all_sp
sound, character, yourname_map, all_sp
sound, projectiles, yourname_map, all_sp
sound, music, yourname_map, all_sp
sound, yourname_map, yourname_map, all_sp
sound, physics, yourname_map, all_sp
sound, destructibles, yourname_map, all_sp
Sound, weapons, audio_test_tuey, all_sp
*/

I even set the music state in my tokyo.gsc in the main function to make sure that it was working.
Code: [Select]
main()
{
level._effect["fx_ash_embers_light"] = loadfx("maps/see1/fx_fire_embers_patch2");
level._effect["fx_fire_campfire_small"] = loadfx("env/fire/fx_fire_campfire_small");
level._effect["fx_battlefield_smokebank_low_thin"] = loadfx("env/smoke/fx_battlefield_smokebank_low_thin");
level._effect["fx_fire_barrel_small"] = loadfx("env/fire/fx_fire_barrel_small");
level._effect["fx_smk_column_md_gray_dir"] = loadfx("env/smoke/fx_smk_column_md_gray_dir");
level._effect["fx_smoke_window_lg_gry"] = loadfx("env/smoke/fx_smoke_window_lg_gry");
level._effect["fx_smk_plume_xlg_slow_blk"] = loadfx("env/smoke/fx_smk_plume_xlg_slow_blk");
level._effect["fx_pollen_lg"] = loadfx("env/foliage/fx_pollen_lg");
level._effect["fx_elec_sparks_looping"] = loadfx("env/electrical/fx_elec_sparks_looping");
level._effect["fx_smoke_crater"] = loadfx("env/smoke/fx_smoke_crater");
level._effect["fx_fire_house_md_jp"] = loadfx("env/fire/fx_fire_house_md_jp");
level._effect["fx_mortarExp_dirt"] = loadfx("explosions/fx_mortarExp_dirt");
level._effect["fx_fire_barrel_d_light"] = loadfx("env/fire/fx_fire_barrel_d_light");
level._effect["mortarExp_water"] = loadfx("explosions/mortarExp_water");
level._effect["fx_fog_rolling_thick_slow"] = loadfx("env/smoke/fx_fog_rolling_thick_slow");
level._effect["fx_fire_column_creep_md"] = loadfx("env/fire/fx_fire_column_creep_md");
level._effect["fx_fire_150x150_tall_distant"] = loadfx("env/fire/fx_fire_150x150_tall_distant");





maps\_sherman::main("vehicle_usa_tracked_shermanm4a3", "sherman");

// Don't give the player the default loadout, we want to specify it for our custom made map
level.dodgeloadout = true;
// Sets up all of the FX in the level
maps\tokyo_fx::main();
// _load, sets up all of the basic entity behaviors
maps\_load::main();
// Sets the player's weapon loadout... This line should be right after _load::main(), and no waits/delays before it.
set_loadout();
// Sets up ambient sounds
maps\tokyo_amb::main();
// Sets up "canned" animations
maps\tokyo_anim::main();


all_sp_fx = getStructArray( "all_sp_fx", "targetname");
if (IsDefined(all_sp_fx))
{
array_thread( all_sp_fx, ::play_all_sp_fx );
}

loopfx = getStructArray( "loop", "targetname");
if (IsDefined(loopfx))
{
array_thread( loopfx, ::loop );
}

env = getStructArray( "loop_env", "targetname");
if (IsDefined(env))
{
array_thread( env, ::loop2 );
}

env2 = getStructArray( "loop_env2", "targetname");
if (IsDefined(env2))
{
array_thread( env2, ::loop3 );
}

maps\_banzai::init();
maps\_spawner::main();

//songcache();

// Get the bad guys( we should make them into a prefab so easier to implement in different maps )
level.Friendly_Spawns = getEntArray( "beach_ally", "targetname" );
assertex( isdefined( level.Friendly_Spawns ), "The required Allied NPCs are not in the map." );
/*
level.Friendly_Spawns2 = getEntArray( "city_ally", "targetname" );
assertex( isdefined( level.Friendly_Spawns2 ), "The required Allied NPCs are not in the map." );
*/
// Get our custom spawning system trigs
level.Friendly_Triggers = getEntArray( "beachtrig", "targetname" );
assertex( isdefined( level.Friendly_Triggers ), "There are no spawn triggers in the map." );
array_thread( level.Friendly_Triggers, ::spawnTrigThink );
level.Friendly_Triggers2 = getEntArray( "citytrig", "targetname" );
assertex( isdefined( level.Friendly_Triggers2 ), "There are no spawn triggers in the map." );
array_thread( level.Friendly_Triggers2, ::spawnTrigThink );

watersimenable (true);
water_settings();

setmusicstate("beachsong");


thread music();
thread eastermusic();
thread shark();

thread obj1();

thread Initial();
allyspawn1();
beachencounter1();
extraally();
beachencounter2();
encounter3spawn();
swampspawn();
//killally1();
allyspawn2();
cityencounter();
docks();
end();
}

Here is the soundalias for "beachsong", in case if you were wondering.
Code: [Select]
beachsong,,,Stream\Music\Mission\oki2\mx_fubar.wav,,0.9,0.9,,,,,,,music,,,0,,,,,,,2d,streamed,,looping,,,,,,,,music,,,,,,,,,,,,100,100,0.25,1,,


Offline codmoddd1234

  • Perk Hacker
  • Posts: 371
  • Country: kh
  • Respect: 333
    • View Profile

Re: Player play music

« Reply #5 on: August 12, 2017, 02:56:58 pm »
Remove  these  lines.
rawfile,sound/stream/music/level/oki2/mx_fubar.wav
rawfile,sound/stream/music/level/oki2/mx_fubar
rawfile,sound,stream,music,level,oki2,mx_fubar.wav
sound,stream,music,level,oki2,mx_fubar
sound,oki2,,mx_fubar
sound,music,tokyo,all_sp
sound,Stream,Music,Mission,oki2,mx_fubar
sound,music,tokyo,all_sp
sound,Tokyo,Music,all_sp
sounds,Tokyo,Music,all_sp
sounds,Music,Tokyo,all_sp
sounds,tokyo,tokyo,all_sp

Remove the lines with all_mp unless you need them for some reason.
Use my csv and files. All you have to do is replace mapname and sp_ examplemap with tokyo in the files.
Try in a new map. Then work backwards and add it to your map.