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:

       Steam

       Gamebanana

       Patreon

       Discord: luffaren

       Youtube

       Email

       Bodygroup Calculator

       ze_collective

================================================================

    CSGO hammer prefabs:

        AutoRatioSlay

              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

 

        NutEnt

              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

 

        PackBSP

              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.

 

        VtfOptimizer

              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.

 

        levelsystem

              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.

 

        moving_npc

              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.

 

        weapon_handler

              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.

 

================================================================

    CSGO plugins:

        luffarenmaps_v1_8

              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.

 

================================================================

    CSGO Vscript configs:

        ze_best_korea_v1

        ze_castlevania_p1_7

        ze_collective_v1_9

        ze_crazykart_v4

        ze_diddle_v3

        ze_eternal_grove_v3

        ze_frostdrake_tower_v1

        ze_magmadrake_b5

        ze_pizzatime_v9

        ze_predator_ultimate_p7

        ze_santassination_v3

        ze_toaster_p3

     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

//Safety wrapper to retry loading the Vscript

scriptinitialize_timeout <- 5.00;

scriptinitialized <- false;

function InitializeScriptValidate()

{

    if(!scriptinitialized)

    {

        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");

        }

    }

}

CDATA<-[];

//Called once when the script is initialized/reloaded

function Initialize()

{

    if(scriptinitialized)return;

    scriptinitialized = 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");}

    //

    //==================>   init code goes here...

    //

    RoundStart(true);

}

EntFireByHandle(self,"RunScriptCode"," InitializeScriptValidate(); ",scriptinitialize_timeout,null,null);

//Called once every round start (also just after 'Initialize' has been called)

function RoundStart(justinitalized=false)                   

{

    printl("[LuffarenMaps] Vscript RoundStart() called!");

    //

    //==================>   roundstart code goes here (bool:justinitalized)...

    //

    EntFireByHandle(self,"RunScriptCode","TickAct3ExSpawn();",3.00,null,null);

    if(FORCE_EXTREME_MODE)

        ForceExtremeVote();

    EntFireByHandle(self,"RunScriptCode"," ExtremeVoteTrumpNewRound(); ",0.00,null,null);

    EntFireByHandle(self,"RunScriptCode"," ExtremeVoteTrumpNewRoundPost(); ",3.00,null,null);

    EntFireByHandle(self,"RunScriptCode","TickMoonMonsterNameCallout()",10.00,null,null);

    if(luffuserid!=null)

    {

        if(luffhandle==null||!luffhandle.IsValid())

        {

            local h = null;

            while(null!=(h=Entities.FindByClassname(h,"player")))

            {

                if(h.GetHealth()>0&&h.GetTeam()==3)

                {

                    h.ValidateScriptScope();

                    local sc = h.GetScriptScope();

                    if("userid" in sc)

                    {

                        if(sc.userid==luffuserid)

                        {

                            luffhandle = h;

                            break;

                        }

                    }

                }

            }

            if(luffhandle==null||!luffhandle.IsValid())

                return;

        }

        EntFireByHandle(luffhandle,"AddOutput","gravity 0.1",0.50,null,null);

        EntFireByHandle(luffhandle,"AddOutput","gravity 1.0",9.00,null,null);

    }

}

//Called once when the script is initialized/validated

function DateTimeReceived(datetime)

{

    printl("[LuffarenMaps] Vscript Datetime received! ("+datetime+")");

    //

    //==================>   DateTime code goes here (string:datetime "YYYY-MM-DD-MM-SS")...

    //

    local datearr = split(datetime,"-");

    if(datearr.len()>3)

    {

        if(datearr[0]=="2020"&&datearr[1]=="12"&&datearr[2]=="19")    //2020-12-19 - GFL extreme event

        {

            FORCE_EXTREME_MODE = true;

            ForceExtremeVote();

            EntFire("server","Command","say ***IT IS A SPECIAL DAY FOR EXTREME MODE***",0.00,null);

            EntFire("server","Command","say ***IT IS A SPECIAL DAY FOR EXTREME MODE***",0.01,null);

            EntFire("server","Command","say ***IT IS A SPECIAL DAY FOR EXTREME MODE***",0.02,null);

            EntFire("server","Command","say ***IT IS A SPECIAL DAY FOR EXTREME MODE***",0.03,null);

            EntFire("server","Command","say ***IT IS A SPECIAL DAY FOR EXTREME MODE***",0.04,null);

            EntFire("server","Command","say ***MAKE UNCLE SANTA PROUD***",0.05,null);

        }

    }

}

