Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Newbie modder pondering Seige Defense Surprises  (Read 2069 times)

wizardofaus

  • Bay Watcher
    • View Profile
Newbie modder pondering Seige Defense Surprises
« on: December 29, 2013, 11:21:44 pm »

So I've picked up Dwarf Fortress and fallen into playing with it lately due to some prolonged downtime, most particularly Meph's Masterwork mod, and I've been enjoying it a lot... but of course there's that nagging little voice that says, 'Yes, but why can't we...'

So, I've also been reading, and scribbling, and looking through mods - for ideas, and to see what others have done so I can see what's possible versus what's a really bad idea for a new modder to get obsessed over. Still, I figured I may as well start rambling to hear opinions (and if they have suggestions I missed). Plus, I'm still new enough to not have even gotten into the realms of cotton candy, so some game concepts I'm still shaky on...

Gunpowder Cannon: Masterwork has new seige engines and gunpowder, so I'm pondering how hard this would be to make. I'd especially like to change the size. A 1x3 device that fires in a straight line would be appealing (and a great way to create your own dwarven bowling alley - load up your favorite bowling block and fire!) Creating a 'gunpowder cannon' ammo would take two reagants - gunpowder, and a block.

Steam Cannon: If a gunpowder cannon would work, why not a steam cannon? Well... building a 'steam cannon charge' ammo would take three reagants - fuel, water, and a block.

Steam Geyser: This one I'm a little more shaky on - firing a gust of steam forward to parboil any poor blighter that gets in front of it. The ammo I'm thinking of would definitely require a special workshop (to make sense, anyhow) - it'd be a pressurized canister of steam, after all. (And hey, who doesn't need a pressurized canister of steam that might explode if damaged?) If I understand right, ammo doesn't self-terminate, though... which would be problematic for this and some other things.

Flame Geyser: As above, but loaded with a pressurized canister of flammables. (Oil would work nicely.) Again, highly dubious as to whether I can get this to work in practice, but I want to set people on fire and if these were good enough for those silly humans from Romance of the Three Kingdoms, they're good enough for Superior Dwarven Craftsmanship. (Or gnomish, or something else... function first, lore after one's done giggling over the ashes.)

Booze Fountain: Great fun at parties, this fires a high-pressure blast of liquid. Again, aside from maybe generating a 'liquid' impact on the first creature within (range) tiles and knockback, as well as figuring out how to contaminate the remaining tiles with liquid, not sure how to do this. On the other hand, steel barrel of dwarven beer pressurized? Got yourself a keg, son. Or, well, ammo. Either way, a great way to welcome new nobles. Humans would probably prefer a water cannon that just requires water and is pressurized by cranking it before you fire.

Netcaster: A 'cannon' that fires (nets / webbing?) that only hits a single target instead of spraying all over like a dwarven child's first experiment with magma. For catching those pesty hard to catch types. Requires nets as ammo (made from silk) or maybe just silk, if I feel like being lazy. May just require handcranking to prime, since it's mechanical and doesn't require high power.

Dart Pistol: Want something more technological but can't commit to gunpowder? Welcome to the age of spring-powered weaponry! The Dart Pistol, powered by a butterfly spring, fires darts (blowgun size) that (with Masterwork) could presumably be poisoned, but would be very small and go far. Probably wouldn't go through even leather, so hit them in the face...

Dart Rifle: A better version with longer range (which probably translates to slightly higher velocity or something, not entirely sure. Would have to start playing with the arena in earnest when I make this to test.) Still, basic idea is the same - a twohanded 'rifle' like those many 'black powder' / 'modern' firearms out there, but built out of mechanisms of metal and menacing with a tiny dart of poison doom.

Sprinkler System/Forest Fire Station: This one I want to try just to see if it's possible. Basic idea: you have to 'prime' it with water and cranking to pressurize water (or maybe load it up with a pressurized water tank from the water cannon idea) - either way, this probably results in a 'boulder' that stays on the 'workshop' until it's deconstructed. The workshop deconstructs if it detects a fire (or if lazy or unable to figure out, when it gets burned up). When the boulder releases, the surrounding area gets splashed with water.

Custom Containers: So I've read a lot of threads and mods, but not nearly all of them; those I've seen make me think this is hard or impractical. In short, we have the bin to store things in. That's good. But I want a container that automatically only accepts a certain type of items into itself but is not a stack. Why? My biggest reason is electricity. I'm going to dig into Deon's Fallout mod and a few other 'modern' mods to see how they've coped, but so far, what I've seen is that Dwarfpower is mechanical in nature, and for some of the mods I'm thinking of making, I'd like to build a way to convert it to electrical in nature, or to generate electricity. (Be it by chemical battery made of iron, copper, and alcohol or a copper corkscrew within a magnetite barrel, the details of how can wait.) Since workshops don't currently use mechanical power, but can use items, if electrical power is an item... then a 'battery' that holds '50 units of charge' and can hold a maximum of 100 -- well, you see what I'm getting at. I just want to avoid 'battery stack destroyed for reaction that requires one unit of battery'.

