Make turrets want hoppers?

Started by Lonely Rogue, July 05, 2015, 11:16:11 PM

Previous topic - Next topic

Lonely Rogue

My pc is not with me right now, and I'm new to modding *cough cough never done it* and I need to know if I can make a turret require a hopper. I have a *tiny* mod in the works to get myself started and the wiki tutorials are confusing and say they are only updated to alpha 9. Thnx for reading!
Rimworld: A game where you're kept as entertainment for thousand year old robots, and you just don't know it yet.
Any mod requests?

Jaxxa

Yes, that should be completely possible.

I actually had my mod doing exactly that a while ago (around Alpha 7/8), but stopped updating that part of it after ammo usage was added into the base mortars. Although that is not exactly the same thing. I have been thinking about bring it up-to-date for the latest version.

In the meantime you can have a look at the older code if you want.
From memory it used the logic from nutrient paste despensors as a base for the ammo usage and if it was out of Ammo stopped the cooldown to fire.

Liegeman

My experience with hoppers tells me that the vanilla ones are incredibly limited in their implementation. They seem quite generic, but they are actually intended specifically for Nutri-paste dispensers.

Not too hard to clone the code and adjust them for turrets, but it is beyond the scope of a simple XML mod.

Jaxxa

You do realise that you will have to do with with C# coding and creating a .dll right? As far as I know you cant do what you want with just editing the xml.

I found the code that I was using to do this on Github that you can have a look at, it is for an old version so probably does not work right now, but I am planning to update it, maybe this weekend. Ask questions if you cant figure it out.

https://github.com/jaxxa/RimWorld-Enhanced-Defence/tree/master/ED-Core/Source/Enhanced_Defence/TurretAmmo