Compare commits

...

4 commits

Author SHA1 Message Date
690035b3dd
mod: simplify player ShouldNotCollide 2022-07-17 20:46:55 +08:00
327f686f62
fix: typo 2022-07-14 18:05:29 +08:00
764bb94570
fix: stackoverflow when hot-reloading 2022-07-12 18:33:47 +08:00
7d92caf327
mod: descriptive files 2022-07-12 18:29:33 +08:00
8 changed files with 82 additions and 46 deletions

View file

@ -2,7 +2,7 @@ JBGM LICENSE
VERSION Xx420xX4, 05 May 2018 VERSION Xx420xX4, 05 May 2018
Copyright <EFBFBD> 2018 William Moodhe Copyright © 2018 William Moodhe
Anyone is allowed to copy, upload, or distribute copies of this license, but changing it is not allowed. Anyone is allowed to copy, upload, or distribute copies of this license, but changing it is not allowed.

View file

@ -361,7 +361,7 @@ function meta:ResetLastBarricadeAttacker(attacker, dmginfo)
end end
end end
meta.OldSetPhysicsAttacker = meta.SetPhysicsAttacker meta.OldSetPhysicsAttacker = meta.OldSetPhysicsAttacker or meta.SetPhysicsAttacker
function meta:SetPhysicsAttacker(ent) function meta:SetPhysicsAttacker(ent)
if string.sub(self:GetClass(), 1, 12) == "func_physbox" and ent:IsValid() then if string.sub(self:GetClass(), 1, 12) == "func_physbox" and ent:IsValid() then
self.PBAttacker = ent self.PBAttacker = ent

View file

@ -652,11 +652,7 @@ end
function meta:ShouldNotCollide(ent) function meta:ShouldNotCollide(ent)
if E_IsValid(ent) then if E_IsValid(ent) then
if getmetatable(ent) == meta then if getmetatable(ent) == meta then
if P_Team(self) == P_Team(ent) or E_GetTable(self).NoCollideAll or E_GetTable(ent).NoCollideAll then return P_Team(self) == P_Team(ent) or E_GetTable(self).NoCollideAll or E_GetTable(ent).NoCollideAll
return true
end
return false
end end
return E_GetDTBool(self, 0) and ent:IsBarricadeProp() return E_GetDTBool(self, 0) and ent:IsBarricadeProp()
@ -665,7 +661,7 @@ function meta:ShouldNotCollide(ent)
return false return false
end end
meta.OldSetHealth = FindMetaTable("Entity").SetHealth meta.OldSetHealth = meta.OldSetHealth or FindMetaTable("Entity").SetHealth
function meta:SetHealth(health) function meta:SetHealth(health)
self:OldSetHealth(health) self:OldSetHealth(health)
if P_Team(self) == TEAM_HUMAN and 1 <= health then if P_Team(self) == TEAM_HUMAN and 1 <= health then

View file

@ -75,7 +75,7 @@ function meta:SetMaxHealth(num)
self:SetDTInt(0, math.ceil(num)) self:SetDTInt(0, math.ceil(num))
end end
meta.OldGetMaxHealth = FindMetaTable("Entity").GetMaxHealth meta.OldGetMaxHealth = meta.OldGetMaxHealth or FindMetaTable("Entity").GetMaxHealth
function meta:GetMaxHealth() function meta:GetMaxHealth()
return self:GetDTInt(0) return self:GetDTInt(0)
end end

View file

