aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/inventory
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/inventory')
-rw-r--r--gamemode/core/inventory/common/animations/sh_swing_mele.lua500
-rw-r--r--gamemode/core/inventory/inventory.lua11
-rw-r--r--gamemode/core/inventory/sv_invtracker.lua5
3 files changed, 509 insertions, 7 deletions
diff --git a/gamemode/core/inventory/common/animations/sh_swing_mele.lua b/gamemode/core/inventory/common/animations/sh_swing_mele.lua
new file mode 100644
index 0000000..4521ddd
--- /dev/null
+++ b/gamemode/core/inventory/common/animations/sh_swing_mele.lua
@@ -0,0 +1,500 @@
+print("Hello from sh_swing_mele.lua!")
+
+RegisterLuaAnimation('swing_onehand_left', {
+ FrameData = {
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = 14.9983
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ RU = 58.1181,
+ RR = 27.0889
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ RU = -7.9421,
+ RR = 34.3556,
+ RF = 4.4799
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RF = 39.5103
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ RR = 47.4665,
+ RF = -19.7371
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = -129.4263,
+ RR = -47.9277
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RR = 2.574
+ }
+ },
+ FrameRate = 5
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = -18.8755
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 90,
+ RR = -4.5286,
+ RF = -100.8045
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = 23.8203,
+ RR = -38.9972,
+ RF = -25.2662
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ RU = -7.9421,
+ RR = 34.3556,
+ RF = 4.4799
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ }
+ },
+ FrameRate = 1.6667
+ }
+ },
+ Type = TYPE_GESTURE
+})
+
+RegisterLuaAnimation('swing_onehand_overhead', {
+ FrameData = {
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_L_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ RU = -14.9433,
+ RR = -26.7191,
+ RF = 10.6193
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 83.616,
+ RR = 93.0582,
+ RF = 62.0103
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = -111.0966,
+ RR = -74.1549,
+ RF = -62.4384
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RR = -2.5225,
+ RF = -39.26
+ },
+ ['ValveBiped.Bip01_L_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -9.0093,
+ RR = 14.4999,
+ RF = 25.671
+ }
+ },
+ FrameRate = 5
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = 14.4193
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ RU = 10.6282,
+ RR = 9.7472,
+ RF = -42.9906
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ RU = -14.9433,
+ RR = -26.7191,
+ RF = 10.6193
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 98.1268,
+ RR = 5.534,
+ RF = 96.1386
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = -203.1287,
+ RR = -120.029,
+ RF = -2.2254
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ RF = 9.6129
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RU = 18.6599,
+ RF = 43.4352
+ },
+ ['ValveBiped.Bip01_L_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -41.5509,
+ RR = -6.2725,
+ RF = 16.9206
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_L_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 1.6667
+ }
+ },
+ Type = TYPE_GESTURE
+})
+
+RegisterLuaAnimation('swing_onehand_right', {
+ FrameData = {
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = -13.0166
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 64.7312,
+ RR = -12.5429,
+ RF = -0.7
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RF = -26.2859
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -2.0679,
+ RR = -3.5029,
+ RF = 87.3164
+ }
+ },
+ FrameRate = 5
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = 47.2023
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ RR = -15.9212,
+ RF = -57.372
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ RR = 21.3645,
+ RF = 0.6008
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 64.7168,
+ RR = -50.8221,
+ RF = -48.8765
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RR = -35.8651,
+ RF = -47.1548
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ RF = 11.3894
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RF = 36.4235
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ RU = 49.4639,
+ RR = -10.0868,
+ RF = 6.7341
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -2.0679,
+ RR = 44.9745,
+ RF = 85.4281
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 1.6667
+ }
+ },
+ Type = TYPE_GESTURE
+})
+
+RegisterLuaAnimation('swing_onehand_stab', {
+ FrameData = {
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = -18.294
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ RU = -23.5308,
+ RF = -3.6617
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ RU = -22.1427
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ RF = -11.4656
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RF = -4.7217
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 24.4736,
+ RR = -3.368
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = 4.3187,
+ RR = 2.4775,
+ RF = -147.3305
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -43.7725,
+ RR = -3.349,
+ RF = -3.218
+ }
+ },
+ FrameRate = 5
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ RF = 25.4603
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ RR = -20.3889,
+ RF = -45.1608
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ RU = 3.6368,
+ RR = 20.8097,
+ RF = 6.6735
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ RU = 83.1342,
+ RR = -4.2804,
+ RF = -21.4632
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ RU = -11.8714,
+ RR = 4.3073,
+ RF = -65.2235
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ RF = 45.7756
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ RF = 4.61
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ RU = -23.5308,
+ RF = -3.6617
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ RU = -22.1427
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ RU = -48.1903,
+ RR = -24.3979,
+ RF = 53.5558
+ }
+ },
+ FrameRate = 10
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_Spine2'] = {
+ },
+ ['ValveBiped.Bip01_Neck1'] = {
+ },
+ ['ValveBiped.Bip01_R_Clavicle'] = {
+ },
+ ['ValveBiped.Bip01_R_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_R_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_Spine1'] = {
+ },
+ ['ValveBiped.Bip01_Spine4'] = {
+ },
+ ['ValveBiped.Bip01_L_Forearm'] = {
+ },
+ ['ValveBiped.Bip01_L_UpperArm'] = {
+ },
+ ['ValveBiped.Bip01_R_Hand'] = {
+ }
+ },
+ FrameRate = 1.6667
+ }
+ },
+ Type = TYPE_GESTURE
+})
diff --git a/gamemode/core/inventory/inventory.lua b/gamemode/core/inventory/inventory.lua
index 62e4819..f28cc18 100644
--- a/gamemode/core/inventory/inventory.lua
+++ b/gamemode/core/inventory/inventory.lua
@@ -119,8 +119,11 @@ function inv.RegisterInventory(tbl)
assert(type(tbl[v[1]]) == v[2],
string.format("Attempted to register inventory with field %q of type %q when it should have been %q",v[1],type(tbl[v[1]]),v[2]))
end
- assert(inventories[tbl.Name] == nil,
- string.format("Attempted to register 2 inventories with the same name: %q", tbl.Name))
+ --assert(inventories[tbl.Name] == nil,
+ -- string.format("Attempted to register 2 inventories with the same name: %q", tbl.Name))
+ if inventories[tbl.Name] ~= nil then
+ MsgC(Color(255,255,0),"Registering 2 inventories with the same name:" .. tbl.Name)
+ end
assert((tbl.AddObserver == nil and tbl.RemoveObserver == nil) or
(tbl.AddObserver ~= nil and tbl.RemoveObserver ~= nil),
"AddObserver and RemoveObserver must be defined in pairs")
@@ -145,10 +148,10 @@ function inv.CreateInventoryFromData(name,data)
local tinv = inv.CreateInventory(name)
--print("tinv was", tinv)
--PrintTable(tinv)
- tinv:DeSerialize(data)
+ local ret = tinv:DeSerialize(data)
--print("is now",tinv)
--PrintTable(tinv)
- return tinv
+ return ret
end
--Must be called in a coroutine.
diff --git a/gamemode/core/inventory/sv_invtracker.lua b/gamemode/core/inventory/sv_invtracker.lua
index 56407e2..d4e7d79 100644
--- a/gamemode/core/inventory/sv_invtracker.lua
+++ b/gamemode/core/inventory/sv_invtracker.lua
@@ -145,7 +145,7 @@ function track.NotifyPlayerOfInventory(ply,inv)
net.WriteString(inv.Name)
net.WriteUInt(#initaldat,32)
net.WriteData(initaldat,#initaldat)
- print("Before sending, inv owner is", inv.Owner)
+ print("Before sending, inv owner is", inv.Owner, "and type is",inv.Name)
net.WriteEntity(inv.Owner)
net.Send(ply)
end
@@ -264,8 +264,7 @@ concommand.Add("artery_GiveItem",function(ply,cmd,args)
xpcall(function()
ply:GiveItem(itm.GetItemByName(args[1]))
end,function(err)
- print("Could not give that item!:")
- print(err)
+ print("Could not give that item!:", err)
end)
end)