Tests with amputating legs
This commit is contained in:
65
media/AnimSets/player/idle/Bob_NoLegsIdle.xml
Normal file
65
media/AnimSets/player/idle/Bob_NoLegsIdle.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animNode>
|
||||
<m_Name>Bob_NoLegsIdle</m_Name>
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
|
||||
<m_SpeedScale>0.48</m_SpeedScale>
|
||||
<m_BlendTime>0.20</m_BlendTime>
|
||||
<m_Conditions>
|
||||
<m_Name>IsCrawling</m_Name>
|
||||
<m_Type>BOOL</m_Type>
|
||||
<m_BoolValue>true</m_BoolValue>
|
||||
</m_Conditions>
|
||||
<m_Scalar>IdleSpeed</m_Scalar>
|
||||
<m_Scalar2>IdleSpeed</m_Scalar2>
|
||||
<m_2DBlends referenceID="1">
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_XPos>0.00</m_XPos>
|
||||
<m_YPos>0.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="2">
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_XPos>0.00</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="3">
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_XPos>0.00</m_XPos>
|
||||
<m_YPos>0.04</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlendTri>
|
||||
<node1>1</node1>
|
||||
<node2>2</node2>
|
||||
<node3>3</node3>
|
||||
</m_2DBlendTri>
|
||||
<m_Transitions>
|
||||
<m_Target>aim_default</m_Target>
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_blendInTime>0.5</m_blendInTime>
|
||||
<m_speedScale>1.5</m_speedScale>
|
||||
</m_Transitions>
|
||||
<m_Transitions>
|
||||
<m_Target>defaultWalk</m_Target>
|
||||
<m_blendInTime>0.3</m_blendInTime>
|
||||
<m_blendOutTime>0.3</m_blendOutTime>
|
||||
<m_Conditions>
|
||||
<m_Name>isTurningAround</m_Name>
|
||||
<m_Type>BOOL</m_Type>
|
||||
<m_BoolValue>false</m_BoolValue>
|
||||
</m_Conditions>
|
||||
</m_Transitions>
|
||||
<m_Transitions>
|
||||
<m_Target>defaultRun</m_Target>
|
||||
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
|
||||
<m_blendInTime>0.1</m_blendInTime>
|
||||
<m_blendOutTime>0.1</m_blendOutTime>
|
||||
<m_Conditions>
|
||||
<m_Name>isTurningAround</m_Name>
|
||||
<m_Type>BOOL</m_Type>
|
||||
<m_BoolValue>false</m_BoolValue>
|
||||
</m_Conditions>
|
||||
</m_Transitions>
|
||||
</animNode>
|
||||
109
media/AnimSets/player/movement/Bob_NoLegsMovement.xml
Normal file
109
media/AnimSets/player/movement/Bob_NoLegsMovement.xml
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animNode>
|
||||
<m_Name>defaultWalk</m_Name>
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_DeferredBoneName>Translation_Data</m_DeferredBoneName>
|
||||
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
|
||||
<m_SpeedScale>1.04</m_SpeedScale>
|
||||
<m_BlendTime>0.20</m_BlendTime>
|
||||
<m_Conditions>
|
||||
<m_Name>IsCrawling</m_Name>
|
||||
<m_Type>BOOL</m_Type>
|
||||
<m_BoolValue>true</m_BoolValue>
|
||||
</m_Conditions>
|
||||
|
||||
<m_Scalar>WalkInjury</m_Scalar>
|
||||
<m_Scalar2>WalkSpeed</m_Scalar2>
|
||||
<m_2DBlends referenceID="1">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>0.50</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="2">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>-0.50</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="3">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>1.00</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="4">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>-1.00</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="5">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>0.00</m_XPos>
|
||||
<m_YPos>1.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlends referenceID="6">
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_XPos>0.00</m_XPos>
|
||||
<m_YPos>0.00</m_YPos>
|
||||
<m_SpeedScale>0.80</m_SpeedScale>
|
||||
</m_2DBlends>
|
||||
<m_2DBlendTri>
|
||||
<node1>2</node1>
|
||||
<node2>4</node2>
|
||||
<node3>6</node3>
|
||||
</m_2DBlendTri>
|
||||
<m_2DBlendTri>
|
||||
<node1>5</node1>
|
||||
<node2>2</node2>
|
||||
<node3>6</node3>
|
||||
</m_2DBlendTri>
|
||||
<m_2DBlendTri>
|
||||
<node1>6</node1>
|
||||
<node2>1</node2>
|
||||
<node3>5</node3>
|
||||
</m_2DBlendTri>
|
||||
<m_2DBlendTri>
|
||||
<node1>6</node1>
|
||||
<node2>3</node2>
|
||||
<node3>1</node3>
|
||||
</m_2DBlendTri>
|
||||
<m_Transitions>
|
||||
<m_Target>Bob_NoLegsIdle</m_Target>
|
||||
<m_blendInTime>0.3</m_blendInTime>
|
||||
<m_speedScale>1</m_speedScale>
|
||||
</m_Transitions>
|
||||
<m_Transitions>
|
||||
<m_Target>Bob_NoLegsIdle</m_Target>
|
||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
||||
<m_blendInTime>0.3</m_blendInTime>
|
||||
<m_blendOutTime>0.3</m_blendOutTime>
|
||||
<m_Conditions>
|
||||
<m_Name>DeltaY</m_Name>
|
||||
<m_Type>GTR</m_Type>
|
||||
<m_FloatValue>-0.5</m_FloatValue>
|
||||
</m_Conditions>
|
||||
<m_Conditions>
|
||||
<m_Name>isMoving</m_Name>
|
||||
<m_Type>BOOL</m_Type>
|
||||
<m_BoolValue>false</m_BoolValue>
|
||||
</m_Conditions>
|
||||
</m_Transitions>
|
||||
<m_Transitions>
|
||||
<m_Target>Bob_NoLegsIdle</m_Target>
|
||||
<m_blendInTime>0.1</m_blendInTime>
|
||||
</m_Transitions>
|
||||
|
||||
<m_Events>
|
||||
<m_EventName>Footstep</m_EventName>
|
||||
<m_TimePc>0.15</m_TimePc>
|
||||
<m_ParameterValue>walk</m_ParameterValue>
|
||||
</m_Events>
|
||||
<m_Events>
|
||||
<m_EventName>Footstep</m_EventName>
|
||||
<m_TimePc>0.6</m_TimePc>
|
||||
<m_ParameterValue>walk</m_ParameterValue>
|
||||
</m_Events>
|
||||
</animNode>
|
||||
12
media/clothing/clothingItems/Amputation_Left_Foot.xml
Normal file
12
media/clothing/clothingItems/Amputation_Left_Foot.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<clothingItem>
|
||||
<m_MaleModel>Amputation_Left_Hand_Male</m_MaleModel>
|
||||
<m_FemaleModel>Amputation_Left_Hand_Female</m_FemaleModel>
|
||||
<m_GUID>45c0b872-bdf1-466f-b810-c7783171bda1</m_GUID>
|
||||
<m_Static>false</m_Static>
|
||||
<m_AllowRandomHue>false</m_AllowRandomHue>
|
||||
<m_AllowRandomTint>false</m_AllowRandomTint>
|
||||
<m_Masks>8</m_Masks>
|
||||
<m_MasksFolder>none</m_MasksFolder>
|
||||
|
||||
</clothingItem>
|
||||
@@ -76,4 +76,9 @@
|
||||
<path>media/clothing/clothingItems/Prost_Left_LowerArm_MetalHand.xml</path>
|
||||
<guid>0405a4c0-f71b-45a8-9edc-489fc81dca39</guid>
|
||||
</files>
|
||||
|
||||
<files>
|
||||
<path>media/clothing/clothingItems/Amputation_Left_Foot.xml</path>
|
||||
<guid>45c0b872-bdf1-466f-b810-c7783171bda1</guid>
|
||||
</files>
|
||||
</fileGuidTable>
|
||||
24
media/lua/client/TOC_Animations.lua
Normal file
24
media/lua/client/TOC_Animations.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Thanks to Glytcher and Matías N. Salas for helping out with this
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function SetMissingFootAnimation(check)
|
||||
|
||||
|
||||
local player = getPlayer()
|
||||
|
||||
if check then
|
||||
player:setVariable("IsCrawling", "true")
|
||||
else
|
||||
player:setVariable("IsCrawling", "false")
|
||||
end
|
||||
|
||||
-- if isClient() then
|
||||
-- sendClientCommand("TOC", "SetCrawlAnimation", {})
|
||||
-- end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -208,6 +208,26 @@ end
|
||||
|
||||
|
||||
|
||||
-- ANIMATIONS
|
||||
-----------------------
|
||||
Commands["SetCrawlAnimation"] = function(args)
|
||||
|
||||
local source = getPlayer()
|
||||
local player = getPlayerByOnlineID(args.id)
|
||||
|
||||
if source ~= player then
|
||||
if args.hasInjury then
|
||||
player:setVariable('SetCrawlAnimation', 'true');
|
||||
else
|
||||
player:setVariable('SetCrawlAnimation', 'false');
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Base stuff
|
||||
local function OnTocServerCommand(module, command, args)
|
||||
|
||||
@@ -76,14 +76,18 @@ function ISInventoryPane:onMouseDoubleClick(x, y)
|
||||
|
||||
local item_to_check = self.items[self.mouseOverOption]
|
||||
local player_inventory = getPlayerInventory(self.player).inventory
|
||||
if instanceof(item_to_check, "InventoryItem") then
|
||||
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
||||
elseif CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or CheckIfItemIsInstalledProsthesis(item_to_check.items[1]) then
|
||||
--print("TOC: Can't double click this item")
|
||||
else
|
||||
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
||||
-----------------------------------------------------------------------------------
|
||||
-- TODO THIS IS DISABLED ONLY FOR TEST!!!!! REMEMBER TO RESTORE IT
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
end
|
||||
-- if instanceof(item_to_check, "InventoryItem") then
|
||||
-- og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
||||
-- elseif CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or CheckIfItemIsInstalledProsthesis(item_to_check.items[1]) then
|
||||
-- --print("TOC: Can't double click this item")
|
||||
-- else
|
||||
|
||||
-- end
|
||||
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
||||
|
||||
|
||||
|
||||
@@ -96,13 +100,17 @@ function ISInventoryPane.getActualItems(items)
|
||||
local ret = og_ISInventoryPaneGetActualItems(items)
|
||||
|
||||
-- This is gonna be slower than just overriding the function but hey it's more compatible
|
||||
-----------------------------------------------------------------------------------
|
||||
-- TODO THIS IS DISABLED ONLY FOR TEST!!!!! REMEMBER TO RESTORE IT
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
for i = 1, #ret do
|
||||
local item_full_type = ret[i]:getFullType()
|
||||
if string.find(item_full_type, "Amputation_") or string.find(item_full_type, "Prost_") then
|
||||
table.remove(ret, i)
|
||||
end
|
||||
end
|
||||
|
||||
-- for i = 1, #ret do
|
||||
-- local item_full_type = ret[i]:getFullType()
|
||||
-- if string.find(item_full_type, "Amputation_") or string.find(item_full_type, "Prost_") then
|
||||
-- table.remove(ret, i)
|
||||
-- end
|
||||
-- end
|
||||
return ret
|
||||
end
|
||||
|
||||
|
||||
@@ -176,12 +176,29 @@ end
|
||||
|
||||
-- MAIN UPDATE FUNCTIONS
|
||||
|
||||
local testOnAnimEvent = IsoGameCharacter.OnAnimEvent
|
||||
|
||||
function IsoGameCharacter.OnAnimEvent(animLayer, animEvent)
|
||||
print("ENTERING ON ANIM EVENT!!!")
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function TocUpdateOnTick()
|
||||
|
||||
local player = getPlayer()
|
||||
if player == nil then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
local toc_data = player:getModData().TOC
|
||||
if toc_data ~= nil then
|
||||
CheckIfPlayerIsInfected(player, toc_data)
|
||||
|
||||
@@ -24,6 +24,14 @@ TOC_Commands["AskDamageOtherPlayer"] = function(_, arg)
|
||||
end
|
||||
|
||||
|
||||
-------- ANIMATIONS
|
||||
TOC_Commands["SetCrawlAnimation"] = function(player, args)
|
||||
|
||||
local player_id = player:getOnlineID()
|
||||
|
||||
sendServerCommand(player, "TOC", "SetCrawlAnimation", {})
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ local function addBodyLocationBefore(newLocation, movetoLocation)
|
||||
|
||||
|
||||
|
||||
list:remove(list:size()-1)
|
||||
list:remove(newItem)
|
||||
local i = group:indexOf(movetoLocation)
|
||||
list:add(i, newItem)
|
||||
end
|
||||
@@ -70,6 +70,7 @@ local group = BodyLocations.getGroup("Human")
|
||||
|
||||
addBodyLocationBefore("TOC_ArmRight", "Shoes")
|
||||
addBodyLocationBefore("TOC_ArmLeft", "Shoes")
|
||||
addBodyLocationBefore("TOC_LegLeft", "Shoes")
|
||||
addBodyLocationBefore("TOC_ArmRightProsthesis", "Shoes")
|
||||
addBodyLocationBefore("TOC_ArmLeftProsthesis", "Shoes")
|
||||
|
||||
|
||||
@@ -440,4 +440,20 @@ item ProthesisMag3
|
||||
ReplaceOnUse = ProthesisMag3,
|
||||
Tooltip = Tooltip_ProthesisMag2,
|
||||
}
|
||||
|
||||
item Amputation_Left_Foot
|
||||
{
|
||||
Weight = 1,
|
||||
Type = Clothing,
|
||||
DisplayCategory = Test,
|
||||
DisplayName = amp test foot,
|
||||
ClothingItem = Amputation_Left_Foot,
|
||||
BodyLocation = TOC_LegLeft,
|
||||
BloodLocation = Hands,
|
||||
Icon = woodenHook,
|
||||
Tooltip = test,
|
||||
CanHaveHoles = false,
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user