Jump to content

SandyBeaches

Member
  • Posts

    32
  • Joined

  • Last visited

Everything posted by SandyBeaches

  1. 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!
  2. sorry for double post but edit is not working. Knock down is interesting too. if ((this.Health <= 0.0F) || (this.BodyDamage.getHealth() <= 0.0F) || (((weapon.isAlwaysKnockdown()) || (bKnockdown)) && ((this instanceof IsoZombie)))) { DoDeath(weapon, wielder); } Basically; For a zombie, having knockdown occur while already on the ground is instant death. After a little bit of testing, it seems this is the main way we are actually killing zombies. This is also the primary way a weaponless player kills (stomping) and why it is near impossible to kill zombies at low endurance. Default unarmed does NO damage but has decent pushback and some knockdown. Second knock down on downed zombie kills. First level of exhaustion reduced knockdown chance by 50%!!! Final level reduces knockdown chance to just 16% of normal. Note that a weapon that always knocks down ignores the endurance calculation, and always kills a fallen zombie. MODMAKERS TAKE NOTE! This is why low damage/high knock down weapons are still ridiculously deadly. This has implications for my fist, blunt and pole arm plans. Players are immune to second knockdown kill. I may start tips thread with all this info in it..
  3. Just for a little bit of information, here is the whole contents of the Hit function in the java core. Note that this is calculated from the perspective of the character who gets hit (usually a zombie). Some interesting things to note: Several stats have ceiling and floor checks, knockback for instance. There are hardcoded references to several weapon categories including: Shoving does NO damage! No matter how often you shove a zombie, you won't hurt it. Unarmed can never do more than 0.7 damage, even after modifiers, unless it critically hits. Axes get a coded 2x bonus to damage, but only to standing enemies. Then there is the nature of critical hits: You CAN get up to 100% crit chance. None of that 95% limiter some games have. Zombies that are downed give double crit chance. Critical hits do 10x as much damage. Some oddities that don't show up in this bit but are hidden in the statesmanager: Staggered entities can't take damage and can't be shot at. Others I have forgotten. Enjoy!
  4. 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.
  5. I'd probably add the pistol to inventory, then find the spawned object in player inventory and change its properties.
  6. I think it is defined in the base code. Remind me to have a poke around some time.
  7. The best way I can see to do this is to interrupt "add to inventory" and swap the container for a dummy item whenever it is added to any inventory other than the ground, at which point the container would get swapped back in. This is kind of how furniture is currently handled.. There are a couple of ways to store the container item... actually, you just need to store the inventory of it, not the inventoryitem class itself..
  8. Hence the reason this is not for base game, but a mod
  9. For the back one, I'd say treat it as a new moodle series. First step, "strained back"; minor pain, slightly lower speed and damage, further damage from weight procs sooner (eg, normally can carry for 30 min at max without damage, now can only carry for 20). Heals in a couple of hours or when you rest/sleep. Back support negates moodle while in base inventory. If you proc weight damage while strained, you get "sprained back"; moderate pain, reduced speed and melee damage, further damage from weight procs sooner, and from lower weight (in just 5 min of moderate weight will proc damage). Heals to "strained back" in a week, faster if you carry back support in base inventory. Movement speed improved to "strained back" level if cane/equivalent is equipped. "torn back"; High pain from moving, severe pain from carrying weight, reduced speed, greatly reduced melee damage, and now reduced ranged accuracy. Moderate weight instantly procs damage. Heals to "sprained back" in a fortnight, faster if you carry back support in base inventory. Movement speed improved to "strained back" level if cane/equivalent is equipped. "crippled back"; High pain at all times. Immobile if carrying weight. Melee damage AND accuracy severely reduced. Ranged accuracy AND reload speed severely reduced. Cannot sprint. Cannot move without back support in inventory and cane/equivalent equipped. New items needed: Back support (found? crafted?), Craftable canes. New icons needed. (I could help with that) What do you think?
  10. Looks interesting! How long does a battery last?
  11. Interesting! I'm currently working on a lua workaround for the system. I'll give yours a look.
  12. 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. I have been thinking, in terms of breeding, a better way to go would be to use the moddable farming mod(?) and make rabbits a 'crop'. That way, you can make them take a while to 'breed' (harvestable) and HAVE NO FLOWERING GROWTH (Harvestable + seeds), instead have it cycle like tomatoes. Also, you can only water them, but seeding can require a number of different items combined into a breeder, eg; 1 female + 1 male + cage = rabbit breeder. Used as seed. Plant rabbit breeders, 1 needed per plot. Need low water requirements (can't leave them entirely outside. Need shelter to prevent excess rainfall) For fertilizer etc just consider that you are also growing food for them. When you 'harvest' you get several generic baby rabbits, governed by farming skill. The plot returns to stage one, newly planted. Raising babies to adults requires feeding them through several stages (can be done in groups) via recipes. This allows easy lua hooks to determine sex, etc.This way, the cage is permanently tied to a plot and can't be recovered. Only allowing babies to be gathered means you must take care of any diseases that occur to the rabbits, and not abandon them too long, or risk losing them. The same can easily be done with other livestock as well.
  14. 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 spawningline 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!
  15. 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 luaAlso 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.
  16. Something is going wrong in the latest version. Easiest way to show the bug is with corpses. pick up a corpse add to hotbar drop corpse Stack traces galore in output.I really like this mod blind coder, so can you have a look?
  17. Ha! funny. By the way, the morph weapons work like this: If x weapon type earns buffs y and or z, Give it EXTRA properties/Change its type etc. Usually unique stuff that isn't covered in the base buffs. end So in the case of "Doge this" (My thoughts on the name. Play on 'dodge this' from the matrix. Maybe make it a pistol or rifle?) If Shotgun earns buffs Evil legendary buff + range buff, Rename to "Doge this", Add to-hit chance? Other stuff? End. So what would "Batter up" get? It requires Giant and haste, but what does it give? Plus, I like punny names, so batter could refer to 'cooking batter' or the great aussie 'beer batter'. Remember, adding drops to zombies when killed by a weapon is relatively easy.
  18. I have to increase the durability as that is my way of checking if I have reloaded the stats or not (max condition is not saved to disk by the game), however, I am happy to admit things are a bit overpowered at the moment. If you feel things are too overpowered, open the lua file and edit the values in the table. I have added a lot of comments, so it should be pretty simple to understand. Yeah, sorry. I am working on an "Update" mod that strips all buffs off items, then re-adds them based on the prefix suffix in the name of the item, but that is a bit of a back seat to making sure this works properly. Oh, and I would be happy to have suggestions on what combo morph weapons you think of.
  19. OH FOR F SAKE. I made a stupid stupid mistake. I used the same array values in the load array twice, so the second buff overwrote the first buff. Thankyou very much for the bug report and the console output. Without it, I may not have figured this out for a while Download: V0.4 https://drive.google.com/file/d/0ByMUSPQ5XkQkTjByY3MzTkktZms/view?usp=sharing Use the down arrow at the center top of the screen to download. Changelog: Fixed a critical bug in loading that was discarding the first buff. Slight change to reloading buffs; if you have the weapon equiped when reloading, killing a zombie triggers the reload. - Unequiped items will still have to be equiped once to reload buffs.Update recommended. Once again, borked weapons will not be 'fixed', though I am working on a separate mod to recover them. Any weapon that does not have a suffix yet should be fine though. Planned Features: Combo weapon morphs: Kind of like easter eggs, these are more complex changes that happen when specific item types get certain buff categories/specific buffs. Note: Can be either suffix or prefix. Weapons keep their buffs. Will make it load a list so items from other mods that would fit into categories (e.g. survival axe as an axe) can get morphs too. Current ideas include:Throwing Spoons/Forks/Knives. If a spoon, fork or low tier knife (butter knife etc) gets a high tier range buff AND a knockback buff, it gets changed to a ranged weapon with no ammo requirements, be restricted to only hitting one target, and get 8 extra range. Will use aiming instead of blunt/blade from there after. HomeStar Runner. Baseball bat with swing speed and knockback buffs. Player gains movement speed while equipped. (pretty certain I can do this.) Foam Hammer. Sledgehammer with damage/knockback buff and feather (0 weight) buff. Swing speed increased, weapon uses no endurance, player gains happiness and reduces panic whenever they score a kill. [Easy] Kitchen Fan. Fryingpan with range or knockback. Greatly increased swing time (Very SLOW!), increased range, always knocks down enemies, max hit count increased to 20. Basically a magic fan hitting crowds of zombies with wind. [Moderate]It's All You Have, Or Need. (Based of the saying, when all you have is a hammer, every problem looks like nails.) Hammer or Axe with Wood-Foe legendary buff (+35 tree AND door/structure damage). Gains properties and abilities of hammers, sledgehammers and axes, you can build with it, barricade, destroy walls and chop trees. Gains high durability. [Hard] Friend of the Freemen. Crowbar with high durability buff and swing speed. Player becomes immune to panic while in inventory or equipped. Nerf Now. Requires pistol with durability and critical hit buffs. Gains Engi abilities (Can use it as a hammer, killed enemies have a high chance to drop metal.. i mean nails and it gains 100 damage to trees) Grave Digger, Shotgun with Damage and Critical hit buffs. Gains large clip size, extra durability, can be used as a spade. Butcher's Cleaver. Kitchen Knife (or mod cleaver) with critical hit buff AND legendary critical hit buff. Gains range, durability, and for some reason zombies you kill with it have their inventories full of delicious bacon... or is it steak? Hmm. Nope, tastes like bacon!
  20. Was it with a fresh weapon, or did the weapon have the prefix from the bugged version? Also, reload the game, re-equip the weapon, pause the game and alt-tab to look at the console. You will see a bunch of output like: Loading! MaxRange = 1.6Loading! SwingSpeed = 0.4Loading! ConditionMax = 30stored buff condition is 30Current Max Condition is 30Can you post that here? Thanks. This is actually how it currently works if you are using a low durability item. The distance between 0, buff1 and buff2 are directly determined by the items chance to lose durability and max durability, and is determined the first time you equip an item. If you want to see how many kills you need, that too is listed on the console. Just equip the weapon, pause, alt tab and it should say something like This is for a spoon Kills = 0Kills to Stage 1 = 2Kills to Stage 2 = 3Baseball bats take 16 kills to get the prefix (I think) and sledgehammers take much longer.
  21. Thanks for the bug report. I see the typo and it is fixed. I have fixed a lot of bugs. Unfortunatelly, you will have to use a new weapon. Also, check your console.txt for any stack traces. I have the mod print heaps of info as it is running. Also, looks like I forgot to put prefixes and suffixes for knock back, so you may have gotten a knockback buff. If you are using the old-slightly-borked version, the weapon will be broken when you reload the game (byte flip overflow error on max condition.) New, totally fixed version below! DOWNLOAD V0.3 http://www.filedropper.com/sandybeacheseditnamedweapons_3 CHANGELOG v0.3 Critical damage buffs now also increase tree/building damage.Knockback now has prefix/suffixes.Knockback now increases the number of targets hitRange now increases the number of targets hit (more than knockback)typos fixed.Deleted Herobrine
  22. Whoops, left one error in, I forgot to convert two values to integers when assigning them to namedWeaponstKillQuota. And another error fixed, turns out if a weapon is saved with a current durability of more than 127, there is a good chance it will be loaded with negative condition and instantly broken. Caused by condition being saved to file in a byte, nothing I can do about that. Luckily, I already had the checks needed to fix it! Tables are great. New, improved, now hopefully completely bug free version below. Remember that you must re-equip a weapon after reloading the game for the stats to be reapplied. DOWNLOAD http://www.filedropper.com/sandybeacheseditnamedweapons_2
  23. 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!
  24. 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...