-
Posts
516 -
Joined
Posts posted by nolanri
-
-
8 minutes ago, IndigoRebel said:
I respect the game enough to join a forum. Hack it at making my own map, and voice my opinion.
But im not speaking from a "bwaaaah I want hats" place
I am 100% positive just even a hat feature would have had an effect on the sales better than any of their minor updates lately. Have you ever seen how apeshit people would go for a new hat sprite in Runescape. Even if it was compulsive buyers who only put 5 minutes into the games, its still money for the game.
So i feel they wasted their time.
And Un youre right
We dont know how long they can work on this project before theyre burnt.
And I notice that there are these simple map tools and mod tools in place just in case the devs did cease development so that the game could still try to thrive through the community alone.
The U.S. president is Trump right now.... anything can happen.
I would go pretty "apeshit " at being able to choose a hat
-
if you can't use absolute paths, you could just make the path to the map save folder relative to where you run the map tool.
-
There's always been the direct download links here, though often they are out of date. I just updated each.
http://undeniable.info/pz/DrivingCarsMod.php
http://undeniable.info/pz/Survivors.php -
Please add a "Run to" Timed action. Doesn't necessarily need to add it to right click on ground like walk to timed action
-
For future reference, since this was frustrating to calculate. Here is the method for all to use. it calculates the grid square that your mouse is over based on screen size and properly accounts for the Zoom level as well. using the center of the screen as a starting point.
local sw = (128 / getCore():getZoom(0)); local sh = (64 / getCore():getZoom(0)); local mapx = getPlayer():getX(); local mapy = getPlayer():getY(); local mousex = ( (getMouseX() - (getCore():getScreenWidth() / 2)) ) ; local mousey = ( (getMouseY() - (getCore():getScreenHeight() / 2)) ) ; local sx = mapx + (mousex / (sw/2) + mousey / (sh/2)) /2; local sy = mapy + (mousey / (sh/2) -(mousex / (sw/2))) /2; local TheSquareYourMouseIsOn = getCell():getGridSquare(sx,sy,getPlayer():getZ());
-
its should be
for i=0, actmods:size()-1, 1 do
Here is my function to check if a mod is enabled:
function isModEnabled(modname) local actmods = getActivatedMods(); for i=0, actmods:size()-1, 1 do if actmods:get(i) == modname then return true; end end return false; end
-
3D Models Showing now:
-
could you work on the switching for semi-auto to auto. now it deletes any attachments or ammo in the gun when you do it.
you could use
weapon:getModData().currentCapacity
weapon:getModData().roundChambered
weapon:getCanon();
weapon:getScope();
to save that stuff and then reset it to the new weapon after switching semiauto.
or just using nonsemiweapon:setType("ORGM.semiweapon");
just use setType to switch back and forth might work
-
- trombonaught, Hicks, grammarsalad and 1 other
- 4
-
-
IsoPlayer.class
public void setPlayerIndex(int newPlayerIndex)
{
this.PlayerIndex = newPlayerIndex;players[newPlayerIndex] = this;
}
please and thanks -
On 2017-01-22 at 1:14 PM, lazyman said:
So whenever i hit P, to view my armor, my entire inventory gets filled up with ammo, and guns, and books for how to shot and what not. I equipped some SWAT gear, but i dont know if it is actually doing anything of just clogging up my inventory.
sounds like you pressed the ORGM test button. YOur supposed to delete the test file to disable it. if you press it. you get 1 of EVERYTHING orgm in your inventory. I can't recall what key it is, i think it was delete or end, or something near that.
-
8 hours ago, blackteapie said:
A roll-up door is something like this. In the game these doors are usually located in large warehouse.
Players can't only destroy the door, but also the door frame, which means we will have to destroy all support at that tile.
that is technically just a wall. A wall that is colored to look like a door.
-
sure its possible,... just I did not have the end goal of the mod to be some kind of masterpiece. From the start I had bare bones in mind. So i just don't know how much more if any work will be done on this. I tell you it would be far more enjoyable to work on if there was a bug and problem free working Survivor class I could work with. This system uses Players class as survivors which causes a boat load of problems, the major problems have been worked around but it still frustrating. Im especially sick of trying to explain to people how to paste java files in their install dir.
-
Spoiler
--[[
Injury Detection And Armor Based Injury Blocking
By Nolan Ritchie
]]
ArmorTempBodyDamage = {};
function loadArmorToPlayer(Armor, player)
ArmorSaveBodyDamage(player);
loadArmor(Armor);
endfunction getBodyPartDisplayName(TypeIn)
BPType = tostring(TypeIn);
if(BPType == "Foot_L") then return "Left Foot";
elseif(BPType == "Foot_R") then return "Right Foot";
elseif(BPType == "ForeArm_L") then return "Left Fore Arm";
elseif(BPType == "ForeArm_R") then return "Right Fore Arm";
elseif(BPType == "Hand_L") then return "Left Hand";
elseif(BPType == "Hand_R") then return "Right Hand";
elseif(BPType == "LowerLeg_L") then return "Left Lower Leg";
elseif(BPType == "LowerLeg_R") then return "Right Lower Leg";
elseif(BPType == "Torso_Lower") then return "Lower Torso";
elseif(BPType == "Torso_Upper") then return "Upper Torso";
elseif(BPType == "UpperArm_L") then return "Left Upper Arm";
elseif(BPType == "UpperArm_R") then return "Right Upper Arm";
elseif(BPType == "UpperLeg_L") then return "Left Upper Leg";
elseif(BPType == "UpperLeg_R") then return "Right Upper Leg";
else return BPType;
endend
function ExamineArmor(items, result, player)
for i=0, items:size()-1 do
Armor = items:get(i);
end
loadArmor(Armor);
local out = "Remaining Durability: " .. tostring(Armor:getModData().Durability) .. "\n";
local BPs = player:getBodyDamage():getBodyParts();
for i=0, BPs:size()-1 do
if(Armor:getModData().ScratchRes ~= nil) and (Armor:getModData().ScratchRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().ScratchRes[tostring(BPs:get(i):getType())]).. "%" .. " chance to block Scratches on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().DeepWoundRes ~= nil) and (Armor:getModData().DeepWoundRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().DeepWoundRes[tostring(BPs:get(i):getType())]).. "%" .. " Chance to block to Deep Wounds on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BiteRes ~= nil) and (Armor:getModData().BiteRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BiteRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Bites on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().GlassRes ~= nil) and (Armor:getModData().GlassRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().GlassRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Glass on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().FractureRes ~= nil) and (Armor:getModData().FractureRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().FractureRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Fractures on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BurnRes ~= nil) and (Armor:getModData().BurnRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BurnRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Burns on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BulletRes ~= nil) and (Armor:getModData().BulletRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BulletRes[tostring(BPs:get(i):getType())]).. "%" .. " Chance to block to Bullets on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
end
out = Armor:getDisplayName() .. "\n" .. out;
ArmorWindow:setText(out);
ArmorWindow:setVisible(true);
--player:Say();
endfunction ArmorSaveBodyDamage(player)
--player:Say("Saving body damage");
local BD = player:getBodyDamage();
--local InjuryTypes = {0 = "Scratch",1 = "DeepWound", 2 = "Burn", 3 = "BulletRes", 4 = "Fracture", 5 = "Glass"};
ArmorTempBodyDamage["IsInfected"] = BD:IsInfected();
local BPs = BD:getBodyParts();
for i=0, BPs:size()-1 do
ArmorTempBodyDamage[tostring(BPs:get(i):getType())] = {Splint= false, Bandage = false, Bite = false, Scratch = false, DeepWound = false, Burn = false, Bullet = false, Fracture = false, Glass = false};
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Splint"] = BPs:get(i):isSplint();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bandage"] = BPs:get(i):bandaged();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Scratch"] = BPs:get(i):scratched();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["DeepWound"] = BPs:get(i):deepWounded();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Burn"] = BPs:get(i):getBurnTime();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"] = BPs:get(i):haveBullet();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Fracture"] = BPs:get(i):getFractureTime();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"] = BPs:get(i):haveGlass();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bite"] = BPs:get(i):bitten();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["HasInjury"] = BPs:get(i):HasInjury()
end
ArmorBDamageSaved = true;
endfunction tryBlock(BodyPartType, InjuryType, ArmorType, player)
local Armor = player:getInventory():getItemFromType(ArmorType);
if(InjuryType == "Scratch") then
if(Armor:getModData().ScratchRes ~= nil) and (Armor:getModData().ScratchRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().ScratchRes[BodyPartType] );
end
elseif(InjuryType == "DeepWound") then
if((Armor:getModData().DeepWoundRes ~= nil) and Armor:getModData().DeepWoundRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().DeepWoundRes[BodyPartType] );
end
elseif(InjuryType == "Bite") then
if(Armor:getModData().BiteRes ~= nil) and (Armor:getModData().BiteRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BiteRes[BodyPartType] );
end
elseif(InjuryType == "Fracture") then
if(Armor:getModData().FractureRes ~= nil) and (Armor:getModData().FractureRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().FractureRes[BodyPartType] );
end
elseif(InjuryType == "Burn") then
if(Armor:getModData().BurnRes ~= nil) and (Armor:getModData().BurnRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BurnRes[BodyPartType] );
end
elseif(InjuryType == "Glass") then
if(Armor:getModData().GlassRes ~= nil) and (Armor:getModData().GlassRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().GlassRes[BodyPartType] );
end
elseif(InjuryType == "Bullet") then
if(Armor:getModData().BulletRes ~= nil) and (Armor:getModData().BulletRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BulletRes[BodyPartType] );
end
endend
function EquipAsShield(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
if (player:getSecondaryHandItem() == player:getPrimaryHandItem()) then
player:setPrimaryHandItem(nil);
end
player:setSecondaryHandItem(items:get(i));
player:getModData().ShieldArmor = items:get(i):getType();
end
end
function EquipOnHead(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().HeadArmor = items:get(i):getType();
end
end
function EquipOnHands(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().HandArmor = items:get(i):getType();
end
end
function EquipOnArms(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().ArmArmor = items:get(i):getType();
end
end
function EquipOnLegs(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().LegArmor = items:get(i):getType();
end
end
function EquipOnChest(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().ChestArmor = items:get(i):getType();
end
end
function EquipOnFeet(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().FootArmor = items:get(i):getType();
end
endfunction DamageArmor(Armor, player, InjuryType)
local Damage = 1;
if(InjuryType == "Scratch") then
Damage = 1;
elseif(InjuryType == "DeepWound") then
Damage = 3;
elseif(InjuryType == "Bite") then
Damage = 2;
elseif(InjuryType == "Fracture") then
Damage = 3;
elseif(InjuryType == "Burn") then
Damage = 2;
elseif(InjuryType == "Glass") then
Damage = 2;
elseif(InjuryType == "Bullet") then
Damage = 5;
endlocal isBroken = false;
Armor:getModData().Durability = Armor:getModData().Durability - Damage;
if (Armor:getModData().Durability <= 0) then
isBroken = true;
if(Armor:getModData().onBreakTurnInto ~= nil) then
player:Say("adding broken armor" .. Armor:getModData().onBreakTurnInto);
player:getInventory():AddItem(Armor:getModData().onBreakTurnInto);
end
player:getInventory():Remove(Armor);
end
return isBroken;
endfunction wasDamagedBlocked(BodyPartType, InjuryType, player)
if(ArmorTempBodyDamage[tostring(BodyPartType)]["Glass"] == true) or (ArmorTempBodyDamage[tostring(BodyPartType)]["Bullet"] == true) or (ArmorTempBodyDamage[tostring(BodyPartType)]["HasInjury"] == true) or (ArmorTempBodyDamage[tostring(BodyPartType)]["Bandage"] == true) or (ArmorTempBodyDamage[tostring(BodyPartType)]["Splint"] == true) then
return false;
end
--player:Say("trying to block:"..tostring(BodyPartType));if(player:getSecondaryHandItem() ~= nil) then
if(player:getModData().ShieldArmor ~= nil) and (player:getSecondaryHandItem():getType() == player:getModData().ShieldArmor) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ShieldArmor, player) == true) then
if(DamageArmor(player:getInventory():getItemFromType(player:getModData().ShieldArmor),player,InjuryType) == true) then
player:setSecondaryHandItem(nil);
end
return true;
end
end
end
if(player:getModData().HeadArmor ~= nil) and (player:getInventory():contains(player:getModData().HeadArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().HeadArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().HeadArmor),player,InjuryType);
return true;
end
end
if(player:getModData().HandArmor ~= nil) and (player:getInventory():contains(player:getModData().HandArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().HandArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().HandArmor),player,InjuryType);
return true;
end
end
if(player:getModData().ArmArmor ~= nil) and (player:getInventory():contains(player:getModData().ArmArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ArmArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().ArmArmor),player,InjuryType);
return true;
end
end
if(player:getModData().ChestArmor ~= nil) and (player:getInventory():contains(player:getModData().ChestArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ChestArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().ChestArmor),player,InjuryType);
return true;
end
end
if(player:getModData().LegArmor ~= nil) and (player:getInventory():contains(player:getModData().LegArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().LegArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().LegArmor),player,InjuryType);
return true;
end
end
if(player:getModData().FootArmor ~= nil) and (player:getInventory():contains(player:getModData().FootArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().FootArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().FootArmor),player,InjuryType);
return true;
end
endreturn false;
endfunction healBodyPart(bodyPart, player, BD)
bodyPart:SetInfected(false);
bodyPart:setInfectedWound(false);
bodyPart:setWoundInfectionLevel(0);
bodyPart:SetFakeInfected(false);
if(ArmorTempBodyDamage["IsInfected"] == false) and (BD:IsInfected() == true) then
BD:setInf(false); -- remove infection if did not have before the blocked scratch
BD:setInfectionLevel(0);
end
bodyPart:RestoreToFullHealth();
bodyPart:DamageUpdate() ;
player:Say("!");
sendClientCommand(player, "Armor", "Say", {saythis = "!"});
endfunction ArmorCheckForDamage(player)
local ArmorbInjuryDetected = false;
if(ArmorBDamageSaved ~= nil) and (player ~= nil) then
local BD = player:getBodyDamage();
--local InjuryTypes = {0 = "Scratch",1 = "DeepWound", 2 = "Burn", 3 = "BulletRes", 4 = "Fracture", 5 = "Glass"};
--ArmorTempBodyDamage["IsInfected"] = BD:IsInfected();
local BPs = BD:getBodyParts();
for i=0, BPs:size()-1 do
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Scratch"] ~= BPs:get(i):scratched()) and (BPs:get(i):scratched() == true) then
--player:Say("Scratch Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Scratch", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["DeepWound"] ~= BPs:get(i):deepWounded()) and (BPs:get(i):deepWounded() == true) and (BPs:get(i):haveBullet() == false) and (BPs:get(i):haveGlass() == false) then
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"]) or (ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"]) then
ArmorbInjuryDetected = true;
else
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "DeepWound", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bite"] ~= BPs:get(i):bitten()) and (BPs:get(i):bitten() == true) then
--player:Say("Bite Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Bite", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Burn"] ~= BPs:get(i):getBurnTime()) and (BPs:get(i):getBurnTime() ~= 0) then
--player:Say("Burn Detected on ".. tostring(BPs:get(i):getType()) );
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Burn", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"] ~= BPs:get(i):haveBullet()) and (BPs:get(i):haveBullet() == true) and (BPs:get(i):deepWounded() == false) then
--player:Say("Lodged Bullets Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Bullet", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Fracture"] ~= BPs:get(i):getFractureTime()) and (BPs:get(i):getFractureTime() ~= 0) and (BPs:get(i):isSplint() == false) then
--player:Say("Fracture Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Fracture", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"] ~= BPs:get(i):haveGlass()) and (BPs:get(i):haveGlass() == true) and (BPs:get(i):deepWounded() == false) then
--player:Say("Logged Glass Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Glass", player) == true) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
end
end
if(ArmorbInjuryDetected) then
ArmorSaveBodyDamage(player);
end
return ArmorbInjuryDetected;
endlocal UCount = 0;
function ArmorupdateThePlayer(player)
UCount = UCount + 1;
ArmorCheckForDamage(player);
--if(UCount % 15 == 0) then ArmorSaveBodyDamage(player) end
player:getInventory():Remove("HCEquiparmor");
endfunction ArmorInit()
ArmorSaveBodyDamage(getPlayer());
end
function ArmorKeysUp(keynum)
--getPlayer():Say(tostring(keynum));
if keynum == 25 then
local player = getPlayer();
local armorstring = "Currently Equipped Armor \n";
if(player:getModData().ShieldArmor ~= nil) and (player:getSecondaryHandItem() ~= nil) and (player:getSecondaryHandItem():getType() == player:getModData().ShieldArmor) then
armorstring = armorstring .. "Shield: " .. player:getInventory():getItemFromType(player:getModData().ShieldArmor):getDisplayName() .. "\n";
end
if(player:getModData().HeadArmor ~= nil) and (player:getInventory():contains(player:getModData().HeadArmor)) then
armorstring = armorstring .. "Helmet: " .. player:getInventory():getItemFromType(player:getModData().HeadArmor):getDisplayName() .. "\n";
end
if(player:getModData().HandArmor ~= nil) and (player:getInventory():contains(player:getModData().HandArmor)) then
armorstring = armorstring .. "Hands: " .. player:getInventory():getItemFromType(player:getModData().HandArmor):getDisplayName() .. "\n";
end
if(player:getModData().ArmArmor ~= nil) and (player:getInventory():contains(player:getModData().ArmArmor)) then
armorstring = armorstring .. "Arms: " .. player:getInventory():getItemFromType(player:getModData().ArmArmor):getDisplayName() .. "\n";
end
if(player:getModData().LegArmor ~= nil) and (player:getInventory():contains(player:getModData().LegArmor)) then
armorstring = armorstring .. "Legs: " .. player:getInventory():getItemFromType(player:getModData().LegArmor):getDisplayName() .. "\n";
end
if(player:getModData().ChestArmor ~= nil) and (player:getInventory():contains(player:getModData().ChestArmor)) then
armorstring = armorstring .. "Chest: " .. player:getInventory():getItemFromType(player:getModData().ChestArmor):getDisplayName() .. "\n";
end
if(player:getModData().FootArmor ~= nil) and (player:getInventory():contains(player:getModData().FootArmor)) then
armorstring = armorstring .. "Feet: " .. player:getInventory():getItemFromType(player:getModData().FootArmor):getDisplayName() .. "\n";
end
ArmorWindow:setText(armorstring);
ArmorWindow:setVisible(true);
end
endEvents.OnKeyPressed.Add(ArmorKeysUp);
Events.OnPlayerUpdate.Add(ArmorupdateThePlayer);
Events.OnGameStart.Add(ArmorInit);okay. 3rd times the charm. hopfully the final fix for armor.lua
tested and observed fix of bug healing injuries by equipping to body parts already injuredtested and observed fix of bug healing by removing glass or bullets with armor guarding deep wounds on subject body part
tested and observed fix of bug, infection now blocked if armor blocked a injury that resulted in an infection IF there was no infection before the block
AND i made sure i am sending you the file that i edited and not some older random version. -
someone try setting a house on fire and see what happens. Fire changes the walls to "burnt" version of the same wall doesnt really delete walls so I dont think the upper floors would fall down in the case of fire.
what happens if there is containers and items and such on the ground in upper floors? will they fall to the ground?
-
does this use like a sledgehamemr event? or would it work no matter how the walls get destroyed? like by fire or car collisions?
-
9 hours ago, Hydromancerx said:
That's was one of the errors that was back in when the recent code was updated. It should be re-fixed next update.
Yeah this should be fixed with update today. This happened because removing the bandage made it seem like the injury appeared the moment your removed the bandage. Now it will not heal if the previous state of the body part was bandaged or splinted before the injury was detected. This means however that even real injuries will not be blocked on body parts that are bandaged. For example. if your chest is bandaged, and your wearing riot armor. you cannot block any injury to the chest. because this system has no way to tell the difference between an injury appear from "bandaged body part being injured" or from "removing a bandage and exposing an injury". Without a proper injury event, it's not possible to tell the difference.
so in short the exploits will be gone, BUT your already injured body parts are STILL vulnerable even if you have armor blocking them. which ..kind of makes sense in a small way, because an injury does make you more sensitive and vulnerable then compared to not having an injury.
-
1 minute ago, Jason132 said:
i got scratched while wearing riot armor, the ! above my head appeared signalling it blocked it and the health panel didn't show any damage but later that day i got a fever and turned into a zombie. So i think the armor blocked the scratch itself but not the zombie virus?
yeah that was a known problem for a while. And i think it will also be addressed with this update. I let myself be attacked by 4 zombies for a number of minutes with 100% block and then afterwards i waited for 24 hours in game and hp was not going down and i was not sick so, my testing went well anyway. we\ll see how it goes after next update.
-
Spoiler
--[[
Injury Detection And Armor Based Injury Blocking
By Nolan Ritchie
]]function loadArmorToPlayer(Armor, player)
loadArmor(Armor);
ArmorSaveBodyDamage(player);
endfunction getBodyPartDisplayName(TypeIn)
BPType = tostring(TypeIn);
if(BPType == "Foot_L") then return "Left Foot";
elseif(BPType == "Foot_R") then return "Right Foot";
elseif(BPType == "ForeArm_L") then return "Left Fore Arm";
elseif(BPType == "ForeArm_R") then return "Right Fore Arm";
elseif(BPType == "Hand_L") then return "Left Hand";
elseif(BPType == "Hand_R") then return "Right Hand";
elseif(BPType == "LowerLeg_L") then return "Left Lower Leg";
elseif(BPType == "LowerLeg_R") then return "Right Lower Leg";
elseif(BPType == "Torso_Lower") then return "Lower Torso";
elseif(BPType == "Torso_Upper") then return "Upper Torso";
elseif(BPType == "UpperArm_L") then return "Left Upper Arm";
elseif(BPType == "UpperArm_R") then return "Right Upper Arm";
elseif(BPType == "UpperLeg_L") then return "Left Upper Leg";
elseif(BPType == "UpperLeg_R") then return "Right Upper Leg";
else return BPType;
endend
function ExamineArmor(items, result, player)
for i=0, items:size()-1 do
Armor = items:get(i);
end
loadArmor(Armor);
local out = "Remaining Durability: " .. tostring(Armor:getModData().Durability) .. "\n";
local BPs = player:getBodyDamage():getBodyParts();
for i=0, BPs:size()-1 do
if(Armor:getModData().ScratchRes ~= nil) and (Armor:getModData().ScratchRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().ScratchRes[tostring(BPs:get(i):getType())]).. "%" .. " chance to block Scratches on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().DeepWoundRes ~= nil) and (Armor:getModData().DeepWoundRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().DeepWoundRes[tostring(BPs:get(i):getType())]).. "%" .. " Chance to block to Deep Wounds on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BiteRes ~= nil) and (Armor:getModData().BiteRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BiteRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Bites on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().GlassRes ~= nil) and (Armor:getModData().GlassRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().GlassRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Glass on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().FractureRes ~= nil) and (Armor:getModData().FractureRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().FractureRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Fractures on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BurnRes ~= nil) and (Armor:getModData().BurnRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BurnRes[tostring(BPs:get(i):getType())]) .. "%".. " Chance to block to Burns on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
if(Armor:getModData().BulletRes ~= nil) and (Armor:getModData().BulletRes[tostring(BPs:get(i):getType())] ~= nil) then
out = out .. tostring(Armor:getModData().BulletRes[tostring(BPs:get(i):getType())]).. "%" .. " Chance to block to Bullets on the " .. getBodyPartDisplayName(BPs:get(i):getType()) .. "\n";
end
end
out = Armor:getDisplayName() .. "\n" .. out;
ArmorWindow:setText(out);
ArmorWindow:setVisible(true);
--player:Say();
endfunction ArmorSaveBodyDamage(player)
ArmorTempBodyDamage = {};
local BD = player:getBodyDamage();
--local InjuryTypes = {0 = "Scratch",1 = "DeepWound", 2 = "Burn", 3 = "BulletRes", 4 = "Fracture", 5 = "Glass"};
ArmorTempBodyDamage["IsInfected"] = BD:IsInfected();
local BPs = BD:getBodyParts();
for i=0, BPs:size()-1 do
ArmorTempBodyDamage[tostring(BPs:get(i):getType())] = {Splint= false, Bandage = false, Bite = false, Scratch = false, DeepWound = false, Burn = false, Bullet = false, Fracture = false, Glass = false};
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Splint"] = BPs:get(i):isSplint();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bandage"] = BPs:get(i):bandaged();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Scratch"] = BPs:get(i):scratched();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["DeepWound"] = BPs:get(i):deepWounded();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Burn"] = BPs:get(i):getBurnTime();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"] = BPs:get(i):haveBullet();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Fracture"] = BPs:get(i):getFractureTime();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"] = BPs:get(i):haveGlass();
ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bite"] = BPs:get(i):bitten();
end
ArmorBDamageSaved = true;
endfunction tryBlock(BodyPartType, InjuryType, ArmorType, player)
local Armor = player:getInventory():getItemFromType(ArmorType);
if(InjuryType == "Scratch") then
if(Armor:getModData().ScratchRes ~= nil) and (Armor:getModData().ScratchRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().ScratchRes[BodyPartType] );
end
elseif(InjuryType == "DeepWound") then
if((Armor:getModData().DeepWoundRes ~= nil) and Armor:getModData().DeepWoundRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().DeepWoundRes[BodyPartType] );
end
elseif(InjuryType == "Bite") then
if(Armor:getModData().BiteRes ~= nil) and (Armor:getModData().BiteRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BiteRes[BodyPartType] );
end
elseif(InjuryType == "Fracture") then
if(Armor:getModData().FractureRes ~= nil) and (Armor:getModData().FractureRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().FractureRes[BodyPartType] );
end
elseif(InjuryType == "Burn") then
if(Armor:getModData().BurnRes ~= nil) and (Armor:getModData().BurnRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BurnRes[BodyPartType] );
end
elseif(InjuryType == "Glass") then
if(Armor:getModData().GlassRes ~= nil) and (Armor:getModData().GlassRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().GlassRes[BodyPartType] );
end
elseif(InjuryType == "Bullet") then
if(Armor:getModData().BulletRes ~= nil) and (Armor:getModData().BulletRes[BodyPartType] ~= nil) then
return ( (ZombRand(100)+1) < Armor:getModData().BulletRes[BodyPartType] );
end
endend
function EquipAsShield(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
if (player:getSecondaryHandItem() == player:getPrimaryHandItem()) then
player:setPrimaryHandItem(nil);
end
player:setSecondaryHandItem(items:get(i));
player:getModData().ShieldArmor = items:get(i):getType();
end
end
function EquipOnHead(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().HeadArmor = items:get(i):getType();
end
end
function EquipOnHands(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().HandArmor = items:get(i):getType();
end
end
function EquipOnArms(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().ArmArmor = items:get(i):getType();
end
end
function EquipOnLegs(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().LegArmor = items:get(i):getType();
end
end
function EquipOnChest(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().ChestArmor = items:get(i):getType();
end
end
function EquipOnFeet(items, result, player) -- Recipe must only have one ingredient which is the armor, and be set to "keep"
for i=0, items:size()-1 do
loadArmorToPlayer(items:get(i), player);
player:getModData().FootArmor = items:get(i):getType();
end
endfunction DamageArmor(Armor, player, InjuryType)
local Damage = 1;
if(InjuryType == "Scratch") then
Damage = 1;
elseif(InjuryType == "DeepWound") then
Damage = 3;
elseif(InjuryType == "Bite") then
Damage = 2;
elseif(InjuryType == "Fracture") then
Damage = 3;
elseif(InjuryType == "Burn") then
Damage = 2;
elseif(InjuryType == "Glass") then
Damage = 2;
elseif(InjuryType == "Bullet") then
Damage = 5;
endlocal isBroken = false;
Armor:getModData().Durability = Armor:getModData().Durability - Damage;
if (Armor:getModData().Durability <= 0) then
isBroken = true;
if(Armor:getModData().onBreakTurnInto ~= nil) then
player:Say("adding broken armor" .. Armor:getModData().onBreakTurnInto);
player:getInventory():AddItem(Armor:getModData().onBreakTurnInto);
end
player:getInventory():Remove(Armor);
end
return isBroken;
endfunction wasDamagedBlocked(BodyPartType, InjuryType, player)
if(ArmorTempBodyDamage[tostring(BodyPartType)]["Bandage"] == true) or (ArmorTempBodyDamage[tostring(BodyPartType)]["Splint"] == true) then
return false;
endif(player:getSecondaryHandItem() ~= nil) then
if(player:getModData().ShieldArmor ~= nil) and (player:getSecondaryHandItem():getType() == player:getModData().ShieldArmor) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ShieldArmor, player) == true) then
if(DamageArmor(player:getInventory():getItemFromType(player:getModData().ShieldArmor),player,InjuryType) == true) then
player:setSecondaryHandItem(nil);
end
return true;
end
end
end
if(player:getModData().HeadArmor ~= nil) and (player:getInventory():contains(player:getModData().HeadArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().HeadArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().HeadArmor),player,InjuryType);
return true;
end
end
if(player:getModData().HandArmor ~= nil) and (player:getInventory():contains(player:getModData().HandArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().HandArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().HandArmor),player,InjuryType);
return true;
end
end
if(player:getModData().ArmArmor ~= nil) and (player:getInventory():contains(player:getModData().ArmArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ArmArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().ArmArmor),player,InjuryType);
return true;
end
end
if(player:getModData().ChestArmor ~= nil) and (player:getInventory():contains(player:getModData().ChestArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().ChestArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().ChestArmor),player,InjuryType);
return true;
end
end
if(player:getModData().LegArmor ~= nil) and (player:getInventory():contains(player:getModData().LegArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().LegArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().LegArmor),player,InjuryType);
return true;
end
end
if(player:getModData().FootArmor ~= nil) and (player:getInventory():contains(player:getModData().FootArmor)) then
if(tryBlock(BodyPartType, InjuryType, player:getModData().FootArmor, player) == true) then
DamageArmor(player:getInventory():getItemFromType(player:getModData().FootArmor),player,InjuryType);
return true;
end
endreturn false;
endfunction healBodyPart(bodyPart, player, BD)
bodyPart:SetInfected(false);
bodyPart:setInfectedWound(false);
bodyPart:setWoundInfectionLevel(0);
bodyPart:SetFakeInfected(false);
if(ArmorTempBodyDamage["IsInfected"] == false) and (BD:IsInfected() == true) then
BD:setInf(false); -- remove infection if did not have before the blocked scratch
BD:setInfectionLevel(0);
end
bodyPart:RestoreToFullHealth();
bodyPart:DamageUpdate() ;
player:Say("!");
sendClientCommand(player, "Armor", "Say", {saythis = "!"});
endfunction ArmorCheckForDamage(player)
local ArmorbInjuryDetected = false;
if(ArmorBDamageSaved ~= nil) and (player ~= nil) then
local BD = player:getBodyDamage();
--local InjuryTypes = {0 = "Scratch",1 = "DeepWound", 2 = "Burn", 3 = "BulletRes", 4 = "Fracture", 5 = "Glass"};
--ArmorTempBodyDamage["IsInfected"] = BD:IsInfected();
local BPs = BD:getBodyParts();
for i=0, BPs:size()-1 do
if(BPs:get(i):bandaged() == false) then
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Scratch"] ~= BPs:get(i):scratched()) and (BPs:get(i):scratched() == true) then
--player:Say("Scratch Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Scratch", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["DeepWound"] ~= BPs:get(i):deepWounded()) and (BPs:get(i):deepWounded() == true) and (BPs:get(i):haveBullet() == false) and (BPs:get(i):haveGlass() == false) then
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"]) or (ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"]) then
ArmorbInjuryDetected = true;
else
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "DeepWound", player)) then
healBodyPart(BPs:get(i), player, BD);
end
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bite"] ~= BPs:get(i):bitten()) and (BPs:get(i):bitten() == true) then
--player:Say("Bite Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Bite", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Burn"] ~= BPs:get(i):getBurnTime()) and (BPs:get(i):getBurnTime() ~= 0) then
--player:Say("Burn Detected on ".. tostring(BPs:get(i):getType()) );
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Burn", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Bullet"] ~= BPs:get(i):haveBullet()) and (BPs:get(i):haveBullet() == true) and (BPs:get(i):deepWounded() == false) then
--player:Say("Lodged Bullets Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Bullet", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Fracture"] ~= BPs:get(i):getFractureTime()) and (BPs:get(i):getFractureTime() ~= 0) and (BPs:get(i):isSplint() == false) then
--player:Say("Fracture Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Fracture", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
if(ArmorTempBodyDamage[tostring(BPs:get(i):getType())]["Glass"] ~= BPs:get(i):haveGlass()) and (BPs:get(i):haveGlass() == true) and (BPs:get(i):deepWounded() == false) then
--player:Say("Logged Glass Detected on ".. tostring(BPs:get(i):getType()));
if(wasDamagedBlocked(tostring(BPs:get(i):getType()), "Glass", player)) then
healBodyPart(BPs:get(i), player, BD);
end
ArmorbInjuryDetected = true;
end
end
end
end
if(ArmorbInjuryDetected) then
ArmorSaveBodyDamage(player);
end
return ArmorbInjuryDetected;
endfunction ArmorupdateThePlayer(player)
ArmorCheckForDamage(player);
player:getInventory():Remove("HCEquiparmor");
endfunction ArmorInit()
ArmorSaveBodyDamage(getPlayer());
end
function ArmorKeysUp(keynum)
--getPlayer():Say(tostring(keynum));
if keynum == 25 then
local player = getPlayer();
local armorstring = "Currently Equipped Armor \n";
if(player:getModData().ShieldArmor ~= nil) and (player:getSecondaryHandItem() ~= nil) and (player:getSecondaryHandItem():getType() == player:getModData().ShieldArmor) then
armorstring = armorstring .. "Shield: " .. player:getInventory():getItemFromType(player:getModData().ShieldArmor):getDisplayName() .. "\n";
end
if(player:getModData().HeadArmor ~= nil) and (player:getInventory():contains(player:getModData().HeadArmor)) then
armorstring = armorstring .. "Helmet: " .. player:getInventory():getItemFromType(player:getModData().HeadArmor):getDisplayName() .. "\n";
end
if(player:getModData().HandArmor ~= nil) and (player:getInventory():contains(player:getModData().HandArmor)) then
armorstring = armorstring .. "Hands: " .. player:getInventory():getItemFromType(player:getModData().HandArmor):getDisplayName() .. "\n";
end
if(player:getModData().ArmArmor ~= nil) and (player:getInventory():contains(player:getModData().ArmArmor)) then
armorstring = armorstring .. "Arms: " .. player:getInventory():getItemFromType(player:getModData().ArmArmor):getDisplayName() .. "\n";
end
if(player:getModData().LegArmor ~= nil) and (player:getInventory():contains(player:getModData().LegArmor)) then
armorstring = armorstring .. "Legs: " .. player:getInventory():getItemFromType(player:getModData().LegArmor):getDisplayName() .. "\n";
end
if(player:getModData().ChestArmor ~= nil) and (player:getInventory():contains(player:getModData().ChestArmor)) then
armorstring = armorstring .. "Chest: " .. player:getInventory():getItemFromType(player:getModData().ChestArmor):getDisplayName() .. "\n";
end
if(player:getModData().FootArmor ~= nil) and (player:getInventory():contains(player:getModData().FootArmor)) then
armorstring = armorstring .. "Feet: " .. player:getInventory():getItemFromType(player:getModData().FootArmor):getDisplayName() .. "\n";
end
ArmorWindow:setText(armorstring);
ArmorWindow:setVisible(true);
end
endEvents.OnKeyPressed.Add(ArmorKeysUp);
Events.OnPlayerUpdate.Add(ArmorupdateThePlayer);
Events.OnGameStart.Add(ArmorInit);fixed armor code.
fixes a few exploits such as removing glass or bullet with armor healing the wound.
-
5 hours ago, Dr_Cox1911 said:
I think what you are looking for is in "ISWorldObjectContextMenu.lua", specifically this parts:
... if sheetRopeSquare and getSpecificPlayer(player):canClimbSheetRope(sheetRopeSquare) and getSpecificPlayer(player):getPerkLevel(Perks.Strength) >= 0 then if test == true then return true; end context:addOption(getText("ContextMenu_Climb_Sheet_Rope"), worldobjects, ISWorldObjectContextMenu.onClimbSheetRope, sheetRopeSquare, false, player) end ... ISWorldObjectContextMenu.onClimbSheetRope = function(worldobjects, square, down, player) if square then local playerObj = getSpecificPlayer(player) ISTimedActionQueue.add(ISWalkToTimedAction:new(playerObj, square)) ISTimedActionQueue.add(ISClimbSheetRopeAction:new(playerObj, down)) end end
thanks for the point to the file, thats what i was looking for.
but after looking at it. I dont think it helps me. since the problem is only going DOWN the sheet ropes not up. The canClimbDownSheetRope bool detect stopped working it seems. anyway i'll try working with it for a while
-
Just now, thiosk said:
The trick is right click to use. The reason for this is the sheer number of people who were falling out of windows and over railings because of the e button. I've been caught by hordes i was burning before, or bitten from a quiet zed in a closet, but most of my deaths are from falling. The disable of climb on the second floor has therefore been a huge help.
I think theres a way to force E climb but I'm not sure if thats legit.
I know why they disabled it, my question is about lua modding not about how to climb down a rope without using E
-
it seems that the change in build 35 which made it so you cant jump over a fence or out of a window from the 2nd floor or higher via the interact button "E" has litterly just disabled the functions:
player:hopFence(player:getLastdir() , false);
player:climbThroughWindow(window);when on the 2nd floor or higher.
so this has made my survivors in the survivors mod not able to climb down sheet ropes
any way to re-enable this interact option like it was in b34 or some other way to force a player down a sheet rope via lua.
what file handles the right click "Climb over" option. i thought looking at that would be a start but no idea what file it is in. -
1 hour ago, Hydromancerx said:
Bah! Are any of the other code you sent me like that?
armor.lua doesnt need that. traps i think does need it.
Survivors Mod
in Mods
Posted
finally a nice menu: