Skip to content

Commit

Permalink
Multiple small changes
Browse files Browse the repository at this point in the history
* Removed npc_bullseye from kill feed ( Dummy NPC )
* Changed default killer for npc to worldspawn
* Floor turret isn't killed by world when knocked down
* Disallow giving weapons from spawnmenu when not alive
* Added Gravity Gun and Zombine Grenade to spawnmenu
* Added Physgun, Toolgun and Camera to the spawnmenu
* Cleaned up game_ep2.lua
* Updated language files
* Removed unused settings files
  • Loading branch information
robotboy655 committed Feb 19, 2014
1 parent 96df9c2 commit 9ff1adc
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 365 deletions.
10 changes: 7 additions & 3 deletions garrysmod/gamemodes/base/gamemode/npc.lua
Expand Up @@ -8,6 +8,9 @@ util.AddNetworkString( "NPCKilledNPC" )
-----------------------------------------------------------]]
function GM:OnNPCKilled( ent, attacker, inflictor )
-- Don't spam the killfeed with scripted stuff
if ( ent:GetClass() == "npc_bullseye" ) then return end
-- Convert the inflictor to the weapon that they're holding if we can.
if ( inflictor && inflictor != NULL && attacker == inflictor && (inflictor:IsPlayer() || inflictor:IsNPC()) ) then
Expand All @@ -16,8 +19,8 @@ function GM:OnNPCKilled( ent, attacker, inflictor )
end
local InflictorClass = "World"
local AttackerClass = "World"
local InflictorClass = "worldspawn"
local AttackerClass = "worldspawn"
if ( IsValid( inflictor ) ) then InflictorClass = inflictor:GetClass() end
if ( IsValid( attacker ) ) then
Expand All @@ -43,7 +46,8 @@ function GM:OnNPCKilled( ent, attacker, inflictor )
end
if ( ent:GetClass() == "npc_turret_floor" ) then AttackerClass = ent:GetClass() end
net.Start( "NPCKilledNPC" )
net.WriteString( ent:GetClass() )
Expand Down
Expand Up @@ -30,7 +30,7 @@ SWEP.Slot = 5
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
SWEP.Spawnable = false
SWEP.Spawnable = true

if ( SERVER ) then

Expand Down
Expand Up @@ -11,8 +11,6 @@ SWEP.SlotPos = 6
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true

SWEP.Spawnable = false

SWEP.WepSelectIcon = surface.GetTextureID( "vgui/gmod_tool" )
SWEP.Gradient = surface.GetTextureID( "gui/gradient" )
SWEP.InfoIcon = surface.GetTextureID( "gui/info" )
Expand Down
Expand Up @@ -10,6 +10,7 @@ SWEP.WorldModel = "models/weapons/w_toolgun.mdl"
SWEP.AnimPrefix = "python"

SWEP.UseHands = true
SWEP.Spawnable = true

