Scripting guide - eirisocherry/csgo-editing GitHub Wiki
Scripting
My CS2 scripting guide: https://github.com/eirisocherry/cs2-editing/wiki/Scripting-guide
CSGO scripting is the same but with some differences:
- CSGO configs path:
Counter-Strike Global Offensive\csgo\cfgPlaycommand path looks a bit different: https://github.com/eirisocherry/csgo-editing/wiki/CSGO-sounds- CSGO doesn't have
r_dofcommands, while CS2 doesn't havenet_graph, properly workingdeveloperand some others
Helpful detailed CSGO scripting guide for those who don't understand mine: https://steamcommunity.com/sharedfiles/filedetails/?id=314801693
List of actions for binds
//////////////////
//Combat Actions//
//////////////////
Action: Command: Default key:
Attack +attack Mouse1
Secondary Attack +attack2 Mouse2
Reload +reload R
Use +use E
Next Weapon invnext mwheeldown
Previous Weapon invprev mwheelup
Next grenade invnextgrenade none
Next item invnextitem none
Switch between primary and secondary invnextnongrenade none
Switch to Primary slot1 1
Switch to Secondary slot2 2
Switch to Melee slot3 3
Switch to Grenades slot4 4
Switch to Bomb slot5 5
Switch to HE Grenade slot6 none
Switch to Flashbang slot7 none
Switch to Smoke slot8 none
Switch to Decoy slot9 none
Switch to Incendiery/Molotov slot10 none
Switch to last used lastinv Q
Inspect Weapon +lookatweapon F
Drop Weapon drop G
////////////
//Movement//
////////////
Action: Command: Default key:
Move Forward +forward W
Move Backwards +back S
Strafe Left +moveleft A
Strafe Right +moveright D
Jump +jump Space
Crouch +duck Ctrl
Turn Left +left none
Turn Right +right none
Walk +speed Shift
//////////////////////
//UI & Communication//
//////////////////////
Action: Command: Default key:
Scoreboard +score Tab
Open Chat messagemode Y
Open Chat (team) messagemode2 U
Voice chat +voicerecord V
Open Buy Menu buymenu B
Open Team Menu teammenu M
Autobuy autobuy F1
Rebuy rebuy F2
Take Screenshot screenshot F6
Take Jpeg Screenshot jpeg F5
HLAE streams
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────///////////////////////─────────────────────────────────────────────────────
//──────────────────────────────────────────────────//CREATING THE LAYERS//─────────────────────────────────────────────────────
//──────────────────────────────────────────────────///////////////////////─────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
mirv_streams add <preset> <LAYERNAME> //add the layer (ex1: mirv_streams add normal 1normal; ex2: mirv_streams add matte 3particlesALPHA)
//presets
1. normal:
just a normal layer without any effects
this layer must have id=0 to prevent problems, to do this just create this layer first before creating other OR use "mirv_streams move LAYERNAME 0"
2. baseFx:
~~~~~~~~~~~~~~~~~~~~~~~~
This type of layer uses five parameters:
draw -> draws the objects
nodraw -> hides the objects
white -> makes the objects white (don't really recommend you to use this parameter as it ignores a lot of things)
black -> makes the objects black (don't really recommend you to use this parameter as it ignores a lot of things)
mask -> makes the objects green
~~~~~~~~~~~~~~~~~~~~~~~~
the same as the normal layer but it has so much more settings
doBloomAndToneMapping and doDepthOfField functions are set to 0 by default for this layer, set them back to default if you want to make it absolutely the same as the normal layer
3. matteEntity:
~~~~~~~~~~~~~~~~~~~~~~~~
This type of layer uses five parameters:
draw -> draws the objects
nodraw -> hides the objects
white -> makes the objects white (don't really recommend you to use this parameter as it ignores a lot of things)
black -> makes the objects black (don't really recommend you to use this parameter as it ignores a lot of things)
mask -> makes the objects green
~~~~~~~~~~~~~~~~~~~~~~~~
everything is green (masked) but viewmodel, weapons, players and shells
if you wanna make it full green use these commands:
mirv_streams edit LAYERNAME shellModelsAction nodraw //[x] shells
mirv_streams edit LAYERNAME shellParticleAction nodraw //[x] shells particles
mirv_streams edit LAYERNAME playerModelsAction mask //(mask) players
mirv_streams edit LAYERNAME weaponModelsAction mask //(mask) weapons
mirv_streams edit LAYERNAME drawViewModel 0 //[x] viewmodel
4. matte:
~~~~~~~~~~~~~~~~~~~~~~~~
This type of layer uses three parameters:
drawMatte -> draws the objects
noDrawMatte -> hides the objects
draw -> masks the objects (yeah, not draws)
~~~~~~~~~~~~~~~~~~~~~~~~~
basically the same as matteEntity but instead of green there is nothing (transparency/alpha)
you can record this transparency using proresxq preset cuz it has the alpha support, here's the command (it's already in my config, just letting you know):
mirv_streams settings add ffmpeg PRORESXQ "-vsync 1 -c:v prores_ks -profile:v 5 -c:a pcm_s16le {QUOTE}{AFX_STREAM_PATH}_proresxq.mov{QUOTE}" //proresxq (12-16 bit, alpha support)
5. there are some more presets, you can see them by typing in "mirv_streams add", but I find them not very useful
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//────────────────────────────────────────────────────//////////////////////────────────────────────────────────────────────────
//────────────────────────────────────────────────────//EDITING THE LAYERS//────────────────────────────────────────────────────
//────────────────────────────────────────────────────//////////////////////────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//////////////////////
//RECORDING SETTINGS//
//////////////////////
mirv_streams print //shows what layers are set to record
mirv_streams edit LAYERNAME record 1 //toggles layer recording (0 - disabled; 1 - enabled)
mirv_streams edit LAYERNAME settings prores //overrides layer's recording settings
mirv_streams edit LAYERNAME attachCommands "fog_enable 1" //enables the commands for this layer
mirv_streams edit LAYERNAME detachCommands "fog_enable 0" //disables the commands for other layer
//////////////
//PARAMETERS//
//////////////
draw -> draws the objects
nodraw -> hides the objects
white -> makes the objects white (don't really recommend you to use this parameter as it ignores a lot of things)
black -> makes the objects black (don't really recommend you to use this parameter as it ignores a lot of things)
mask -> makes the objects green
drawMatte -> draws the objects (this parameter made for the special matte type layer)
noDrawMatte -> hides the objects (this parameter made for the special matte type layer)
/////////////
//FUNCTIONS//
/////////////
//reshade
mirv_streams edit LAYERNAME reshade enabled 1 //toggles the reshade (special hlae reshade addon is required)
//z-depth
mirv_streams edit LAYERNAME writeZAction draw //no idea
mirv_streams edit LAYERNAME drawZ gray //toggles z-depth shader (none -> disabled; gray -> default 8-bit z-depth; rgb -> 24-bit depth)
mirv_streams edit LAYERNAME captureType dithered //z-depth render type (normal -> 8-bit z-depth; dithered -> smooth 8-bit z-depth; depth24 -> 24-bit exr depth)
mirv_streams edit LAYERNAME drawZMode pyramidalLinear //draw method
mirv_streams edit LAYERNAME depthVal 0 //minimal depth point value
mirv_streams edit LAYERNAME depthValMax 4096 //maximum depth point value
//visual
mirv_streams edit LAYERNAME clientEffectTexturesAction draw //lighting/glow (you may wanna disable it if you're using 'mat_drawgray 1', cuz it has the square lighting)
mirv_streams edit LAYERNAME doBloomAndToneMapping default //bloom (disabled by default when you create the basefx type layer)
mirv_streams edit LAYERNAME doDepthOfField default //dof (disabled by default when you create the basefx type layer)
//players and weapons
mirv_streams edit LAYERNAME playerModelsAction draw //players
mirv_streams edit LAYERNAME weaponModelsAction draw //weapons
mirv_streams edit LAYERNAME drawViewModel 1 //viewmodel
mirv_streams edit LAYERNAME otherAction draw //things such as 'r_showenvcubemap 1', 'r_drawothermodels 2'
//particles and small things
mirv_streams edit LAYERNAME otherParticleAction draw //particles (blood, muzzle flash, smoke)
mirv_streams edit LAYERNAME smokeOverlayAlphaFactor 1 //smoke overlay alpha (0 -> disabled; 1 -> enabled; 0.5 -> half transparent)
mirv_streams edit LAYERNAME decalTexturesAction draw //decals
mirv_streams edit LAYERNAME statTrakAction draw //stattrack
mirv_streams edit LAYERNAME stickerAction draw //stickers
mirv_streams edit LAYERNAME shellModelsAction draw //shells
mirv_streams edit LAYERNAME shellParticleAction draw //shells particles
mirv_streams edit LAYERNAME effectsAction draw //blood splatters, sparks, flashes
//hud
mirv_streams edit LAYERNAME drawHud 1 //hud ('cl_drawhud 1' is required or nothing will work)
mirv_streams edit LAYERNAME vguiAction draw //must be set to 'draw' if you're recording the hud, otherwise you may ran into troubles
mirv_streams edit LAYERNAME clearBeforeHud none //none -> disabled; black/white -> draws the hud on the black or white solid (useless to be honest, you better use mine hud layer preset)
mirv_streams edit LAYERNAME clear 1 //clears the black color before rendering
//objects
mirv_streams edit LAYERNAME skyBoxTexturesAction draw //skybox
mirv_streams edit LAYERNAME worldTexturesAction draw //buildings
mirv_streams edit LAYERNAME staticPropTexturesAction draw //small decorations
mirv_streams edit LAYERNAME cableAction draw //cables
mirv_streams edit LAYERNAME otherModelsAction draw //objects you can interact with (cones, doors etc)
mirv_streams edit LAYERNAME errorMaterialAction draw //some objects
mirv_streams edit LAYERNAME shouldForceNoVisOverride 1 //if 1 -> disables the black screen when you fly into the wall
/////////////////
//ACTION FILTER//
/////////////////
very powerful tool, that I used a lot when was creating layers
all I can say about it is that the priority of this thing works backwards, look at these lines:
mirv_streams edit LAYERNAME actionFilter clear //clears actions
mirv_streams edit LAYERNAME actionFilter addEx "className=predicted_viewmodel" "action=drawmatte" //(+) viewmodel
mirv_streams edit LAYERNAME actionfilter addEx "name=models/weapons/shared/shells/\*" "action=drawmatte" //(+) shells
mirv_streams edit LAYERNAME actionFilter addEx "textureGroup=SkyBox textures" "action=nodrawmatte" //[x] skybox
mirv_streams edit LAYERNAME actionFilter addEx "action=noDrawmatte" //no draws everything but above
the first thing actionfilter do is clears itself then "no draws everything but above", "[x] disables skybox", "(+) adds shells" etc... keep it in mind
Simple tutorials:
https://www.youtube.com/watch?v=7Mnbr-3RvPs
https://www.youtube.com/watch?v=KNj4CmUoWIs
advanced tutorial: https://www.youtube.com/watch?v=aLxHUIOpGcU
Some useful actions:
mirv_streams edit LAYERNAME actionFilter addEx "className=class C_CSPlayer" "action=nodraw" //[x] players
mirv_streams edit LAYERNAME actionFilter addEx "className=class C_CSRagdoll" "action=nodraw" //[x] ragdolls
mirv_streams edit LAYERNAME actionFilter addEx "className=predicted_viewmodel" "action=draw" //(+) viewmodel
mirv_streams edit LAYERNAME actionfilter addEx "name=models/weapons/shared/shells/\*" "action=draw" //(+) shells
mirv_streams edit LAYERNAME actionFilter addEx "textureGroup=SkyBox textures" "action=mask" //(mask) skybox
mirv_streams edit LAYERNAME actionFilter addEx "name=particle/vistasmokev1/vistasmokev1_smokegrenade" "action=nodraw" //[x] smoke
mirv_streams edit LAYERNAME actionFilter addEx "name=particle/vistasmokev1/vistasmokev1_fire" "action=nodraw" //[x] smoke ring
mirv_streams edit LAYERNAME actionFilter addEx "name=particle/vistasmokev1/vistasmokev1_emods_impactdust" "action=nodraw" //[x] smoke static end particles
mirv_streams edit LAYERNAME actionFilter addEx "name=particle/vistasmokev1/vistasmokev1_emods" "action=nodraw" //[x] smoke dynamic end particles
mirv_streams edit LAYERNAME actionFilter addEx "name=effects/flashbang" "action=nodraw" //[x] flashbang overlay
mirv_streams edit LAYERNAME actionFilter addEx "name=effects/flashbang_white" "action=nodraw" //[x] flashbang overlay
mirv_streams edit LAYERNAME actionFilter addEx "modelName=models/weapons/\*" "action=nodraw" //[x] weapons
mirv_streams edit LAYERNAME actionfilter addEx "name=//platform/materials/debug/env_cubemap_model" "action=draw" //(+) r_showenvcubemap shader
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//matte (full empty template)
~~~~~~~~~~~~~~~~~~~~~~~~
This type of layer uses three parameters:
drawMatte -> draws the objects
noDrawMatte -> hides the objects
draw -> masks the objects (yeah, not draws)
~~~~~~~~~~~~~~~~~~~~~~~~
mirv_streams add matte EMPTYMATTE //creates the EMPTYMATTE layer
mirv_streams edit EMPTYMATTE record 0 //disables the EMPTYMATTE layer recording
alias "EMPTYMATTE" "EMPTYMATTE_on" //toggles the EMPTYMATTE layer recording on/off
alias "EMPTYMATTE_on" "mirv_streams edit EMPTYMATTE record 1; alias EMPTYMATTE EMPTYMATTE_off; echo [+] EMPTYMATTE stream set to RECORD"
alias "EMPTYMATTE_off" "mirv_streams edit EMPTYMATTE record 0; alias EMPTYMATTE EMPTYMATTE_on; echo [x] EMPTYMATTE stream NOT set to RECORD"
mirv_streams edit EMPTYMATTE clientEffectTexturesAction noDrawMatte //lighting/glow (you may wanna disable it if you're using 'mat_drawgray 1', cuz it has the square lighting)
mirv_streams edit EMPTYMATTE worldTexturesAction nodrawmatte //buildings
mirv_streams edit EMPTYMATTE skyBoxTexturesAction nodrawmatte //skybox
mirv_streams edit EMPTYMATTE staticPropTexturesAction nodrawmatte //small decorations
mirv_streams edit EMPTYMATTE cableAction noDrawMatte //cables
mirv_streams edit EMPTYMATTE errorMaterialAction nodrawMatte //some objects
mirv_streams edit EMPTYMATTE statTrakAction nodrawMatte //stattrack
mirv_streams edit EMPTYMATTE stickerAction nodrawMatte //stickers
mirv_streams edit EMPTYMATTE shellModelsAction nodrawMatte //shells
mirv_streams edit EMPTYMATTE shellParticleAction nodrawMatte //shells particles
mirv_streams edit EMPTYMATTE otherModelsAction nodrawmatte //objects you can interact with (cones, doors etc)
mirv_streams edit EMPTYMATTE decalTexturesAction noDrawMatte //decals
mirv_streams edit EMPTYMATTE effectsAction noDrawMatte //blood splatters and sparks
mirv_streams edit EMPTYMATTE otherParticleAction noDrawMatte //particles (blood, muzzle flash etc)
mirv_streams edit EMPTYMATTE smokeOverlayAlphaFactor 0 //smoke alpha (0 -> disabled; 1 -> enabled; 0.5 -> half transparent)
mirv_streams edit EMPTYMATTE otherAction noDrawMatte //things such as 'r_showenvcubemap 1', 'r_drawothermodels 2'
mirv_streams edit EMPTYMATTE writeZAction nodrawMatte //
mirv_streams edit EMPTYMATTE clear 1 //clears the black color before rendering
mirv_streams edit EMPTYMATTE shouldForceNoVisOverride 1 //if 1 -> disables the black screen when you fly into the wall
mirv_streams edit EMPTYMATTE drawHud 0 //hud ('cl_drawhud 1' is required or nothing will work)
mirv_streams edit EMPTYMATTE vguiAction nodrawmatte //must be set to 'draw' if you're recording the hud, otherwise you may ran into troubles
mirv_streams edit EMPTYMATTE clearBeforeHud none //none -> disabled; black/white -> draws the hud on the black or white solid (useless to be honest, you better use mine hud layer preset)
mirv_streams edit EMPTYMATTE drawViewModel 0 //viewmodel
mirv_streams edit EMPTYMATTE playerModelsAction nodrawMatte //players
mirv_streams edit EMPTYMATTE weaponModelsAction nodrawMatte //weapons
mirv_streams edit EMPTYMATTE attachCommands "" //enables the commands for this layer
mirv_streams edit EMPTYMATTE detachCommands "" //disables the commands for other layer
//basefx (full empty template):
~~~~~~~~~~~~~~~~~~~~~~~~
This type of layer uses five parameters:
draw -> draws the objects
nodraw -> hides the objects
white -> makes the objects white (don't really recommend you to use this parameter as it ignores a lot of things)
black -> makes the objects black (don't really recommend you to use this parameter as it ignores a lot of things)
mask -> makes the objects green
~~~~~~~~~~~~~~~~~~~~~~~~
mirv_streams add basefx EMPTYBASEFX //creates the EMPTYBASEFX layer
mirv_streams edit EMPTYBASEFX record 0 //disables the EMPTYBASEFX layer recording
alias "EMPTYBASEFX" "EMPTYBASEFX_on" //toggles the EMPTYBASEFX layer recording on/off
alias "EMPTYBASEFX_on" "mirv_streams edit EMPTYBASEFX record 1; alias EMPTYBASEFX EMPTYBASEFX_off; echo [+] EMPTYBASEFX stream set to RECORD"
alias "EMPTYBASEFX_off" "mirv_streams edit EMPTYBASEFX record 0; alias EMPTYBASEFX EMPTYBASEFX_on; echo [x] EMPTYBASEFX stream NOT set to RECORD"
mirv_streams edit EMPTYBASEFX clientEffectTexturesAction nodraw //lighting/glow (you may wanna disable it if you're using 'mat_drawgray 1', cuz it has the square lighting)
mirv_streams edit EMPTYBASEFX worldTexturesAction nodraw //buildings
mirv_streams edit EMPTYBASEFX skyBoxTexturesAction mask //skybox (YOU NEED TO MASK/DRAW THE SKY OR IT WILL CAUSE VISUAL GLITCHES)
mirv_streams edit EMPTYBASEFX staticPropTexturesAction nodraw //small decorations
mirv_streams edit EMPTYBASEFX cableAction nodraw //cables
mirv_streams edit EMPTYBASEFX errorMaterialAction nodraw //some objects
mirv_streams edit EMPTYBASEFX statTrakAction nodraw //stattrack
mirv_streams edit EMPTYBASEFX stickerAction nodraw //stickers
mirv_streams edit EMPTYBASEFX shellModelsAction nodraw //shells
mirv_streams edit EMPTYBASEFX shellParticleAction nodraw //shells particles
mirv_streams edit EMPTYBASEFX otherModelsAction nodraw //objects you can interact with (cones, doors etc)
mirv_streams edit EMPTYBASEFX decalTexturesAction nodraw //decals
mirv_streams edit EMPTYBASEFX effectsAction nodraw //blood splatters and sparks
mirv_streams edit EMPTYBASEFX otherParticleAction nodraw //particles (blood, muzzle flash etc)
mirv_streams edit EMPTYBASEFX smokeOverlayAlphaFactor 0 //smoke alpha (0 -> disabled; 1 -> enabled; 0.5 -> half transparent)
mirv_streams edit EMPTYBASEFX otherAction nodraw //things such as 'r_showenvcubemap 1', 'r_drawothermodels 2'
mirv_streams edit EMPTYBASEFX writeZAction nodraw //
mirv_streams edit EMPTYBASEFX clear 1 //clears the black color before rendering
mirv_streams edit EMPTYBASEFX shouldForceNoVisOverride 1 //if 1 -> disables the black screen when you fly into the wall
mirv_streams edit EMPTYBASEFX drawHud 0 //hud ('cl_drawhud 1' is required or nothing will work)
mirv_streams edit EMPTYBASEFX vguiAction nodraw //must be set to 'draw' if you're recording the hud, otherwise you may ran into troubles
mirv_streams edit EMPTYBASEFX clearBeforeHud none //none -> disabled; black/white -> draws the hud on the black or white solid (useless to be honest, you better use mine hud layer preset)
mirv_streams edit EMPTYBASEFX drawViewModel 0 //viewmodel
mirv_streams edit EMPTYBASEFX playerModelsAction nodraw //players
mirv_streams edit EMPTYBASEFX weaponModelsAction nodraw //weapons
mirv_streams edit EMPTYBASEFX attachCommands "" //enables the commands for this layer
mirv_streams edit EMPTYBASEFX detachCommands "" //disables the commands for other layer
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
//──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
///////////////////////////////////////
//RANDOM THINGS THAT MIGHT BE HELPFUL//
///////////////////////////////////////
//mirv_fix oldDuckFix 1 //fixes crouch stuck on old demos
//mirv_streams edit LAYERNAME actionFilter add "particle/vistasmokev1/vistasmokev1_smokegrenade" noDraw //smoke removal
//mirv_streams edit LAYERNAME actionFilter add "particle/vistasmokev1/vistasmokev1_fire" noDraw //smoke removal
//mirv_streams edit LAYERNAME actionFilter add "decals/playerlogo\*" noDraw //removes graffity
//mirv_streams edit LAYERNAME actionFilter addEx "name=models/weapons/uid/\*" "action=noDraw" //removes nametags
//mirv_streams edit LAYERNAME actionFilter addEx name=particle/particle_flares/particle_flare_gray action=noDraw //removes black smoke from molotovs
//mirv_streams edit LAYERNAME actionFilter addEx name=particle/particle_flares/particle_flare_001_nodepth_noz action=noDraw //removes black smoke from molotovs
//r_staticlight_streams 1 //fixes black trains on de_train
//r_staticlight_streams 1; mat_ambient_light_r 0.1; mat_ambient_light_g 0.1; mat_ambient_light_b 0.1 //fixes tetris boxes on de_mirage