Jump to content

SandyBeaches

Member
  • Posts

    32
  • Joined

  • Last visited

Reputation Activity

  1. Like
    SandyBeaches got a reaction from Fomyak in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  2. Like
    SandyBeaches got a reaction from frootloopers in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  3. Like
    SandyBeaches got a reaction from theCrius in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  4. Like
    SandyBeaches got a reaction from Thunderator in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  5. Like
    SandyBeaches got a reaction from Arya in Detailed information about melee weapons and how combat is calculated   
    I made some posts in the Hydrocraft mod thread showing the java behind melee combat and some quick thoughts on it.
    See here and here
     
    I am going to use this thread to summarize my findings, so others can use them as a reference.
     
    Firstly: Skill modifiers and weapon categories. What do they affect? By how much?
    If the weapon has the category "Unarmed", no perk related.
    The only calculation for unarmed is that it is capped at 0.7 damage per hit.
    NOTE MODDERS: This means if you categorize a weapon in your scripts as unarmed, putting max damage higher than 0.7 does nothing.
     
    These are not intuitive at all. Rather than either starting at 100% damage and increasing (bonus damage) or starting at a low point and reaching 100% at level 10 (competency), skills in project zomboid are a mixture of both.
    If the weapon has the category of "Blade" or "Axe", use Blade Accuracy perk (java name=PerkFactory.Perks.Axe):
    If the weapon has the category of "Blunt", use Blunt Accuracy perk (java name=PerkFactory.PerksBlunt):
    Both Axe and Blunt perks affect damage the same way.
    0:30%, 1:40%, 2:50%, 3:60%, 4:70%, 5:80%, 6:90, 7:100%, 8:110%, 9:120%, 10:130%
    Or, to put it more compactly: Damage = TotalDamage*(0.3+PerkLevel*0.1)
     
    If the weapon is "Ranged" (not category), Aiming level affects critchance, not damage.
    The calculation is weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2)
    So for calculating the maximum crit of you custom guns, add the amingcritmodifier only 5 times, not 10.
     
    Lastly calculated,
    If the weapon has the category of "Axe" and the target is NOT knocked over.
    Double damage. Yup, axes do double damage to all standing targets.
     
    ORDER OF CALCULATION
    None of these calculations are exclusive! Furthermore, none of the melee checks actually restricts themselves to melee weapons. So, if you have a firearm (isRanged=TRUE) with the categories Unarmed,Axe,Blunt, and you attack a standing zombie, the following would happen.
    Get damage from weapon/wielder. If damage is more than 0.7, reduce to 0.7 (unarmed). damage *= 0.3+AxeLevel*0.1 damage *= 0.3+BluntLevel*0.1 critical chance = weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2) damage = damage*2 (Axe)  
    There may be checks earlier in the code to prevent such items from existing at startup, but I know you can make these with lua.
    NOTE: I have yet to find any references to "improvised" in the code. I'll keep looking.
     
    Next time, Strength, endurance, push back, knockdown, and YOU!
     
     
  6. Like
    SandyBeaches got a reaction from GoodOldLeon in Detailed information about melee weapons and how combat is calculated   
    I made some posts in the Hydrocraft mod thread showing the java behind melee combat and some quick thoughts on it.
    See here and here
     
    I am going to use this thread to summarize my findings, so others can use them as a reference.
     
    Firstly: Skill modifiers and weapon categories. What do they affect? By how much?
    If the weapon has the category "Unarmed", no perk related.
    The only calculation for unarmed is that it is capped at 0.7 damage per hit.
    NOTE MODDERS: This means if you categorize a weapon in your scripts as unarmed, putting max damage higher than 0.7 does nothing.
     
    These are not intuitive at all. Rather than either starting at 100% damage and increasing (bonus damage) or starting at a low point and reaching 100% at level 10 (competency), skills in project zomboid are a mixture of both.
    If the weapon has the category of "Blade" or "Axe", use Blade Accuracy perk (java name=PerkFactory.Perks.Axe):
    If the weapon has the category of "Blunt", use Blunt Accuracy perk (java name=PerkFactory.PerksBlunt):
    Both Axe and Blunt perks affect damage the same way.
    0:30%, 1:40%, 2:50%, 3:60%, 4:70%, 5:80%, 6:90, 7:100%, 8:110%, 9:120%, 10:130%
    Or, to put it more compactly: Damage = TotalDamage*(0.3+PerkLevel*0.1)
     
    If the weapon is "Ranged" (not category), Aiming level affects critchance, not damage.
    The calculation is weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2)
    So for calculating the maximum crit of you custom guns, add the amingcritmodifier only 5 times, not 10.
     
    Lastly calculated,
    If the weapon has the category of "Axe" and the target is NOT knocked over.
    Double damage. Yup, axes do double damage to all standing targets.
     
    ORDER OF CALCULATION
    None of these calculations are exclusive! Furthermore, none of the melee checks actually restricts themselves to melee weapons. So, if you have a firearm (isRanged=TRUE) with the categories Unarmed,Axe,Blunt, and you attack a standing zombie, the following would happen.
    Get damage from weapon/wielder. If damage is more than 0.7, reduce to 0.7 (unarmed). damage *= 0.3+AxeLevel*0.1 damage *= 0.3+BluntLevel*0.1 critical chance = weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2) damage = damage*2 (Axe)  
    There may be checks earlier in the code to prevent such items from existing at startup, but I know you can make these with lua.
    NOTE: I have yet to find any references to "improvised" in the code. I'll keep looking.
     
    Next time, Strength, endurance, push back, knockdown, and YOU!
     
     
  7. Like
    SandyBeaches got a reaction from tommysticks in Detailed information about melee weapons and how combat is calculated   
    I made some posts in the Hydrocraft mod thread showing the java behind melee combat and some quick thoughts on it.
    See here and here
     
    I am going to use this thread to summarize my findings, so others can use them as a reference.
     
    Firstly: Skill modifiers and weapon categories. What do they affect? By how much?
    If the weapon has the category "Unarmed", no perk related.
    The only calculation for unarmed is that it is capped at 0.7 damage per hit.
    NOTE MODDERS: This means if you categorize a weapon in your scripts as unarmed, putting max damage higher than 0.7 does nothing.
     
    These are not intuitive at all. Rather than either starting at 100% damage and increasing (bonus damage) or starting at a low point and reaching 100% at level 10 (competency), skills in project zomboid are a mixture of both.
    If the weapon has the category of "Blade" or "Axe", use Blade Accuracy perk (java name=PerkFactory.Perks.Axe):
    If the weapon has the category of "Blunt", use Blunt Accuracy perk (java name=PerkFactory.PerksBlunt):
    Both Axe and Blunt perks affect damage the same way.
    0:30%, 1:40%, 2:50%, 3:60%, 4:70%, 5:80%, 6:90, 7:100%, 8:110%, 9:120%, 10:130%
    Or, to put it more compactly: Damage = TotalDamage*(0.3+PerkLevel*0.1)
     
    If the weapon is "Ranged" (not category), Aiming level affects critchance, not damage.
    The calculation is weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2)
    So for calculating the maximum crit of you custom guns, add the amingcritmodifier only 5 times, not 10.
     
    Lastly calculated,
    If the weapon has the category of "Axe" and the target is NOT knocked over.
    Double damage. Yup, axes do double damage to all standing targets.
     
    ORDER OF CALCULATION
    None of these calculations are exclusive! Furthermore, none of the melee checks actually restricts themselves to melee weapons. So, if you have a firearm (isRanged=TRUE) with the categories Unarmed,Axe,Blunt, and you attack a standing zombie, the following would happen.
    Get damage from weapon/wielder. If damage is more than 0.7, reduce to 0.7 (unarmed). damage *= 0.3+AxeLevel*0.1 damage *= 0.3+BluntLevel*0.1 critical chance = weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2) damage = damage*2 (Axe)  
    There may be checks earlier in the code to prevent such items from existing at startup, but I know you can make these with lua.
    NOTE: I have yet to find any references to "improvised" in the code. I'll keep looking.
     
    Next time, Strength, endurance, push back, knockdown, and YOU!
     
     
  8. Like
    SandyBeaches got a reaction from Zorak in Detailed information about melee weapons and how combat is calculated   
    I made some posts in the Hydrocraft mod thread showing the java behind melee combat and some quick thoughts on it.
    See here and here
     
    I am going to use this thread to summarize my findings, so others can use them as a reference.
     
    Firstly: Skill modifiers and weapon categories. What do they affect? By how much?
    If the weapon has the category "Unarmed", no perk related.
    The only calculation for unarmed is that it is capped at 0.7 damage per hit.
    NOTE MODDERS: This means if you categorize a weapon in your scripts as unarmed, putting max damage higher than 0.7 does nothing.
     
    These are not intuitive at all. Rather than either starting at 100% damage and increasing (bonus damage) or starting at a low point and reaching 100% at level 10 (competency), skills in project zomboid are a mixture of both.
    If the weapon has the category of "Blade" or "Axe", use Blade Accuracy perk (java name=PerkFactory.Perks.Axe):
    If the weapon has the category of "Blunt", use Blunt Accuracy perk (java name=PerkFactory.PerksBlunt):
    Both Axe and Blunt perks affect damage the same way.
    0:30%, 1:40%, 2:50%, 3:60%, 4:70%, 5:80%, 6:90, 7:100%, 8:110%, 9:120%, 10:130%
    Or, to put it more compactly: Damage = TotalDamage*(0.3+PerkLevel*0.1)
     
    If the weapon is "Ranged" (not category), Aiming level affects critchance, not damage.
    The calculation is weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2)
    So for calculating the maximum crit of you custom guns, add the amingcritmodifier only 5 times, not 10.
     
    Lastly calculated,
    If the weapon has the category of "Axe" and the target is NOT knocked over.
    Double damage. Yup, axes do double damage to all standing targets.
     
    ORDER OF CALCULATION
    None of these calculations are exclusive! Furthermore, none of the melee checks actually restricts themselves to melee weapons. So, if you have a firearm (isRanged=TRUE) with the categories Unarmed,Axe,Blunt, and you attack a standing zombie, the following would happen.
    Get damage from weapon/wielder. If damage is more than 0.7, reduce to 0.7 (unarmed). damage *= 0.3+AxeLevel*0.1 damage *= 0.3+BluntLevel*0.1 critical chance = weapon.critchance + weapon.AimingPerkCritModifier * (AimingLevel/2) damage = damage*2 (Axe)  
    There may be checks earlier in the code to prevent such items from existing at startup, but I know you can make these with lua.
    NOTE: I have yet to find any references to "improvised" in the code. I'll keep looking.
     
    Next time, Strength, endurance, push back, knockdown, and YOU!
     
     
  9. Like
    SandyBeaches reacted to Lumbo in Hydrocraft Mod   
    Great suggetions imo Beaches! I love the "fist weapon" idea
  10. Like
    SandyBeaches got a reaction from Lumbo in Hydrocraft Mod   
    Hi again! I was sick of getting set on fire even with blacksmith apron and welding mask, so I whipped up a realistic, and decidedly endgame recipe for making the fire resistant suit. (For those that don't know, if you have the firesuit in your inventory, you never get burned by the kiln etc. Ground fire still hurts you).
     
    This actually follows the guidelines of the national fire association.
    Keep in mind, making this suit requires lots of wax, leather, some steel (if using bees), mined resources and rare loot. I think that is balanced enough, considering it took me 12 days + 10 skill foraging + many trips into dangerous areas to make, and that I leveled up first aid to 5 along the way.
     
    Secondly, I'd like to discuss weapon diversification. Currently, the pole-arms and hammers have almost no combat purpose. They are inferior to their equivalent tier blade weapons. To remedy this, I propose the following split between fists, pole arms, blades, blunt and axes. (I am currently testing in game):
    Fists: Friend of the Friendless
    I am not talking about the unarmed push and stomp, which you can still do by using the space key (default) even when armed, I am talking about punching, implemented as a very cheap one handed blunt weapon that anyone can make:
    PROS Almost always available. Just need two strips of cloth. Fast Decent Knock down Can punch zombies that are very close (0.1 min range) means you can fight indoors. Mix with base contextual melee (Space bar default) for martial arts action! Push, stomp AND punch! Improves with, and trains, blunt melee skill as opposed to normal unarmed which does not. Very low endurance requirements. Hits multiple opponents NEUTRAL CONS Very short range! You are liable to get scratched or bitten! Very low damage with no CQC! A spoon will kill a zombie faster, but only once. PURPOSE Fists are your final backup, or your first choice, depending on your level of sanity. Their only redeeming features are that they hit 2, can hit them VERY close, and you usually have a pair. An improvement over the default melee alone due to improvement via training, should be mixed with default for maximum effect. (Seriously, it is fun. Dangerous, but very satisfying if you can pull it off.) IDEA Have multiple types of 'fists' weapons defined representing different types/levels of combat, then lock them behind recipes requiring certain levels of blunt accuracy/defense/books/rare items. Current ideas: Karate; Single target, high push back, slightly more range, requires both hands . Boxing; Faster attack speed, slightly more damage, requires both hands. Judo; Single target, high knock down, slower attack speed but more damage, requires both hands Kung fu; Multi target fighting (3), can use one hand, stronger with two Kenpo; Slower attack speed, lower range, but can special attack Claws; Blade skill. Pole-arm: Friend of the Wanderer
    PROS Largest range (2.5 to 3.5) Moderate critical chance Simple resources needed in construction (mostly wood with a metal tip) High damage true to real life. (max damage 2 to 3) NEUTRAL Moderate/low weight Moderate durability Moderate knockdown modifier (trip) While most are blades, some are blunt (shovels, quarterstaves) CONS High minimum range (1 to 1.4), means you have to use PUSH (space default) if they get close. Max hit count of 1! Can only attack one zombie at a time. Unwieldy: Cannot use at max endurance High weapon weight. The length of the weapon exacerbates its weight, leading to high endurance usage. Slow swing speed. Cannot use single handed. Low push back modifier Rare. You won't find many pole arms in the modern world, but that is ok, you can make them! PURPOSE The pole-arm is an easy to make, easy to replace, high damage, single target weapon suited to taking down lone zombies at a safe distance without the noise of a firearm. It should be a survivors default weapon choice for starting out, and when traveling outside.
    A survivor should avoid using a pole-arm indoors however, as the high minimum range means you may be unable to hit enemies at close quarters, and the slow swing speed, high endurance cost, and single target limit means they cannot be relied upon to handle even moderately sized hoards. Blade: Friend of the Scavenger
    PROS King of CQC. Only blades can perform the close quarters instant kill. Low weight Easy to use. Most blades can be used at maximum endurance High swing speed One handed combat. Most blades can be used to full effect with one hand Highest critical chance. NEUTRAL Moderate damage. Many types of blades. Some can hit more than one target. Simple blades can be found in many locations, making them available early on. When a some blades become blunt, they become a low class club instead of breaking. (need to add. Perhaps chance to destroy? Look at makeshift axe for idea) Some blunted blades can be repaired by sharpening (need to add. Perhaps chance to destroy?) CONS Lowest durability of all weapon types. A blunt blade does significantly less damage. Lowest pushback. Damage is from piercing or slashing, very little gets turned into impact force. If you get overwhelmed, use push (space default). CQC takes a small amount of time. If you are swarmed, you may die if you forget to push. Highest construction requirements. A quality blade takes finesse and resources to make. Lowest range of all equivalent weapons PURPOSE Blades are the weapon of choice for exploring buildings or quickly dispatching small groups of zombies. Their (mostly) one handed usage means that survivors can carry an additional bag etc in their off hand while still fighting effectively. The low range combined with a special attack at point blank makes them perfect for surprise zombies hiding in bathroom/closets/upstairs and for fighting zombies without accidentally smashing windows. A low average weight means that a survivor should always be able to bring a blade with them to compliment their main weapon, or even just a spare.
    Due to the low durability and high resource cost, survivors may choose not to use a blade as their main weapon, and the low range and lack of push back makes blades unsuitable for dealing with hordes in open areas.  
    Blunt: Friend of the Desperate
    PROS Highest durability. A solid lump of something heavy is still a solid lump of something even if it gets flattened a bit. Highest knock back and knock down. Hit them with something heavy. Multiple targets. Most larger blunt weapons can hit many enemies at once. Easy to find. Many things can be effective blunt weapons if you are desperate enough. Pipe, plank, bat, hammer, chair etc. Useful. Several blunt weapons are also essential building tools. High minimum damage. Total damage may be low, but it is reliable NEUTRAL Moderate resource cost to make. It doesn't take much skill to make a weapon heavy, just a lot of weapon. Weakest part of a blunt weapon is the handle. Replacing the handle can fix many blunt weapons (need to add. Look at makeshift axes.) Upgrade! Several blunt weapons can be upgraded for more damage. Moderate range. You don't need to put your weapon through them, a glancing blow still does damage. Moderate minimum range. Don't get surrounded or you can't knock them all down. CONS Lowest damage per zombie. Compared to all other weapons, blunt weapons do the least dps to individual zombies. Moderate/Low swing speed. Faster than pole arms. Blunt force instruments need to be swung. Cannot use most of them at maximum exertion. While most CAN be used one handed, most blunt weapons are more effective two handed. Uses a different skill set to bladed weapons. Highest weight among comparable weapons. High exertion usage. Slightly more than pole arms. No/low critical chance. PURPOSE Blunt weapons are for escaping from, or if the survivor is touched in the head, fighting, zombie hordes. If your situation is looking desperate, if you woke up surrounded and they're coming through the windows, a good blunt weapon will get you out. The key to this is the large knock back and knock down modifiers, combined with the high multi target capability. A trained survivor with a good blunt weapon can keep a hoard on their backs long enough to kill them all, or run away. In addition, the high durability means they are unlikely to find themselves weaponless during a fight.
    The key weakness of the blunt weapons is their endurance cost. While a survivor wielding a blunt weapon CAN reliably take on a horde, they are going to need a good lie down afterwards. As such, blunt weapons are for emergencies, or planned clearing of an area. Otherwise, a reckless survivor will find themselves exhausted, unable to fight back or run. Axes: Friend of the Survivor
    PROS Reliable damage (High minimum damage). Damage is partly due to weight, so even glancing blows do damage. Useful. Axes are a basic tool Moderate/High Durability. Less than blunt, more than pole arms. Axes are designed to withstand punishment Moderate/High Damage. Less than pole arms, more than blades. Moderate/High knock down Repeatedly repairable. Due to the mass of the head, it can be repeatedly sharpened, while the handle can be replaced. NEUTRAL Comes in one handed and two handed versions. Moderate swing speed. Moderate/Low critical chance Moderate knock back. Moderate range. Roughly the same as blunt. More than blades. CONS Rare. Axes are prized but due to their specialized nature, they are far harder to find than blades or blunts. Resource intensive to make. Not only do axes need as much materials as blunt weapons, they need to be sharpened and balanced too. Moderate/High weight. Axes weigh almost as much as blunt weapons. Moderate/High exertion cost. You can swing an axe longer than a similar blunt weapon, but not all day. Dual purpose. Unlike other tools, an axe loses durability when used for its task. PURPOSE The axe is the best general purpose weapon a survivor can have, if they can afford to use it as one. It doesn't have the reach and damage of the pole arm, the CQC advantage of blades or the knock back of blunt weapons, but is still above average in almost all aspects. The problem is finding one, and keeping it. However, survivor should always carry a backup weapon better specialized to deal with situations they find difficult. Or two.  
    Sorry for the wall of text, but I hope you can appreciate the thought that has gone into this. I will be playtesting this myself for a while, please give me your thoughts.
     
  11. Like
    SandyBeaches got a reaction from Hydromancerx in Hydrocraft Mod   
    Hi again! I was sick of getting set on fire even with blacksmith apron and welding mask, so I whipped up a realistic, and decidedly endgame recipe for making the fire resistant suit. (For those that don't know, if you have the firesuit in your inventory, you never get burned by the kiln etc. Ground fire still hurts you).
     
    This actually follows the guidelines of the national fire association.
    Keep in mind, making this suit requires lots of wax, leather, some steel (if using bees), mined resources and rare loot. I think that is balanced enough, considering it took me 12 days + 10 skill foraging + many trips into dangerous areas to make, and that I leveled up first aid to 5 along the way.
     
    Secondly, I'd like to discuss weapon diversification. Currently, the pole-arms and hammers have almost no combat purpose. They are inferior to their equivalent tier blade weapons. To remedy this, I propose the following split between fists, pole arms, blades, blunt and axes. (I am currently testing in game):
    Fists: Friend of the Friendless
    I am not talking about the unarmed push and stomp, which you can still do by using the space key (default) even when armed, I am talking about punching, implemented as a very cheap one handed blunt weapon that anyone can make:
    PROS Almost always available. Just need two strips of cloth. Fast Decent Knock down Can punch zombies that are very close (0.1 min range) means you can fight indoors. Mix with base contextual melee (Space bar default) for martial arts action! Push, stomp AND punch! Improves with, and trains, blunt melee skill as opposed to normal unarmed which does not. Very low endurance requirements. Hits multiple opponents NEUTRAL CONS Very short range! You are liable to get scratched or bitten! Very low damage with no CQC! A spoon will kill a zombie faster, but only once. PURPOSE Fists are your final backup, or your first choice, depending on your level of sanity. Their only redeeming features are that they hit 2, can hit them VERY close, and you usually have a pair. An improvement over the default melee alone due to improvement via training, should be mixed with default for maximum effect. (Seriously, it is fun. Dangerous, but very satisfying if you can pull it off.) IDEA Have multiple types of 'fists' weapons defined representing different types/levels of combat, then lock them behind recipes requiring certain levels of blunt accuracy/defense/books/rare items. Current ideas: Karate; Single target, high push back, slightly more range, requires both hands . Boxing; Faster attack speed, slightly more damage, requires both hands. Judo; Single target, high knock down, slower attack speed but more damage, requires both hands Kung fu; Multi target fighting (3), can use one hand, stronger with two Kenpo; Slower attack speed, lower range, but can special attack Claws; Blade skill. Pole-arm: Friend of the Wanderer
    PROS Largest range (2.5 to 3.5) Moderate critical chance Simple resources needed in construction (mostly wood with a metal tip) High damage true to real life. (max damage 2 to 3) NEUTRAL Moderate/low weight Moderate durability Moderate knockdown modifier (trip) While most are blades, some are blunt (shovels, quarterstaves) CONS High minimum range (1 to 1.4), means you have to use PUSH (space default) if they get close. Max hit count of 1! Can only attack one zombie at a time. Unwieldy: Cannot use at max endurance High weapon weight. The length of the weapon exacerbates its weight, leading to high endurance usage. Slow swing speed. Cannot use single handed. Low push back modifier Rare. You won't find many pole arms in the modern world, but that is ok, you can make them! PURPOSE The pole-arm is an easy to make, easy to replace, high damage, single target weapon suited to taking down lone zombies at a safe distance without the noise of a firearm. It should be a survivors default weapon choice for starting out, and when traveling outside.
    A survivor should avoid using a pole-arm indoors however, as the high minimum range means you may be unable to hit enemies at close quarters, and the slow swing speed, high endurance cost, and single target limit means they cannot be relied upon to handle even moderately sized hoards. Blade: Friend of the Scavenger
    PROS King of CQC. Only blades can perform the close quarters instant kill. Low weight Easy to use. Most blades can be used at maximum endurance High swing speed One handed combat. Most blades can be used to full effect with one hand Highest critical chance. NEUTRAL Moderate damage. Many types of blades. Some can hit more than one target. Simple blades can be found in many locations, making them available early on. When a some blades become blunt, they become a low class club instead of breaking. (need to add. Perhaps chance to destroy? Look at makeshift axe for idea) Some blunted blades can be repaired by sharpening (need to add. Perhaps chance to destroy?) CONS Lowest durability of all weapon types. A blunt blade does significantly less damage. Lowest pushback. Damage is from piercing or slashing, very little gets turned into impact force. If you get overwhelmed, use push (space default). CQC takes a small amount of time. If you are swarmed, you may die if you forget to push. Highest construction requirements. A quality blade takes finesse and resources to make. Lowest range of all equivalent weapons PURPOSE Blades are the weapon of choice for exploring buildings or quickly dispatching small groups of zombies. Their (mostly) one handed usage means that survivors can carry an additional bag etc in their off hand while still fighting effectively. The low range combined with a special attack at point blank makes them perfect for surprise zombies hiding in bathroom/closets/upstairs and for fighting zombies without accidentally smashing windows. A low average weight means that a survivor should always be able to bring a blade with them to compliment their main weapon, or even just a spare.
    Due to the low durability and high resource cost, survivors may choose not to use a blade as their main weapon, and the low range and lack of push back makes blades unsuitable for dealing with hordes in open areas.  
    Blunt: Friend of the Desperate
    PROS Highest durability. A solid lump of something heavy is still a solid lump of something even if it gets flattened a bit. Highest knock back and knock down. Hit them with something heavy. Multiple targets. Most larger blunt weapons can hit many enemies at once. Easy to find. Many things can be effective blunt weapons if you are desperate enough. Pipe, plank, bat, hammer, chair etc. Useful. Several blunt weapons are also essential building tools. High minimum damage. Total damage may be low, but it is reliable NEUTRAL Moderate resource cost to make. It doesn't take much skill to make a weapon heavy, just a lot of weapon. Weakest part of a blunt weapon is the handle. Replacing the handle can fix many blunt weapons (need to add. Look at makeshift axes.) Upgrade! Several blunt weapons can be upgraded for more damage. Moderate range. You don't need to put your weapon through them, a glancing blow still does damage. Moderate minimum range. Don't get surrounded or you can't knock them all down. CONS Lowest damage per zombie. Compared to all other weapons, blunt weapons do the least dps to individual zombies. Moderate/Low swing speed. Faster than pole arms. Blunt force instruments need to be swung. Cannot use most of them at maximum exertion. While most CAN be used one handed, most blunt weapons are more effective two handed. Uses a different skill set to bladed weapons. Highest weight among comparable weapons. High exertion usage. Slightly more than pole arms. No/low critical chance. PURPOSE Blunt weapons are for escaping from, or if the survivor is touched in the head, fighting, zombie hordes. If your situation is looking desperate, if you woke up surrounded and they're coming through the windows, a good blunt weapon will get you out. The key to this is the large knock back and knock down modifiers, combined with the high multi target capability. A trained survivor with a good blunt weapon can keep a hoard on their backs long enough to kill them all, or run away. In addition, the high durability means they are unlikely to find themselves weaponless during a fight.
    The key weakness of the blunt weapons is their endurance cost. While a survivor wielding a blunt weapon CAN reliably take on a horde, they are going to need a good lie down afterwards. As such, blunt weapons are for emergencies, or planned clearing of an area. Otherwise, a reckless survivor will find themselves exhausted, unable to fight back or run. Axes: Friend of the Survivor
    PROS Reliable damage (High minimum damage). Damage is partly due to weight, so even glancing blows do damage. Useful. Axes are a basic tool Moderate/High Durability. Less than blunt, more than pole arms. Axes are designed to withstand punishment Moderate/High Damage. Less than pole arms, more than blades. Moderate/High knock down Repeatedly repairable. Due to the mass of the head, it can be repeatedly sharpened, while the handle can be replaced. NEUTRAL Comes in one handed and two handed versions. Moderate swing speed. Moderate/Low critical chance Moderate knock back. Moderate range. Roughly the same as blunt. More than blades. CONS Rare. Axes are prized but due to their specialized nature, they are far harder to find than blades or blunts. Resource intensive to make. Not only do axes need as much materials as blunt weapons, they need to be sharpened and balanced too. Moderate/High weight. Axes weigh almost as much as blunt weapons. Moderate/High exertion cost. You can swing an axe longer than a similar blunt weapon, but not all day. Dual purpose. Unlike other tools, an axe loses durability when used for its task. PURPOSE The axe is the best general purpose weapon a survivor can have, if they can afford to use it as one. It doesn't have the reach and damage of the pole arm, the CQC advantage of blades or the knock back of blunt weapons, but is still above average in almost all aspects. The problem is finding one, and keeping it. However, survivor should always carry a backup weapon better specialized to deal with situations they find difficult. Or two.  
    Sorry for the wall of text, but I hope you can appreciate the thought that has gone into this. I will be playtesting this myself for a while, please give me your thoughts.
     
  12. Like
    SandyBeaches got a reaction from Hydromancerx in Hydrocraft Mod   
    Hello again hydro! Been a while since I chirped in.
     
    I have just spent a couple of hours trawling the files to find errors. Here is the results of my labour:
     
    To save you the trouble, I have attached a zip of the altered files below.
     
    Cheers!
    hydrocraft bugfixes.zip
  13. Like
    SandyBeaches got a reaction from Zomboid in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  14. Like
    SandyBeaches got a reaction from khamseen in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  15. Like
    SandyBeaches got a reaction from evankimori in Hydrocraft Mod   
    Heya hydro, I looks like my last post disappeared. I posted the solution and some other bugs a while back before you did the update.
    To be specific, the problem was caused by:
    LINE 435 if chance <= bugLvl10 thenThis if has no end. Just place one as line 437 and everything works fine.
     
    Other bugs:
    In Books.txt, line 329 ends with }' instead of } HCPlantScavengeDefinition.lua line # 150, you have the following code causing stack trace. :
    file: HCPlantScavengeDefinition.lua line # 150local HCMulberryleaf = {};HCMulberryleaf.type = "Hydrocraft.HCMulberryleaf";HCMulberryleaf.minCount = 1;HCMulberryleaf.maxCount = 2;HCMulberryleaf.skill = 3;local HCMulberryleaf = {}; <-!!!!! Just reset it to {}! Should just be HCMulberryHCMulberry.type = "Hydrocraft.HCMulberry"; <-!!!! Trying to write to a table that doesn't exist! Stack trace!HCMulberry.minCount = 2;HCMulberry.maxCount = 5;HCMulberry.skill = 3; Dogwhistle recipe needs to have 'keep Dogwhistle' Many errors in HCLoading.lua. These prevent items from spawning in containers.Need to remove all references of HCFireextinguisherempty and HCFireblanket as they no longer have item definitions. All cardboard boxes and stacks are spelt 'Cardboarbox'. Should be 'Cardboardbox'. Find replace is your friend. Lists HCJarHoney. Item is actually spelt 'HCJarhoney'. Prevents item from spawning line 3163 lists 'Rubberband'. Item is actually spelt 'RubberBand' In Food Flour.txt, line 131 calls for Egg/WildEggs. WildEggs is not an item. HCGooseegg should be listed instead. These are the basic bugs I can think of off the top of my head. I am working on fixing all the cooking stuff though, so I may post that in a couple of days.
     
    Hope this helps!
  16. Like
    SandyBeaches got a reaction from Hydromancerx in RELEASED: Build 32.16   
    Found why it isn't working. You are missing an 'End' in your new bug code, which causes the rest of the file to be considered part of that function.
     
    Line 435:    if chance <= bugLvl10 then
     
    needs an end.
     
    Other bugs:
    Dogwhistle isn't kept in recipe. Around line 150 in HCPlantScavengeDefinition.lua you define HCMulberryleaf twice (second time should just be HCMulberry) causing segfaults due to attempted write to non existant arrray, and read of now empty array. Need to remove all references to HCFireblanket and HCFireextinguisherempty from distribution lua Also in the distribs, Rubberband, not RubberBand, HCCardboardbox, not HCCardboarbox (do a find replace, it affects the stacks as well) and Jarhoney, not JarHoney. Also, many bugs with the food. Still working on fixing them all
     
    Hope this helps.
  17. Like
    SandyBeaches got a reaction from Svarog in How ZombRand() works.   
    ZombRand() is used in many mods to get random numbers. However, many are using it incorrectly, and because it returns a random value, they are not realizing they have a bug.
     
    The most common problem I have seen is when code is written similar this;
    n = ZombRand(2);if n == 2 then....else....endn == 2 will always be false as ZombRand(2) will never return 2, only 0 or 1.
     
    What is ZombRand(n)?
    ZombRand is an exposed implimentation of rand.Int(n) with a couple of changes.
     
    What does it do?
    Given value n, ZombRand will return a pseudo random number from the set of INTEGERS from 0 to n-1 inclusive.
     
    Why ask for n if it only gives up to n-1?
    The n in ZombRand(n) is not the maximum value wanted, but the range of the result wanted.
    For example, ZombRand(4) can return 0, 1, 2, or 3, which is exactly 4 values.
     
    If you desire results from 1 to n just do
    foo = ZombRand(n)+1;Special Cases
    ZombRand(0) is always 0 ZombRand(-n) = -1*ZombRand(n)  
    Hope that clears some things up!
  18. Like
    SandyBeaches got a reaction from blindcoder in Named Weapons   
    Sorry for the ridiculously long post last time. I don't know how to do folds, and it is to long to edit. Could a mod remove it?

    Anyway, EXCITING NEWS!
    After much pain, learning, and digging through java and lua references, I have completely rebuilt this mod from the ground up. Unfortunately, rescuing previously buffed weapons proved too onerous for me to achieve, so sorry but your old buffs are gone.

    Rejoyce however! At the prospect of NEW buffs, that SURVIVE RELOADS! I still cannot work out how OnLoad works, but for now all you have to do is re-equip an item after loading, and ALL THE BUFFS COME BACK!

    It has truly been a learning experience for me, and I thank sticks and blind for their examples. For the sake of easy maintenance, addition and error checking, all potential buffs are now stored in a table and iterated over. Almost half the length of the file is comments, take a look! It was a lot of fun and I am pretty proud of it.


    Oh, by the way, for shizz and giggles try putting 10 in the add fields of all the range buffs. You can hit things further away than a pistol!
     
    DOWNLOAD: Old download had bug.
×
×
  • Create New...