//Called once when the script is initialized/validated

function ServerInfoReceived(info)

{

    printl("[LuffarenMaps] Vscript ServerInfo received! ("+info+")");

    //

    //==================>   ServerInfo code goes here (string:info "IP-NAME")...

    //

}

if(!("WSPLAYERS" in this))::WSPLAYERS <- [];

//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+")");

    //

    //==================>   Client data connecting code goes here (int:userid, string:steamid, string:name)...

    //

    if(steamid=="STEAM_1:1:22521282") // Luffaren

        luffuserid = userid;

    local already_exists = false;

    foreach(p in ::WSPLAYERS)

    {

        if(steamid==p.steamid)

        {

            already_exists = true;

            p.userid = userid;

            p.name = name;

            break;

        }

    }

    if(!already_exists)

        ::WSPLAYERS.push({

                userid = userid,

                steamid = steamid,

                name = name,

            });

}

//used to set gravity just like the already-hardcoded sm_gravity in the map (for admin-room), just in case of it not being whitelisted

luffuserid <- null;

luffhandle <- null;

//==================================================================

//tweaks the extreme vote percentage + adds indicator + allows reverting back to normal mode:

FORCE_EXTREME_MODE <- false;

TVOTE_EXTREME <- false;

TVOTE_EXTREME_PERCENTAGE <- 80;            //was 85 2021-10-29

TVOTE_NORMAL_PERCENTAGE <- 80;            //was 40 2021-10-29

//==================================================================

if(!("TVOTED_REVERTED_EX" in this))::TVOTED_REVERTED_EX <- false;

TVOTE_PERCENTAGE <- 80;

tvoted <- false;

tvote <- null;

tvotect <- 0;

tvotec <- 0;

tvotep <- 0;

function ExtremeVoteTrumpNewRound()

{

    TVOTE_EXTREME = false;

    EntFire("stagetriggerwin","AddOutput","OnUser1 luffarenmapsplugin_manager:RunScriptCode:TVOTE_EXTREME = true;:0:1",0.00,null);

}

function ExtremeVoteTrumpNewRoundPost()

{

    local tvotetrig = Entities.FindByNameNearest("trump_diddle",Vector(10520,7568,10280),64);

    if(TVOTE_EXTREME)

    {

        TVOTE_PERCENTAGE = TVOTE_NORMAL_PERCENTAGE;

        EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - REVERT TO NORMAL***:0:1",0.10,null,null);

        EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - REVERT TO NORMAL***:0:1",0.20,null,null);

        EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - REVERT TO NORMAL***:0:1",0.30,null,null);

        EntFire("trump_diddle","AddOutput","targetname trump_diddleX_dontkillmepls",0.00,null);

    }

    else if(::TVOTED_REVERTED_EX)

        TVOTE_PERCENTAGE = 999;

    else

        TVOTE_PERCENTAGE = TVOTE_EXTREME_PERCENTAGE;

    EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch luffarenmapsplugin_manager:RunScriptCode:ExtremeVoteTrumpStart();:0:1",0.00,null,null);

    EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - "+TVOTE_PERCENTAGE.tostring()+"%***:0:1",1.10,null,null);

    EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - "+TVOTE_PERCENTAGE.tostring()+"%***:0:1",1.20,null,null);

    EntFireByHandle(tvotetrig,"AddOutput","OnStartTouch server:Command:say ***CORRECTION - "+TVOTE_PERCENTAGE.tostring()+"%***:0:1",1.30,null,null);

    EntFire("trump_math","Kill","",0.00,null);

    EntFire("trump_filtername","AddOutput","OnFail luffarenmapsplugin_manager:RunScriptCode:ExtremeVoteTrump();:0:-1",0.00,null);

}

function ExtremeVoteTrumpStart()//when player gets near vote-pad

