User:Alvin/Sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Freeman.lua: new section)
(→‎Stargate.lua: new section)
Line 206: Line 206:


list.Set( "NPC", "npc_freeman", NPC )
list.Set( "NPC", "npc_freeman", NPC )
== Stargate.lua ==
-- Small library loader! Therefore no GPL Header (but it's GPLed)
StarGate = StarGate or {};
include("stargate/VERSION.lua");
-- Only loads serverside files on server,clientside files on client, shared on both and vgui on client
local function ValidToInclude(state)
return (state == "server" and SERVER) or ((state == "client" or state == "vgui") and CLIENT) or state == "shared";
end
--################# Loads the libraries @aVoN
function StarGate.Load()
MsgN("=======================================================");
MsgN("StarGate Pack: Initializing");
MsgN("Version: "..StarGate.VERSION.."\n");
for _,state in pairs({"shared","server","client","vgui"}) do
-- Init always comes at first!
if(ValidToInclude(state) and #file.FindInLua("stargate/"..state.."/init.lua") == 1) then
MsgN("Loading: stargate/"..state.."/init.lua");
include("stargate/"..state.."/init.lua");
end
for _,v in pairs(file.FindInLua("stargate/"..state.."/*.lua")) do
if(SERVER and state ~= "server") then
AddCSLuaFile("stargate/"..state.."/"..v); -- Add clientside files
end
if(ValidToInclude(state) and v ~= "init.lua") then
MsgN("Loading: stargate/"..state.."/"..v);
include("stargate/"..state.."/"..v);
end
end
end
if(SERVER) then
AddCSLuaFile("autorun/stargate.lua"); -- Ourself of course!
AddCSLuaFile("stargate/VERSION.lua"); -- Version
AddCSLuaFile("weapons/gmod_tool/stargate_base_tool.lua"); -- Special GMOD Basetool
end
MsgN("=======================================================");
end
StarGate.Load();
--################# For the concommand @aVoN
function StarGate.CallReload(p,override) -- Override is called in stargate_base/init.lua if someone calls lua_reloadents
if(override or (not ValidEntity(p) or SinglePlayer() or p:IsAdmin())) then
StarGate.Load();
for _,v in pairs(player.GetAll()) do
v:SendLua("StarGate.Load()");
end
else
p:SendLua("StarGate.Load()");
end
end
if SERVER then
concommand.Add("stargate_reload",StarGate.CallReload);
end

Revision as of 20:40, 19 July 2011

Source Engine 2009

"Garry's Mod" (Tools > Options > Edit > Add)

Game Data Files: (orangebox/bin) HalfLife2.fgd = Ep2 (HL2 as well) base.fgd cstrike.fgd = CS:S dod.fgd = DoD:S hl2mp.fgd = HL2:DM (could be needed) portal.fgd = Portal tf.fgd = TF2 (garrysmod/garrysmod) Garrysmod.fgd (optional lang.)


Default Point Entity class: info_player_start

Default SolidEntity class: func_detail

Cordon Texture: tools/toolsskybox

Game Executable Directory: $SteamUserDir\garrysmod

Game Directory: $SteamUserDir\garrysmod\garrysmod

Hammer VMF Directory: (Where you want to save and load VMF saves for Garrysmod) i use.. $SteamUserDir\garrysmod\garrysmod\maps\vmf

Now go to the last Tab, Build programs..

Game Executable: $SteamUserDir\garrysmod\hl2.exe

BSP $SteamUserDir\sourcesdk\bin\orangebox\bin\vbsp.exe

VIS $SteamUserDir\sourcesdk\bin\orangebox\bin\vvis.exe

RAD $SteamUserDir\sourcesdk\bin\orangebox\bin\vrad.exe

Place compiled maps... $SteamUserDir\garrysmod\garrysmod\maps

It will say that the changes will show when you open hammer another time but you need to restart Source SDK if you made a new config in order to see your new config in the selection menu.


Tagalog, pwede ba? :(

CS:S NPC Lua Script

local Category = "CSS"

local NPC = { Name = "Hostage 1", Class = "npc_citizen", Model = "models/characters/hostage_01.mdl", Health = "100", KeyValues = { Squadname = "hostages" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_hostage_1", NPC )


local NPC = { Name = "Hostage 2", Class = "npc_citizen", Model = "models/characters/hostage_02.mdl", Health = "100", KeyValues = { Squadname = "hostages" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_hostage_2", NPC )


local NPC = { Name = "Hostage 3", Class = "npc_citizen", Model = "models/characters/hostage_03.mdl", Health = "100", KeyValues = { Squadname = "hostages" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_hostage_3", NPC )


local NPC = { Name = "Hostage 4", Class = "npc_citizen", Model = "models/characters/hostage_04.mdl", Health = "100", KeyValues = { Squadname = "hostages" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_hostage_4", NPC )


local NPC = { Name = "T Arctic", Class = "npc_combine_s", Model = "models/characters/arctic.mdl", Health = "100", KeyValues = { Squadname = "terrors" }, KeyValues = { Numgrenades = "2" }, Category = Category }


list.Set( "NPC", "css_t_arctic", NPC )


local NPC = { Name = "T Guerilla", Class = "npc_combine_s", Model = "models/characters/guerilla.mdl", Health = "100", KeyValues = { Squadname = "terrors" }, KeyValues = { Numgrenades = "2" }, Category = Category }


list.Set( "NPC", "css_t_guerilla", NPC )


local NPC = { Name = "T Leet", Class = "npc_combine_s", Model = "models/characters/leet.mdl", Health = "100", KeyValues = { Squadname = "terrors" }, KeyValues = { Numgrenades = "2" }, Category = Category }


list.Set( "NPC", "css_t_leet", NPC )


local NPC = { Name = "T Phoenix", Class = "npc_combine_s", Model = "models/characters/phoenix.mdl", Health = "100", KeyValues = { Squadname = "terrors" }, KeyValues = { Numgrenades = "2" }, Category = Category }


list.Set( "NPC", "css_t_phoenix", NPC )


local NPC = { Name = "CT SAS", Class = "npc_citizen", Model = "models/characters/gasmask.mdl", Health = "100", KeyValues = { Squadname = "counters" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_ct_sas", NPC )


local NPC = { Name = "CT GIGN", Class = "npc_citizen", Model = "models/characters/swat.mdl", Health = "100", KeyValues = { Squadname = "counters" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_ct_gign", NPC )


local NPC = { Name = "CT GSG-9", Class = "npc_citizen", Model = "models/characters/riot.mdl", Health = "100", KeyValues = { Squadname = "counters" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_ct_gsg9", NPC )


local NPC = { Name = "CT ST-6", Class = "npc_citizen", Model = "models/characters/urban.mdl", Health = "100", KeyValues = { Squadname = "counters" }, KeyValues = { citizentype = 4 }, Category = Category }


list.Set( "NPC", "css_ct_st6", NPC )

Freeman.lua

local Category = "Humans + Resistance"


local NPC = { Name = "Gordon Freeman", Class = "npc_citizen", Model = "models/katharsmodels/gordon_freeman/gordon_freeman.mdl", Health = "100", KeyValues = { citizentype = 4 }, Category = Category }

list.Set( "NPC", "npc_freeman", NPC )

Stargate.lua

-- Small library loader! Therefore no GPL Header (but it's GPLed) StarGate = StarGate or {}; include("stargate/VERSION.lua"); -- Only loads serverside files on server,clientside files on client, shared on both and vgui on client local function ValidToInclude(state) return (state == "server" and SERVER) or ((state == "client" or state == "vgui") and CLIENT) or state == "shared"; end --################# Loads the libraries @aVoN function StarGate.Load() MsgN("======================================================="); MsgN("StarGate Pack: Initializing"); MsgN("Version: "..StarGate.VERSION.."\n"); for _,state in pairs({"shared","server","client","vgui"}) do -- Init always comes at first! if(ValidToInclude(state) and #file.FindInLua("stargate/"..state.."/init.lua") == 1) then MsgN("Loading: stargate/"..state.."/init.lua"); include("stargate/"..state.."/init.lua"); end for _,v in pairs(file.FindInLua("stargate/"..state.."/*.lua")) do if(SERVER and state ~= "server") then AddCSLuaFile("stargate/"..state.."/"..v); -- Add clientside files end if(ValidToInclude(state) and v ~= "init.lua") then MsgN("Loading: stargate/"..state.."/"..v); include("stargate/"..state.."/"..v); end end end if(SERVER) then AddCSLuaFile("autorun/stargate.lua"); -- Ourself of course! AddCSLuaFile("stargate/VERSION.lua"); -- Version AddCSLuaFile("weapons/gmod_tool/stargate_base_tool.lua"); -- Special GMOD Basetool end MsgN("======================================================="); end StarGate.Load();

--################# For the concommand @aVoN function StarGate.CallReload(p,override) -- Override is called in stargate_base/init.lua if someone calls lua_reloadents if(override or (not ValidEntity(p) or SinglePlayer() or p:IsAdmin())) then StarGate.Load(); for _,v in pairs(player.GetAll()) do v:SendLua("StarGate.Load()"); end else p:SendLua("StarGate.Load()"); end end

if SERVER then concommand.Add("stargate_reload",StarGate.CallReload); end