Electroshock Therapy: Something to do with that electricity - wire a battery to a chair and let your fort's psychiatrist give people therapy! (And, via a LUA script, I believe this could change traits, not necessarily for the better. Not sure if this could be done without invoking DFHack.) I blame the mad science thread I was reading for this one.

Electrocution: Because burning people to death with electricity is funny. Also because I want to learn about syndromes, and therefore, I want to make something that hurts you like fire, also does damage to your nerves, and generally isn't pleasant. The syndrome would be centered on a tile (that might be a 'Electrocution Trap' pet) that uses the syndrome when it is touched. (... or submerged in water, with damage radiating outward throughout the water... )

Triggers: On the end of the out-there scale... triggers. I don't think there's anything to be done about making new triggers, but syndromes make me wonder. In short, I want to invent new triggers and sensors (a trigger activated when a temperature goes too high, for instance, or a line-of-sight trigger to spot trespassers - trapavoid -that!-, or a numeric sensor that goes off when a set of triggers reaches or exceeds a preset number (with additive triggers that add X to that number, subtractive triggers to subtract X, negating triggers to reduce to zero, override triggers to activate always, multiplicative triggers to multiply by X, divisive triggers to divide by X)... I know some of this can be done with creature logic or complicated constructions, but I'd love to simplify.

So... yeah. Any of this definitely impossible?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #1 on: December 30, 2013, 12:34:28 am »

Any of this definitely impossible?

 - New siege engines are impossible. Mine are hacky, I made workshops, and the actual fighting is done by transforming the worker into a immobile siege-operator who fights with interactions. If you go with this style, you can do all the ones you describe, but not exactly as intended.

 - Geysers are impossible. But you can make creatures that fire projectiles that use ProjectileExtension, a script by Putnam, to generate fire and steam with them. Again, done with creatures and interactions.

 - Booze Fountain: Impossible. You can build it with water pressure and large tanks and minecarts and doors and levers... but not as a workshop.

 - Netcaster: As a creature, possible. Same as above. I even have one of these already, the web-turret.

 - Dart Pistol/Rifle: Possible.

 - Sprinkler System/Forest Fire Station: Solid idea, but if I remember correctly the amount of liquids a workshop can hold is limited by the size. I tried making magma-landmines this way once. Buildingdestroyers raze the workshop, release the magma. I kinda worked, but not really. But this one requires testing. I personally use "praying for rain" or magical weather control to stop fires. They happen quite often in the mod, as you maybe noticed. ;)

 - Custom Containers: That works. I once made an "essence container" that took up to 1000 essence. Dont ask why, I am just saying that a "battery container" that takes up "charges" is possible. You can even have workshops use the battery and only use the charges inside, leaving the battery intact. Another way would be to make two items, "full/empty battery". You cant really make "powered" workshops, like the millstone, but you can simulate it. ... ... ... Actually... you could use the string dump replacer to rename the millstone to "Dynamo", which requires real mechanical power, and it runs reactions to charge batteries. This way you could use the real DF machinery, waterwheels and windmills, to charge your electricity. The vanilla millstone reactions could just be disabled and left at the quern. Seriously, who uses millstones anyway... Mh... that got me thinking. IndigoFenix would probably like this.

 - Electroshock Therapy: You cant really wire anything to chairs/thrones, but you can make a custom workshop for this. I assume that this should be similar to the "lobotomy" option I have in the Apothecary? You can certainly influence traits or mental stats with a workshop.

 - Electrocution: Works with a creature, OR have a look at the totem-bomb and booby-trap items and materials. Kobolds have them. They are AoE trap components. You make a ranged weapon that is so large, no one can use it. This means this ranged weapon can only be used in weapon traps. Then you make ammo that only fits into this ranged weapon... effectively the charges for your trap. The ammo uses itemsyndrome/projectileexpansion to affect the target with interactions/creates a cloud that carries a syndromes. This way I made little weapontraps, that when triggered, have an AoE effect. Dwarves automatically reload them, as soon as ammo is available. Ammo could be named battery or charges or capacitor-rod, and the ranged weapon a tesla-coil. ;)

 - Triggers: As IndigoFenix said in another post: Interactions are turing complete. In theory you can program anything into interactions. So... yes. Triggers are possible, but will become very complex, very fast.

On a personal note: I really like this thread. So many good ideas. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #2 on: December 30, 2013, 02:36:21 pm »

