Trying to make an item depandant on a wall

Started by Honey_Badger, July 18, 2019, 02:55:51 PM

Previous topic - Next topic

Honey_Badger

Hello all!

I'm in the process of making a mod, i'm almost done (It's a simple turret mod), but I need it to be restricted so it can only be built on walls.

Any help/suggestions?
HELP, I DON'T KNOW WHAT I'M DOING (look at my wall turret mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=1812077718)


Honey_Badger

Thanks for the post, though I don't think it's what i'm looking for

I'll admit, it's on me, I should've been specific that I wanted it so it can only be built next to a wall, like in wall lights.
HELP, I DON'T KNOW WHAT I'M DOING (look at my wall turret mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=1812077718)

LWM

Wall lights are actually built on walls - at least the version I have.  One side of them extends past the cell they are on to give the actual physical part of the "light" on the next cell over.  So that might be an option.  Otherwise...how good are you at C#?

--LWM

Honey_Badger

#4
Quote from: LWM on July 18, 2019, 08:29:19 PM
Wall lights are actually built on walls - at least the version I have.  One side of them extends past the cell they are on to give the actual physical part of the "light" on the next cell over.  So that might be an option.  Otherwise...how good are you at C#?

Ah, in my version, they have to be built in the next tile over, but on the wall, (Nope nope, ignore this, it's the same as yours) I know the creator of that mod used a custom placeworker.

I'm a complete newb, 0 experience with it, it's literally just for a wall turret mod where I want to build a turret that can only be built next to a wall, I've got everything else done, but not that part, and it's the only thing holding me back...
HELP, I DON'T KNOW WHAT I'M DOING (look at my wall turret mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=1812077718)

Menoske

I posted the thread that Canute referenced.  It was also to support a wall turret mod.  I got it working  to an extent but stepped away from it to work on other mods.  I used the Wall Light mod and the additional joy objects mods as references for placing things on walls.

My issue now is that my code will allow it to only be placed on walls, but then it deconstructs the wall when its being built.  I think that's an issue with my ThingDef instead of the code itself, but I have an earlier working version where the turret installs fine on the walls (without C#) but they can be placed everywhere as well.  Now to reconcile it.

Feel free to PM me later today and I'll share my custom PlaceWorker with you for placing on walls.

Honey_Badger

Quote from: Menoske on July 19, 2019, 08:43:37 AM
I posted the thread that Canute referenced.  It was also to support a wall turret mod.  I got it working  to an extent but stepped away from it to work on other mods.  I used the Wall Light mod and the additional joy objects mods as references for placing things on walls.

My issue now is that my code will allow it to only be placed on walls, but then it deconstructs the wall when its being built.  I think that's an issue with my ThingDef instead of the code itself, but I have an earlier working version where the turret installs fine on the walls (without C#) but they can be placed everywhere as well.  Now to reconcile it.

Feel free to PM me later today and I'll share my custom PlaceWorker with you for placing on walls.

Appreciate the help, however I managed to get some help on the RimWorld discord, I managed to get it so they can be built beside walls without destroying them (however they don't have the gun appear with them, so I'll have to figure that out)
HELP, I DON'T KNOW WHAT I'M DOING (look at my wall turret mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=1812077718)