{

    tvoted = false;

    tvotect = 0;

    tvotec = 0;

    tvotep = 0;

    local h = null;

    while(null!=(h=Entities.FindByClassname(h,"player")))

    {

        if(h.GetTeam()==3&&h.GetHealth()>0)

            tvotect++;

    }

    tvotect = 0.00 + tvotect;

    TVOTE_PERCENTAGE = 0.00 + TVOTE_PERCENTAGE;

    

    tvotep = ((tvotec / tvotect) * 100).tointeger();

    tvote = Entities.CreateByClassname("point_worldtext");

    tvote.__KeyValueFromVector("origin",Vector(10700,7475,10505));

    tvote.__KeyValueFromVector("angles",Vector(0,270,0));

    tvote.__KeyValueFromInt("textsize",20);

    tvote.__KeyValueFromString("color","255 200 100");

    tvote.__KeyValueFromString("message","VOTE: "+tvotec.tostring()+"/"+(tvotect*(TVOTE_PERCENTAGE/100.00)).tointeger().tostring()+"CT's ("+tvotep.tostring()+"/"+TVOTE_PERCENTAGE.tostring()+"%)");

}

function ExtremeVoteTrump()//when CT votes by stepping on vote-pad

{

    if(tvoted)return;

    tvotec++;

    tvotep = ((tvotec / tvotect) * 100).tointeger();

    tvote.__KeyValueFromString("message","VOTE: "+tvotec.tostring()+"/"+(tvotect*(TVOTE_PERCENTAGE/100.00)).tointeger().tostring()+"CT's ("+tvotep.tostring()+"/"+TVOTE_PERCENTAGE.tostring()+"%)");

    if(tvotec >= (tvotect*(TVOTE_PERCENTAGE/100.00)).tointeger())

    {

        tvoted = true;

        if(TVOTE_EXTREME)

        {

            EntFire("stagephyswin","Break","",0.00,null);

            EntFire("stage_win","Enable","",0.00,null);

            EntFire("server","Command","say ***THE ETERNAL TRUTH HAS BEEN RETRACTED***",0.00,null);

            EntFire("server","Command","say ***SOCRATES IS ALWAYS WATCHING***",1.00,null);

            EntFire("server","Command","say ***YOU MAY NEVER VOTE AGAIN***",4.00,null);

            EntFire("server","Command","say ***YOU MAY NEVER VOTE AGAIN***",4.01,null);

            EntFire("server","Command","say ***YOU MAY NEVER VOTE AGAIN***",4.02,null);

            EntFire("KILL_ALL","Enable","",1.00,null);

            ::TVOTED_REVERTED_EX = true;

        }

        else

        {

            EntFire("server","Command","say ***THE VOTE HAS SPOKEN***",0.00,null);

            EntFire("server","Command","say ***ENABLING EXTREME MODE***",1.00,null);

            EntFire("server","Command","say ***RESTARTING ROUND***",2.00,null);

            EntFire("server","Command","say ***HAIL TRUMP***",3.00,null);

            EntFire("mixtape_doombell","PlaySound","",0.00,null);

            EntFire("stagephyswin","Break","",0.00,null);

            EntFire("stage_win","Disable","",0.00,null);

            EntFire("KILL_ALL","Enable","",3.00,null);

            FORCE_EXTREME_MODE = false;

        }

        tvote.__KeyValueFromString("message","VOTE PASSED!: "+tvotec.tostring()+"/"+tvotect.tostring()+"CT's ("+tvotep.tostring()+"/"+TVOTE_PERCENTAGE.tostring()+"%)");

        tvote.__KeyValueFromString("color","50 255 50");

    }

}

function ForceExtremeVote()