Thanks! I've been thinking up a ton of things, and when you get stuck with a game and a lot of thinking, you get !!ideas!!. Not necessarily good ones, but it's good to separate the 'ones you can do with effort' from the 'ones that are not going to happen on your part'. I just figured I'd try not to splat my first post with a ton of random ideas, hee. (And naturally I then proceeded to sneak other things in anyhow.)

Various Cannons: Seige-engines-as-creatures seems the best way to go for the cannons and geyser, then - the web turret I already know and love (and use as a friendly welcoming committee to anyone who gets past a certain point in my defensive structure, in collusion with cage traps. Only problem is, they don't lock in one direction (well, not a problem for the defenders, unless you're worried about friendly fire...) Science will have to ensue.

Sprinkler System: Yes, I noticed how easily you can disappoint Smokey the Dwarf (and occasionally have started some myself quasi-intentionally, hence my thinking about it -- "Okay, that solved the problem, now how do we put the fire -out?" "You mean we wanted to be able to do that?") On one of my earlier games, I had a very bad habit of setting the first cavern on fire, which I 'solved' by washing out the fire with the water collected from the runoff from the archer practice arena / dance parlor that pooled at the bottom of the drowning chamber / pit of doom downstairs. Still... even though I've had a very bad habit of going overkill with water pathing, it occurs to me that maybe I should be trying to make something a little smarter, hence the idea of pressurizing water inside of a container. The tanker carts were my first inkling of 'yes, this should be doable as written', but the 'creature that can spray things all over' might also work, if they can generate water as well as steam. ("Warning: Water Landmine. Break in case of fire or uncleanliness or just because you feel surly.")

