Senior Member
Join Date: Jul 2011
Location: Peru
|
07-11-2023
, 13:02
Re: [L4D2/CS:GO/TF2/NMRiH] VScript File Replacer (1.15) [20-Dec-2022]
|
#88
|
Quote:
Originally Posted by Kerouha
What you posted, is telling to edit vscripts_override, and my question was, how to skip this exact step.
It would be weird if there is no option to automatically replace vanilla files with ones from custom folder (if their names completely match).
|
You can create file director_base_addon.nut and put in left4dead2\scripts\vscripts\director_base_add on.nut with this code inside:
Spoiler
PHP Code:
printl("VScript: Initiating director_base_addon script");
::CustomScript <- {
function OnGameEvent_round_start(p) {
IncludeScript("vscripts_custom/" + Director.GetMapName() + "_" + Director.GetGameMode() + "_custom");
}
}
__CollectGameEventCallbacks(CustomScript);
Then in this path you can create your own vscript files, for example:
left4dead2\scripts\vscripts\vscripts_custom\r ocketbuild1_coop_custom.nut with this code inside:
Lets Build a Rocket map
Spoiler
PHP Code:
printl( "VScript: Initiating rocketbuild1_coop_custom script" );
// This setup causes 1 more tank to spawn in each tank-round up to the maximum tank limit specified in this code.
// In this case, the limit will be 16 tanks.
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "second_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank",
o2 = "third_tank_spawn,Enable,,1",
o3 = "third_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "third_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "fourth_tank_spawn,Enable,,1",
o3 = "fourth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "fourth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "fifth_tank_spawn,Enable,,1",
o3 = "fifth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "fifth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "sixth_tank_spawn,Enable,,1",
o3 = "sixth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "sixth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "seventh_tank_spawn,Enable,,1",
o3 = "seventh_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "seventh_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "eighth_tank_spawn,Enable,,1",
o3 = "eighth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "eighth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "nineth_tank_spawn,Enable,,1",
o3 = "nineth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "nineth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "tenth_tank_spawn,Enable,,1",
o3 = "tenth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "tenth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "eleventh_tank_spawn,Enable,,1",
o3 = "eleventh_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "eleventh_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "twelfth_tank_spawn,Enable,,1",
o3 = "twelfth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "twelfth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "thirteenth_tank_spawn,Enable,,1",
o3 = "thirteenth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "thirteenth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "fourteenth_tank_spawn,Enable,,1",
o3 = "fourteenth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "fourteenth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "fifteenth_tank_spawn,Enable,,1",
o3 = "fifteenth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "fifteenth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
o2 = "sixteenth_tank_spawn,Enable,,1",
o3 = "sixteenth_tank_spawn,Trigger"
}
}
});
SpawnEntityFromTable("logic_relay", {
StartDisabled = true,
targetname = "sixteenth_tank_spawn"
connections = {
OnTrigger = {
o1 = "special_spawner,SpawnZombie,tank"
}
}
});
EntFire("special_picker", "AddOutput", "OnCase06 second_tank_spawn,Enable,,1");
EntFire("special_picker", "AddOutput", "OnCase06 second_tank_spawn,Trigger");
The line of code:
PHP Code:
IncludeScript("vscripts_custom/" + Director.GetMapName() + "_"+ Director.GetGameMode() + "_custom");
Represents the path from where you will load the custom file.
Spoiler
PHP Code:
"vscripts_custom/" = path
Director.GetMapName() = mapname
"_" = path
Director.GetGameMode() = gamemode
"_custom" = path
Other example: left4dead2\scripts\vscripts\vscripts_custom\c 1m1_hotel_coop_custom.nut
I think you can also use this method as another alternative.
From what I know, you would have to use the GCFScape program to extract the contents of the .vpk file (which is normally found in left4dead2/addons/workshop), customize the files to your liking, recompress them into a .vpk , then you should place the new .vpk in your left4dead2/addons folder and the changes should take effect.
Last edited by Tonblader; 07-11-2023 at 15:14.
|
|