[b18] BookBurner's mods (electric fence, chemical waste disposal, dickbutt)

Started by BookBurner, August 20, 2017, 03:54:11 AM

Previous topic - Next topic

BookBurner

ELECTRIC FENCE

Electric fences have been used as perimeter security measures during the whole span of the 20th century ranging from stun fences to lethal perimeter defense.

This mod aims to do just that :)

Electric fence is connected to you power grid and and the more power the grid has, the more damage the fence does. Injuries ranging from small burns to instant deaths with corpses set on fire by electrical currents.

mod contains:
- electric fence: works as a power conduit that tan be climbed (like sandbags) but does burn damage to anything potentially hostile that might try (animals and neutral factions included) when connected to power
- electric fence gate: gate that can be opened by anyone but that does damage to potentially hostile factions
- plasma version of the fence which has different power calculation which favours large stable power gains
- stun floor panels

mechanics:
fence does damage based on positive power gain in the power grid and on power stored in the batteries in the power grid. The more power stored in the grid, the more efficient the fence is.

Steam link:
http://steamcommunity.com/sharedfiles/filedetails/?id=1103101448

Dropbox
https://www.dropbox.com/s/pzkw3fwkpcxxfnd/ElectricFence.rar?dl=0

Known bugs
- missing dynamic pathing (enemies go directly for the gate)
- fence gate does not align with fence (sandbag problem)
- insects from infestation are not affected by the fence


DICKBUTT

dickbutt, no other explanation needed :)
advanced intelligence critter that can be found in arid, tropic and temperate biomes. Can be bought from traders and provides 200 units of meat while hunted or slaughtered.

ancient dickbutt
bigger and stronger version of dickbutt with manhunter pack possibility

pet stone
slow, eats a lot, sheds it's shell every day in form of raw limestone

both dickbutt versions lay bricks over time and can be sheared for some steel.

Steam link:
http://steamcommunity.com/sharedfiles/filedetails/?id=1128770769

Dropbox
https://www.dropbox.com/s/mdpkcjq3jwphp5i/dickbutt.rar?dl=0


CHEMICAL WASTE DISPOSAL

Break anything you don't need into chemical compounds. Can be used as a good form of waste disposal.

Produce Steel, Neutroamine, Uranium and other stuff from chemical compounds.

Contains:
- chemical power plant produces power from chemical compounds
- chemical synthesizer dissolves stuff into chemical compounds and allows producing useful resources
- chemical launcher, weapon which causes chemical burns
- chemical compound post-processing into ionic particle mass
- production of synthread, hyperweave and three new fabrics from ionic particle mass (one of the pictures shows the differences)

Steam link:
http://steamcommunity.com/sharedfiles/filedetails/?id=1121259411

Dropbox
https://www.dropbox.com/s/9tj60qe8b4is0l9/Chemical_plant.rar?dl=0

faltonico

Thank you for finally posting it here!
The dropbox link is not for the download but for dropbox's home page xD

Canute

Interesting concept, i didn't used it yet but i think it could be a bit to powerful.

How does the enemies react on these fences ? Does they try to destroy/set on fire them when no friendlies are on range, like wall/door or plants ?

BookBurner

Quote from: faltonico on August 20, 2017, 05:02:27 AM
Thank you for finally posting it here!
The dropbox link is not for the download but for dropbox's home page xD

my bad, link fixed :D

BookBurner

Quote from: Canute on August 20, 2017, 06:11:56 AM
Interesting concept, i didn't used it yet but i think it could be a bit to powerful.

How does the enemies react on these fences ? Does they try to destroy/set on fire them when no friendlies are on range, like wall/door or plants ?

I created the gate passable by anyone, so enemies and animals try to pass through it by using fence gate unless it is on fire or something. Fence itself has quite low HP and it burns.

Formula for damage can lead to instant kills if user has large power gain in the grid and more than 10k stored power. But since every hit drains maximum of 1k power from the batteries, it can deplete your power reserves quickly and then it does only limited damage based on the steady power gain. From my experience, in large raids, it kills 10 - 14 people and then they pass through relatively unharmed. Either the fence depleted my power reserves or burned itself down. (large damage done by the fence leads to fire which has to be extinguished).

Also, long fences around bases are not that practical since animals trigger it quite often, leading to constant state of empty batteries.

Canute

Quotemore than 10k stored power.
Ah ok battery.
But what happen when i don't use batteries. But got 10k surplus power ?
Unlimted dead strikes ?

BookBurner

Quote from: Canute on August 20, 2017, 12:24:55 PM
Quotemore than 10k stored power.
Ah ok battery.
But what happen when i don't use batteries. But got 10k surplus power ?
Unlimted dead strikes ?

