[A12C] Mechanical Defence 2 (Update 23 - quick fix)

Started by mipen, November 10, 2014, 03:58:33 AM

Previous topic - Next topic

mipen

QuoteYou do realize, it is possible to stack an item more than it's stack max, right?  I've had this happen with events that spawn an item.  For example, 400 is the Silver max stack, correct?  When I save an outlaw from a bounty hunter on the event, the outlaw drops a stack of 2200 silver in one single slot.  So if the building is destroyed or deconstructed, you can stack all of it, in a single stack rather than spilling it everywhere risking a glitch of no space found.
This would be a good way of handling when the chest is destroyed, I'll definitely look at changing that over!
QuoteInteresting, does this work with trade zones?  So I can build a bunch of these in a single trade zone and store specific items in them?  I'd like to not have to build 10 illogical orbital beacons to trade items.  :P
No, I don't think this will work with trade zones, except for the single stack that stays on the output slot. I can't think of a way to have it include the contents of the chest without rewriting the trade beacon class and changing it in the defs - something I'm reluctant to do because I don't like changing things that affect mod compatability.
QuoteThe walls, if they are raised, do they still count as a door?  Would the NPCs go right to them?  Or would they think it is a wall?
The walls are toggled manually by the player, so pawns will think they are normal walls when they are raised

Vas

Quote from: mipen on November 10, 2014, 11:43:37 PMThis would be a good way of handling when the chest is destroyed, I'll definitely look at changing that over!
Read next quote's reply -->
Quote from: mipen on November 10, 2014, 11:43:37 PMNo, I don't think this will work with trade zones, except for the single stack that stays on the output slot. I can't think of a way to have it include the contents of the chest without rewriting the trade beacon class and changing it in the defs - something I'm reluctant to do because I don't like changing things that affect mod compatability.
The way to solve this, is to implement the previous quote's method.  If you move the stack over to combine it with the item on the other side of the table, then the trade beacon will see all of that one stack.  So rather than storing the value, just shove the item into the large stack beside it.

Quote from: mipen on November 10, 2014, 11:43:37 PMThe walls are toggled manually by the player, so pawns will think they are normal walls when they are raised
These walls also require power right?  I assume, for logic reasons.  :P  Wouldn't that make them make the game rather laggy if you use a lot of them?  I did make a wall lights mod once, that Architect used in his power mod, but when you used a lot of them, it became real laggy.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

mipen

QuoteThe way to solve this, is to implement the previous quote's method.  If you move the stack over to combine it with the item on the other side of the table, then the trade beacon will see all of that one stack.  So rather than storing the value, just shove the item into the large stack beside it.
That's a good idea, I'll definitely look into it. My concern is whether the game will retain that large number after saving/reloading.
QuoteThese walls also require power right?  I assume, for logic reasons.  :P  Wouldn't that make them make the game rather laggy if you use a lot of them?  I did make a wall lights mod once, that Architect used in his power mod, but when you used a lot of them, it became real laggy.
Yes they do require power. I'm not sure if having a large number of them will cause lag, I will have to test it. They don't have any tick method, only a GetCommands(), which is only called when the building is selected. Unless having a large amount of buildings that require power to run, I can't think of anything that would make them make the game lag

skullywag

The lag with wall lights would have been updates to the glowgrid. Thats not the same as the powergrid which this mod would affect.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Dave-In-Texas

Quote from: mipen on November 11, 2014, 12:53:49 PM
QuoteThe way to solve this, is to implement the previous quote's method.  If you move the stack over to combine it with the item on the other side of the table, then the trade beacon will see all of that one stack.  So rather than storing the value, just shove the item into the large stack beside it.
That's a good idea, I'll definitely look into it. My concern is whether the game will retain that large number after saving/reloading.
QuoteThese walls also require power right?  I assume, for logic reasons.  :P  Wouldn't that make them make the game rather laggy if you use a lot of them?  I did make a wall lights mod once, that Architect used in his power mod, but when you used a lot of them, it became real laggy.
Yes they do require power. I'm not sure if having a large number of them will cause lag, I will have to test it. They don't have any tick method, only a GetCommands(), which is only called when the building is selected. Unless having a large amount of buildings that require power to run, I can't think of anything that would make them make the game lag

this is a very interesting mod, specifically the mechanical walls and the storage device.  if you can implement this persons suggestion i'll definitely find your mod useful :)

i've not run a game with it yet but i'm wondering if it would be possible to make walls that utilize power thusly:  interruption of power triggers a switch in mode of the wall; that way you could have a toggle command on the wall so that an event that disables power would cause the walls to either rise or fall as needed by the base designer.  you could also control the walls simply by toggling power, without having to run a colonist over.  not to mention that this would interface well with powerswitch by haplo :)