Custom Containers: (I won't ask, but I'll admit I'm curious.) This is the one thing I really want to get into -- and for much the reason you're discussing here, especially if workshops can use the battery and only take out the charges inside -- then dwarves (or gnomes, if Ms. Fenix does her civ for them, or whatever modern mod needs electrical power) could haul their steampunk battery over and plug it in to get things done using charge as part of the reagants, and the only other question would be to convert mechanical to electrical power. The millstone is what I was thinking of tying things to, precisely for that reason (I knew reactions can be added to it - didn't know you can rename it, which would be nice, if only for flavor's sakes). Plus, if I can get a handle on a single type of custom container, I can do it for other things (see also: the original idea about making a pressurized tank as a container, and loading it up with 'pressurized water', 'pressurized air', or so on for reagants' sakes.) And if capacity can be set to something other than 20 units... going to have to figure out how to do this, but the fact that it's been done is highly encouraging. If you happen to have an example somewhere (or can point me in the right direction), I'd really appreciate it, because it sounds like this'll be the linchpin for my electric mayhem.

Electroshock Therapy: Yes -- I've honestly been wary of trying Lobotomy out 'just to see what happens', but I'm going to have to root around in there to see 'how one does it' - and what it does. (And whether you can use it on someone specifically because they annoy you -- "Urist McDimwit has sealed himself behind the floodgate once too often" -- instead of having your psychiatrist run around electrocuting dwarves at random because he's been given a fresh battery and a barrel of dwarven wine. Or at least whether you can make the psychatrist pick on the ones that are 'too liberal' or something. This isn't no elf hippie commune! "Give therapy to suspected elf-lovers".) If I can get the psychiatrist position exclusively to get the right to shock the bejeezus out of people, bonus. (Mind you, it brings up another question - could one make a similar workshop to shock the bejeezus out of normally untameable things until they agree to be 'tame' to stop you from shocking the bejeezus out of 'em? Dwarven psychology: we have ways of making you think the way we prefer.) And, if Lobotomy specifically invokes the brainwash DFHack script, I'd have to tweak it to do something a little less... drastic and not necessarily beneficial to dwarfkind, since electrocuting someone's brain generally isn't always a good thing. (Second side question: can you make new thoughts? Urist McShockedBeard was unhappy to receive electroshock therapy lately...)

Electrocution: Will definitely have to take a closer look at that and use it for advice on the subject - it sounds like it should do very nicely and may give me ideas for some other weapon types, too. Bzzzap! (I'll worry about 'channeling electricity through water' some other time because I'm pretty darn sure that's a much nastier beast to slay, if it can be wounded at all.)

Triggers: As IndigoFenix also said, unfortunately, they're missing that 'force use this as soon as possible' bit that'd finish the job, which makes it more a game of AI roulette, if I understand right -- but then again, that just means you have to make a network of 'insecurity cameras' to deal with each other's potential lack of immediate response. Or (and this is what got me thinking of building such) a series of additive (or subtractive) triggers so that if a few go off accidentally due to the dumbs of the system, the system has a numeric threshold before it goes and releases magma on the world. (A lazier way of implementing those complex self-destruct systems, or just activating the yearly hall-washing system.) Or something. So probably best for my sanity to start with things like 'shiny weapon' and 'new critter' and 'dear god why does that have claws', but good to hear that it's not exactly impossible, and that gets me thinking about condensing things like repeaters and operators into single-entity triggers... So -- just to be clear, would any of these be capable of being connected to a door, a hatch, or a weapon trap (similar to how a pressure plate currently can be)?

Adding more of my thoughts to the list regarding electricity - I'm actually sure now that most of these are doable, I just want to note them down and refine a few points:

Steam Generator: Basically, just a custom workshop. You put in water, fuel, and a (custom container) battery that has room in it (is not full). The reaction gives out a decent charge for the effort, and probably trains machine operator. Should be made from firesafe materials. Requires a corkscrew, two copper barrels, and iron bars. (Tempted to require magnetite, but...)

Dwarf-Power Generator: Another custom workshop. You give it a (custom container) battery to charge, and your dwarf starts peddling. (Would probably borrow from the weight bench.) Trains Athlete and other weight-benchy attributes to a small degree, and provides charge (though not nearly as well as the steam generator would). Requires a corkscrew, two copper barrels, and iron bars.

Dwarf-Brew Generator: I'll stop with the generators after this one, I swear. Same general concept - except you give it a battery and it charges it a little bit on each reaction. Why? Because it's a chemical battery that generates a constant but extremely low voltage. (Realists might point out that chemical batteries wear out. To that I say, 'dwarves sleep only a couple times a year and you didn't complain about that...' Besides, the concept could just as easily be used for future/modern mods for post-modern nuclear reactors and the like. Working out concepts and how to make them first; finding appropriate places for them later.) Anyhow. The chemical generator version would probably require the corkscrew, copper barrels, iron bars, and the most sacred of things to dwarves, two barrels of alcohol. (If I could require masterwork brew, I would, just because it's that much of a sacrifice to be using up the booze on something to fry goblins.) Modernists/futurists could extend this to a solar generator that doesn't require the booze, and may require different materials to make, but must be built on a Light tile. (The fact that Light tiles underground frequently end up covered by floors because otherwise things fly in is an exercise in 'do we care?' If you're worried, make it a glass floor; if you're not, make it out of lignite and light it on fire every now and then as part of the traditional welcome to beseigers... okay, so that wasn't the best idea, and forgetting to un-designate all the trees for chopping was also not wise... I've learned things.)

Electroplating: This, I suspect, isn't quite doable from what I understand... or more accurately, if I wanted to do it, I'd have to create new materials for things - but here's the basic idea. Essentially, you have a workshop. You take your iron longsword to it along with your units of electrical charge and a bar of silver, a reaction happens, you get back a silvered iron longsword. Effects: if silver does any good in your world, great, now your iron longsword can hurt it, without the whole thing being made of silver. Problems: I don't think items have 'layers' like creatures do, so essentially I'd be creating 'silvered iron' as a material, for example. Also, there's the question of 'is one silver bar burned per weapon too much', but eh, if it is, make more weapons at once, I would suppose. Silvered iron bolts would be more practical anyhow.

Electric-Powered _____: So, let's say we rename the millstone to a dynamo, but it still requires mechanical power to get things done, and people want millstone reactions using electrical power. Or whatever. I imagine that one could build a 'Electric-Powered Millstone' that takes units of charge to get things done that would normally require mechanical power. Not strictly necessary, just throwing it in under the 'why not' category. After all, if I can get some of those axles out of the way, I have more room for ridiculously elaborate deathtraps.

(And yes, I freely admit some of the things I'm thinking of won't fit in a vanilla DF world, or may be 'too techno/too steampunk' for some people's vision of dwarves. Again, lore later, function now, fun most of all.)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #3 on: December 30, 2013, 05:39:09 pm »

Various Cannons: Your only problems seems the "they don't lock in one direction". Solution: Build a U made of walls around them. Leave only one direction open for them to shoot at.

Sprinkler System: The main issue is the reaction time. Constructing something to stop fires is too late, if the fire already started. Constructing something ahead of time can already be done: Channels. Fire doesnt burn up/down, so a few channels will stop fires any time. No need for a complex firesprinkler system, but I would still like to give it a try at some point.

Custom Containers:
Code: [Select]
[ITEM_TOOL:ITEM_TOOL_ESSENCE_CONTAINER]
[NAME:essence container:essence containers]
[VALUE:10]
[SOFT_MAT]
[TOOL_USE:SMALL_OBJECT_STORAGE]
[TILE:173]
[SIZE:100]
[MATERIAL_SIZE:1][UNIMPROVABLE]
[CONTAINER_CAPACITY:1000000]

[ITEM_TOOL:ITEM_TOOL_ESSENCE]
[NAME:essence:essence]
[VALUE:0]
[SOFT_MAT]
[TILE:173]
[SIZE:1]
[MATERIAL_SIZE:1][UNIMPROVABLE]
This is the container and the product. If you rename them to battery and charge, you are all set. Maybe make different sizes, small battery takes X charge, battery 3*X, large battery 10*X. Just a suggestion.

Electroshock Therapy: You misunderstood how it works. Its not the psychiatrist dwarf that does it to others... its another workshop, which affects the worker. So you build the Apothecary, say "lobotomize dwarf", select the dwarf you want using the workshop-profile, and he will go to the workshop and leave lobotomized. It doesnt even need dfhack, it simply makes him a bit mentally stupid, sets his skill learn rates lower, and adds the NOEMOTION tag, which stops any good/bad thoughts. He will never tantrum, which is the main point.

Electrocution: First I wanted to say that water-conduction isnt possible... but actually it can be done. There is this rarely used tag for interactions: IE_LOCATION:IN_WATER. (there is also nowater, inmagma and nomagma). So if you want to electrocute people, just make a workshop, flood it a little (so that dwarves can still pathfind to it), and give the worker the interaction to affect all nearby (lets say 50 tiles) creatures. Not sight range, but EVERTHING within a 50 tile radius. That works even through solid rock, doesnt matter. And the interaction adds a self-targetted interaction to every creature that electrocutes them, adding pain, unconciousness, all that stuff, but only if they stand in water at the moment. This would mean you could build a shallow pool, 1-3 water depth, have a nearby "electrocute workshop", and have the worker (who is immune) run the reaction to electrocute everyone. It would work.

Triggers: No, cant be linked to furniture or machinery. Only creatures with interactions, or items with itemsyndrome, which adds interactions to creatures that use them. For example a "arc thrower" that allow a dwarf to use electrocute interactions.

Generators: All three possible, even if the millstone thing requires some fiddling. The steam engine is done btw, its already included in MDF. It generates mechanical power, yeah, but a reaction for your electrical charge could be added without problem.

Electroplating: Absolutely possible. That is exactly how I do the poisons and runesmithing. Adding a material on top of a weapon or armor that adds a special effect. SPATTER_ADD plugin is the one you want.

Electric-Powered _____:Sure, all possible, because its simple reaction, like everything else, just using your custom container batteries as reagent. :)

Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #4 on: December 31, 2013, 10:53:39 am »

Excellent! I'm going to start trying to put some of these ideas into practice - especially the custom container - and see how they function and whether they act the way I expect, before I start working on the harder stuff, although I'm going to use the electrocution setup as a tester for 'do I understand interactions and workshops and how they combine well enough to make this work?', because truthfully, that sounds -awesome-. "Urist McScientist enjoyed cooking with electricity lately..."

And d'oh - yeah, probably should've thought of that as far as the cannons, etc. go. Enforced line of sight, and preferably take steps to keep dwarves out of it (restrict traffic, open only to invaders, etc) unless dwarfgenics are in play. "Sure, you can join our fortress... If you can survive the MurderGauntlet." (Ah, I think I've found my test fortress name, unless 'Shocking Lack of Wisdom' is in the langfiles... hm, could fix that if it isn't.)

As for the sprinklers, I know you -can- simply dig a trench to prevent fire spreading and it does keep to one Z-level (after previous 'experiments' involving the first cavern level and pyromania), but where's the fun in that when you can build an overcomplicated object on the back-end that takes up a very small space on the front-end? Seriously, my thought was to park it next to the thing you expect will stupidly burst into flames, or on the path you expect will probably cause problems that you really can't afford to cut holes through because you designed poorly. (Truthfully, my -original- thought was to have a sprinkler system so that if some flaming idiot were running nearby it'd douse them, after noting the risks of explosions and fires in the chemist laboratory and thinking I probably should've built it at the top of a tower or something instead of next door to the alchemist's and the toxicologist's, but I was later distracted by the fact that one of the mountain forts I had was having a prolonged forest fire, and it was slowing down the framerate - I was on a laptop at the time where pretty much anything slows down the framerate, to be fair.)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #5 on: December 31, 2013, 04:12:41 pm »

Keep one thing in mind: Stacks. Reactions always use up the entire stack, no matter what. So if you have "Charge:1000", and only use 1 charge in a reaction, all 1000 will be gone. The battery will be empty. Better to split it up, or only use reactions that make sense with larger charges.

Just to make it clear: If the reagent is 1 and the product is 1, and you use a battery with 1000 charges, it will product 1000 products as well. If the reagent is 500, the product is 1, it will be 2 products. The stack is always used up, but it also always fully used to make products. I hope I explained that in a way that makes sense. ^^ DOES_NOT_DETERMINE_PRODUCT_AMOUNT helps with that, then you always get exactly the amount of products you specified.

Just something I had to think of, when you make batteries with so many charge-items in them.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #6 on: January 01, 2014, 06:58:55 pm »

Gotcha. I'm testing out the first bits and pieces now with a simple 1x1 test building to test how reactions work and make sure I'm writing it correctly (the battery makers and chargers, plus one using charge to convert a bar of copper into a bar of orichalcum, and one just lazily calling the Lobotomy effect with a 1% chance of also calling the Fire effect, just for laughs - I'll make something more original as I go, this is mostly just me teaching myself how it works for now), and to make sure I actually added things to buildings in the way I intended.

So far, I found that I made a few schoolboy errors, but mostly in the 'messed up the alcohol requirement call' category on the battery I tried it on - which is just going to take some tinkering to get right. (I intended to use lead bars and alcohol to create the batteries, as a nod to lead-acid batteries, and apparently it's not recognizing my beverages appropriately. At least the 'number of lead bars required' seems to work fine.) As soon as I make sure that the 'batteries' hold nothing but 'charge', and that any of the three battery sizes I made, if holding an appropriate amount of charge, can be called on appropriately, it'll be time for round 2 - making more lore-friendly uses for it, and making sure that reactions aren't, well, over-reacting. (And then onwards to electrocution!)

And happy new year!
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #7 on: January 01, 2014, 09:56:49 pm »

Maybe post the reactions. More experienced modders can probably spot some mistakes directly. Wouldnt want you wasting time on trail and error, just because the wiki explains the syntax not well enough. ;)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #8 on: January 02, 2014, 11:09:28 am »

Yeaaah... gonna do that. (My tests revealed that my battery creator was instead creating random steel weaponry(!), and my charge creator was creating random unlabeled 'pot', 'jug', and 'crafts' items. I officially have no idea what I'm doing, hee. But at least it shows up!)

In reactions_aus.txt:
Code: [Select]

[OBJECT:REACTION]

[REACTION:REACTION_TEST_TITLE]
[NAME:========REACTION TESTS========]
[BUILDING:AUS_REACTION_TESTER:NONE]

[REACTION:CONSTRUCT_BATTERY_SMALL]
[NAME:Make a small battery]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:150:BAR:NONE:INORGANIC:LEAD]
[REAGENT:booze:150:DRINK:NONE:NONE:NONE][DOES_NOT_DETERMINE_PRODUCT_AMOUNT] //add alcohol for acid
[PRODUCT:100:1:TOOL:ITEM_TOOL_BATTERY_SMALL:INORGANIC:LEAD]
[SKILL:METALCRAFT]

[REACTION:CONSTRUCT_BATTERY_MEDIUM]
[NAME:Make a medium battery]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:300:BAR:NONE:INORGANIC:LEAD]
//add alcohol for acid
[PRODUCT:100:1:WEAPON:ITEM_TOOL_BATTERY_SMALL:INORGANIC:STEEL]
[PRODUCT:1:1:BOULDER:NONE:INORGANIC:KNOWLEDGE_STONE] // just adding this to note that this is how to make a reaction 'skill up' someone.
[SKILL:METALCRAFT]

[REACTION:CONSTRUCT_BATTERY_LARGE]
[NAME:Make a large battery]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:600:BAR:NONE:INORGANIC:LEAD]
//add alcohol for acid
[PRODUCT:100:1:WEAPON:ITEM_TOOL_BATTERY_SMALL:INORGANIC:STEEL]
[PRODUCT:2:1:BOULDER:NONE:INORGANIC:KNOWLEDGE_STONE] // just adding this to note that this is how to make a reaction 'skill up' someone.
[SKILL:METALCRAFT]


[REACTION:SHOCK_THERAPY]
[NAME:Report for electroshock therapy]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:charge:5:TOOL:ITEM_TOOL:NONE:NONE][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:battery:1:NONE:NONE:NONE:NONE]
[CONTAINS:charge]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:1:1:BOULDER:NONE:INORGANIC:VIOLENT_REACTION]
[PRODUCT:100:1:BOULDER:NONE:INORGANIC:LOBOTOMY] //based on Meph's Lobotomy, see his code and work out my own version for ELECTROSHOCK...


[REACTION:SHOCK_THAT_COPPER]
[NAME:Energize copper into orichalcum]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:150:BAR:NONE:INORGANIC:COPPER]
[REAGENT:charge:10:TOOL:ITEM_TOOL:NONE:NONE][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:battery:1:NONE:NONE:NONE:NONE]
[CONTAINS:charge]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:1:BAR:NONE:INORGANIC:ORICHALCUM_ORC][PRODUCT_DIMENSION:150] //convert charge into something to see if it is working.



