Welcome to the work f o r c e !
This is where i keep some of my stuff. It will be expanded upon over time.
More, fancier prefabs should be set up eventually.
Hang around, you may find something special.
LINKS:
Discord: luffaren
================================================================
a .nut script which auto-slays CT's when a specific ct/t player ratio is met
read the included .nut file for more information
A script+prefab package allowing you to hot-spawn ents via a global vscript function
You can easily add/remove the entity-classes available for spawning in the prefab .vmf
It also includes some extra general-purpose helper functions
A simple .bat-file .bsp packer, you simply drag+drop a .bsp into it.
It packs everything within the 'csgo' folder that's next to the .bsp file.
An app that handles mass-resizing .vtf files with a max-size-cap and a DXT1/DXT5 toggle.
Can be used to reduce filesize on maps, just read the included instructions and save backups/be careful.
A copy+paste prefab for an easy-to-use level system, also including an example .vmf to help you understand it.
It supports up to 16 stages as it uses a logic_case.
A barebones physbox+thruster npc base that picks a random CT-target every X seconds and then moves towards the target.
This is by no means a complete system, but rather a base to start working your own NPC from.
A standalone script to handle keeping the targetname of weapons + detecting when a weapon has been dropped.
Just add the .nut to the "Entity Scripts" property of any weapon-entity and it'll work automatically.
================================================================
This plugin allows for instant Vscript-based hotfixes, QoL-tweaks, special events and VIP/patron-updates for Luffaren-maps.
The Vscripts are set up/managed by Luffaren centrally, and can be previewed below (in "CSGO Vscript configs").
If a Vscript config exists for the current map on the server, it will load in once as the map starts.
================================================================
These Vscript configs gets loaded in through the LuffarenMaps plugin as the map starts. Click on them to view a preview of the code below.
================================================================
--------------------------------------------------------------------------------------------------------
//============[ NOTE: permanent script scope ]============\\
scinit<-false;CDATA<-[];function InitializeScriptValidate(){if(!scinit)//Safety wrapper to retry loading the Vscript
{printl("[LuffarenMaps] Vscript ERROR - script not initialized!");if(Entities.FindByName(null,"luffarenmapsplugin_reload")==null)
{local e=Entities.CreateByClassname("info_target");e.__KeyValueFromString("targetname","luffarenmapsplugin_reload");}}}
EntFireByHandle(self,"RunScriptCode"," InitializeScriptValidate(); ",5.00,null,null);
//Called once when the script is initialized/reloaded
function Initialize()
{
if(scinit)return;scinit=true;printl("[LuffarenMaps] Vscript initialized!");
local h = null;while(null!=(h=Entities.FindByName(h,"luffarenmapsplugin_reload")))
{EntFireByHandle(h,"Kill","",0.00,null,null);}if(Entities.FindByName(null,"luffarenmapsplugin_success")==null)
{local e = Entities.CreateByClassname("info_target");e.__KeyValueFromString("targetname","luffarenmapsplugin_success");}
EntFireByHandle(self,"RunScriptCode"," InitializeCDATA(); ",0.01,null,null);
EntFireByHandle(self,"RunScriptCode"," RoundStart(true); ",0.02,null,null);
//XXXXXXXXXXXXXXX> init code goes here...
}
//Called once every round start (also just after 'Initialize' has been called)
function RoundStart(justinitalized=false)
{
printl("[LuffarenMaps] Vscript RoundStart() called!");
//XXXXXXXXXXXXXXX> roundstart code goes here (bool:justinitalized)...
jarjarstarted = false;
EntFireByHandle(self,"RunScriptCode"," VolcanoPoleNoCheese(); ",5.00,null,null);
EntFireByHandle(self,"RunScriptCode"," VolcanoClipFixTick(); ",5.10,null,null);
EntFireByHandle(self,"RunScriptCode"," JarJarNoNegevCheese(); ",5.20,null,null);
EntFireByHandle(self,"RunScriptCode"," CapSurfSpeedZInit(); ",5.30,null,null);
EntFireByHandle(self,"RunScriptCode"," RocketSurfSkipFix(); ",10.00,null,null);
EntFireByHandle(self,"RunScriptCode"," solofags_cleansed = false; ",13.00,null,null);
EntFireByHandle(self,"RunScriptCode"," NoMoreSolofagging(); ",14.00,null,null);
EntFireByHandle(self,"RunScriptCode","FanFuckery();",4.50,null,null);
EntFire("luffsprite","AddOutput","rendermode 1",0.00,null);
EntFire("luffsprite","AddOutput","rendermode 1",1.00,null);
EntFire("luffsprite","AddOutput","rendermode 1",5.00,null);
EntFire("luffsprite","AddOutput","rendermode 1",10.00,null);
}
//Called once when the script is initialized/validated
function DateTimeReceived(datetime)
{
printl("[LuffarenMaps] Vscript Datetime received! ("+datetime+")");
//XXXXXXXXXXXXXXX> DateTime code goes here (string:datetime "YYYY-MM-DD-MM-SS")...
}
//Called once when the script is initialized/validated
function ServerInfoReceived(info)
{
printl("[LuffarenMaps] Vscript ServerInfo received! ("+info+")");
//XXXXXXXXXXXXXXX> ServerInfo code goes here (string:info "serverIP-serverNAME")...
}
//Called once when the script is initialized/validated
function InitializeCDATA()
{
foreach(data in CDATA)
{
if(data.len()<=0)continue;local dds="";foreach(dd in data){dds=dds+"|"+dd;}dds=dds+"|";
printl("[LuffarenMaps] Vscript CustomData loaded! ("+dds+")");
//XXXXXXXXXXXXXXX> CustomData code goes here (data:[["IDENTIFIER","data..."]])...
}
}
//Called every time a client is validated/connected with name, userid and steamid
function ClientValidated(userid,steamid,name)
{
userid = userid.tointeger();
local s = [];for(local i=0;i<steamid.len();i++)
{
local ceil = 1+i;if(ceil>steamid.len())break;
local c = steamid.slice(i,ceil);if(c=="c")c=":";s.push(c);
}
steamid = "";foreach(ss in s)steamid = steamid+ss;
printl("[LuffarenMaps] Vscript client validated! ("+userid.tostring()+"|"+steamid+"|"+name+")");
//XXXXXXXXXXXXXXX> Client data connecting code goes here (int:userid, string:steamid, string:name)...
if(steamid=="STEAM_1:1:22521282")
{
local mapman = Entities.FindByName(null,"event_manager");
if(mapman==null||!mapman.IsValid())
return;
mapman.ValidateScriptScope();
mapman.GetScriptScope().MASTER = userid;
}
}
//prevent zombies from pixel-surfing at the pizza-tower (the rocket path):
rocketsurfskip_pos <- [Vector(-1810,-848,2020),Vector(-2799,-848,2023)];
rocketsurfskip_dist <- 250;
rocketsurfskip_tickrate <- 0.10;
function RocketSurfSkipFix()
{
EntFireByHandle(self,"RunScriptCode"," RocketSurfSkipFix(); ",rocketsurfskip_tickrate,null,null);
foreach(pos in rocketsurfskip_pos)
{
for(local p;p=Entities.FindByClassnameWithin(p,"player",pos,rocketsurfskip_dist);)
{
if(p==null||!p.IsValid()||p.GetTeam()!=2||p.GetHealth()<=0.00)continue;
if(TraceLine(pos,p.GetOrigin(),null)<1.00)continue;
p.SetOrigin(p.GetOrigin()+Vector(0,-20,-30));
p.SetVelocity(Vector(0,-200,-100));
}
}
}
//prevent zombies from surfing too fast/getting on the flying pizza near mid-bridge, humans can't do anything about it if it happens
::surfspeedZcap <- 1500;
surfspeedZcap_delay <- 4.00;
function CapSurfSpeedZInit()
{
local zpush = Entities.FindByClassnameNearest("trigger_push",Vector(9216,96,-5920),64);
zpush.ValidateScriptScope();
zpush.GetScriptScope().PlayerTouched <- function()
{
printl(activator);
if(activator==null||!activator.IsValid())return;
if(activator.GetTeam()!=2)return;
if(activator.GetHealth()<=0)return;
if(activator.GetVelocity().Length() > ::surfspeedZcap)
{
local vel = activator.GetVelocity();
vel.Norm();
activator.SetVelocity(vel*::surfspeedZcap);
}
}
EntFireByHandle(zpush,"AddOutput",
"OnStartTouch !self:RunScriptCode:PlayerTouched();:"+surfspeedZcap_delay.tostring()+":-1",0.00,null,null);
}
function VolcanoClipFixTick() //prevents you from clip-stucking yourself along the volcano-entrance clip(s)
{
EntFireByHandle(self,"RunScriptCode"," VolcanoClipFixTick(); ",3.00,null,null);
local h=null;while(null!=(h=Entities.FindByClassnameWithin(h,"player",Vector(-6656,12800,7552),768)))
{
if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)
continue;
if(h.GetVelocity().z < -10)
continue;
if(h.GetOrigin().z>7960||h.GetOrigin().z<6950)
continue;
if(TraceLine(Vector(-6656,12800,7552),h.GetOrigin()+Vector(0,0,2),null)==1.00)
{
h.SetOrigin(Vector(-6656,12800,7552));
h.SetVelocity(Vector(0,0,-500));
}
}
}
volcanopolecheesespots <- [Vector(-6656,11968,7392),Vector(-5648,12800,7392),Vector(-6656,13632,7392),Vector(-7664,12800,7392)];
function VolcanoPoleNoCheese() //prevent 4 cheese-spots in the final volcano area which you can only get to with the earth-item
{
EntFireByHandle(self,"RunScriptCode"," VolcanoPoleNoCheese(); ",5.00,null,null);
foreach(pos in volcanopolecheesespots)
{
local h=null;while(null!=(h=Entities.FindByClassnameWithin(h,"player",pos,200)))
{
if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)
continue;
if(TraceLine(pos,h.GetOrigin()+Vector(0,0,16),null)==1.00)
{
EntFireByHandle(h,"SetHealth",(h.GetHealth()-49).tostring(),0.00,null,null);
EntFire("client","Command","r_screenoverlay luffaren/niederzier",0.00,h);
EntFire("client","Command","play *luffaren_pizzatime/niederzier.mp3",0.00,h);
EntFire("client","Command","r_screenoverlay XXXXX_LUFF_NULL_XXXXX",4.95,h);
EntFire("client","Command","r_screenoverlay ",4.95,h);
}
}
}
}
jarjarboss_hp_base <- 5000; //starting HP (originally 5000)
jarjarboss_hp_add <- 1000; //hp for each alive CT (originally 1500)
jarjarstarted <- false;
jarjarhp <- null;
function JarJarNoNegevCheese() //do not allow jar-jar to take damage before he starts attacking, preventing negev cheese
{
if(jarjarstarted)
return;
EntFireByHandle(self,"RunScriptCode"," JarJarNoNegevCheese(); ",0.50,null,null);
if(jarjarhp==null||!jarjarhp.IsValid())
jarjarhp = Entities.FindByName(null,"boss_jar_hp");
if(jarjarhp==null||!jarjarhp.IsValid())
return;
if(jarjarhp.GetHealth()<999999)
{
jarjarstarted = true;
EntFireByHandle(jarjarhp,"SetHealth","99999999",0.00,null,null);
EntFireByHandle(jarjarhp,"SetHealth","99999999",5.00,null,null);
EntFireByHandle(jarjarhp,"SetHealth","99999999",10.00,null,null);
local sethp = 0;
sethp += jarjarboss_hp_base;
local h=null;while(null!=(h=Entities.FindByClassname(h,"player")))
{
if(h==null||!h.IsValid()||h.GetTeam()!=3||h.GetHealth()<=0)
continue;
sethp += jarjarboss_hp_add;
}
EntFireByHandle(jarjarhp,"SetHealth",sethp.tostring(),14.00,null,null);
EntFireByHandle(jarjarhp,"SetHealth",sethp.tostring(),14.05,null,null);
EntFireByHandle(jarjarhp,"SetHealth",sethp.tostring(),14.10,null,null);
}
}
solofags_cleansed <- false;
function NoMoreSolofagging()
{
if(solofags_cleansed)
return;
EntFireByHandle(self,"RunScriptCode","NoMoreSolofagging();",7.00,null,null);
local count_total = 0;
local count_ct = 0;
local count_t = 0;
local ct_list = [];
for(local h;h=Entities.FindByClassname(h,"player");)
{
if(h==null||!h.IsValid())continue;
count_total++;
if(h.GetTeam()==3 && h.GetHealth()>0)
{
count_ct++;
ct_list.push(h);
}
else if(h.GetTeam()==2 || h.GetHealth()<=0)
count_t++;
}
//print("total:"+count_total + " | ct:" + count_ct + " | t:" + count_t);
if(count_total < 15)
return;
if(count_ct <= 1)
{
foreach(h in ct_list)
{
EntFireByHandle(h,"SetDamageFilter","",0.00,null,null);
EntFireByHandle(h,"SetHealth","-1",0.00,null,null);
EntFireByHandle(h,"SetDamageFilter","",0.02,null,null);
EntFireByHandle(h,"SetHealth","-1",0.02,null,null);
EntFireByHandle(h,"SetDamageFilter","",0.03,null,null);
EntFireByHandle(h,"SetHealth","-1",0.05,null,null);
}
solofags_cleansed = true;
}
}
function FanFuckery()
{
local button = Entities.FindByClassnameNearest("func_button",Vector(1777,9672,6248),512);
if(button == null)
return;
button.ValidateScriptScope();
button.GetScriptScope().fucked <- false;
button.GetScriptScope().InputUse <- function()
{
if(fucked)
return false;
if(activator==null||!activator.IsValid()||activator.GetHealth()<=0)
return false;
if(activator.GetTeam()==2)
{
fucked = true;
return true;
}
else if(activator.GetTeam()==3)
{
local human_is_trolled = false;
local zombie_has_reached = false;
for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(1200,8600,5700),1150);)
{
if(h==null||!h.IsValid()||h.GetHealth()<=0)
continue;
if(h.GetTeam() == 3 && h.GetOrigin().z > 5000)
human_is_trolled = true;
else if(h.GetTeam() == 2 && h.GetOrigin().z > 6000)
zombie_has_reached = true;
}
if(human_is_trolled && !zombie_has_reached)
{
EntFireByHandle(activator,"SetDamageFilter","",0.00,null,null);
EntFireByHandle(activator,"SetHealth","-1",0.00,null,null);
EntFireByHandle(activator,"SetDamageFilter","",0.02,null,null);
EntFireByHandle(activator,"SetHealth","-1",0.05,null,null);
return false;
}
else
{
fucked = true;
return true;
}
}
}
}
Initialize();//=============[RESERVED_CUSTOMDATA_BELOW]=============\\
CDATA.push(["VIP","STEAM_1:1:22521282","STEAM_1:0:5225233","STEAM_1:0:45564798","STEAM_1:1:73344846","STEAM_1:1:11715703","STEAM_1:1:31574014","STEAM_1:1:523970","STEAM_1:1:44083262","STEAM_1:0:481397
71","STEAM_1:1:437584735","STEAM_1:0:23006811","STEAM_1:1:92712277","STEAM_1:0:5680239","STEAM_1:1:76518687","STEAM_1:0:123998228","STEAM_1:0:1726051","STEAM_1:1:57774125","STEAM_1:0:145949752","STEAM
_1:1:19059031","STEAM_1:0:87605592","STEAM_1:1:53399461","STEAM_1:1:90927558","STEAM_1:1:146402862","STEAM_1:1:161646505","STEAM_1:1:2359822","STEAM_1:1:36935027","STEAM_1:0:40225637","STEAM_1:0:73964
697","STEAM_1:1:420487994","STEAM_1:1:224693752","STEAM_1:0:166202549","STEAM_1:1:187387685","STEAM_1:1:431361032","STEAM_1:1:530769946","STEAM_1:1:421423581","STEAM_1:0:589738117","STEAM_1:1:68906947
","STEAM_1:1:209579010","STEAM_1:0:172104190","STEAM_1:0:82257199","STEAM_1:0:110034693","STEAM_1:1:32256533","STEAM_1:1:103714298","STEAM_1:1:194987240","STEAM_1:1:232637165","STEAM_1:1:20450857","ST
EAM_1:1:94436119","STEAM_1:0:513101242","STEAM_1:1:450658765","STEAM_1:0:737862615","STEAM_1:0:225146037","STEAM_1:1:435443801","STEAM_1:0:80773872","STEAM_1:0:142970189","STEAM_1:0:534443260"]);
CDATA.push(["IDENTIFIER","data1","data2","data3"]);
CDATA.push([""]);
-------------------------------------------------------------------------------------------------------------