Skip to content

Commit

Permalink
Merge pull request #60 from Pealover7/main
Browse files Browse the repository at this point in the history
Undead Dread update 2
  • Loading branch information
mtxfellen authored Dec 11, 2024
2 parents f2deff9 + c9de245 commit 1fdd8b7
Show file tree
Hide file tree
Showing 6 changed files with 614 additions and 505 deletions.
6 changes: 6 additions & 0 deletions materials/undead_dread_overlays/weaponmod_shotgun.vmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"UnlitGeneric"
{
"$translucent" 1
"$basetexture" "undead_dread_overlays/weaponmod_shotgun"
"$basetexturetransform" "center 0.5 0.5 scale 4.05 2.025 rotate 0 translate 0 0"
}
Binary file not shown.
51 changes: 17 additions & 34 deletions scripts/population/mvm_underworld_rc2_adv_undead_dread.pop
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ WaveSchedule
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_bow.vtf"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_loch.vtf"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_hatch.vtf"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_shotgun.vtf"

PrecacheGeneric "materials/undead_dread_overlays/weaponmod_bow.vmt"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_loch.vmt"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_hatch.vmt"
PrecacheGeneric "materials/undead_dread_overlays/weaponmod_shotgun.vmt"

PrecacheGeneric "materials/colorcorrection/zombie_cc25.raw"

Expand Down Expand Up @@ -355,7 +358,7 @@ WaveSchedule
MaxActive 5
TotalCount 5
WaitForAllDead "W1B-1"
WaitBeforeStarting 5
WaitBeforeStarting 7
WaitBetweenSpawns 0
TotalCurrency 25
DoneOutput
Expand All @@ -378,7 +381,7 @@ WaveSchedule
MaxActive 16
TotalCount 16
WaitForAllDead "W1B-1"
WaitBeforeStarting 12
WaitBeforeStarting 15
WaitBetweenSpawns 4
TotalCurrency 75
TFBot
Expand All @@ -395,7 +398,7 @@ WaveSchedule
MaxActive 10
TotalCount 19
WaitForAllDead "W1B-1"
WaitBeforeStarting 24
WaitBeforeStarting 27
WaitBetweenSpawns 10
TotalCurrency 75
TFBot
Expand All @@ -411,7 +414,7 @@ WaveSchedule
MaxActive 8
TotalCount 20
WaitForAllDead "W1B-1"
WaitBeforeStarting 24
WaitBeforeStarting 27
WaitBetweenSpawns 8
TotalCurrency 75
TFBot
Expand All @@ -429,7 +432,7 @@ WaveSchedule
MaxActive 10
TotalCount 10
WaitForAllDead "W1B-1"
WaitBeforeStarting 40
WaitBeforeStarting 42
WaitBetweenSpawns 0
TotalCurrency 100
Squad
Expand Down Expand Up @@ -955,7 +958,7 @@ WaveSchedule
MaxActive 2
TotalCount 2
WaitForAllDead "W2C-2"
WaitBeforeStarting 40
WaitBeforeStarting 45
WaitBetweenSpawns 0
TotalCurrency 250
Squad
Expand Down Expand Up @@ -2368,39 +2371,19 @@ WaveSchedule
// {
// Name "W4F"
// Where spawnbot
// SpawnCount 5
// MaxActive 5
// SpawnCount 1
// MaxActive 1
// TotalCount 300
// WaitBeforeStarting 1
// WaitBetweenSpawns 0
// TotalCurrency 0
// Squad
// TFBot
// {
// TFBot
// {
// Class Scout
// Tag test
// }
// TFBot
// {
// Class Soldier
// Tag test
// }
// TFBot
// {
// Class Pyro
// Tag test
// }
// TFBot
// {
// Class Demoman
// Tag test
// }
// TFBot
// {
// Class Heavyweapons
// Tag test
// }
// Class Medic
// Attributes IgnoreFlag
// Attributes IgnoreEnemies