[REACTION:GENERATE_CHARGE_S]
[NAME:Charge a small battery]
[BUILDING:MILLSTONE:CUSTOM_ALT_A]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:1:TOOL:ITEM_TOOL_BATTERY_SMALL:NONE:NONE][PRESERVE_REAGANT]
[PRODUCT:100:5:TOOL:ITEM_TOOL_CHARGE:NONE:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]

[REACTION:GENERATE_CHARGE_M]
[NAME:Charge a medium battery]
[BUILDING:MILLSTONE:CUSTOM_ALT_B]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:1:TOOL:ITEM_TOOL_BATTERY_MEDIUM:NONE:NONE][PRESERVE_REAGANT]
[PRODUCT:100:5:TOOL:ITEM_TOOL_CHARGE:NONE:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]

[REACTION:GENERATE_CHARGE_L]
[NAME:Charge a large battery]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[BUILDING:MILLSTONE:CUSTOM_ALT_C]
[REAGENT:A:1:TOOL:ITEM_TOOL_BATTERY_LARGE:NONE:NONE][PRESERVE_REAGANT]
[PRODUCT:100:5:TOOL:ITEM_TOOL_CHARGE:NONE:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]

In item_electric_aus.txt:
Code: [Select]
[ITEM_TOOL:ITEM_TOOL_BATTERY_SMALL]
[NAME:small battery:small batteries]
[VALUE:10]
[SOFT_MAT]
[TOOL_USE:SMALL_OBJECT_STORAGE]
[TILE:173]
[SIZE:100]
[MATERIAL_SIZE:1][UNIMPROVABLE]
[CONTAINER_CAPACITY:1000000]

