Sign in to follow this  
Ademir11

I want to make a mod to modify mob drops (chance)!

Recommended Posts

Ademir11    3

Hello everyone! I'm new to a modding (and sorry if my english is bad, i live in Bosnia and my main language is bosnian)

So, i want to know how to make a mod that will change  mob drops, what to do, where to code... 

Example: Bunny have 15% chance to drop bunny puff.

Share this post


Link to post
Share on other sites
Ademir11    3
11 hours ago, Ultroman said:

Take a look at the code for mods like this. Also, if you're a newcomer to modding I highly recommend looking through my newcomer post. It WILL help you save hours of your life.

Thank you a lot! I know something, not much, i reskined one mod that had disgousting looking freezer.

 

Share this post


Link to post
Share on other sites
Ultroman    695
7 hours ago, Ademir11 said:

Thank you a lot! I know something, not much, i reskined one mod that had disgousting looking freezer!

I saw that :) This mod is going to be 100% code, though. If you're not versed in LUA, I highly recommend taking the crash course and starting out slow e.g. just look through the code of other mods, and try to really understand what is going on.

Whatever the case, good luck with it! That mod should lead you to the right places. You'll mainly be working with the lootdropper component, which has several ways to drop loot. You'll find some threads about how it works on this forum as well. Search for lootdropper on the modding forums (see my newcomer post for tips on how to search this forum properly).

Share this post


Link to post
Share on other sites
Ademir11    3
On 4/2/2019 at 7:53 PM, Ultroman said:

I saw that :) This mod is going to be 100% code, though. If you're not versed in LUA, I highly recommend taking the crash course and starting out slow e.g. just look through the code of other mods, and try to really understand what is going on.

Whatever the case, good luck with it! That mod should lead you to the right places. You'll mainly be working with the lootdropper component, which has several ways to drop loot. You'll find some threads about how it works on this forum as well. Search for lootdropper on the modding forums (see my newcomer post for tips on how to search this forum properly).

Hey, i was trying to add recipe in the game for dubloon (from slot machine mod)

can you tell me what i screwed up? and how it needs to go?

 

modmain.lua

Share this post


Link to post
Share on other sites
Ultroman    695

I need to see your logs in order to help. See my newcomer post (linked previously) in the part about debugging to see where to find them and how to use them to your advantage.

That said, there are a bunch of problems with your code stemming from missing references. You're using RECIPETABS and SCIENCE, but in the scope of the modmain, those references are not readily available. You have to make them available.

Try this:

local _G = GLOBAL

local dubloon_recipe = AddRecipe("dubloon", { Ingredient("goldnugget", 1)}, _G.RECIPETABS.REFINE, {_G.TECH.SCIENCE=2}, nil, nil, nil, nil, nil, "images/inventoryimages/dubloon.xml")

I don't think you need the PrefabFiles lines, but if this doesn't work, you can try adding it back in at the top.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this