-- Be nice, precache the models
util.PrecacheModel( SWEP.ViewModel )
Expand Down
3 changes: 2 additions & 1 deletion garrysmod/gamemodes/sandbox/gamemode/commands.lua
Expand Up @@ -682,9 +682,10 @@ concommand.Add( "gm_spawnsent", function( ply, cmd, args ) Spawn_SENT( ply, args
function CCGiveSWEP( player, command, arguments )
if ( arguments[1] == nil ) then return end
if ( !player:Alive() ) then return end
-- Make sure this is a SWEP
local swep = list.Get( "Weapon" )[ arguments[1] ];
local swep = list.Get( "Weapon" )[ arguments[1] ]
if (swep == nil) then return end
-- You're not allowed to spawn this!
Expand Down
82 changes: 39 additions & 43 deletions garrysmod/lua/autorun/game_ep2.lua
@@ -1,63 +1,59 @@


if ( !IsMounted( "ep2" ) ) then return end

--
-- Strider Buster
-- NPC's
--

local Category = "Half-Life 2"

local Category = "Humans + Resistance"
list.Set( "NPC", "npc_magnusson", { Name = "Dr.Magnusson", Class = "npc_magnusson", Category = Category } )

game.AddParticles( "particles/striderbuster.pcf" )
Category = "Zombies + Enemy Aliens"
list.Set( "NPC", "npc_zombine", { Name = "Zombine", Class = "npc_zombine", Category = Category } )
list.Set( "NPC", "npc_antlion_worker", { Name = "Antlion Worker", Class = "npc_antlion_worker", Category = Category } )
list.Set( "NPC", "npc_antlion_grub", { Name = "Antlion Grub", Class = "npc_antlion_grub", Category = Category, NoDrop = true, Offset = 1 } )
list.Set( "NPC", "npc_antlionguardian", { Name = "Antlion Guardian", Class = "npc_antlionguard", Category = Category, KeyValues = { cavernbreed = 1, incavern = 1 }, Material = "Models/antlion_guard/antlionGuard2" } )

list.Set( "SpawnableEntities", "weapon_striderbuster", {
-- Required information
PrintName = "Magnusson",
ClassName = "weapon_striderbuster",
Category = Category,

-- Optional information
NormalOffset = 32,
DropToFloor = true,
Author = "VALVe",
AdminOnly = false,
Information = "The strider bustin' Magnusson Device from HL2: Episode 2"
} )
Category = "Combine"
list.Set( "NPC", "npc_hunter", { Name = "Hunter", Class = "npc_hunter", Category = Category } )

--
-- NPC's
-- Strider Buster
--

Category = "Humans + Resistance"
list.Set( "NPC", "npc_magnusson", { Name = "Dr.Magnusson", Class = "npc_magnusson", Category = Category } )
Category = "Half-Life 2"

Category = "Zombies + Enemy Aliens"
list.Set( "NPC", "npc_zombine", { Name = "Zombine", Class = "npc_zombine", Category = Category } )
list.Set( "NPC", "npc_antlion_worker", { Name = "Antlion Worker", Class = "npc_antlion_worker", Category = Category } )
list.Set( "NPC", "npc_antlion_grub", { Name = "Antlion Grub", Class = "npc_antlion_grub", Category = Category, NoDrop = true, Offset = 1 } )
list.Set( "NPC", "npc_antlionguardian", { Name = "Antlion Guardian", Class = "npc_antlionguard", Category = Category, KeyValues = { cavernbreed = 1, incavern = 1 }, Material = "Models/antlion_guard/antlionGuard2" } )
game.AddParticles( "particles/striderbuster.pcf" )

list.Set( "SpawnableEntities", "weapon_striderbuster", {
-- Required information
PrintName = "Magnusson",
ClassName = "weapon_striderbuster",
Category = Category,

-- Optional information
NormalOffset = 32,
DropToFloor = true,
Author = "VALVe",
Information = "The strider bustin' Magnusson Device from HL2: Episode 2"
} )

Category = "Combine"
list.Set( "NPC", "npc_hunter", { Name = "Hunter", Class = "npc_hunter", Category = Category } )


--
-- Vehicles
--

list.Set( "Vehicles", "Jalopy", {
-- Required information
Name = "Jalopy",
Class = "prop_vehicle_jeep",
Category = "Half-Life 2",

-- Optional information
Author = "VALVe",
Information = "The muscle car from Episode 2",
Model = "models/vehicle.mdl",
-- Required information
Name = "Jalopy",
Class = "prop_vehicle_jeep",
Category = Category,

-- Optional information
Author = "VALVe",
Information = "The muscle car from Episode 2",
Model = "models/vehicle.mdl",

KeyValues = {
vehiclescript = "scripts/vehicles/jalopy.txt"
}
} )
KeyValues = {
vehiclescript = "scripts/vehicles/jalopy.txt"
}
} )
34 changes: 13 additions & 21 deletions garrysmod/lua/autorun/game_hl2.lua
Expand Up @@ -4,14 +4,14 @@ local Category = ""

local function ADD_ITEM( name, class )

list.Set( "SpawnableEntities", class, { PrintName = name, ClassName = class, Category = Category, NormalOffset = 32, DropToFloor = true, Author = "VALVe", AdminOnly = false } )
list.Set( "SpawnableEntities", class, { PrintName = name, ClassName = class, Category = Category, NormalOffset = 32, DropToFloor = true, Author = "VALVe" } )
duplicator.Allow( class )

end

local function ADD_WEAPON( name, class )