[ITEM_TOOL:ITEM_TOOL_CHARGE]
[NAME:charge:charges]
[VALUE:0]
[SOFT_MAT]
[TILE:173]
[SIZE:1]
[MATERIAL_SIZE:1][UNIMPROVABLE]

[ITEM_TOOL:ITEM_TOOL_BATTERY_MEDIUM]
[NAME:medium battery:medium batteries]
[VALUE:10]
[SOFT_MAT]
[TOOL_USE:SMALL_OBJECT_STORAGE]
[TILE:173]
[SIZE:300]
[MATERIAL_SIZE:1][UNIMPROVABLE]
[CONTAINER_CAPACITY:3000000]

[ITEM_TOOL:ITEM_TOOL_BATTERY_LARGE]
[NAME:large battery:large batteries]
[VALUE:10]
[SOFT_MAT]
[TOOL_USE:SMALL_OBJECT_STORAGE]
[TILE:173]
[SIZE:1000]
[MATERIAL_SIZE:1][UNIMPROVABLE]
[CONTAINER_CAPACITY:10000000]

I did get the reactions in there properly and made a tiny little workshop to test from (borrowing the expedition start point, to be completely honest - a 1x1 tile that only requires Architecture seemed wise until I figure out what the heck I'm doing and can get fancy later), and added these reactions to entity_default.txt under the dwarf civ, so the Reaction Tester does show up with its reactions, at least.

Unfortunately, as you can see, my first round was kind of a copy-pasta mess - there's a lot wrong, and I can see some of it (I forgot to make the batteries lead instead of steel, left off the alcohol requirement, and the alcohol requirement doesn't even seem to actually work as intended - but why on earth is it creating steel weapons instead of steel batteries?) And I can see that I didn't finish my 'use charge' reactions so that it's invoking the full tool name for the charge... but it's a moot point if the charge doesn't even exist yet. So, yeah, I'm scrubbing what I can see, but the 'why is it giving me random weapons' is confusing me for certain.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #9 on: January 02, 2014, 11:18:51 am »