// Tag test
// }
// }
// WaveSpawn
Expand Down
104 changes: 80 additions & 24 deletions scripts/vscripts/pea2.nut
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
[
["CBaseCombatWeapon", ["GetOwner"]],
["CBaseEntity", ["Enable", "Disable"]],
["CTFBot", ["IsGrounded", "GetWeapon", "GetWearable", "GetWearableItem", "Zombify"]],
["CTFPlayer", ["IsGrounded", "GetWeapon", "GetWearable", "GetWearableItem"]]
["CTFBot", ["IsGrounded", "GetWeapon", "GetWearable", "GetWearableItem", "GetAllWearables", "RemoveWearable", "Zombify"]],
["CTFPlayer", ["IsGrounded", "GetWeapon", "GetWearable", "GetWearableItem", "GetAllWearables", "RemoveWearable"]]
]

zombieitems = [5617, 5625, 5618, 5620, 5622, 5619, 5624, 5623, 5621]

playerlog_limit = 16250
// playerlog_limit = 40

tanks_in_wave = 0
blimps_in_wave = 0
Expand Down Expand Up @@ -1304,50 +1303,65 @@ CTFBot.GetWeapon <- CTFPlayer.GetWeapon

CTFPlayer.GetWearable <- function(model, bonemerge = true, attachment = null, offsets = null)
{
local modelIndex = GetModelIndex(model)
for (local child = this.FirstMoveChild(); child != null; child = child.NextMovePeer())
{
if ("custom_wearable" in child.GetScriptScope())
{
if (typeof(model) == "string") { if (NetProps.GetPropIntArray(child, "m_nModelIndexOverrides", 3) == GetModelIndex(model)) return false }
if (typeof(model) == "integer") { if (NetProps.GetPropIntArray(child, "m_nModelIndexOverrides", 3) == model) return false }
}
}

local modelIndex

if (typeof(model) == "string")
{
modelIndex = GetModelIndex(model)
if (modelIndex == -1) modelIndex = ::PrecacheModel(model)
}

if (modelIndex == -1) modelIndex = ::PrecacheModel(model)
if (typeof(model) == "integer") modelIndex = model

local wearable = Entities.CreateByClassname("tf_wearable")

NetProps.SetPropInt(wearable, "m_nModelIndex", dummywearableindex)
NetProps.SetPropInt(wearable, "m_nModelIndex", modelIndex)

wearable.SetAbsOrigin(this.GetLocalOrigin())
wearable.SetAbsAngles(this.GetLocalAngles())

wearable.SetSkin(this.GetTeam())
wearable.SetTeam(this.GetTeam())
wearable.SetSolidFlags(4)
wearable.SetCollisionGroup(11)

NetProps.SetPropEntity(wearable, "m_hOwnerEntity", this)
wearable.SetOwner(this)
Entities.DispatchSpawn(wearable)

NetProps.SetPropInt(wearable, "m_fEffects", bonemerge ? 1 | 128 : 0)

NetProps.SetPropInt(wearable, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 65535)

NetProps.SetPropInt(wearable, "m_AttributeManager.m_Item.m_iEntityLevel", 1)

NetProps.SetPropBool(wearable, "m_bValidatedAttachedEntity", true)
NetProps.SetPropBool(wearable, "m_AttributeManager.m_Item.m_bInitialized", true)
NetProps.SetPropBool(wearable, "m_AttributeManager.m_Item.m_bOnlyIterateItemViewAttributes", false)

wearable.AcceptInput("SetParent", "!activator", this, this)

if (attachment != null) // troubleshooting attachments not working
{
wearable.AcceptInput("SetParentAttachment", attachment, null, null)
// EntFireByHandle(wearable, "SetParentAttachment", attachment, 0.1, null, null)
// EntFireByHandle(wearable, "SetParentAttachment", attachment, 0.5, null, null)
// EntFireByHandle(wearable, "SetParentAttachment", attachment, 1.0, null, null)
}
if (attachment != null) wearable.AcceptInput("SetParentAttachment", attachment, null, null)

if (offsets != null)
{
EntFireByHandle(wearable, "RunScriptCode", "self.SetLocalOrigin(Vector(" + offsets[0].x + ", " + offsets[0].y + ", " + offsets[0].z + "))", 0.1, null, null)
EntFireByHandle(wearable, "RunScriptCode", "self.SetLocalAngles(QAngle(" + offsets[1].x + ", " + offsets[1].y + ", " + offsets[1].z + "))", 0.1, null, null)
}

else
{
EntFireByHandle(wearable, "RunScriptCode", "self.SetLocalOrigin(Vector(0, 0, 0))", 0.1, null, null)
EntFireByHandle(wearable, "RunScriptCode", "self.SetLocalAngles(QAngle(0, 0, 0))", 0.1, null, null)
}

EntFireByHandle(wearable, "RunScriptCode", "NetProps.SetPropIntArray(self, `m_nModelIndexOverrides`, " + modelIndex + ", 0)", 1.0, null, null)
EntFireByHandle(wearable, "RunScriptCode", "NetProps.SetPropIntArray(self, `m_nModelIndexOverrides`, " + modelIndex + ", 1)", 1.0, null, null)
EntFireByHandle(wearable, "RunScriptCode", "NetProps.SetPropIntArray(self, `m_nModelIndexOverrides`, " + modelIndex + ", 2)", 1.0, null, null)
EntFireByHandle(wearable, "RunScriptCode", "NetProps.SetPropIntArray(self, `m_nModelIndexOverrides`, " + modelIndex + ", 3)", 1.0, null, null)
NetProps.SetPropIntArray(wearable, "m_nModelIndexOverrides", modelIndex, 0)
NetProps.SetPropIntArray(wearable, "m_nModelIndexOverrides", modelIndex, 1)
NetProps.SetPropIntArray(wearable, "m_nModelIndexOverrides", modelIndex, 2)
NetProps.SetPropIntArray(wearable, "m_nModelIndexOverrides", modelIndex, 3)

wearable.ValidateScriptScope()
wearable.GetScriptScope().custom_wearable <- true
Expand All @@ -1357,6 +1371,11 @@ CTFPlayer.GetWearable <- function(model, bonemerge = true, attachment = null, of

CTFPlayer.GetWearableItem <- function(id)
{
for (local child = this.FirstMoveChild(); child != null; child = child.NextMovePeer())
{
if ("custom_wearable" in child.GetScriptScope() && NetProps.GetPropInt(child, "m_AttributeManager.m_Item.m_iItemDefinitionIndex") == id) return
}

local dummy_Weapon = Entities.CreateByClassname("tf_weapon_parachute")
NetProps.SetPropInt(dummy_Weapon, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", 1101)
NetProps.SetPropBool(dummy_Weapon, "m_AttributeManager.m_Item.m_bInitialized", true)
Expand All @@ -1371,8 +1390,9 @@ CTFPlayer.GetWearableItem <- function(id)
dummy_Weapon.Kill()

NetProps.SetPropInt(wearable, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", id)

NetProps.SetPropBool(wearable, "m_AttributeManager.m_Item.m_bInitialized", true)
NetProps.SetPropBool(wearable, "m_bValidatedAttachedEntity", true)

wearable.DispatchSpawn()

wearable.ValidateScriptScope()
Expand All @@ -1381,6 +1401,42 @@ CTFPlayer.GetWearableItem <- function(id)
return wearable
}

CTFPlayer.RemoveWearable <- function(input)
{
local killarray = []

for (local child = this.FirstMoveChild(); child != null; child = child.NextMovePeer())
{
if ("custom_wearable" in child.GetScriptScope())
{
if (typeof(input) == "integer")
{
if (NetProps.GetPropInt(child, "m_AttributeManager.m_Item.m_iItemDefinitionIndex") == input) killarray.append(child)
if (NetProps.GetPropInt(child, "m_nModelIndex") == input) killarray.append(child)
}

if (typeof(input) == "string") { if (NetProps.GetPropIntArray(child, "m_nModelIndexOverrides", 3) == GetModelIndex(input)) killarray.append(child) }
}
}

foreach (ent in killarray) ent.Kill()
}

CTFPlayer.GetAllWearables <- function()
{
local array = []

for (local child = this.FirstMoveChild(); child != null; child = child.NextMovePeer())
{
if ("custom_wearable" in child.GetScriptScope()) array.append(child)
}

return array
}

CTFBot.RemoveWearable <- CTFPlayer.RemoveWearable
CTFBot.GetAllWearables <- CTFPlayer.GetAllWearables

CTFBot.GetWearable <- CTFPlayer.GetWearable
CTFBot.GetWearableItem <- CTFPlayer.GetWearableItem

Expand Down
Loading

0 comments on commit 1fdd8b7

Please sign in to comment.