fix to audio, gonna rewrite a lot of mp\client stuff
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<animNode x_extends="turn_idle_180.xml">
|
|
||||||
<m_Name>turn_idle_180L_craw;</m_Name>
|
|
||||||
<m_AnimName>Zombie_Crawl</m_AnimName>
|
|
||||||
<m_Conditions />
|
|
||||||
<m_Conditions />
|
|
||||||
<m_Conditions />
|
|
||||||
<m_Conditions />
|
|
||||||
<m_Conditions>
|
|
||||||
<m_Name>IsCrawling</m_Name>
|
|
||||||
<m_Type>BOOL</m_Type>
|
|
||||||
<m_BoolValue>true</m_BoolValue>
|
|
||||||
</m_Conditions>
|
|
||||||
</animNode>
|
|
||||||
@@ -1,21 +1,11 @@
|
|||||||
-- Synchronization and MP related stuff
|
------------------------------------------
|
||||||
|
-------- THE ONLY CURE BUT BETTER --------
|
||||||
|
------------------------------------------
|
||||||
|
------------ CLIENT COMMANDS -------------
|
||||||
|
|
||||||
|
|
||||||
local Commands = {}
|
local Commands = {}
|
||||||
|
|
||||||
Commands["ResponseCanAct"] = function(arg)
|
|
||||||
|
|
||||||
|
|
||||||
print("TOC: ResponseCanAct")
|
|
||||||
local ui = GetConfirmUIMP()
|
|
||||||
ui.responseReceive = true
|
|
||||||
ui.responseAction = arg["toSend"][2]
|
|
||||||
ui.responsePartName = arg["toSend"][1]
|
|
||||||
ui.responseCan = arg["toSend"][3]
|
|
||||||
ui.responseUserName = getPlayerByOnlineID(arg["From"]):getUsername()
|
|
||||||
ui.responseActionIsBitten = getPlayerByOnlineID(arg["From"]):getBodyDamage():getBodyPart(TocGetBodyPartFromPartName(ui
|
|
||||||
.responsePartName)):bitten()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function SendCutLimb(player, part_name, surgeon_factor, bandage_table, painkiller_table)
|
function SendCutLimb(player, part_name, surgeon_factor, bandage_table, painkiller_table)
|
||||||
local arg = {}
|
local arg = {}
|
||||||
@@ -25,7 +15,7 @@ function SendCutLimb(player, part_name, surgeon_factor, bandage_table, painkille
|
|||||||
|
|
||||||
|
|
||||||
-- TODO Hotfix for sound, fix this later
|
-- TODO Hotfix for sound, fix this later
|
||||||
arg["toSend"] = {part_name, surgeon_factor, bandage_table, painkiller_table, getPlayer():getOnlineID()}
|
arg["toSend"] = {part_name, surgeon_factor, bandage_table, painkiller_table}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -103,13 +93,30 @@ function AskCanUnequipProsthesis(player, part_name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Commands["ResponseCanAct"] = function(arg)
|
||||||
|
|
||||||
|
|
||||||
|
print("TOC: ResponseCanAct")
|
||||||
|
local ui = GetConfirmUIMP()
|
||||||
|
ui.responseReceive = true
|
||||||
|
ui.responseAction = arg["toSend"][2]
|
||||||
|
ui.responsePartName = arg["toSend"][1]
|
||||||
|
ui.responseCan = arg["toSend"][3]
|
||||||
|
ui.responseUserName = getPlayerByOnlineID(arg["From"]):getUsername()
|
||||||
|
ui.responseActionIsBitten = getPlayerByOnlineID(arg["From"]):getBodyDamage():getBodyPart(TocGetBodyPartFromPartName(ui
|
||||||
|
.responsePartName)):bitten()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Patient (receive)
|
-- Patient (receive)
|
||||||
Commands["CutLimb"] = function(arg)
|
Commands["CutLimb"] = function(arg)
|
||||||
local arg = arg["toSend"]
|
local arg = arg["toSend"]
|
||||||
local surgeon_id = arg[5]
|
--local surgeon_id = arg[5]
|
||||||
|
|
||||||
-- Disable the sound coming from the surgeon
|
-- Disable the sound coming from the surgeon
|
||||||
getPlayerByOnlineID(surgeon_id):getEmitter():stopSoundByName("Amputation_Sound")
|
--getPlayerByOnlineID(surgeon_id):getEmitter():stopSoundByName("Amputation_Sound")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +128,6 @@ Commands["OperateLimb"] = function(arg)
|
|||||||
TocOperateLimb(arg[1], arg[2], arg[3])
|
TocOperateLimb(arg[1], arg[2], arg[3])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Commands["EquipProsthesis"] = function(arg)
|
Commands["EquipProsthesis"] = function(arg)
|
||||||
|
|
||||||
-- part_name = arg[1]
|
-- part_name = arg[1]
|
||||||
@@ -208,8 +214,6 @@ Commands["AcceptResetEverything"] = function(arg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Cut Limb stuff
|
-- Cut Limb stuff
|
||||||
Commands["AcceptDamageOtherPlayer"] = function(arg)
|
Commands["AcceptDamageOtherPlayer"] = function(arg)
|
||||||
|
|
||||||
@@ -219,8 +223,6 @@ Commands["AcceptDamageOtherPlayer"] = function(arg)
|
|||||||
TocDamagePlayerDuringAmputation(patient, part_name)
|
TocDamagePlayerDuringAmputation(patient, part_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- ANIMATIONS
|
-- ANIMATIONS
|
||||||
-----------------------
|
-----------------------
|
||||||
Commands["SetCrawlAnimation"] = function(args)
|
Commands["SetCrawlAnimation"] = function(args)
|
||||||
@@ -241,6 +243,31 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------
|
||||||
|
--- GENERIC COMMANDS ---------
|
||||||
|
|
||||||
|
Commands["StopAmputationSound"] = function(args)
|
||||||
|
|
||||||
|
local player = getPlayerByOnlineID(args.surgeon_id)
|
||||||
|
print("TOC: Running StopAmputationSound for " .. player:getUsername())
|
||||||
|
|
||||||
|
player:getEmitter():stopSoundByName("Amputation_Sound")
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Base stuff
|
-- Base stuff
|
||||||
local function OnTocServerCommand(module, command, args)
|
local function OnTocServerCommand(module, command, args)
|
||||||
@@ -263,7 +290,7 @@ Events.OnServerCommand.Add(OnTocServerCommand)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------- TEST -----------------------------
|
---------------------------------- Global Mod Data -----------------------------
|
||||||
|
|
||||||
|
|
||||||
function TOC_OnReceiveGlobalModData(key, modData)
|
function TOC_OnReceiveGlobalModData(key, modData)
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function TocReapplyAmputationClothingItem(mod_data)
|
local function TocReapplyAmputationClothingItem(mod_data)
|
||||||
local player = getPlayer()
|
local player = getPlayer()
|
||||||
local player_inv = player:getInventory()
|
local player_inv = player:getInventory()
|
||||||
@@ -40,7 +45,7 @@ function TocCheckCompatibilityWithOlderVersions(mod_data)
|
|||||||
print("TOC: Something was wrongly initiliazed before. Resetting parameters")
|
print("TOC: Something was wrongly initiliazed before. Resetting parameters")
|
||||||
TocResetEverything()
|
TocResetEverything()
|
||||||
else
|
else
|
||||||
print("TOC: Found compatible data, correcting models in case of errors")
|
print("TOC: Found compatible data, correcting models in case of errors and adding limbs")
|
||||||
TocReapplyAmputationClothingItem(mod_data)
|
TocReapplyAmputationClothingItem(mod_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -78,11 +78,6 @@ local function TocUpdateBaseData(mod_data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if limb == "Hand" then
|
if limb == "Hand" then
|
||||||
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1700
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1700
|
||||||
mod_data.TOC.Limbs[part_name].depends_on = {}
|
mod_data.TOC.Limbs[part_name].depends_on = {}
|
||||||
|
|||||||
@@ -23,7 +23,12 @@ end
|
|||||||
|
|
||||||
function ISCutLimb:stop()
|
function ISCutLimb:stop()
|
||||||
|
|
||||||
|
print("Stopping ISCutLimb")
|
||||||
self.surgeon:getEmitter():stopSoundByName("Amputation_Sound")
|
self.surgeon:getEmitter():stopSoundByName("Amputation_Sound")
|
||||||
|
sendClientCommand(self.surgeon, "TOC", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
||||||
|
|
||||||
|
-- TODO test this with more than 2 players
|
||||||
|
-- TODO this gets bugged when player dies while amputating
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -115,6 +120,7 @@ function ISCutLimb:perform()
|
|||||||
|
|
||||||
if self.patient ~= self.surgeon and isClient() then
|
if self.patient ~= self.surgeon and isClient() then
|
||||||
SendCutLimb(self.patient, self.part_name, surgeon_factor, bandage_table, painkiller_table)
|
SendCutLimb(self.patient, self.part_name, surgeon_factor, bandage_table, painkiller_table)
|
||||||
|
sendClientCommand(self.surgeon, "TOC", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
||||||
else
|
else
|
||||||
TocCutLimb(self.part_name, surgeon_factor, bandage_table, painkiller_table)
|
TocCutLimb(self.part_name, surgeon_factor, bandage_table, painkiller_table)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -47,6 +47,18 @@ TOC_Commands["AskToResetEverything"] = function(_, arg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
TOC_Commands.AskStopAmputationSound = function(_, args)
|
||||||
|
|
||||||
|
print("TOC: We're in AskStopAmputationSound")
|
||||||
|
sendServerCommand("TOC", "StopAmputationSound", {surgeon_id = args.surgeon_id})
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
TOC_Commands.ChangePlayerState = function(playerObj, args)
|
||||||
|
ModData.get("TOC_PLAYER_DATA")[playerObj:getUsername()] = args
|
||||||
|
ModData.transmit("TOC_PLAYER_DATA")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
------ Global Mod Data -----------
|
------ Global Mod Data -----------
|
||||||
@@ -57,8 +69,14 @@ end
|
|||||||
|
|
||||||
Events.OnInitGlobalModData.Add(TOC_OnInitGlobalModData)
|
Events.OnInitGlobalModData.Add(TOC_OnInitGlobalModData)
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TOC_Commands.OnClientCommand = function(module, command, playerObj, args)
|
TOC_Commands.OnClientCommand = function(module, command, playerObj, args)
|
||||||
|
|
||||||
|
print("TOC: Running ClientCommand " .. command)
|
||||||
if module == 'TOC' and TOC_Commands[command] then
|
if module == 'TOC' and TOC_Commands[command] then
|
||||||
TOC_Commands[command](playerObj, args)
|
TOC_Commands[command](playerObj, args)
|
||||||
end
|
end
|
||||||
@@ -68,7 +86,3 @@ end
|
|||||||
Events.OnClientCommand.Add(TOC_Commands.OnClientCommand)
|
Events.OnClientCommand.Add(TOC_Commands.OnClientCommand)
|
||||||
|
|
||||||
|
|
||||||
TOC_Commands.ChangePlayerState = function(playerObj, args)
|
|
||||||
ModData.get("TOC_PLAYER_DATA")[playerObj:getUsername()] = args
|
|
||||||
ModData.transmit("TOC_PLAYER_DATA")
|
|
||||||
end
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local function addBodyLocationBefore(new_location, move_to_location)
|
local function AddBodyLocationBefore(new_location, move_to_location)
|
||||||
local group = BodyLocations.getGroup("Human")
|
local group = BodyLocations.getGroup("Human")
|
||||||
local list = getClassFieldVal(group, getClassField(group, 1))
|
local list = getClassFieldVal(group, getClassField(group, 1))
|
||||||
group:getOrCreateLocation(new_location)
|
group:getOrCreateLocation(new_location)
|
||||||
@@ -10,17 +10,17 @@ local function addBodyLocationBefore(new_location, move_to_location)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
addBodyLocationBefore("TOC_ArmRight", "Shoes")
|
AddBodyLocationBefore("TOC_ArmRight", "Shoes")
|
||||||
addBodyLocationBefore("TOC_ArmLeft", "Shoes")
|
AddBodyLocationBefore("TOC_ArmLeft", "Shoes")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
addBodyLocationBefore("TOC_ArmRightProsthesis", "Shoes")
|
AddBodyLocationBefore("TOC_ArmRightProsthesis", "Shoes")
|
||||||
addBodyLocationBefore("TOC_ArmLeftProsthesis", "Shoes")
|
AddBodyLocationBefore("TOC_ArmLeftProsthesis", "Shoes")
|
||||||
|
|
||||||
addBodyLocationBefore("TOC_LegRight", "FannyPackFront")
|
AddBodyLocationBefore("TOC_LegRight", "FannyPackFront")
|
||||||
addBodyLocationBefore("TOC_LegLeft", "FannyPackFront")
|
AddBodyLocationBefore("TOC_LegLeft", "FannyPackFront")
|
||||||
|
|
||||||
|
|
||||||
addBodyLocationBefore("TOC_LegRightProsthesis", "FannyPackFront")
|
AddBodyLocationBefore("TOC_LegRightProsthesis", "FannyPackFront")
|
||||||
addBodyLocationBefore("TOC_LegLeftProsthesis", "FannyPackFront")
|
AddBodyLocationBefore("TOC_LegLeftProsthesis", "FannyPackFront")
|
||||||
|
|||||||
Reference in New Issue
Block a user