Why is it giving weapons? Probably because you create :WEAPON: ^^

Quote
[PRODUCT:100:1:WEAPON:ITEM_TOOL_BATTERY_SMALL:INORGANIC:STEEL]

It must be :TOOL:ITEM_TOOL_BATTERY_SMALL.

For the "Charge a small battery" reactions: Better add EMPTY to the reagent, otherwise it tries to charge already full batteries.

Quote
[REAGENT:booze:150:DRINK:NONE:NONE:NONE][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]    //add alcohol for acid
That doesnt work, because dwarves cant just carry drinks. Drinks are liquids, they must be in a container. So the reagent should list a container, which includes a drink. More like this:
Code: [Select]
[REAGENT:drink:150:DRINK:NONE:NONE:NONE]           
   [REAGENT:drink container:1:NONE:NONE:NONE:NONE]
      [CONTAINS:drink]
      [PRESERVE_REAGENT]

The "charge creator" is producing random tools, because it cant find the correct type. It know you want ITEM_TOOL, but it cant find the TOOL:ITEM_TOOL_CHARGE, so it takes TOOL:RANDOM_TOOL. I dont know whats up with that, the reaction + item looks fine, so maybe you didnt gen a new world, or something else is amiss.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #10 on: January 02, 2014, 11:27:41 am »

