local player = GetListenServerHost() local soundscapetable = {} local fogcontrollertable = {} // ::GenerateDefaultSoundScapes <- function() // { // local soundscapes = [ // "tf2.respawn_room" // "tf2.general_ambient" // "2fort.Underground" // "2fort.Underground2" // "2fort.OutdoorPond" // "2fort.OutdoorFort" // "2fort.Indoor" // "Dustbowl.Outdoors" // "Dustbowl.Indoors" // "Well.DeepInside" // "Well.Inside" // "Well.Outside" // "Badlands.Inside" // "Badlands.Outside" // "Badlands.OutsideInterior" // "Gravelpit.Outside" // "Gravelpit.Inside" // "Hydro.Outside" // "Hydro.Inside" // "Granary.Outside" // "Granary.Inside" // "Goldrush.Outside" // "Goldrush.Inside" // "Goldrush.DeepInside" // "Ravine.Inside" // "Ravine.Outside" // "Lumberyard.Inside" // "Lumberyard.Outside" // "Chariots.Inside" // "Chariots.Outside" // "Sawmill.Inside" // "Sawmill.InsideNoLights" // "Sawmill.InsideWaterfall" // "Sawmill.DeepInside" // "Sawmill.Outside" // "Egypt.Indoor" // "Egypt.Outdoor" // "Nucleus.Inside" // "Nucleus.Outside" // "viaduct.Inside" // "Viaduct.Outside" // "Gorge.Inside" // "Gorge.Outside" // "Medieval.Inside" // "Medieval.Outside" // "ThunderMountain.Inside" // "ThunderMountain.Outside" // "HighTower.Inside" // "HighTower.Outside" // "Upward.Inside" // "Upward.Outside" // "stormfront.Underground" // "stormfront.Outside" // "Halloween.Inside" // "Halloween.Outside" // "Halloween.Underworld" // "Halloween.hell" // "Halloween_sf14.Inside" // "Halloween_sf14.Outside" // "mountainlab.Inside" // "mountainlab.Outside1" // "mountainlab.Outside2" // ] // foreach (s in soundscapes) // { // local soundscape = Entities.CreateByClassname("env_soundscape_triggerable") // NetProps.SetPropString(soundscape, "m_soundscapeName", s) // soundscape.DispatchSpawn() // local trigger = Entities.CreateByClassname("trigger_soundscape") // NetProps.SetPropEntity(trigger, "m_hSoundscape", soundscape) // trigger.SetSolid(2) // trigger.SetSize(Vector(), Vector(1, 1, 1)) // trigger.DispatchSpawn() // EntFireByHandle(trigger, "StartTouch", "", -1, player, player) // EntFireByHandle(player, "RunScriptCode", format("GetSoundScapeIndex(`%s`, self)", s), -1, null, null) // EntFireByHandle(trigger, "Kill", "", -1, null, null) // EntFireByHandle(soundscape, "Kill", "", -1, null, null) // } // } ::GetSoundScapeIndex <- function(s, player) { soundscapetable.rawset(NetProps.GetPropInt(player, "m_Local.m_audio.soundscapeIndex"), s) } for (local soundscape; soundscape = Entities.FindByClassname(soundscape, "env_soundscape*");) { local name = strip(NetProps.GetPropString(soundscape, "m_soundscapeName")) local split = split(name, " ") if (!split.len()) continue local trigger = Entities.CreateByClassname("trigger_soundscape") NetProps.SetPropEntity(trigger, "m_hSoundscape", soundscape) trigger.DispatchSpawn() EntFireByHandle(trigger, "StartTouch", "", -1, player, player) EntFireByHandle(player, "RunScriptCode", format("GetSoundScapeIndex(`%s`, self)", split[0]), -1, null, null) EntFireByHandle(trigger, "Kill", "", -1, null, null) } for (local fogcontroller; fogcontroller = Entities.FindByClassname(fogcontroller, "env_fog_controller");) fogcontrollertable.rawset(fogcontroller.entindex(), NetProps.GetPropString(fogcontroller, "m_iName")) ::CreateFile <- function() { local stable = "" foreach (k, v in soundscapetable) { printl(k + " : " + v) stable += format("\t[%d] = \"%s\",\n", k, v) } StringToFile("advcc_soundscapes.nut", format("::SoundScapeTable <- {\n%s}\n", stable)) local ftable = "" foreach (k, v in fogcontrollertable) { printl(k + " : " + v) ftable += format("\t[%d] = \"%s\",\n", k, v) } StringToFile("advcc_fogcontrollers.nut", format("::FogControllerTable <- {\n%s}\n", ftable)) } EntFire("bignet", "CallScriptFunction", "CreateFile", 0.015)