Modding question

Been looking at modding some existing items but not sure the proper way to go about it. If I make a mod can I just ‘update’ the items in the mod, or do I have to blacklist the original item, and create a new one? Or is it something else?

So now on to some of the stuff I would like to do/address:
Personally, I want to flesh out throwing more. Add more weapons and add special attacks to some to help expand and hopefully make it more attractive/viable.
I would also like to make armor/clothing more varied. Currently most protection values are equal which would not be the case in reality. Simple clothing does nothing to protect against a bludgeoning attack.

I don’t know… thoughts/comments?

If you make a copy of the item with the same id but different stats in a mod, I believe it will overwrite the original.

New items: just copy, paste, and edit as desired. If you’re replacing the existing item, advertise as much and then I’d just change the existing item. (Yeah, what Kevin said.) Messing around with stuff that’s in a save either kills compatibility or creates Nones.

Work on the clothing sounds interesting. Throwing has been tried and I think that hit problems re weight/damage calculations, but maybe you’ll have better luck.

In regards to throwing: what I was thinking of was something, like a bola, that would entangle/trip opponents opening them up to further attacks, or allowing a retreat. Another idea was that the sling/slingshot could have a small chance to stun. BUT, I guess the first question should be: can ranged weapons have special effect/attacks?

Also, while doing research on clothing I came up with some questions, or things I would like to clarify:
What decides that a weapon is piercing? the spear tag?
What does environmental protection on something other than eyes and mouth do?
How does armor affect the damage calculations? I’m looking at the source, but want to make sure I’ve got it right.

Neat, good idea. This has been brought up, but no one has implemented it.

They can, though I’m not sure why a slingshot in particular should have a stun chance.
The two places to look are ammo_effects() in damage.cpp and deal_projectile_attack() in creature.cpp. The first is more for explosion and AOE type stuff, the second is where most attack effects happen. There’s already a stun effect from the beanbag rounds, though with a bola you might want an entangle thing.

[quote=“OrigamiZoo, post:4, topic:6640”]Also, while doing research on clothing I came up with some questions, or things I would like to clarify:
What decides that a weapon is piercing? the spear tag?[/quote]
Spear or pierce flag, they’re only very slightly different.

Diseases have a chance to infect based on the environmental protection of the body part they target. Different diseases target different body parts. Fungal spores for example target every body part, so you need total coverage to be safe from them, others only target eyes or mouth.

Armor simply has a damage negation value, incoming attacks are applied to the armor starting from the outermost and working its way in, finally hitting the player if it has damage left. Along the way it has a chance to damage the armor.

Ok, so just adding the items that I wanted to mod works fine… except for recipes. It is looking for a single item which, apparently, when you mod an item creates a duplicate of it. Just for reference both items have the same stats (looking at them through the debug menu).
No problem, recipe is minor anyway.
So I created my bola just to try see if I can get it to work like I hope. Looks like thrown weapons don’t trigger effects or techniques…
I’ll take a look at the code later to see if I can maybe spot the issue. (I can mostly read the source, just really suck at writing it :))
Anywho I’ll add what I have so if somebody sees something I missed… I’m using the large_beanbag as a test effect. Future plan would be to write a function to add different effects depending on area hit (Head could choke or stun, legs entangle/trip, ect.)

EDIT: Almost forgot… looks like adding stab or spear to thrown doesn’t seem to help either

{
        "type" : "AMMO",
        "id" : "bola",
        "category" : "weapons",
        "price" : 10000,
        "name" : "bola",
        "name_plural" : "bolas",
        "symbol" : ";",
        "color" : "light_gray",
        "description" : "A throwing weapon made of weights on the ends of interconnected cords, designed to capture animals by entangling their legs. Causes minor damage.",
        "material" : "cotton",
        "volume" : 1,
        "weight" : 907,
        "bashing" : 4,
        "cutting" : 0,
        "to_hit" : 1,
        "ammo_type" : "thrown",
        "casing" : "NULL",
        "damage" : 0,
        "pierce" : 0,
        "range" : 0,
        "dispersion" : 0,
        "recoil" : 0,
        "count": 1,
        "effects" : ["LARGE_BEANBAG"]
    },

Pro tip: Putting code tags inside of spoilers breaks them both. Just put it in the code tags and it will automatically create a scrollable, fairly small box.

As for throwing IIRC it was just never updated when the rest of the ranged weapons were (so it’s still using old code) and nobody has gotten around to doing it yet. There have been a few tweaks since then, but it’s still basically the same code it’s always been.