::bleep!:: Whoops. And since the only one that was written correctly was the one not working... yeeaaaah, I see the problem. ::goes in with a screwdriver::
Logged

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #11 on: January 02, 2014, 12:59:31 pm »

Hrm. Just for laughs, if I define a material type - say, 'ELECTRIC', and enforce that - as in,
Code: [Select]
[PRODUCT:100:5:TOOL:ITEM_TOOL_CHARGE:INORGANIC:ELECTRIC]
would I at least be able to see it spitting out 'electric pots' instead of blank 'pot' entries? (The eventual intent, of course, being 'electric charge', but, yeah.) And would I be able to sneak that in without having to do another worldgen? ... eh, I think I'll just try doing that, doing my other fixes, and doing another world gen to see how it shakes out.

(I did start a fresh worldgen before trying this out the first time, which is how I know the reactions showed up properly, at least!)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Newbie modder pondering Seige Defense Surprises
« Reply #12 on: January 02, 2014, 01:06:42 pm »

Code: [Select]
[ITEM_TOOL:ITEM_TOOL_CHARGE]
[NAME:charge:charges]
[VALUE:1][TILE:17][SIZE:1][MATERIAL_SIZE:1]

There is your charge tool. If INORGANIC:ELECTRIC exists, you can do that. But it doesnt, so you have to write it first. ;)

Inorganics need a new world gen.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

wizardofaus

  • Bay Watcher
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #13 on: January 02, 2014, 03:06:51 pm »

Just world-genned again, tried, and got... a lead mining cart, instead of a lead battery. Hrm. On the plus side, it does successfully use the booze...

snipped from reaction_aus.txt as visible in the newly generated world:
Code: [Select]

[REACTION:CONSTRUCT_BATTERY_SMALL]
[NAME:Make a small battery]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:150:BAR:NONE:INORGANIC:LEAD]
[REAGENT:booze:150:DRINK:NONE:NONE:NONE][DOES_NOT_DETERMINE_PRODUCT_AMOUNT] //add alcohol for acid
[REAGENT:booze-container:1:NONE:NONE:NONE:NONE]
      [CONTAINS:booze]
      [PRESERVE_REAGENT]
[PRODUCT:100:1:TOOL:ITEM_TOOL_BATTERY_SMALL:INORGANIC:LEAD]
[SKILL:METALCRAFT]

snipped from item_electric_aus.txt as visible in the newly generated world:
Code: [Select]

[ITEM_TOOL:ITEM_TOOL_BATTERY_SMALL]
[NAME:small battery:small batteries]
[VALUE:10]
[SOFT_MAT]
[TOOL_USE:SMALL_OBJECT_STORAGE]
[TILE:173]
[SIZE:100]
[MATERIAL_SIZE:1][UNIMPROVABLE]
[CONTAINER_CAPACITY:1000000]

[ITEM_TOOL:ITEM_TOOL_CHARGE]
[NAME:charge:charges]
[VALUE:1][TILE:17][SIZE:1][MATERIAL_SIZE:1]


...and on the minus, it's still calling up random tools (jug, pot, crafts) when I run the reaction. ::facefault:: I suspect this is gonna be a while.

Actually, what troubles me is, shouldn't it not work at all, considering the battery isn't being made? Or since it can't figure out how to make the battery, does it decide hey, any tool works, and spits out any tool as a reply?

Charge code:
Code: [Select]

[REACTION:GENERATE_CHARGE_S]
[NAME:Charge a small battery]
[BUILDING:MILLSTONE:CUSTOM_ALT_A]
[BUILDING:AUS_REACTION_TESTER:CUSTOM_NONE]
[REAGENT:A:1:TOOL:ITEM_TOOL_BATTERY_SMALL:NONE:NONE][PRESERVE_REAGANT]
[PRODUCT:100:5:TOOL:ITEM_TOOL_CHARGE:NONE:NONE][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:A]

Did pencil in an ELECTRIC type just so it's there for later, based on (well, directly copied from) ENERGY, by the by.

You know, stupid question, but is there a way to have it detect 'this type of tool is meant to store charge' instead of making three separate charge interactions? Hm. I may have to step back, build some other things to get more experience, and come back when I've had something work properly. ::amused:: I'm half-tempted to build an electricity system that runs on something ridiculous like lead coins until I get the kinks worked out of this. "That'll be 20 electricity tokens, please."

Hm. Feed your millstone a bar of lead and a barrel of wine and get a case of non-rechargeable 'energy cells'. Not quite how I wanted to go, but that's another way around it...




Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Newbie modder pondering Seige Defense Surprises
« Reply #14 on: January 02, 2014, 03:21:51 pm »

Post the entirety of the tool file.
Pages: [1] 2