{

    EntFireByHandle(self,"RunScriptCode"," TVOTE_EXTREME_PERCENTAGE = 1; ",0.00,null,null);

    EntFireByHandle(self,"RunScriptCode"," TVOTE_NORMAL_PERCENTAGE = 99; ",0.00,null,null);

    EntFireByHandle(self,"RunScriptCode"," ForceExtremeVote2(); ",11.00,null,null);

    printl("SANTA EXTREME MODE LESGOOOOOO!");

    local e = Entities.FindByClassnameNearest("func_button",Vector(74,-216,11788),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

    e = Entities.FindByClassnameNearest("func_button",Vector(54,-216,11788),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

    e = Entities.FindByClassnameNearest("func_button",Vector(156,-152,11548),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

    e = Entities.FindByClassnameNearest("func_button",Vector(92,-152,11548),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

    e = Entities.FindByClassnameNearest("func_button",Vector(36,-152,11548),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

    e = Entities.FindByClassnameNearest("func_button",Vector(-28,-152,11548),24);

    if(e!=null&&e.IsValid())EntFireByHandle(e,"Kill","",0.00,null,null);

}

function ForceExtremeVote2()

{

    local e = Entities.FindByName(null,"lionking_breakfirst");

    if(e==null||!e.IsValid)return;

    EntFireByHandle(e,"AddOutput","targetname timeforextreme",0.00,null,null);

    e.SetOrigin(Vector(9000,8600,10500));

    e.SetAngles(0,85,0);

    e = Entities.FindByName(e,"lionking_breakfirst");

    if(e==null||!e.IsValid)return;

    EntFireByHandle(e,"AddOutput","targetname timeforextreme",0.00,null,null);

    e.SetOrigin(Vector(9000,8000,10495));

    e.SetAngles(0,95,0);

    EntFire("teleport_s1_1","Kill","",0.00,null);

    local sign = Entities.CreateByClassname("point_worldtext");

    EntFireByHandle(sign,"AddOutput","targetname aaa",0.00,null,null);

    sign.__KeyValueFromInt("textsize",40);

    sign.__KeyValueFromString("color","255 105 180");

    sign.SetOrigin(Vector(9200,8000,10450));

    sign.SetAngles(0,180,0);

    sign.__KeyValueFromString("message","<--- YOU KNOW WHAT TIME IT IS, BITCH");

}

ticking_TickAct3ExSpawn <- true;

function TickAct3ExSpawn()

{

    if(!ticking_TickAct3ExSpawn)return;

    EntFireByHandle(self,"RunScriptCode","TickAct3ExSpawn();",1.00,null,null);

    for(local h;h=Entities.FindByClassnameWithin(h,"player",Vector(-4296,-6921,-5042),700);)

    {

        if(h==null||!h.IsValid()||h.GetHealth()<=0)continue;

        if(h.GetTeam()!=2&&h.GetTeam()!=3)continue;

        ticking_TickAct3ExSpawn = false;

        ::TVOTED_REVERTED_EX = true;        //this also prevents the vote from being used post-normal win

        break;

    }

}

//calls out the player who triggered the moonmonster

function TickMoonMonsterNameCallout()

{

    EntFireByHandle(self,"RunScriptCode","TickMoonMonsterNameCallout()",10.00,null,null);

    for(local h;h=Entities.FindByName(h,"i_mm_phys*");)

    {

        if(h==null||!h.IsValid())continue;

        h.ValidateScriptScope();

        if(("pcallout_tagged" in h.GetScriptScope()))continue;

        h.GetScriptScope().pcallout_tagged <- true;

        local c = h.FirstMoveChild();

        local count = 0;

        while(c!=null)

        {

            count++;

            if(count == 1)

            {

                c.ValidateScriptScope();

                c.GetScriptScope().pcallout_triggered <- function()

                {

                    if(activator==null||!activator.IsValid())return;

                    activator.ValidateScriptScope();

                    if(!("userid" in activator.GetScriptScope()))return;

                    local userid = activator.GetScriptScope().userid;

                    if(userid == null)return;

                    local name = null;

                    foreach(p in ::WSPLAYERS)

                    {

                        if(p.userid==userid)

                        {

                            try{name = "["+p.steamid.tostring()+"] "+p.name.tostring();}catch(_e_e){}

                            break;

                        }

                    }

                    if(name == null)return;

                    EntFire("server","Command","say MoonMonster triggered by "+name,0.00,null);

                }

                EntFireByHandle(c,"AddOutput","OnStartTouch !self:RunScriptCode:pcallout_triggered();:0:1",0.00,null,null);

                break;

            }

            c = c.NextMovePeer();

        }

    }

}

//==================================================================

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:0:82660003","STEAM_1:0:82581980","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:36935

027","STEAM_1:0:40225637","STEAM_1:0:73964697","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","STE

AM_1:1:232637165","STEAM_1:1:20450857","STEAM_1:1:94436119","STEAM_1:0:513101242","STEAM_1:1:450658765","STEAM_1:0:534443260","STEAM_1:0:737862615","STEAM_1:0:225146037","STEAM_1:1:435443801","STEAM_1

:0:80773872","STEAM_1:0:142970189","STEAM_1:0:186122076"]);

CDATA.push(["IDENTIFIER","data1","data2","data3"]);

CDATA.push([""]);

-------------------------------------------------------------------------------------------------------------