@ -808,7 +808,7 @@ local function SetModel(pl, mdl)
end end
end end
meta.OldCreateRagdoll = meta.CreateRagdoll meta.OldCreateRagdoll = meta.OldCreateRagdoll or meta.CreateRagdoll
function meta:CreateRagdoll() function meta:CreateRagdoll()
local status = self.status_overridemodel local status = self.status_overridemodel
if status and status:IsValid() then if status and status:IsValid() then
@ -974,7 +974,7 @@ function meta:Resupply(owner, obj)
end end
-- Lets other players know about our maximum health. -- Lets other players know about our maximum health.
meta.OldSetMaxHealth = FindMetaTable("Entity").SetMaxHealth meta.OldSetMaxHealth = meta.OldSetMaxHealth or FindMetaTable("Entity").SetMaxHealth
function meta:SetMaxHealth(num) function meta:SetMaxHealth(num)
num = math.ceil(num) num = math.ceil(num)
self:SetDTInt(0, num) self:SetDTInt(0, num)
@ -1462,7 +1462,7 @@ function meta:SetLastAttacker(ent)
end end
end end
meta.OldUnSpectate = meta.UnSpectate meta.OldUnSpectate = meta.OldUnSpectate or meta.UnSpectate
function meta:UnSpectate() function meta:UnSpectate()
if self:GetObserverMode() ~= OBS_MODE_NONE then if self:GetObserverMode() ~= OBS_MODE_NONE then
self:OldUnSpectate(obsm) self:OldUnSpectate(obsm)

View file

@ -75,7 +75,7 @@ Hook. Human kills a zombie.
GM:HumanKilledZombie(Player victim, Player attacker, DamageInfo dmginfo, Bool headshot, Bool wassuicide) GM:HumanKilledZombie(Player victim, Player attacker, DamageInfo dmginfo, Bool headshot, Bool wassuicide)
Hook. Zombie kills a human. Hook. Zombie kills a human.
GM:HumanKilledZombie(Player victim, Player attacker, DamageInfo dmginfo, Bool headshot, Bool wassuicide) GM:ZombieKilledHuman(Player victim, Player attacker, DamageInfo dmginfo, Bool headshot, Bool wassuicide)
SELF-EXPLANATORY HOOKS AND FUNCTIONS SELF-EXPLANATORY HOOKS AND FUNCTIONS
GM:LoadMapEditorFile() GM:LoadMapEditorFile()

View file

