I need help with creating a basic mod.

Place to get help with not working mods / modding interface.
Post Reply
Danny49210
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jan 09, 2024 10:33 pm
Contact:

I need help with creating a basic mod.

Post by Danny49210 »

Hello! I'm new to programming and I can't get the script right just yet.

I'm trying to create a basic mod where players can choose which "Ministry" to join, each "Ministry" providing the items at half the cost, for example one that reduces at half the cost of items under Logistics tab.

Can someone help me and guide me through a little bit?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: I need help with creating a basic mod.

Post by DaveMcW »

Cool idea, but this is not a basic mod.

Recipes cannot be edited while the game is running, and players on the same team cannot have different recipes.

These issues can be worked around with different hacks, but I would not recommend trying it as your first mod.

Danny49210
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jan 09, 2024 10:33 pm
Contact:

Re: I need help with creating a basic mod.

Post by Danny49210 »

Then maybe can I modify their character based on their choice? I tried to give them 100 inserters based on that and is not working...

Danny49210
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jan 09, 2024 10:33 pm
Contact:

Re: I need help with creating a basic mod.

Post by Danny49210 »

Here is what I have achieved by looking at other mods and with chatgpt
Attachments
informatron_integration.lua
(975 Bytes) Downloaded 17 times
class_perks.lua
(1.05 KiB) Downloaded 16 times
class_choice_gui.lua
(644 Bytes) Downloaded 18 times
remote_interface.lua
(332 Bytes) Downloaded 17 times
ministry_of_transportation.lua
(495 Bytes) Downloaded 14 times
ministry_of_defence.lua
(111 Bytes) Downloaded 12 times
info.json
(224 Bytes) Downloaded 15 times
control.lua
(173 Bytes) Downloaded 16 times
class_perks.lua
(1.4 KiB) Downloaded 16 times

BraveCaperCat
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: I need help with creating a basic mod.

Post by BraveCaperCat »

You proabably want to use Settings.lua and make a Per Player setting, a String Setting Type which defines some (Extra) starter items recieved in Control.lua. This makes it much easier. If you could acess the Per Player setting in Data.lua, you could make the recipes different. But you could also just make a recipe for each, all of which loaded, but then only one set of recipes are actually enabled, which CAN be done in Control.lua.

Post Reply

Return to “Modding help”