Well, lets calculate damage for a case 10k power gain and 10k power stored, we will ignore the power gain to the batteries between hits

formula is like this:

Pg = positive gain of power in the grid
Psb = power stored in batteries

damage = (Pg/1000) * (Psb / 1000) + (Psb(max 10k power) / 100)

fence hit drains 1k battery power if it can

1. hit = 10 * 10 + 100 = 200 dmg
2. hit = 10 * 9 + 90 = 180 dmg
3. hit = 10 * 8 + 80 = 160 dmg
4. hit = 10 * 7 + 70 = 140 dmg
5. hit = 10 * 6 + 60 = 120 dmg
6. hit = 10 * 5 + 50 = 100 dmg (still enough to burn off limbs and so on)
7. hit = 10 * 4 + 40 = 80 dmg
8. hit = 10 * 3 + 30 = 60 dmg
9. hit = 10 * 2 + 20 = 40 dmg (below this the injuries are not severe enough to stop human pawn)
10. hit = 10 * 1 + 10 = 20 dmg

other hits without stored power

hit = 10 * 1 + 0 = 10 dmg

Canute

Ok, no batteries no damage. :-(

I think you should modify it a bit to take in count a power system without batteries.
damage = pg/1000 * 100  + Psb(max 1k power) / 1000 *100

no damage when pg is below 1000 and Psb is 0.

BookBurner

#8
Well, that is doable for sure, but with the case mentioned it would do damage with ranges

100 -> 200, never going below (I used the formula you mentioned).

wouldn't that be OP?

But you gave me an idea. What about having two type of fences, one which works as designed by me, using battery power and second with different visuals which is stronger (more damage from Pg, less added damage from Psb but less power drain from batts as well) but perhaps more complicated meaning slightly less HP? Meaning more solid damage, but higher chance of fence breaking and allowing enemies to pass through during bigger raids.

Canute

Yep my formula is to bad, not balanced at last.
I just wanted create something that give a damage from the surplus power + extra damage from stored power.
200 damage is OP anyway, even the best other traps build with plasteel just  around 100 damage, which is mosttimes enough to kill normal raiders.
I don't know how expierenced you are at moding, but since you use a .dll you shouldn't be a simple xml modder ! :-)
What do you think to limit the fence damage to 100. When the surplus power isn't enough to reach the damage, it will use stored power to reach the maximum.


BookBurner

okey, new version released, with plasma fences and stun floor panels, enjoy :)

kaptain_kavern

Now you got me really intrigued :p

Thanks for your work

BookBurner

I repost the same problem I have with my mod at the moment. If anyone here has more experiences with C# coding of rimworld mods than I have :)

Hi, I am writing a trap mod which has several kinds of traps and one generic function for deciding which pawn can be hit by it or not. I have issues with method which decides this. Function is as follows.

public static bool CoreKnowsOfTrap (Pawn p, Faction f)
{
    Lord lord = p.GetLord ();
    if (p != null && p.def.race.Animal && p.Faction == Faction.OfPlayer && !p.InAggroMentalState) { // tamed animals
        return true;
    } else if (p != null && p.def.race.Animal && lord != null) { // caravan animals
        return true;
    } else if (p != null && p.def.race.Animal) {
        return false;
    }
    if (p.guest != null && lord != null && (lord.LordJob is LordJob_FormAndSendCaravan || lord.LordJob is LordJob_AssistColony || lord.LordJob is LordJob_VisitColony)) { // caravans, friendlies, visitors
        return true;
    }
    if (p.guest != null && p.guest.released) { // released prisoners
        return true;
    }
    if (p.guest != null && p.guest.IsPrisoner && !p.guest.PrisonerIsSecure && !p.guest.released) { // escaping prisoners
        return false;
    }
    if (p.Faction != null && !p.Faction.HostileTo (f)) { // non hostiles
        return true;
    }
    if (p.Faction.IsPlayer && p.RaceProps.Humanlike) { // player humanlike pawns
        return true;
    }

    return false;
}


and usage is here:

private bool KnowsOfTrapFence (Pawn p)
{
    return fenceCore.CoreKnowsOfTrap (p, base.Faction);
}



pawn is the pawn thet is on the trap, base.faction is a faction of trap (basically player faction)

I have a problem with released prisoners, they are not hostile but they are still hit by the trap and I can't wrap my head around how to differenciate released prisoner from escaped prisoner. So escaped prisoner is killed by trap but released prisoner isn't.

same thing with animals from infestations, I wasn't able to designate those as hostiles for the trap either.

Anyone solved something like this? Google is unfortunately silent... :)

BookBurner

updated script to allow passage for released prisoners