list.Set( "Weapon", class, { ClassName = class, PrintName = name, Category = Category, AdminOnly = false, Spawnable = true } )
list.Set( "Weapon", class, { ClassName = class, PrintName = name, Category = Category, Author = "VALVe", Spawnable = true } )
duplicator.Allow( class )

end
Expand All @@ -29,7 +29,6 @@ ADD_ITEM( "Crossbow Bolts", "item_ammo_crossbow" )
ADD_ITEM( "SMG Grenade", "item_ammo_smg1_grenade" )
ADD_ITEM( "RPG", "item_rpg_round" )


-- Items
ADD_ITEM( "Suit Battery", "item_battery" )
ADD_ITEM( "Health Vial", "item_healthvial" )
Expand All @@ -38,33 +37,26 @@ ADD_ITEM( "Suit Charger", "item_suitcharger" )
ADD_ITEM( "Health Charger", "item_healthcharger" )
ADD_ITEM( "Suit", "item_suit" )

-- Weapons
ADD_ITEM( "Helicopter Grenade", "grenade_helicopter" )
--ADD_WEAPON( "Zombine Grenade", "npc_grenade_frag" )
ADD_ITEM( "Thumper", "prop_thumper" )
ADD_ITEM( "Combine Mine", "combine_mine" )
ADD_ITEM( "Helicopter Grenade", "grenade_helicopter" )
ADD_ITEM( "Zombine Grenade", "npc_grenade_frag" )

-- Weapons
ADD_WEAPON( "357", "weapon_357" )
ADD_WEAPON( "Annabelle", "weapon_annabelle" )
ADD_WEAPON( "Annabelle", "weapon_annabelle" )
ADD_WEAPON( "AR2", "weapon_ar2" )
ADD_WEAPON( "Bug Bait", "weapon_bugbait" )
ADD_WEAPON( "Crossbow", "weapon_crossbow" )
ADD_WEAPON( "Crowbar", "weapon_crowbar" )
--ADD_WEAPON( "Physcannon", "weapon_physcannon" )
ADD_WEAPON( "Gravity Gun", "weapon_physcannon" )
ADD_WEAPON( "Frag Grenade", "weapon_frag" )
--ADD_WEAPON( "Physgun", "weapon_physgun" )
ADD_WEAPON( "Pistol", "weapon_pistol" )
ADD_WEAPON( "Pistol", "weapon_pistol" )
ADD_WEAPON( "RPG Launcher", "weapon_rpg" )
ADD_WEAPON( "Shotgun", "weapon_shotgun" )
ADD_WEAPON( "SLAM", "weapon_slam" )
ADD_WEAPON( "SMG", "weapon_smg1" )
ADD_WEAPON( "Stunstick", "weapon_stunstick" )

list.Set("SpawnableEntities", "prop_thumper",
{
PrintName = "Thumper",
ClassName = "prop_thumper",
Category = Category,
DropToFloor = true,
Author = "VALVe",
AdminOnly = false
})
ADD_WEAPON( "Stunstick", "weapon_stunstick" )

Category = "Other"
ADD_WEAPON( "Physics Gun", "weapon_physgun" )
Binary file modified garrysmod/resource/language/npc-ents_english.txt
Binary file not shown.
Binary file modified garrysmod/resource/language/sandbox-cleanup_english.txt
Binary file not shown.
Binary file modified garrysmod/resource/language/sandbox-settings_english.txt
Binary file not shown.
Binary file modified garrysmod/resource/language/sandbox-undo_english.txt
Binary file not shown.
2 changes: 2 additions & 0 deletions garrysmod/resource/localization/en/tool.properties
Expand Up @@ -307,6 +307,8 @@ effecttype.waterexplosion=Water Surface Explosion
effecttype.watersplash=Water Splash
effecttype.dirtywatersplash=Dirty Water Splash
effecttype.glassimpact=Glass Impact
effecttype.bloodimpact=Blood Impact
effecttype.muzzleeffect=Muzzle Flash
tool.faceposer.name=Face Poser
tool.faceposer.desc=Alter the expressions of NPCs and Ragdolls
Expand Down

2 comments on commit 9ff1adc

@ajloveslily14
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does "Zombine Grenade" do?

@robotboy655
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spawns a zombine grenade? You can pick it up and throw and it'll explode.

Please sign in to comment.