@ -1,41 +1,37 @@
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ English | [中文(简体)](readme_zh-CN.md)
ZZZ ZZZ
ZZZ ZOMBIE SURVIVAL ZZZ # Zombie Survival
ZZZ THE DEFINITIVE ZOMBIE EXPERIENCE ZZZ The definitive zombie experience.
ZZZ A GAMEMODE FOR GMOD ZZZ A gamemode for Garry's Mod.
ZZZ ZZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ## Credits
Created and programmed by William "JetBoom" Moodhe Created and programmed by William "JetBoom" Moodhe
E-mail: williammoodhe@gmail.com E-mail: williammoodhe@gmail.com
Alternate e-mail: jetboom@noxiousnet.com Alternate e-mail: jetboom@noxiousnet.com
Web: http://www.noxiousnet.com Web: http://www.noxiousnet.com
Additional credits: ### Addtional credits
Zombie view models 11k (tjd113@gmail.com) |Contribution |Credit |
Zombie kill icons Eisiger (k2deseve@gmail.com) |-------------------|------------------------------------------------------|
Some HUD textures Typhon (lukas-tinel@hotmail.com) |Zombie view models |11k (tjd113@gmail.com) |
Ambient beat sounds Austin "Little Nemo" Killey (austin_odyssey@yahoo.com) |Zombie kill icons |Eisiger (k2deseve@gmail.com) |
Melee weapon models Zombie Panic: Source (http://www.zombiepanic.org/) |Some HUD textures |Typhon (lukas-tinel@hotmail.com) |
Board Kit model Samuel (samuel_games@hotmail.com) |Ambient beat sounds|Austin "Little Nemo" Killey (austin_odyssey@yahoo.com)|
|Melee weapon models|Zombie Panic: Source (http://www.zombiepanic.org/) |
|Board Kit model |Samuel (samuel_games@hotmail.com) |
|Current maintainer |LuoRain (luotianyi@luotianyi.me) |
## Install
ZZZZZZZZZZZZZZZZZZZZZZZZZ
ZZ ZZ
ZZ INSTALL ZZ
ZZ ZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZ
1. Put the zombiesurvival folder in garrysmod/gamemodes with all the other gamemode folders. 1. Put the zombiesurvival folder in garrysmod/gamemodes with all the other gamemode folders.
2. In console: gamemode zombiesurvival 2. In console: gamemode zombiesurvival
3. Run a zs_ map. 3. Run a zs_ map.
## Running servers
ZZZZZZZZZZZZZZZZZZZZZZZZZ
ZZ ZZ
ZZ RUNNING SERVERS ZZ
ZZ ZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZ
1. Get srcds and configure it for garrysmod (requires steamcmd). 1. Get srcds and configure it for garrysmod (requires steamcmd).
2. Put the zombiesurvival folder in garrysmod/gamemodes with all the other gamemode folders. 2. Put the zombiesurvival folder in garrysmod/gamemodes with all the other gamemode folders.
@ -45,11 +41,6 @@ ZZ ZZ
srcds.exe -port 27015 -console -game garrysmod -secure +ip 24.102.103.104 +hostport 27015 +gamemode zombiesurvival +maxplayers 32 +map zs_oldhouse +hostname "Your ZS Server" srcds.exe -port 27015 -console -game garrysmod -secure +ip 24.102.103.104 +hostport 27015 +gamemode zombiesurvival +maxplayers 32 +map zs_oldhouse +hostname "Your ZS Server"
6. Run it. You now have a server. See other guides on the web for setting up sv_downloadurl. 6. Run it. You now have a server. See other guides on the web for setting up sv_downloadurl.
## Legal jargon
ZZZZZZZZZZZZZZZZZZZZZZZZ See [license](LICENSE) file
ZZ ZZ
ZZ LEGAL JARGON ZZ
ZZ ZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZ
See license file

49
readme_zh-CN.md Normal file
View file

@ -0,0 +1,49 @@
[English](readme.md) | 中文(简体)
# 僵尸生存
终极僵尸体验。
一个Garry's Mod游戏模式。
## 作者
William "JetBoom" Moodhe 创建和编写
电子邮件: williammoodhe@gmail.com
备用电子邮件: jetboom@noxiousnet.com
网站: http://www.noxiousnet.com
### 其它作者
|贡献 |作者 |
|-----------|------------------------------------------------------|
|僵尸视角模型|11k (tjd113@gmail.com) |
|僵尸击杀图标|Eisiger (k2deseve@gmail.com) |
|一些HUD材质 |Typhon (lukas-tinel@hotmail.com) |
|环境击打音效|Austin "Little Nemo" Killey (austin_odyssey@yahoo.com)|
|搏斗武器模型|Zombie Panic: Source (http://www.zombiepanic.org/) |
|木板包模型 |Samuel (samuel_games@hotmail.com) |
|当前维护者 |LuoRain (luotianyi@luotianyi.me) |
## 安装
1. 将zombiesurvival目录与其他游戏模式目录一起放到garrysmod/gamemodes里。
2. 在控制台输入gamemode zombiesurvival
3. 切换到一个zs_地图。
## 运行服务器
1. 获取srcds并将其配置为garrysmod服务器需要steamcmd
2. 将zombiesurvival目录与其他游戏模式目录一起放到garrysmod/gamemodes里。
3. 弄点地图。互联网上有许多的ZS_地图并且游戏也支持其它的地图类型如CS:S, Zombie Mod, Zombie Horde, Zombie Panic! Source
4. 可以自己装一个自定义投票脚本或者使用mapcycle_zombiesurvival.txt。在garrysmod目录创建一个名为mapcycle_zombiesurvival.txt的文件。将不带.bsp后缀的地图名字放进去。一个一行。
5. Make your auto-start batch file or whatever you use. The line should look like this:
srcds.exe -port 27015 -console -game garrysmod -secure +ip 24.102.103.104 +hostport 27015 +gamemode zombiesurvival +maxplayers 32 +map zs_oldhouse +hostname "Your ZS Server"
5. 制作你自己的自动启动脚本或别的什么东西。它看起来应该是这样的:
`srcds.exe -port 27015 -console -game garrysmod -secure +ip 24.102.103.104 +hostport 27015 +gamemode zombiesurvival +maxplayers 32 +map zs_oldhouse +hostname "Your ZS Server"`
6. 运行它。你现在就有了一个服务器。看看网上的其他教程来设置sv_downloadurl。
## 法律用语
查看[license](LICENSE)文件