Vas

A thought, on balancing.  I haven't used your mod yet, I tend to avoid mods if they have something in them that seems to be unbalanced, like infinite metal.  I'll try it out though here in a few minutes, lemme just post my thoughts though.

I think the extractor should spit out 3 Rock Rubble each time.  Except those times when it spits out a bit of metal, then maybe 2 rock rubble and some metal, or if it's a large metal vein it hit, then 2 metal stacks and one rock rubble.  It does dig through the earth after all.  Once it has finished, you can click a "fill the earth" button, that will let you put rock rubble inside the hole to fill it.  Taking a lot of rock rubble or stone.

Can you make the metal extractor only run a certain amount of times before it runs out?  Or better yet, 100 cycles before a colonist must go over and hit the activate switch again.  The building will need to keep track of how far it's gone so far too.  We also need to add lava.  I'll explain Lava first, then the stages that you can go.

Lava; You need to create a terrain texture that is red, and unwalkable like ocean is.  Anything on it needs to be destroyed, be it a colonist, or metal ore, plasteel, even an indestructible monolith.  When you hit lava, the area all around the metal extractor turns into a lava pit.  10 blocks out in all directions from the hole, becomes stone earth (the stuff you find under mountains), and 6 blocks out in all directions, becomes lava.  If you want to add one more stage, a cracked earth texture that is partial lava and partial stone, walk speed 10% with a chance that each step will burn the person walking on it, that would go out 8 blocks in each direction from the hole, under the lava.  So first you lay out the stone, then the cracked earth, then lava.  If you don't want to do cracked earth, skip it.

Lava can not be cleaned up by fertilizers.  You could use a special new type of building that can clean it, but other than that, either it is permanent, or you can make the lava harden up into normal stone after 1 year has passed.  That's the outer edges, the inner ones cool 6 months after the outer edges have.  It'll take years for all the lava to be gone.  Now lets explain the stages of your drill.

Stage 1: 100 cycles deep, 60% stone, 20% air, 15% metal, 5% other.
This means that there is a 60% chance you'll get nothing but stone from your digs through stage 1.  This is also an all over the land thing, so you may not always get metal with that one extractor.  Or even the 5% other.

Stage 2: 200 cycles deep, 40% stone, 15% air, 30% metal, 5% gem, 5% other, 5% lava.
Other, is things you might find from other mods, or maybe even plasteel or silver.  If you hit Lava by chance, your power facility will explode.

Stage 3: 300 cycles deep, 25% stone, 2% air, 38% metal, 10% silver, 10% Plasteel, 5% gem, 10% lava
Pretty risky now, a 10% chance you'll hit lava!  Well, magma.  If you want to be technical.

Stage 4: 400 cycles deep, 10% stone, 40% metal, 5% silver, 15% plasteel, 10% gem, 20% lava.
Really risky now.  Lets hope you have a mod with conveyors to be moving what you get away as soon as you get it, or a lot of colonists dedicated to hauling, because if you hit lava, all that stuff you mined up will be immediately destroyed.

Stage 5: 500 cycles deep, 10% stone, 30% metal, 20% plasteel, 10% gem, 30% lava.
Ok, if you go any deeper than this, you're clearly nuts.

Stage 6: 600 cycles deep, 3% stone, 12% metal, 40% plasteel, 45% lava.
Well hey, at least you get a lot of plasteel before you explode.

Stage 7: 700 cycles deep, 1% stone, 5% metal, 9% plasteel, 80% lava.
Wow, is it worth the risk?  I mean, I don't even think you'll get back the materials you would lose if you just deconstruct the metal mining thing.

Stage 8: 800 cycles deep, 1% gem, 99% lava.
Yea, lots of gold down here.  Take the chance!  If you somehow made it past stage 7 without exploding.

Stage 9: 801 cycles deep, 100% lava.
If by some miracle you get past stage 8, stage 9 is 100% absolute total lava.  It will explode the instant you hit start, you will lose the facility, and you will have a big lava mess all around for several years minimum.

Just a note, you need to store how many levels you have gone down in the fissure as well, so you can't deconstruct and build a new one on that spot.  Another note, if you decided not to fill it, based on the depth you have gone, should have a random chance of a lava eruption at that location.  Make the fissure have a sort of timer on it that counts down, 6 hours at a time with a % chance of eruption.

