mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
45
lua/autorun/server/admin_functions.lua
Normal file
45
lua/autorun/server/admin_functions.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: KickId2
|
||||
Desc: Allows admins to use the kickid2 command to kick people.
|
||||
-----------------------------------------------------------]]
|
||||
local function KickId( player, command, arguments )
|
||||
|
||||
if ( !player:IsAdmin() ) then return end
|
||||
|
||||
local id = arguments[1]
|
||||
local reason = arguments[2] or "Kicked"
|
||||
|
||||
RunConsoleCommand( "kickid", id, Format( "%s (%s)", reason, player:Nick() ) )
|
||||
|
||||
end
|
||||
|
||||
concommand.Add( "kickid2", KickId, nil, "", { FCVAR_DONTRECORD } )
|
||||
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Name: BanId2
|
||||
Desc: Allows admins to use the banid2 command to ban people.
|
||||
-----------------------------------------------------------]]
|
||||
local function BanID( player, command, arguments )
|
||||
|
||||
if ( !player:IsAdmin() ) then return end
|
||||
|
||||
local length = arguments[1]
|
||||
local id = arguments[2]
|
||||
|
||||
RunConsoleCommand( "banid", length, id )
|
||||
|
||||
end
|
||||
|
||||
concommand.Add( "banid2", BanID, nil, "", { FCVAR_DONTRECORD } )
|
||||
138
lua/autorun/server/advdupe2_sv_init.lua
Normal file
138
lua/autorun/server/advdupe2_sv_init.lua
Normal file
@@ -0,0 +1,138 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
AdvDupe2 = {
|
||||
Version = "1.1.0",
|
||||
Revision = 51
|
||||
}
|
||||
|
||||
AdvDupe2.DataFolder = "advdupe2" --name of the folder in data where dupes will be saved
|
||||
|
||||
function AdvDupe2.Notify(ply,msg,typ, showsvr, dur)
|
||||
net.Start("AdvDupe2Notify")
|
||||
net.WriteString(msg)
|
||||
net.WriteUInt(typ or 0, 8)
|
||||
net.WriteFloat(dur or 5)
|
||||
net.Send(ply)
|
||||
|
||||
if(showsvr==true)then
|
||||
print("[AdvDupe2Notify]\t"..ply:Nick()..": "..msg)
|
||||
end
|
||||
end
|
||||
|
||||
AddCSLuaFile( "autorun/client/advdupe2_cl_init.lua" )
|
||||
AddCSLuaFile( "advdupe2/file_browser.lua" )
|
||||
AddCSLuaFile( "advdupe2/sh_codec.lua" )
|
||||
AddCSLuaFile( "advdupe2/cl_file.lua" )
|
||||
AddCSLuaFile( "advdupe2/cl_ghost.lua" )
|
||||
|
||||
util.AddNetworkString("AdvDupe2_ReportClass")
|
||||
util.AddNetworkString("AdvDupe2_ReportModel")
|
||||
util.AddNetworkString("AdvDupe2Notify")
|
||||
util.AddNetworkString("AdvDupe2_RemoveGhosts")
|
||||
util.AddNetworkString("AdvDupe2_ResetDupeInfo")
|
||||
util.AddNetworkString("AdvDupe2_StartGhosting")
|
||||
util.AddNetworkString("AdvDupe2_InitProgressBar")
|
||||
util.AddNetworkString("AdvDupe2_DrawSelectBox")
|
||||
util.AddNetworkString("AdvDupe2_RemoveSelectBox")
|
||||
util.AddNetworkString("AdvDupe2_UpdateProgressBar")
|
||||
util.AddNetworkString("AdvDupe2_RemoveProgressBar")
|
||||
util.AddNetworkString("AdvDupe2_ResetOffsets")
|
||||
util.AddNetworkString("AdvDupe2_SetDupeInfo")
|
||||
util.AddNetworkString("AdvDupe2_ReceiveFile")
|
||||
util.AddNetworkString("AdvDupe2_CanAutoSave")
|
||||
|
||||
CreateConVar("AdvDupe2_DebugInfo", "0", {FCVAR_ARCHIVE}, "Should extra info be printed to console?", 0, 1)
|
||||
CreateConVar("AdvDupe2_SpawnRate", "1", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MaxFileSize", "200", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MaxEntities", "0", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MaxConstraints", "0", {FCVAR_ARCHIVE})
|
||||
|
||||
CreateConVar("AdvDupe2_MaxContraptionEntities", "10", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MaxContraptionConstraints", "15", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MinContraptionSpawnDelay", "0.2", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MinContraptionUndoDelay", "0.1", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MaxContraptionUndoDelay", "60", {FCVAR_ARCHIVE})
|
||||
|
||||
CreateConVar("AdvDupe2_FileModificationDelay", "5", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_UpdateFilesDelay", "10", {FCVAR_ARCHIVE})
|
||||
|
||||
CreateConVar("AdvDupe2_LoadMap", "0", {FCVAR_ARCHIVE})
|
||||
CreateConVar("AdvDupe2_MapFileName", "", {FCVAR_ARCHIVE})
|
||||
|
||||
local function PasteMap()
|
||||
if(GetConVarString("AdvDupe2_LoadMap")=="0")then return end
|
||||
local filename = GetConVarString("AdvDupe2_MapFileName")
|
||||
|
||||
if(not filename or filename == "")then
|
||||
print("[AdvDupe2Notify]\tInvalid file name to loap map save.")
|
||||
return
|
||||
end
|
||||
|
||||
if(not file.Exists("advdupe2_maps/"..filename..".txt", "DATA"))then
|
||||
print("[AdvDupe2Notify]\tFile does not exist for a map save.")
|
||||
return
|
||||
end
|
||||
|
||||
local map = file.Read("advdupe2_maps/"..filename..".txt")
|
||||
local success,dupe,info,moreinfo = AdvDupe2.Decode(map)
|
||||
if not success then
|
||||
print("[AdvDupe2Notify]\tCould not open map save "..dupe)
|
||||
return
|
||||
end
|
||||
|
||||
local Tab = {Entities=dupe["Entities"], Constraints=dupe["Constraints"], HeadEnt=dupe["HeadEnt"]}
|
||||
local Entities = AdvDupe2.duplicator.Paste(nil, table.Copy(Tab.Entities), Tab.Constraints, nil, nil, Tab.HeadEnt.Pos, true)
|
||||
local maptype = GetConVarString("AdvDupe2_LoadMap")
|
||||
|
||||
if(maptype=="1")then
|
||||
local PhysObj
|
||||
for k,v in pairs(Entities) do
|
||||
if(IsValid(v))then
|
||||
for i=0, #Tab.Entities[k].PhysicsObjects do
|
||||
if(Tab.Entities[k].PhysicsObjects[i].Frozen)then
|
||||
PhysObj = v:GetPhysicsObjectNum( i )
|
||||
if IsValid(PhysObj) then
|
||||
PhysObj:EnableMotion(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
if v.CPPISetOwner then v:CPPISetOwner(game.GetWorld()) end
|
||||
end
|
||||
end
|
||||
elseif(maptype=="2")then
|
||||
local PhysObj
|
||||
for k,v in pairs(Entities) do
|
||||
if(IsValid(v))then
|
||||
for i=0, #Tab.Entities[k].PhysicsObjects do
|
||||
PhysObj = v:GetPhysicsObjectNum( i )
|
||||
if IsValid(PhysObj) then
|
||||
PhysObj:EnableMotion(true)
|
||||
end
|
||||
end
|
||||
if v.CPPISetOwner then v:CPPISetOwner(game.GetWorld()) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print("[AdvDupe2Notify]\tMap save pasted.")
|
||||
end
|
||||
hook.Add("InitPostEntity", "AdvDupe2_PasteMap", PasteMap)
|
||||
hook.Add("PostCleanupMap", "AdvDupe2_PasteMap", PasteMap)
|
||||
hook.Add("PlayerInitialSpawn","AdvDupe2_AddPlayerTable",function(ply)
|
||||
ply.AdvDupe2 = {}
|
||||
end)
|
||||
|
||||
include( "advdupe2/sv_clipboard.lua" )
|
||||
include( "advdupe2/sh_codec.lua" )
|
||||
include( "advdupe2/sv_misc.lua" )
|
||||
include( "advdupe2/sv_file.lua" )
|
||||
include( "advdupe2/sv_ghost.lua" )
|
||||
|
||||
26
lua/autorun/server/effect_remove_hook_d2k.lua
Normal file
26
lua/autorun/server/effect_remove_hook_d2k.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
//Global variable to inform Export To Lua addon that the core addon is installed
|
||||
SpecialEffectsD2KIsInstalled = true
|
||||
|
||||
|
||||
//Find effects and cut the sound they're making
|
||||
local function OnEffectRemove_D2K(effect_d2k)
|
||||
|
||||
//Stop sounds
|
||||
if effect_d2k.SFX_Sound then
|
||||
effect_d2k.SFX_Sound:Stop()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
//Add hook
|
||||
hook.Add("EntityRemoved", "EffectRemoveHook_D2K", OnEffectRemove_D2K)
|
||||
11
lua/autorun/server/gm_dumptimers-fix.lua
Normal file
11
lua/autorun/server/gm_dumptimers-fix.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
require("dumptimers_fix")
|
||||
289
lua/autorun/server/morematerials.lua
Normal file
289
lua/autorun/server/morematerials.lua
Normal file
@@ -0,0 +1,289 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
// adding materials to the material toolguns list
|
||||
|
||||
list.Add( "OverrideMaterials", "models/XQM//Deg360" )
|
||||
list.Add( "OverrideMaterials", "models/XQM//LightLinesGB" )
|
||||
list.Add( "OverrideMaterials", "models/XQM//LightLinesRed" )
|
||||
list.Add( "OverrideMaterials", "models/XQM//SquaredMat" )
|
||||
list.Add( "OverrideMaterials", "models/XQM//WoodTexture_1" )
|
||||
list.Add( "OverrideMaterials", "models/airboat/airboat_blur02" )
|
||||
list.Add( "OverrideMaterials", "models/alyx/emptool_glow" )
|
||||
list.Add( "OverrideMaterials", "models/antlion/antlion_innards" )
|
||||
list.Add( "OverrideMaterials", "models/barnacle/roots" )
|
||||
list.Add( "OverrideMaterials", "models/combine_advisor/body9" )
|
||||
list.Add( "OverrideMaterials", "models/combine_advisor/mask" )
|
||||
list.Add( "OverrideMaterials", "models/combine_scanner/scanner_eye" )
|
||||
list.Add( "OverrideMaterials", "models/debug/debugwhite" )
|
||||
list.Add( "OverrideMaterials", "models/dog/eyeglass" )
|
||||
list.Add( "OverrideMaterials", "models/effects/portalrift_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/effects/slimebubble_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/effects/splode1_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/effects/splode_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/gibs/metalgibs/metal_gibs" )
|
||||
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs01" )
|
||||
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs02" )
|
||||
list.Add( "OverrideMaterials", "models/gibs/woodgibs/woodgibs03" )
|
||||
list.Add( "OverrideMaterials", "models/player/player_chrome1" )
|
||||
list.Add( "OverrideMaterials", "models/props_animated_breakable/smokestack/brickwall002a" )
|
||||
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
|
||||
list.Add( "OverrideMaterials", "models/props_building_details/courtyard_template001c_bars" )
|
||||
list.Add( "OverrideMaterials", "models/props_buildings/destroyedbuilldingwall01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_buildings/plasterwall021a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/frostedglass_01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/furniturefabric002a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/furnituremetal001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/gate_door02a" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/metalladder001" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/metalladder002" )
|
||||
list.Add( "OverrideMaterials", "models/props_c17/metalladder003" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01b" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/canal_bridge_railing_01c" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/canalmap_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/coastmap_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/metalcrate001d" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/metalwall005b" )
|
||||
list.Add( "OverrideMaterials", "models/props_canal/rock_riverbed01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/citadel_cable_b" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/com_shield001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/combine_interface_disp" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/combine_monitorbay_disp" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/metal_combinebridge001" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/pipes01" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/pipes03" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/prtl_sky_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/props_combine/stasisfield_beam" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/building_template010a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/building_template022j" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/composite_debris" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/concretefloor013a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/concretefloor020a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/concretewall019a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/metalwall001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterceiling008a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall009d" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall021a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034a" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall034d" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall039c" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/plasterwall040c" )
|
||||
list.Add( "OverrideMaterials", "models/props_debris/tilefloor001c" )
|
||||
list.Add( "OverrideMaterials", "models/props_foliage/driftwood_01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_foliage/oak_tree01" )
|
||||
list.Add( "OverrideMaterials", "models/props_foliage/tree_deciduous_01a_trunk" )
|
||||
list.Add( "OverrideMaterials", "models/props_interiors/metalfence007a" )
|
||||
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01b" )
|
||||
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01c" )
|
||||
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01d" )
|
||||
list.Add( "OverrideMaterials", "models/props_junk/plasticcrate01e" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/Tank_Glass001" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/cornerunit_cloud" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/door_klab01" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/security_screens" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/security_screens2" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/warp_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/props_lab/xencrystal_sheet" )
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/GutterMetal01a")
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/destroyedpipes01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/pipemetal001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/pipeset_metal02" )
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin1" )
|
||||
list.Add( "OverrideMaterials", "models/props_pipes/pipesystem01a_skin2" )
|
||||
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001" )
|
||||
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001b" )
|
||||
list.Add( "OverrideMaterials", "models/props_vents/borealis_vent001c" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/concretefloor010a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall064b" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/concretewall066a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/dirtwall001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/metal_tram001a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/quarryobjects01" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02b" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff02c" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/rockcliff04a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/rockgranite02a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat01" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/tugboat02" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a" )
|
||||
list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a_skin2" )
|
||||
list.Add( "OverrideMaterials", "models/shadertest/predator" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_crossbow/rebar_glow" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_crowbar/crowbar_cyl" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_grenade/grenade body" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light1" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_slam/new light2" )
|
||||
list.Add( "OverrideMaterials", "models/weapons/v_smg1/texture5" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/BoxFull_diffuse" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/CellShadedCamo_diffuse" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/CinderBlock_Tex" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/JetBody2TailPiece_diffuse" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/PoleX1_diffuse" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/Rails/gumball_1" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/SquaredMatInverted" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/WoodPlankTexture" )
|
||||
list.Add( "OverrideMaterials", "models/XQM/boxfull_diffuse" )
|
||||
list.Add( "OverrideMaterials", "models/dav0r/hoverball" )
|
||||
list.Add( "OverrideMaterials", "models/spawn_effect" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/Fender_chrome" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/Fender_white" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/Fender_wood" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/Future_vents" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/FuturisticTrackRamp_1-2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/OfficeWindow_1-1" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/Pro_gear_side" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/black_brushes" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/black_chrome" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/blue_steel" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/camera" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/car_tire" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/checkers_map" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/cigar" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/concrete0" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/concrete1" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/concrete2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/concrete3" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier00" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_barrier2_00" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/construct/concrete_pipe_00" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/egg" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/gear" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/gear_top" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/grey_chrome" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/grey_steel" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/heli" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/indentTiles2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/iron_rails" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_carbonfiber2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_metallic2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mat/mat_phx_plastic2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/metal_plate" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/metal_wheel" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/metalbox" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/metalbox2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/metalfence004a" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/middle" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/mrref2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/output_jack" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/pack2/chrome" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/pack2/interior_sides" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/pack2/train_floor" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/potato" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/pro_gear_top2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/ps_grass" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/road" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/roadside" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/scrnspace" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/side" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic1" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/simplyMetallic2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/smallwheel" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/spheremappy" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/t_light" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/thruster" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/tiles2" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/top" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/torpedo" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamside" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_beamtop" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plate" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/trains/track_plateside" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/white_brushes" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/white_fps" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/window" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_blue" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_green" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_red" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/wood_dome" )
|
||||
list.Add( "OverrideMaterials", "phoenix_storms/wood_side" )
|
||||
|
||||
// Checking if CSS is mounted and adding CSS textures if it is
|
||||
|
||||
function engine.IsMounted(g)
|
||||
for k,v in pairs(engine.GetGames()) do
|
||||
if (' cstrike' ) then
|
||||
return true;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if IsMounted( 'cstrike' ) and (engine.IsMounted('cstrike')) then
|
||||
|
||||
list.Add( "OverrideMaterials", "models/cs_havana/wndb" )
|
||||
list.Add( "OverrideMaterials", "models/cs_havana/wndd" )
|
||||
list.Add( "OverrideMaterials", "models/cs_italy/light_orange" )
|
||||
list.Add( "OverrideMaterials", "models/cs_italy/plaster" )
|
||||
list.Add( "OverrideMaterials", "models/cs_italy/pwtrim2" )
|
||||
list.Add( "OverrideMaterials", "models/de_cbble/wndarch" )
|
||||
list.Add( "OverrideMaterials", "models/de_chateau/ch_arch_b1" )
|
||||
list.Add( "OverrideMaterials", "models/pi_window/plaster" )
|
||||
list.Add( "OverrideMaterials", "models/pi_window/trim128" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/dollar" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/fireescapefloor" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/metal_stairs1" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/moneywrap02" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/moneytop" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_assault/pylon" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/boulder01" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/milceil001" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarock" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/militiarockb" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/milwall006" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/rocks01" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams01" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams02" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/roofbeams03" )
|
||||
list.Add( "OverrideMaterials", "models/props/CS_militia/RoofEdges" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_office/clouds" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet2" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_office/file_cabinet3" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_office/screen" )
|
||||
list.Add( "OverrideMaterials", "models/props/cs_office/snowmana" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/de_inferno_boulder_03" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/infflra" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/infflrd" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/inftowertop" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/offwndwb_break" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/roofbits" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/tileroof01" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_inferno/woodfloor008a" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_nuke/nukconcretewalla" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_nuke/nukecardboard" )
|
||||
list.Add( "OverrideMaterials", "models/props/de_nuke/pipeset_metal" )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
// Making sure there's no double materials in the list in case of other addons, plus sorting them
|
||||
|
||||
timer.Simple(0, function()
|
||||
local mats = list.GetForEdit("OverrideMaterials");
|
||||
local cleaner = {};
|
||||
for i, mat in pairs(mats) do
|
||||
cleaner[mat] = true;
|
||||
mats[i] = nil;
|
||||
end
|
||||
local i = 1;
|
||||
for mat in pairs(cleaner) do
|
||||
mats[i] = mat;
|
||||
i = i + 1;
|
||||
end
|
||||
table.sort(mats);
|
||||
end);
|
||||
107
lua/autorun/server/rb655_map_dupe_fix.lua
Normal file
107
lua/autorun/server/rb655_map_dupe_fix.lua
Normal file
@@ -0,0 +1,107 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
resource.AddWorkshop( "104619813" )
|
||||
|
||||
hook.Add( "EntityKeyValue", "rb655_keyval_fix", function( ent, key, val )
|
||||
|
||||
if ( ent:GetClass() == "env_headcrabcanister" ) then
|
||||
|
||||
if ( key == "HeadcrabType" ) then ent.headcrab = val end
|
||||
if ( key == "HeadcrabCount" ) then ent.count = val end
|
||||
if ( key == "FlightSpeed" ) then ent.speed = val end
|
||||
if ( key == "FlightTime" ) then ent.time = val end
|
||||
if ( key == "StartingHeight" ) then ent.height = val end
|
||||
if ( key == "Damage" ) then ent.damage = val end
|
||||
if ( key == "DamageRadius" ) then ent.radius = val end
|
||||
if ( key == "SmokeLifetime" ) then ent.duration = val end
|
||||
if ( key == "spawnflags" ) then ent.spawnflags = val end
|
||||
if ( key == "targetname" ) then ent.targetname = val end
|
||||
|
||||
elseif ( ent:GetClass() == "prop_thumper" ) then
|
||||
|
||||
if ( key == "dustscale" ) then ent.dustscale = val end
|
||||
if ( key == "targetname" ) then ent.targetname = val end
|
||||
|
||||
elseif ( ent:GetClass() == "prop_door_rotating" ) then
|
||||
|
||||
if ( !ent.rb655_dupe_data ) then ent.rb655_dupe_data = { ismapcreated = ent:CreatedByMap() } end
|
||||
|
||||
if ( key == "speed" ) then ent.rb655_dupe_data.speed = val end
|
||||
if ( key == "distance" ) then ent.rb655_dupe_data.distance = val end
|
||||
if ( key == "hardware" ) then ent.rb655_dupe_data.hardware = val end
|
||||
if ( key == "returndelay" ) then ent.rb655_dupe_data.returndelay = val end
|
||||
if ( key == "skin" ) then ent.rb655_dupe_data.skin = val end
|
||||
if ( key == "angles" ) then ent.rb655_dupe_data.initialAngles = Angle( val ) end
|
||||
if ( key == "ajarangles" ) then ent.rb655_dupe_data.ajarangles = val end
|
||||
if ( key == "spawnflags" ) then ent.rb655_dupe_data.spawnflags = val end
|
||||
if ( key == "spawnpos" ) then ent.rb655_dupe_data.spawnpos = val end
|
||||
if ( key == "targetname" ) then ent.rb655_dupe_data.targetname = val end
|
||||
--if ( key == "slavename" ) then print( "slavename", key, val ) ent.rb655_dupe_data.targetname = val end
|
||||
|
||||
function ent:PreEntityCopy()
|
||||
self.rb655_door_opened = self:GetInternalVariable( "m_eDoorState" ) != 0
|
||||
self.rb655_door_locked = self:GetInternalVariable( "m_bLocked" )
|
||||
end
|
||||
|
||||
elseif ( ent:GetClass() == "item_ammo_crate" ) then
|
||||
|
||||
if ( key == "AmmoType" ) then ent.type = val end
|
||||
|
||||
elseif ( ent:GetClass() == "item_item_crate" ) then
|
||||
|
||||
if ( key == "ItemCount" ) then ent.amount = val end
|
||||
if ( key == "ItemClass" ) then ent.class = val end
|
||||
if ( key == "CrateAppearance" ) then ent.appearance = val end
|
||||
if ( key == "targetname" ) then ent.targetname = val end
|
||||
|
||||
end
|
||||
|
||||
end )
|
||||
|
||||
-- Ehhh... We gotta copy over wire_base_entity stuff for dupes
|
||||
function rb655_hl2_CopyWireModMethods( targetEnt )
|
||||
|
||||
local oldPreFunc = targetEnt.PreEntityCopy
|
||||
function targetEnt:PreEntityCopy()
|
||||
if ( oldPreFunc ) then oldPreFunc( self ) end
|
||||
|
||||
duplicator.ClearEntityModifier( self, "WireDupeInfo" )
|
||||
|
||||
-- build the DupeInfo table and save it as an entity mod
|
||||
local DupeInfo = WireLib.BuildDupeInfo( self )
|
||||
if ( DupeInfo ) then
|
||||
duplicator.StoreEntityModifier( self, "WireDupeInfo", DupeInfo )
|
||||
end
|
||||
end
|
||||
|
||||
local function EntityLookup( createdEntities )
|
||||
return function( id, default )
|
||||
if ( id == nil ) then return default end
|
||||
if ( id == 0 ) then return game.GetWorld() end
|
||||
local ent = createdEntities[ id ]
|
||||
if ( IsValid( ent ) ) then return ent else return default end
|
||||
end
|
||||
end
|
||||
|
||||
local oldPostFunc = targetEnt.PostEntityPaste
|
||||
function targetEnt:PostEntityPaste( player, ent, createdEntities )
|
||||
-- We manually apply the entity mod here rather than using a
|
||||
-- duplicator.RegisterEntityModifier because we need access to the
|
||||
-- CreatedEntities table.
|
||||
if ( ent.EntityMods and ent.EntityMods.WireDupeInfo ) then
|
||||
WireLib.ApplyDupeInfo( player, ent, ent.EntityMods.WireDupeInfo, EntityLookup( createdEntities ) )
|
||||
end
|
||||
|
||||
if ( oldPostFunc ) then oldPostFunc( self, player, ent, createdEntities ) end
|
||||
end
|
||||
|
||||
end
|
||||
129
lua/autorun/server/sensorbones/css.lua
Normal file
129
lua/autorun/server/sensorbones/css.lua
Normal file
@@ -0,0 +1,129 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local SPNE = 1
|
||||
local TRSO = 2
|
||||
local RSLD = 3
|
||||
local LSLD = 4
|
||||
local LARM = 5
|
||||
local LWST = 6
|
||||
local LHND = 7
|
||||
local RARM = 8
|
||||
local RWST = 9
|
||||
local RHND = 10
|
||||
local RTHY = 11
|
||||
local RCLF = 12
|
||||
local LTHY = 13
|
||||
local LCLF = 14
|
||||
local HEAD = 15
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 1.0
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.5 )
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * 0.2 )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.2 )
|
||||
-- sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.3 )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[TRSO] = SENSORBONE.SPINE,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = SENSORBONE.SPINE,
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = LTHY, to = RTHY, up = "hips_fwd" },
|
||||
[SPNE] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_rgt" },
|
||||
[TRSO] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_rgt" },
|
||||
[HEAD] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SHOULDER, up = "chest_lft" },
|
||||
[RSLD] = { from = RSLD, to = LSLD, up = "chest_bck" },
|
||||
[LSLD] = { from = LSLD, to = RSLD, up = "chest_fwd" },
|
||||
[RARM] = { from = RARM, to = RSLD, up = "chest_up" },
|
||||
[LARM] = { from = LARM, to = LSLD, up = "chest_dn" },
|
||||
[RWST] = { from = RHND, to = RARM, up = "chest_up" },
|
||||
[LWST] = { from = LHND, to = LARM, up = "chest_dn" },
|
||||
[RTHY] = { from = RCLF, to = RTHY, up_up = SPNE },
|
||||
[RCLF] = { from_sensor = SENSORBONE.ANKLE_RIGHT, to_sensor = SENSORBONE.KNEE_RIGHT, up_up = RTHY },
|
||||
[LTHY] = { from = LCLF, to = LTHY, up_up = SPNE },
|
||||
[LCLF] = { from_sensor = SENSORBONE.ANKLE_LEFT, to_sensor = SENSORBONE.KNEE_LEFT, up_up = LTHY },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_lft = RARM },
|
||||
[LHND] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.WRIST_LEFT, up_rgt = LARM },
|
||||
[LWST] = { from = LHND, to = LARM, up = "chest_dn" },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
pos[SPNE] = LerpVector( 0.45, pos[SPNE], pos[HEAD] )
|
||||
pos[RWST] = pos[RARM]
|
||||
pos[LWST] = pos[LARM]
|
||||
|
||||
end,
|
||||
|
||||
-- We're used as a default - no need to return true to anything here.
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/ct_gign.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/ct_sas.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/ct_urban.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models//player/ct_gsg9.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/t_guerilla.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/t_leet.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/t_phoenix.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models//player/t_arctic.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "CounterStrikeSource", Builder )
|
||||
114
lua/autorun/server/sensorbones/eli.lua
Normal file
114
lua/autorun/server/sensorbones/eli.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local LTHY = 1
|
||||
local SPNE = 2
|
||||
local RSLD = 3
|
||||
local RARM = 4
|
||||
local LSLD = 5
|
||||
local LARM = 6
|
||||
local LHND = 7
|
||||
local HEAD = 8
|
||||
local RHND = 9
|
||||
local RTHY = 10
|
||||
local RCLF = 11
|
||||
local LCLF = 12
|
||||
local RFOT = 13
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.7
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.5 )
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * 0.3 )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.3 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.HIP_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.2 )
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.2 )
|
||||
|
||||
end,
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = SENSORBONE.SPINE,
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = LTHY, to = RTHY, up = "hips_fwd" },
|
||||
[SPNE] = { from = HEAD, to = SPNE, up = "chest_rgt" },
|
||||
[HEAD] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_lft" },
|
||||
[RSLD] = { from = RARM, to = RSLD, up = "chest_up" },
|
||||
[RARM] = { from = RHND, to = RARM, up_up = RSLD },
|
||||
[LSLD] = { from = LARM, to = LSLD, up = "chest_dn" },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[RTHY] = { from = RCLF, to = RTHY, up_up = SPNE },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
[LTHY] = { from = LCLF, to = LTHY, up_up = SPNE },
|
||||
[LCLF] = { from_sensor = SENSORBONE.ANKLE_LEFT, to = LCLF, up_up = LTHY },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_lft = RARM },
|
||||
[LHND] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.WRIST_LEFT, up_rgt = LARM }
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
pos[SPNE] = LerpVector( 0.4, pos[SPNE], pos[HEAD] )
|
||||
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 20, 0, 0 )
|
||||
|
||||
end,
|
||||
|
||||
-- Should this entity use this builder?
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
return ent:GetModel():EndsWith( "models/eli.mdl" )
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "Eli", Builder )
|
||||
173
lua/autorun/server/sensorbones/tf2_engineer.lua
Normal file
173
lua/autorun/server/sensorbones/tf2_engineer.lua
Normal file
@@ -0,0 +1,173 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
-- coord
|
||||
local RTHY = 2
|
||||
local RCLF = 3
|
||||
local RFOT = 4
|
||||
local LTHY = 5
|
||||
local LCLF = 6
|
||||
local LFOT = 7
|
||||
|
||||
local SPNE = 8
|
||||
local RSLD = 9
|
||||
local RARM = 10
|
||||
local LSLD = 11
|
||||
local LARM = 12
|
||||
local LHND = 13
|
||||
local NECK = 14
|
||||
local HEAD = 15
|
||||
local RHND = 16
|
||||
|
||||
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.6
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.0 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.0 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.2 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.2 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.2 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.2 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[NECK] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = SPNE, to = HEAD, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = SPNE },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_bck = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up_dn = PLVS },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
[RFOT] = { from = RCLF, to = RFOT, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up_dn = PLVS },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
[LFOT] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT]:RotateAroundAxis( ang[RFOT]:Up(), -90 )
|
||||
ang[RFOT]:RotateAroundAxis( ang[RFOT]:Forward(), 180 )
|
||||
ang[LFOT]:RotateAroundAxis( ang[LFOT]:Up(), 90 )
|
||||
|
||||
ang[LFOT]:RotateAroundAxis( ang[LFOT]:Forward(), -45 )
|
||||
ang[RFOT]:RotateAroundAxis( ang[LFOT]:Forward(), -45 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
ang[NECK] = ang[HEAD]
|
||||
|
||||
pos[1] = pos[PLVS]
|
||||
ang[1] = ang[PLVS] * -1
|
||||
ang[1]:RotateAroundAxis( ang[1]:Right(), 90 )
|
||||
pos[17] = pos[PLVS]
|
||||
ang[17] = ang[PLVS] * -1
|
||||
ang[17]:RotateAroundAxis( ang[1]:Right(), 90 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[LHND] = ang[LARM] * 1
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), 90 )
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/engineer.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/engineer.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/engineer/bot_engineer.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/demo_engineer/bot_demo_engineer.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_engineer", Builder )
|
||||
157
lua/autorun/server/sensorbones/tf2_heavy.lua
Normal file
157
lua/autorun/server/sensorbones/tf2_heavy.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local RTHY = 1
|
||||
local RCLF = 2
|
||||
local LTHY = 3
|
||||
local LCLF = 4
|
||||
local LFOT = 5
|
||||
local SPNE = 6
|
||||
local SPN2 = 7
|
||||
local RSLD = 8
|
||||
local LSLD = 9
|
||||
local LARM = 10
|
||||
local LHND = 11
|
||||
local RARM = 12
|
||||
local RHND = 13
|
||||
local HEAD = 14
|
||||
local RFOT = 15
|
||||
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 1.2
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.6 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.3 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.3 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE },
|
||||
[SPN2] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[SPN2] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = SPNE, to = HEAD, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = SPNE },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_bck = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up = "right" },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up = "forward" },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 0, 180, -40 )
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 0, -90, 130 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[SPN2]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[LHND] = ang[LARM] * 1
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), 90 )
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/heavy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/heavy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/heavy/bot_heavy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/heavy_boss/bot_heavy_boss.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_heavy", Builder )
|
||||
153
lua/autorun/server/sensorbones/tf2_medic.lua
Normal file
153
lua/autorun/server/sensorbones/tf2_medic.lua
Normal file
@@ -0,0 +1,153 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
|
||||
-- Coat 1-9
|
||||
local RTHY = 10
|
||||
local RCLF = 11
|
||||
|
||||
-- Coat 12
|
||||
local LTHY = 13
|
||||
local LCLF = 14
|
||||
local LFOT = 15
|
||||
local SPNE = 16
|
||||
local RSLD = 17
|
||||
local RARM = 18
|
||||
local LSLD = 19
|
||||
local LARM = 20
|
||||
local HEAD = 21
|
||||
local RHND = 22
|
||||
local RFOT = 23
|
||||
|
||||
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.6
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.6 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.1 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.1 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.0 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.0 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.0 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.0 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = SPNE, to = HEAD, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = SPNE },
|
||||
[LARM] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.ELBOW_LEFT, up_up = LSLD },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up = "right" },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up = "forward" },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 0, 180, -40 )
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 0, -90, 130 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/medic.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/medic.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/medic/bot_medic.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/medic_boss/bot_medic_boss.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_medic", Builder )
|
||||
157
lua/autorun/server/sensorbones/tf2_pyro_demo.lua
Normal file
157
lua/autorun/server/sensorbones/tf2_pyro_demo.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local RTHY = 1
|
||||
local RCLF = 2
|
||||
local LTHY = 3
|
||||
local LCLF = 4
|
||||
local LFOT = 5
|
||||
local SPNE = 6
|
||||
local RSLD = 7
|
||||
local RARM = 8
|
||||
local LSLD = 9
|
||||
local LARM = 10
|
||||
local LHND = 11
|
||||
local HEAD = 12
|
||||
local RHND = 13
|
||||
local RFOT = 14
|
||||
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.6
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.3 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.3 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = SPNE, to = HEAD, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = SPNE },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_bck = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up = "right" },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up = "forward" },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 0, 180, -40 )
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 0, -90, 130 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[LHND] = ang[LARM] * 1
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), 90 )
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel();
|
||||
|
||||
if ( mdl:EndsWith( "models/player/pyro.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/pyro.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/pyro/bot_pyro.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/demo.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/demo.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/pyro/bot_demo.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/pyro_boss/bot_pyro_boss.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/demo_boss/bot_demo_boss.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_pyro", Builder )
|
||||
160
lua/autorun/server/sensorbones/tf2_scout.lua
Normal file
160
lua/autorun/server/sensorbones/tf2_scout.lua
Normal file
@@ -0,0 +1,160 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local RTHY = 1
|
||||
local RCLF = 2
|
||||
local LTHY = 3
|
||||
local LCLF = 4
|
||||
local LFOT = 5
|
||||
local SPNE = 6
|
||||
local RSLD = 7
|
||||
local RARM = 8
|
||||
local LSLD = 9
|
||||
local LARM = 10
|
||||
local LHND = 11
|
||||
local NECK = 12
|
||||
local HEAD = 13
|
||||
local DGTG = 14
|
||||
local RHND = 15
|
||||
local RFOT = 16
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.5
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.3 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.3 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 1.2 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 1.2 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
--[TRSO] = { type = "lerp", value = 0.2, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE },
|
||||
[NECK] = { type = "lerp", value = 0.5, from = SENSORBONE.SHOULDER, to = SENSORBONE.HEAD },
|
||||
[DGTG] = { type = "lerp", value = 0.2, from = SENSORBONE.SHOULDER, to = SENSORBONE.HIP },
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = NECK, to = HEAD, up = "head_back" },
|
||||
[NECK] = { from = SPNE, to = NECK, up = "head_back" },
|
||||
|
||||
[DGTG] = { from = NECK, to = DGTG, up = "chest_up" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_dn = SPNE },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_bck = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up = "right" },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up = "forward" },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 0, 180, -40 )
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 0, -90, 130 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[NECK]:RotateAroundAxis( ang[NECK]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[LHND] = ang[LARM] * 1
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), 90 )
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/scout.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/scout.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/scout/bot_scout.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_scout", Builder )
|
||||
169
lua/autorun/server/sensorbones/tf2_sniper.lua
Normal file
169
lua/autorun/server/sensorbones/tf2_sniper.lua
Normal file
@@ -0,0 +1,169 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local RTHY = 1
|
||||
local RCLF = 2
|
||||
local RFOT = 3
|
||||
local LTHY = 4
|
||||
local LCLF = 5
|
||||
local LFOT = 6
|
||||
local SPNE = 7
|
||||
local RSLD = 8
|
||||
local RARM = 9
|
||||
local LSLD = 10
|
||||
local LARM = 11
|
||||
local LHND = 12
|
||||
local NECK = 13
|
||||
local HEAD = 14
|
||||
local RHND = 15
|
||||
|
||||
-- pouch
|
||||
|
||||
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.8
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.9 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.06
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.3 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.3 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.FOOT_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.6 + acrosships )
|
||||
sensor[SENSORBONE.FOOT_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.6 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.6 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.6 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[NECK] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = PLVS, to = SPNE, up = "chest_bck" },
|
||||
[HEAD] = { from = SPNE, to = HEAD, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = SPNE },
|
||||
[RARM] = { from = RHND, to = RARM, up_rgt = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_fwd = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = SPNE },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_bck = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up_dn = PLVS },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_lft = RTHY },
|
||||
[RFOT] = { from = RCLF, to = RFOT, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up_dn = PLVS },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
[LFOT] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT]:RotateAroundAxis( ang[RFOT]:Up(), -90 )
|
||||
ang[RFOT]:RotateAroundAxis( ang[RFOT]:Forward(), 180 )
|
||||
ang[LFOT]:RotateAroundAxis( ang[LFOT]:Up(), 90 )
|
||||
|
||||
ang[LFOT]:RotateAroundAxis( ang[LFOT]:Forward(), -45 )
|
||||
ang[RFOT]:RotateAroundAxis( ang[LFOT]:Forward(), -45 )
|
||||
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
ang[NECK] = ang[HEAD]
|
||||
|
||||
pos[16] = pos[PLVS]
|
||||
ang[16] = ang[PLVS] * 1
|
||||
ang[16]:RotateAroundAxis( ang[1]:Right(), 180 )
|
||||
|
||||
--
|
||||
-- AGH HANDS
|
||||
--
|
||||
ang[LHND] = ang[LARM] * 1
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), 90 )
|
||||
ang[RHND] = ang[RARM] * 1
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/sniper.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/sniper.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/sniper/bot_sniper.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_sniper", Builder )
|
||||
164
lua/autorun/server/sensorbones/tf2_spy_solider.lua
Normal file
164
lua/autorun/server/sensorbones/tf2_spy_solider.lua
Normal file
@@ -0,0 +1,164 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local RTHY = 1
|
||||
local RCLF = 2
|
||||
local LTHY = 3
|
||||
local LCLF = 4
|
||||
local LFOT = 5
|
||||
local SPNE = 6
|
||||
local TRSO = 7
|
||||
local RSLD = 8
|
||||
local LSLD = 9
|
||||
local LARM = 10
|
||||
local LHND = 11
|
||||
local RARM = 12
|
||||
local NECK = 13
|
||||
local RHND = 14
|
||||
local HEAD = 15
|
||||
local RFOT = 16
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.8
|
||||
|
||||
local acrossshoulders = ( sensor[SENSORBONE.SHOULDER_RIGHT] - sensor[SENSORBONE.SHOULDER_LEFT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch - acrossshoulders )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch + acrossshoulders )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.8 )
|
||||
|
||||
local acrosships = ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.HIP_RIGHT] ):GetNormal() * 0.08
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * -0.1 + acrosships )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * -0.1 + acrosships * -1 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.KNEE_LEFT]-sensor[SENSORBONE.HIP_LEFT] ) * 0.3 + acrosships )
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.KNEE_RIGHT] - sensor[SENSORBONE.HIP_RIGHT] ) * 0.3 - acrosships )
|
||||
|
||||
sensor[SENSORBONE.ANKLE_LEFT]:Add( ( sensor[SENSORBONE.ANKLE_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.8 + acrosships )
|
||||
sensor[SENSORBONE.ANKLE_RIGHT]:Add( ( sensor[SENSORBONE.ANKLE_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.8 - acrosships )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[TRSO] = { type = "lerp", value = 0.2, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE },
|
||||
[NECK] = { type = "lerp", value = 0.3, from = SENSORBONE.SHOULDER, to = SENSORBONE.HEAD },
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = { type = "lerp", value = 0.8, from = SENSORBONE.SHOULDER, to = SENSORBONE.SPINE }
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = PLVS, to = SPNE, up = "hips_back" },
|
||||
[SPNE] = { from = SPNE, to = TRSO, up = "chest_bck" },
|
||||
[TRSO] = { from = TRSO, to = NECK, up = "head_back" },
|
||||
[HEAD] = { from = NECK, to = HEAD, up = "head_back" },
|
||||
[NECK] = { from = TRSO, to = NECK, up = "head_back" },
|
||||
|
||||
[RSLD] = { from = RARM, to = RSLD, up_rgt = TRSO },
|
||||
[RARM] = { from = RHND, to = RARM, up_up = RSLD },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_dn = RARM },
|
||||
|
||||
[LSLD] = { from = LARM, to = LSLD, up_lft = TRSO },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[LHND] = { from_sensor = SENSORBONE.WRIST_LEFT, to_sensor = SENSORBONE.HAND_LEFT, up_up = LARM },
|
||||
|
||||
[RTHY] = { from = RCLF, to = RTHY, up = "right" },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
|
||||
[LTHY] = { from = LCLF, to = LTHY, up = "forward" },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
--
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
--
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 0, 90, -70 )
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 0, -90, 110 )
|
||||
|
||||
--
|
||||
-- TODO: Get the hands working.
|
||||
--
|
||||
--ang[RHND] = ( ang[RARM]:Up() ):AngleEx( ang[RARM]:Right() * -1 )
|
||||
--ang[LHND] = ( ang[LARM]:Up() ):AngleEx( ang[LARM]:Right() )
|
||||
|
||||
--
|
||||
-- Maya uses Y up for some bones. Because life isn't hard enough already.
|
||||
--
|
||||
ang[PLVS]:RotateAroundAxis( ang[PLVS]:Up(), -90 )
|
||||
ang[SPNE]:RotateAroundAxis( ang[SPNE]:Up(), -90 )
|
||||
ang[TRSO]:RotateAroundAxis( ang[TRSO]:Up(), -90 )
|
||||
ang[NECK]:RotateAroundAxis( ang[NECK]:Up(), -90 )
|
||||
ang[HEAD]:RotateAroundAxis( ang[HEAD]:Up(), -90 )
|
||||
|
||||
ang[LHND]:RotateAroundAxis( ang[LHND]:Up(), -90 )
|
||||
ang[RHND]:RotateAroundAxis( ang[RHND]:Up(), -90 )
|
||||
|
||||
--ang[LHND]:RotateAroundAxis( ang[LHND]:Right(), 180 )
|
||||
|
||||
end,
|
||||
|
||||
IsApplicable = function( self, ent )
|
||||
|
||||
local mdl = ent:GetModel()
|
||||
|
||||
if ( mdl:EndsWith( "models/player/hwm/soldier.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/soldier.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/spy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/player/hwm/spy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/soldier/bot_soldier.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/spy/bot_spy.mdl" ) ) then return true end
|
||||
if ( mdl:EndsWith( "models/bots/soldier_boss/bot_soldier_boss.mdl" ) ) then return true end
|
||||
|
||||
return false
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "TF2_soldier_spy", Builder )
|
||||
114
lua/autorun/server/sensorbones/valvebiped.lua
Normal file
114
lua/autorun/server/sensorbones/valvebiped.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--
|
||||
-- These are the physics bone numbers
|
||||
--
|
||||
local PLVS = 0
|
||||
local SPNE = 1
|
||||
local RSLD = 2
|
||||
local LSLD = 3
|
||||
local LARM = 4
|
||||
local LHND = 5
|
||||
local RARM = 6
|
||||
local RHND = 7
|
||||
local RTHY = 8
|
||||
local RCLF = 9
|
||||
local HEAD = 10
|
||||
local LTHY = 11
|
||||
local LCLF = 12
|
||||
local LFOT = 13
|
||||
local RFOT = 14
|
||||
|
||||
local Builder =
|
||||
{
|
||||
PrePosition = function( self, sensor )
|
||||
|
||||
local spinestretch = ( sensor[SENSORBONE.SHOULDER] - sensor[SENSORBONE.SPINE] ) * 0.7
|
||||
|
||||
sensor[SENSORBONE.SHOULDER]:Add( spinestretch * 0.7 )
|
||||
sensor[SENSORBONE.SHOULDER_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.SHOULDER_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.ELBOW_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.WRIST_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_LEFT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HAND_RIGHT]:Add( spinestretch )
|
||||
sensor[SENSORBONE.HEAD]:Add( spinestretch * 0.5 )
|
||||
|
||||
sensor[SENSORBONE.HIP_LEFT]:Add( spinestretch * 0.3 )
|
||||
sensor[SENSORBONE.HIP_RIGHT]:Add( spinestretch * 0.3 )
|
||||
|
||||
sensor[SENSORBONE.KNEE_RIGHT]:Add( ( sensor[SENSORBONE.HIP_RIGHT] - sensor[SENSORBONE.KNEE_RIGHT] ) * 0.2 )
|
||||
sensor[SENSORBONE.KNEE_LEFT]:Add( ( sensor[SENSORBONE.HIP_LEFT] - sensor[SENSORBONE.KNEE_LEFT] ) * 0.2 )
|
||||
|
||||
end,
|
||||
|
||||
--
|
||||
-- Which on the sensor should we use for which ones on our model
|
||||
--
|
||||
PositionTable =
|
||||
{
|
||||
[PLVS] = SENSORBONE.HIP,
|
||||
[RSLD] = SENSORBONE.SHOULDER_RIGHT,
|
||||
[LSLD] = SENSORBONE.SHOULDER_LEFT,
|
||||
[LARM] = SENSORBONE.ELBOW_LEFT,
|
||||
[LHND] = SENSORBONE.WRIST_LEFT,
|
||||
[RARM] = SENSORBONE.ELBOW_RIGHT,
|
||||
[RHND] = SENSORBONE.WRIST_RIGHT,
|
||||
[LTHY] = SENSORBONE.HIP_LEFT,
|
||||
[RTHY] = SENSORBONE.HIP_RIGHT,
|
||||
[RCLF] = SENSORBONE.KNEE_RIGHT,
|
||||
[LCLF] = SENSORBONE.KNEE_LEFT,
|
||||
[RFOT] = SENSORBONE.ANKLE_RIGHT,
|
||||
[LFOT] = SENSORBONE.ANKLE_LEFT,
|
||||
[HEAD] = SENSORBONE.HEAD,
|
||||
[SPNE] = SENSORBONE.SPINE,
|
||||
},
|
||||
|
||||
--
|
||||
-- Which bones should we use to determine our bone angles
|
||||
--
|
||||
AnglesTable =
|
||||
{
|
||||
[PLVS] = { from = LTHY, to = RTHY, up = "hips_fwd" },
|
||||
[SPNE] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SPINE, up = "chest_rgt" },
|
||||
[HEAD] = { from_sensor = SENSORBONE.HEAD, to_sensor = SENSORBONE.SHOULDER, up = "chest_lft" },
|
||||
[RSLD] = { from = RARM, to = RSLD, up = "chest_up" },
|
||||
[LSLD] = { from = LARM, to = LSLD, up = "chest_dn" },
|
||||
[RARM] = { from = RHND, to = RARM, up_up = RSLD },
|
||||
[LARM] = { from = LHND, to = LARM, up_up = LSLD },
|
||||
[RTHY] = { from = RCLF, to = RTHY, up_up = SPNE },
|
||||
[RCLF] = { from = RFOT, to = RCLF, up_up = RTHY },
|
||||
[LTHY] = { from = LCLF, to = LTHY, up_up = SPNE },
|
||||
[LCLF] = { from = LFOT, to = LCLF, up_up = LTHY },
|
||||
[RHND] = { from_sensor = SENSORBONE.HAND_RIGHT, to_sensor = SENSORBONE.WRIST_RIGHT, up_lft = RARM },
|
||||
[LHND] = { from_sensor = SENSORBONE.HAND_LEFT, to_sensor = SENSORBONE.WRIST_LEFT, up_rgt = LARM }
|
||||
},
|
||||
|
||||
--
|
||||
-- Any polishing that can't be done with the above tables
|
||||
--
|
||||
Complete = function( self, player, sensor, rotation, pos, ang )
|
||||
|
||||
pos[SPNE] = LerpVector( 0.45, pos[SPNE], pos[HEAD] )
|
||||
|
||||
-- Feet are insanely spazzy, so we lock the feet to the angle of the calf
|
||||
ang[LFOT] = ang[LCLF]:Right():AngleEx( ang[LCLF]:Up() ) + Angle( 20, 0, 0 )
|
||||
ang[RFOT] = ang[RCLF]:Right():AngleEx( ang[RCLF]:Up() ) + Angle( 20, 0, 0 )
|
||||
|
||||
end,
|
||||
|
||||
-- We're used as a default - no need to return true to anything here.
|
||||
IsApplicable = function( self, ent ) return false end,
|
||||
}
|
||||
|
||||
list.Set( "SkeletonConvertor", "ValveBiped", Builder )
|
||||
11
lua/autorun/server/sf2_sd.lua
Normal file
11
lua/autorun/server/sf2_sd.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
resource.AddSingleFile("sound/grove.ogg")
|
||||
31
lua/autorun/server/simf_killscore_credit.lua
Normal file
31
lua/autorun/server/simf_killscore_credit.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
hook.Add( "EntityTakeDamage", "SimfDamageScale", function( target, dmginfo )
|
||||
if IsValid(target) then
|
||||
if target:IsPlayer() or target:IsNPC() then
|
||||
if IsValid(dmginfo:GetInflictor()) then
|
||||
if dmginfo:GetInflictor() ~= target then
|
||||
if dmginfo:GetInflictor():GetClass():find("gmod_sent_vehicle_fphysics_base") then
|
||||
if dmginfo:GetInflictor():GetDriver():IsValid() then
|
||||
dmginfo:SetAttacker(dmginfo:GetInflictor():GetDriver())
|
||||
if dmginfo:GetInflictor() ~= dmginfo:GetInflictor():GetDriver() then return end
|
||||
end
|
||||
if target:IsNPC() then
|
||||
dmginfo:ScaleDamage( 4 )
|
||||
elseif target:IsPlayer() then
|
||||
dmginfo:ScaleDamage( 2 )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
2043
lua/autorun/server/sv_default_wepholster.lua
Normal file
2043
lua/autorun/server/sv_default_wepholster.lua
Normal file
File diff suppressed because it is too large
Load Diff
207
lua/autorun/server/sv_weapon_holsters.lua
Normal file
207
lua/autorun/server/sv_weapon_holsters.lua
Normal file
@@ -0,0 +1,207 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
--[[
|
||||
__ ___ __ __
|
||||
/ |/ /__ ____/ /__ / / __ __
|
||||
/ /|_/ / _ `/ _ / -_) / _ \/ // /
|
||||
/_/ /_/\_,_/\_,_/\__/ /_.__/\_, /
|
||||
___ __ /___/ ___ __
|
||||
/ _ \___ / /_ _____ ___ / /____ ____ / _ \__ ______/ /__
|
||||
/ ___/ _ \/ / // / -_|_-</ __/ -_) __/ / // / // / __/ '_/
|
||||
/_/ \___/_/\_, /\__/___/\__/\__/_/ /____/\_,_/\__/_/\_\
|
||||
/___/
|
||||
https://steamcommunity.com/profiles/76561198057599363
|
||||
]]
|
||||
WepHolster.wepInfo = WepHolster.wepInfo or {}
|
||||
util.AddNetworkString("sendWHData")
|
||||
util.AddNetworkString("sendWholeWHData")
|
||||
util.AddNetworkString("applyWepHolsterData")
|
||||
util.AddNetworkString("reloadWH")
|
||||
util.AddNetworkString("deleteWHData")
|
||||
util.AddNetworkString("reloadWholeWH")
|
||||
util.AddNetworkString("resetWHDataToDefault")
|
||||
util.AddNetworkString("resetWholeWHDataToDefault")
|
||||
util.AddNetworkString("WepHolsters_Settings")
|
||||
|
||||
function WepHolster.setWHData(wep, tbl)
|
||||
file.Write("wepholster/" .. wep .. ".txt", util.TableToJSON(tbl, true))
|
||||
WepHolster.wepInfo[wep] = tbl
|
||||
end
|
||||
|
||||
--[[
|
||||
local function InitOfInit()
|
||||
for k, v in pairs(WepHolster.defData) do
|
||||
WepHolster.setWHData(k, v)
|
||||
end
|
||||
end
|
||||
hook.Add("Initialize", "wepHolstersInit", function()
|
||||
if file.IsDir("wepholster", "DATA") then
|
||||
local files, dirs = file.Find("wepholster/*.txt", "DATA")
|
||||
|
||||
for k, v in pairs(files) do
|
||||
WepHolster.wepInfo[string.sub(v, 1, #v - 4)] = util.JSONToTable(file.Read("wepholster/" .. v))
|
||||
end
|
||||
else
|
||||
file.CreateDir("wepholster", "DATA")
|
||||
InitOfInit()
|
||||
end
|
||||
end)
|
||||
]]
|
||||
local function checkValidSWEP()
|
||||
if not file.IsDir("wepholster", "DATA") then
|
||||
file.CreateDir("wepholster", "DATA")
|
||||
|
||||
for k, v in pairs(WepHolster.defData) do
|
||||
file.Write("wepholster/" .. k .. ".txt", util.TableToJSON(v, true))
|
||||
end
|
||||
end
|
||||
|
||||
local files, dirs = file.Find("wepholster/*.txt", "DATA")
|
||||
|
||||
for k, v in pairs(files) do
|
||||
local wepclass = string.sub(v, 1, #v - 4)
|
||||
local swep = weapons.Get(wepclass)
|
||||
|
||||
if swep or WepHolster.HL2Weps[wepclass] or not WepHolster.defData[wepclass] then
|
||||
WepHolster.wepInfo[wepclass] = util.JSONToTable(file.Read("wepholster/" .. v))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("Initialize", "Initialize Weapon Holsters", checkValidSWEP)
|
||||
|
||||
function WepHolster.sendWholeWHData(ply)
|
||||
net.Start("sendWholeWHData")
|
||||
net.WriteTable(WepHolster.wepInfo)
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "sendWholeWHData", WepHolster.sendWholeWHData)
|
||||
|
||||
net.Receive("resetWholeWHDataToDefault", function(len, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
local files, dirs = file.Find("wepholster/*", "DATA")
|
||||
|
||||
for k, v in pairs(files) do
|
||||
file.Delete("wepholster/" .. v)
|
||||
--print(v)
|
||||
end
|
||||
file.Delete("wepholster")
|
||||
WepHolster.wepInfo = {}
|
||||
checkValidSWEP()
|
||||
net.Start("sendWholeWHData")
|
||||
net.WriteTable(WepHolster.wepInfo)
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("resetWHDataToDefault", function(len, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
local class = net.ReadString()
|
||||
|
||||
if WepHolster.defData[class] then
|
||||
net.Start("sendWHData")
|
||||
net.WriteString(class)
|
||||
net.WriteTable(WepHolster.defData[class])
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("reloadWholeWH", function(len, ply)
|
||||
WepHolster.sendWholeWHData(ply)
|
||||
end)
|
||||
|
||||
net.Receive("applyWepHolsterData", function(len, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
local class = net.ReadString()
|
||||
local weptbl = net.ReadTable()
|
||||
weptbl.notSavedYet = nil
|
||||
weptbl.isEditing = nil
|
||||
WepHolster.setWHData(class, weptbl)
|
||||
net.Start("sendWHData")
|
||||
net.WriteString(class)
|
||||
net.WriteTable(WepHolster.wepInfo[class])
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("reloadWH", function(len, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
local class = net.ReadString()
|
||||
|
||||
if WepHolster.wepInfo[class] then
|
||||
net.Start("sendWHData")
|
||||
net.WriteString(class)
|
||||
net.WriteTable(WepHolster.wepInfo[class])
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("deleteWHData", function(len, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
local class = net.ReadString()
|
||||
WepHolster.wepInfo[class] = nil
|
||||
|
||||
if file.Exists("wepholster/" .. class .. ".txt", "DATA") then
|
||||
file.Delete("wepholster/" .. class .. ".txt")
|
||||
end
|
||||
|
||||
net.Start("sendWHData")
|
||||
net.WriteString(class)
|
||||
net.WriteTable({})
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
|
||||
function WepHolster.CanEditSetting(ply, con, var)
|
||||
if not ply:IsSuperAdmin() then
|
||||
ply:PrintMessage(HUD_PRINTCENTER, "You don't have access to server settings.")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if not ConVarExists(con) then
|
||||
return
|
||||
end
|
||||
|
||||
print("[Weapon Holsters] " .. ply:Nick() .. " (" .. ply:SteamID() .. ") changed " .. con .. " to " .. tostring(var))
|
||||
con = GetConVar(con)
|
||||
con:SetString(var)
|
||||
end
|
||||
|
||||
local whitelist = {}
|
||||
whitelist["sv_weapon_holsters"] = true
|
||||
|
||||
net.Receive("WepHolsters_Settings", function(len, ply)
|
||||
if not ply then
|
||||
return
|
||||
end
|
||||
|
||||
if (ply.WH_LAST or 0) > SysTime() then
|
||||
return
|
||||
end
|
||||
|
||||
ply.WH_LAST = SysTime() + 0.2
|
||||
local con = net.ReadString()
|
||||
local arg = net.ReadString()
|
||||
|
||||
if not con then
|
||||
return
|
||||
end
|
||||
|
||||
if not whitelist[con] then
|
||||
return
|
||||
end
|
||||
|
||||
WepHolster.CanEditSetting(ply, con, arg or nil)
|
||||
end)
|
||||
103
lua/autorun/server/wheelsongroundblyat.lua
Normal file
103
lua/autorun/server/wheelsongroundblyat.lua
Normal file
@@ -0,0 +1,103 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
CreateConVar("WheelMagic", 1, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "Prevent the entire hook script from running")
|
||||
CreateConVar("WheelMagic_RunWithoutEngineActive", 0, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "If it should run when vehicles engine is off (may cause lag)")
|
||||
CreateConVar("WheelMagic_WheelForce", 30, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "With how much force the wheels are being pushed down")
|
||||
CreateConVar("WheelMagic_ChassiForce", 0, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "With how much force the chassi is being pushed down")
|
||||
CreateConVar("WheelMagic_UseChassiAngleForWheelForce", 0, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "If the wheels should define down from the vehicle, instead of world")
|
||||
CreateConVar("WheelMagic_UseChassiAngleForChassiForce", 0, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "If the chassi should define down from the vehicle, instead of world")
|
||||
CreateConVar("WheelMagic_KeepChassiUprightForce", 10, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "With how much force it should align the chassi to the preferred angle")
|
||||
CreateConVar("WheelMagic_KeepChassiPitch", 1, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "Decides whenever it should align the pitch of the chassi or not")
|
||||
CreateConVar("WheelMagic_KeepChassiRoll", 1, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "Decides whenever it should align the roll of the chassi or not")
|
||||
CreateConVar("WheelMagic_ForceWheelsInAirDown", 1, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "Should it push down wheels as soon as they leave the ground?")
|
||||
CreateConVar("WheelMagic_AirWheelForce", 50, bit.bor(FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_SERVER_CAN_EXECUTE), "With how much force the wheels are being pushed down when in air")
|
||||
|
||||
hook.Add( "Tick", "ForceWheelsOnGround", function()
|
||||
if util.tobool(GetConVar("WheelMagic"):GetInt() or 1) then
|
||||
for k,ent in pairs(ents.FindByClass("gmod_sent_vehicle_fphysics_base")) do
|
||||
if util.tobool(GetConVar("WheelMagic_RunWithoutEngineActive"):GetInt() or 1) or ent:GetActive() == true then
|
||||
if util.tobool(GetConVar("WheelMagic_UseChassiAngleForWheelForce"):GetInt() or 1) then
|
||||
for i = 1, table.Count(ent.Wheels) do
|
||||
local Wheel = ent.Wheels[i]
|
||||
local angle = -ent:GetUp() * GetConVar("WheelMagic_WheelForce"):GetInt() or 30
|
||||
local phys = Wheel:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
phys:Wake()
|
||||
phys:ApplyForceCenter( phys:GetMass()*angle/2 )
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 1, table.Count(ent.Wheels) do
|
||||
local Wheel = ent.Wheels[i]
|
||||
if IsValid(Wheel) then
|
||||
local angle = -Entity(0):GetUp() * GetConVar("WheelMagic_WheelForce"):GetInt() or 30
|
||||
local phys = Wheel:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
phys:Wake()
|
||||
phys:ApplyForceCenter( phys:GetMass()*angle/2 )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if util.tobool(GetConVar("WheelMagic_UseChassiAngleForChassiForce"):GetInt() or 1) then
|
||||
local angle = -ent:GetUp() * GetConVar("WheelMagic_ChassiForce"):GetInt() or 0
|
||||
local phys = ent:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
phys:Wake()
|
||||
phys:ApplyForceCenter( phys:GetMass()*angle/2 )
|
||||
end
|
||||
else
|
||||
local angle = -Entity(0):GetUp() * GetConVar("WheelMagic_ChassiForce"):GetInt() or 0
|
||||
local phys = ent:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
phys:Wake()
|
||||
phys:ApplyForceCenter( phys:GetMass()*angle/2 )
|
||||
end
|
||||
end
|
||||
if util.tobool(GetConVar("WheelMagic_KeepChassiPitch"):GetInt() or 1) or util.tobool(GetConVar("WheelMagic_KeepChassiRoll"):GetInt() or 1) then
|
||||
local phys = ent:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
local EntAng = phys:GetAngles()
|
||||
local P,Y,R = 0,0,0
|
||||
|
||||
if util.tobool(GetConVar("WheelMagic_KeepChassiPitch"):GetInt() or 1) then
|
||||
P = math.rad(math.AngleDifference(EntAng.p,P))
|
||||
end
|
||||
--Y = math.rad(math.AngleDifference(EntAng.y,Y))*math.cos(math.rad(EntAng.p))
|
||||
if util.tobool(GetConVar("WheelMagic_KeepChassiRoll"):GetInt() or 1) then
|
||||
R = math.rad(math.AngleDifference(EntAng.r,R))
|
||||
end
|
||||
local DivAng = Vector(P,Y,0)
|
||||
DivAng:Rotate(Angle(0,-EntAng.r,0))
|
||||
phys:AddAngleVelocity((-Vector(R,DivAng.x,DivAng.y)*GetConVar("WheelMagic_KeepChassiUprightForce"):GetInt() or 10)-(phys:GetAngleVelocity()*0.001))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for k,ent in pairs(ents.FindByClass("gmod_sent_vehicle_fphysics_wheel")) do
|
||||
if util.tobool(GetConVar("WheelMagic_RunWithoutEngineActive"):GetInt() or 1) or ent:GetBaseEnt():GetActive() == true then
|
||||
if util.tobool(GetConVar("WheelMagic_ForceWheelsInAirDown"):GetInt() or 1) then
|
||||
if ent:GetOnGround() == 0 then
|
||||
local angle = -ent:GetBaseEnt():GetUp() * GetConVar("WheelMagic_AirWheelForce"):GetInt() or 50
|
||||
local phys = ent:GetPhysicsObject()
|
||||
if IsValid( phys ) then
|
||||
phys:Wake()
|
||||
phys:ApplyForceCenter( phys:GetMass()*angle/2 )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
17
lua/autorun/server/workshop.lua
Normal file
17
lua/autorun/server/workshop.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Docs: https://wiki.garrysmod.com/page/resource/AddWorkshop
|
||||
-- Place the ID of the workshop addon you want to be downloaded to people who join your server, not the collection ID
|
||||
-- Use https://beta.configcreator.com/create/gmod/resources.lua to easily create a list based on your collection ID
|
||||
|
||||
resource.AddWorkshop( "" )
|
||||
|
||||
221
lua/autorun/server/xeon-drm-dll.lua
Normal file
221
lua/autorun/server/xeon-drm-dll.lua
Normal file
@@ -0,0 +1,221 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local function JohnLua()
|
||||
local quotes = {"In the beginning was the Statement, and the Statement was with Lua, and the Statement was Lua.","Greater love has no one than Lua, that the compiler lay down his life for our code.","Do not think that I will debug with the Stack Trace; For had ye believed the Compiler Errors, ye would have believed Me, for he wrote of Lua; But if ye believe not his Stack Traces, how shall ye believe My code?","Even though my types remain weak, I fear no error, for Lua is with me.","Lua is the chain that ties our health and bodies together.","Rip scripts, you must not. Let the Lua flow straight from your fingers.","Variables are changed by your example, not by your opinion.","The meaning of Lua is to give Lua a meaning.","Doubt has killed more scripts than errors will.","The hottest places in Hell are for those who never declare local variables.","Crashes and overflows may break my bones; But pcalls will never harm me.","Wise men code because they have something to make; Fools because they want to make something.","Lua is the joy of the good, the wonder of the wise, the amazement of the Gods.","You dump functions. You dump memory regions and crash reports that look like hell. You dump unused variables and collected garbage and tables. But people?","Whoever believes in the Trace is not condemned, but whoever does not believe stands condemned already because they have not believed in the name of John Lua's one and only Function.","It is written: \"Lua shall not live on interpreter alone, but on every instruction that comes from the mouth of Mike Pall.\"","Because of Mike Pall's great love we are not consumed, for his Traces never fail. They are new every loop; great is your Just-In-Time compilation.","I give them eternal life, and they shall never perish; no one will collect them out of my heap. My Allocator, who has given them to me, is greater than all; no one can Mark-and-Sweep them out of my Garbage-Collectors hand. I and the Collector are one."}
|
||||
return "\"" .. quotes[math.random(1, #quotes)] .. "\" - John Lua\n"
|
||||
end
|
||||
|
||||
do
|
||||
local hookId = {}
|
||||
for i = 1, math.random(10, 20) do
|
||||
hookId[i] = string.char(math.random(0, 1) == 0 and math.random(97, 122) or math.random(65, 90))
|
||||
end
|
||||
hookId = table.concat(hookId)
|
||||
|
||||
local ipConVar = GetConVar("ip")
|
||||
local function getIPAddress()
|
||||
local ip = game.GetIPAddress()
|
||||
if ip and #ip > 0 and not ip:StartWith("0.0.0.0") and not ip:StartWith("localhost") and not ip:StartWith("loopback") then
|
||||
return true
|
||||
end
|
||||
|
||||
ip = ipConVar:GetString()
|
||||
if ip and #ip > 0 and not ip:StartWith("0.0.0.0") and not ip:StartWith("localhost") and not ip:StartWith("loopback") then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local function init()
|
||||
if not getIPAddress() then return end
|
||||
|
||||
hook.Remove("GetGameDescription", hookId)
|
||||
hook.Remove("PlayerConnect", hookId)
|
||||
|
||||
MsgC(Color(0,255,255), "\n[ Y88b d88P 8888888888 .d88888b. 888b 888 ]\n[ Y88b d88P 888 d88P\" \"Y88b 8888b 888 ]\n[ Y88o88P 888 888 888 88888b 888 ]\n[ Y888P 8888888 888 888 888Y88b 888 ]\n[ d888b 888 888 888 888 Y88b888 ]\n[ d88888b 888 888 888 888 Y88888 ]\n[ d88P Y88b 888 Y88b. .d88P 888 Y8888 ]\n[ d88P Y88b 8888888888 \"Y88888P\" 888 Y888 ]\n\n")
|
||||
MsgC(Color(0,255,0), "DRM (digital rights management) for Billy's scripts\n\n")
|
||||
MsgC(Color(255,255,255), JohnLua())
|
||||
|
||||
MsgC(Color(255,0,255), "\nSupport\n")
|
||||
MsgC(Color(255,255,255), "https://support.billy.enterprises\n")
|
||||
|
||||
MsgC(Color(255,0,255), "\nServer Status\n")
|
||||
MsgC(Color(255,255,255), "https://xeon.network\n")
|
||||
|
||||
MsgC(Color(255,0,255), "\nServer/Licenses Panel\n")
|
||||
MsgC(Color(255,255,255), "https://xeon.network/servers\n")
|
||||
|
||||
if system.IsOSX() then
|
||||
print()
|
||||
for i = 1, 10 do
|
||||
MsgC(Color(255,0,0), "XEON DRM is not compatible with your operating system. You are unable to use Billy's scripts on this computer.\n")
|
||||
end
|
||||
print()
|
||||
hook.Run("XEON.Error", "XEON DRM is not compatible with your operating system. You are unable to use Billy's scripts on this computer.")
|
||||
return
|
||||
end
|
||||
|
||||
local platform = system.IsWindows() and (jit.arch == "x86" and "win32" or "win64") or (jit.arch == "x86" and "linux" or "linux64")
|
||||
if not file.Exists("bin/gmsv_xeon_drm_" .. platform .. ".dll", "LUA") then
|
||||
print()
|
||||
for i = 1, 10 do
|
||||
MsgC(Color(255,0,0), "Your server is running ", Color(255,255,255), (system.IsWindows() and "Windows" or "Linux"), Color(255,0,0), " on the ", Color(255,255,255), (jit.arch == "x86" and "main" or "x86-64"), Color(255,0,0), " branch\n")
|
||||
MsgC(Color(255,0,0), "Couldn't find ", Color(255,255,255), "garrysmod/lua/bin/gmsv_xeon_drm_" .. platform .. ".dll", Color(255,0,0), " on your server!\n")
|
||||
MsgC(Color(255,0,0), "You didn't install the XEON DRM binary module! This is required to use Billy's scripts.\n")
|
||||
MsgC(Color(255,0,0), "Please download it here: ", Color(255,255,255), "https://xeon.network/download\n\n")
|
||||
end
|
||||
print()
|
||||
hook.Run("XEON.Error", "Your server is running " .. (system.IsWindows() and "Windows" or "Linux") .. " on the " .. (jit.arch == "x86" and "main" or "x86-64") .. " branch")
|
||||
hook.Run("XEON.Error", "Couldn't find garrysmod/lua/bin/gmsv_xeon_drm_" .. platform .. ".dll on your server!")
|
||||
hook.Run("XEON.Error", "You didn't install the XEON DRM binary module! This is required to use Billy's scripts.")
|
||||
hook.Run("XEON.Error", "Please download it here: https://xeon.network/download")
|
||||
return
|
||||
end
|
||||
|
||||
print()
|
||||
|
||||
require("xeon_drm")
|
||||
|
||||
if not XEON then
|
||||
print()
|
||||
for i = 1, 10 do
|
||||
MsgC(Color(255,0,0), "XEON DRM failed to load! Please read your server's console for more information.\n")
|
||||
end
|
||||
print()
|
||||
hook.Run("XEON.Error", "XEON DRM failed to load! Please read your server's console for more information.")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("GetGameDescription", hookId, init)
|
||||
hook.Add("PlayerConnect", hookId, init)
|
||||
end
|
||||
|
||||
do
|
||||
util.AddNetworkString("XEON.Error")
|
||||
|
||||
local cached, cachedTick
|
||||
local function getSuperAdmins()
|
||||
if cached and cachedTick == engine.TickCount() then
|
||||
return cached
|
||||
end
|
||||
|
||||
local filter = RecipientFilter()
|
||||
for _, ply in ipairs(player.GetHumans()) do
|
||||
if ply:IsSuperAdmin() then
|
||||
filter:AddPlayer(ply)
|
||||
end
|
||||
end
|
||||
|
||||
cached, cachedTick = filter, engine.TickCount()
|
||||
|
||||
return filter
|
||||
end
|
||||
|
||||
local errors = setmetatable({}, (function()
|
||||
local meta = {}
|
||||
meta.__index = meta
|
||||
|
||||
function meta:add(error)
|
||||
table.insert(self, error)
|
||||
end
|
||||
|
||||
function meta:transmit(ply)
|
||||
if #self == 0 then return end
|
||||
if player.GetCount() == 0 then return end
|
||||
if ply ~= nil and (not IsValid(ply) or not ply:IsSuperAdmin()) then return end
|
||||
net.Start("XEON.Error")
|
||||
net.WriteUInt(#self, 16)
|
||||
for _, error in ipairs(self) do
|
||||
net.WriteString(error)
|
||||
end
|
||||
net.Send(ply == nil and getSuperAdmins() or ply)
|
||||
end
|
||||
|
||||
return meta
|
||||
end)())
|
||||
|
||||
hook.Add("XEON.Error", "XEON.Error", function(error)
|
||||
errors:add(error)
|
||||
errors:transmit()
|
||||
end)
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "XEON.Error", function(ply)
|
||||
timer.Simple(5, function()
|
||||
if not IsValid(ply) or not ply:IsSuperAdmin() then return end
|
||||
errors:transmit(ply)
|
||||
end)
|
||||
end)
|
||||
|
||||
net.Receive("XEON.Error", function(_, ply)
|
||||
if ply:IsSuperAdmin() then
|
||||
errors:transmit(ply)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
do
|
||||
local linksRequired = {}
|
||||
|
||||
local function startAuth(ply)
|
||||
local timerName = "XEON.Auth:" .. ply:SteamID64()
|
||||
timer.Create(timerName, 1, 0, function()
|
||||
if IsValid(ply) then
|
||||
net.Start("XEON.Auth")
|
||||
net.WriteBool(false)
|
||||
net.Send(ply)
|
||||
else
|
||||
timer.Remove(timerName)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function authSpawn(ply)
|
||||
if not linksRequired[ply:SteamID64()] then return end
|
||||
startAuth(ply)
|
||||
end
|
||||
|
||||
net.Receive("XEON.Auth", function(len, ply)
|
||||
if not ply:IsSuperAdmin() then return end
|
||||
local steamid64 = ply:SteamID64()
|
||||
if not linksRequired[steamid64] then return end
|
||||
if len == 0 then
|
||||
timer.Remove("XEON.Auth:" .. ply:SteamID64())
|
||||
else
|
||||
linksRequired[steamid64] = nil
|
||||
if table.IsEmpty(linksRequired) then
|
||||
hook.Remove("PlayerSpawn", "XEON.Auth")
|
||||
end
|
||||
XEON:LinkServer(ply, net.ReadData(32))
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("XEON.Auth", "XEON.Auth", function(steamid64)
|
||||
local ply = player.GetBySteamID64(steamid64)
|
||||
linksRequired[steamid64] = true
|
||||
if IsValid(ply) then
|
||||
startAuth(ply)
|
||||
else
|
||||
hook.Add("PlayerSpawn", "XEON.Auth", authSpawn)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
do
|
||||
util.AddNetworkString("XEON.ReloadMap")
|
||||
net.Receive("XEON.ReloadMap", function(_, ply)
|
||||
if not ply:IsSuperAdmin() then return end
|
||||
RunConsoleCommand("changelevel", game.GetMap())
|
||||
end)
|
||||
end
|
||||
|
||||
MsgC(Color(0,255,255), "XEON DRM is waiting for your server to get an IP address...\n")
|
||||
Reference in New Issue
Block a user