Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.68k stars 2.97k forks source link

[Question] Is there a way to choose what a GenericCrafter produces? #6460

Closed Beanzilla closed 2 years ago

Beanzilla commented 2 years ago

Platform: Linux

Build: 134.1

Issue: I am a mod developer who has developed M1NEDU5TRY H4CK3D.

In my content, I have a Item Replicator (*) (Where * is a number of resources), Is there a way I could make a crafter which takes power and provides a list of items to produce then produces selected item? (I really don't like Java, but I am just about to take up learning it, just to get this one thing implemented)

Or I might just leave it the way it is and let players complain and not do anything about it. (Since it looks more like it's not possible, but rather just a random choice of items list, which is not what I want)

Put it in different light, a Item Replicator (*) is essentially a Item Source just takes power and doesn't produce as fast as it can. ( For those not understanding my question)

Steps to reproduce: N/A

Link(s) to mod(s) used: M1NEDU5TRY H4CK3D

Save file: N/A (Not needed, since this is mod content)

No soul reaping needed. ( :) )

(Crash) logs: N/A (Not reporting a crash)


Place an X (no spaces) between the brackets to confirm that you have read the line below.


Further Notes:

  1. Yes I am aware "Questions are supposed to be placed on Discord" (However I do not use Discord, and NEVER will, just don't ask)
  2. I have looked at Types searching for GenericCrafter shows the current item/machine I am using for Item Replicators. (So one way to solve this is to point me towards a better machine that could do what I want it to do)
GlennFolker commented 2 years ago

You know "question" isn't an "issue report," right?

Anuken commented 2 years ago

Is there a way I could make a crafter which takes power and provides a list of items to produce then produces selected item?

This is possible, but there is no built-in mechanism for it. Closing, as this is an issue tracker, not a forum for discussion - ask on the Discord if you need help with modding.

GlennFolker commented 2 years ago

However I do not use Discord, and never will

Well, there goes your chance of getting answers.

Beanzilla commented 2 years ago

I think I found a way to make it work.

Hijack Item Source so it requires/consumes power. (Not sure if this will stop producing items if it doesn't have power but at least it should allow me to have a choice menu to choose what gets produced, just like bye bye to making it produce at a timed rate)

Ok so nope hijacking Item Source gives you a Item Source. (Even with consumes power, it will still produce items regardless, due to it's nature of being a Item Source)

So long story short, unless I dive into code I guess what I have is the best there is. (Which is fine with me, just wanted to merge a lot of machines into one machine which could do the task of all of them, no big deal though)

Things I have learned

  1. Don't use the Github's issue system as a place for asking for help. (Instead use Discord)
  2. Don't get angry at people who tell you that your miss using the issue system. (Especially when you are miss using the system)
  3. Don't judge others over their preferred platforms of communication. (Yeah I use IRC, but that doesn't mean I should get angry with someone for calling me out on my own mistake, or in this case my choice to not use the proper form of communication)
  4. Welcome to open source development. (It's not easy to collaborate such projects)