So say you got 100 levels down (in stage 1 territory) and left it like that.  There is a 0% chance of eruption each time the timer expires.  Each stage after has it's lava percentage cut by 5 times, that's it's percent chance of erupting each time the timer expires.  AKA, stage 2 with 5% lava, has a 1% chance.  While stage 6, has a 9% chance.  If you somehow made it into stage 8 before you shut down the facility, that fissure would have a 19.8% chance every 6 game hours to erupt.



Wow, I got pretty creative here eh?  I never knew my idea would turn into so much.  xD  Just to balance an object that gave infinite metal.  Turning it into so much more than that.  Maybe you should rename it to ore extractor if you were to implement my idea for it.  I wish I could help, but I got no coding skills at all.

P.S. Why is there 2 DLLs with the same name with the exception of an S and C in Defense?
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Dave-In-Texas

I'd say that very creative.  I'd also say its outside the scope of this addon... you should copy and paste your post to the mods folder with the [Mod Request] tag :)

after all. something like  that is  what led to the mechanical walls part of this addon.

Vas

Quote from: Dave-In-Texas on November 12, 2014, 03:21:09 PM
I'd say that very creative.  I'd also say its outside the scope of this addon... you should copy and paste your post to the mods folder with the [Mod Request] tag :)

after all. something like  that is  what led to the mechanical walls part of this addon.

Well, infinite metal isn't exactly part of "defense" either, which is in the mod's name.  :P  So I'm not sure why infinite metal would even be in this mod if it is all about defenses.  In fact, the only defensive thing here, is the wall.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Dragoon

I like the infinite metal (all that rock rubble tho would be a huge waste) getting rock for stone cutting could be useful but could also be annoying (becuase it's on like a random chance that you get metal or rocks) I would prefer if it did not have  a set number cycles maybe more power cost not a set number before it go kaput (lol) . (then again I like the mod the way it is)
Quote from: faltonico
I truly can't understand that sense of balancing a LOT of modders have, pouring more resources on something doesn't make it more difficult, but more annoying. It is not engaging, even if i'm swimming in silver at late game ¿why to bother?, why all the effort to get there?.

Puch22

I miss some of the features from Mechanical Defense 1.

Are you going to add some of them back, or just add new stuff? What ever you choose I'm content, thanks for taking your time to create this!
A life can be lived millions of ways, but each is unique and can only be chosen once.

mipen

Quote from: Vas on November 12, 2014, 12:36:39 PM
A thought, on balancing.  I haven't used your mod yet, I tend to avoid mods if they have something in them that seems to be unbalanced, like infinite metal.  I'll try it out though here in a few minutes, lemme just post my thoughts though.
I agree with you that the extractor needs a bit if balancing, it was my solution to running out of metal to mine on the map. It currently will produce about 150 metal a day, the amount is slightly randomised. This is less for the rarer metals. I want to make it a bit harder to acquire to extractor, without giving it dozens of required crafting items or research prerequisites. I like your idea with the lava and the different stages, however it would take a lot of coding to implement all of that, and might end up making the machine more of a hindrance than an asset. I can also think of some pretty nice kill box designs using the lava :P
I will definitely be coming back to this to add in some balancing things, random events and the such (like stumbling across a couple of buried centipedes that burst free in a rage, or damage to the extractor itself, requiring it to be repaired before it can resume (maybe with pieces flying off and hurting nearby people too?))
I am also thinking of making the fissures it requires to be spawned randomly into the world, and for the fissure generator to be a hard to get late game tech. This will limit the extractors to a small number, at least until later in the game, and give them not-so-convenient locations. I actually really like your idea, but like someone said, it would be a good idea for an entire mod :)

mipen

Quote from: Puch22 on November 12, 2014, 05:52:11 PM
I miss some of the features from Mechanical Defense 1.

Are you going to add some of them back, or just add new stuff? What ever you choose I'm content, thanks for taking your time to create this!
I'm currently working on recreating the druids and putting them back in (I'm currently working and have exams coming up so progress is a bit slow), so they should be back soon, hopefully not as buggy as they were :P

mipen

Oh, and my bad on the double assembly, I did a names pace change and forgot to delete the old assembly

Reysuke

Hey.
I Love you Walls. They are freaking Amazing!
But i have a problem. I dont need to research anything. i can build everything from the start. i still can research but without any use.
Also is there a way to only have the walls? Like a Modular Mod.
Because the extractor is OP. The Storage and the Walls are super awesome.
Thanks for the Mod <3

HBKRKO619

Hi :)
Same for me, I can do absolutly everything from the start of the game without needed research.
I can do the research but it's useless cause everything is up to build from the start.
Thanks for the mod :)

P.S. : sorry for my average english, french here xD