Sebakool

Help with finishing a simple structure mod

Recommended Posts

Sebakool    2

Hello to ya'all, after several hours figuring why is not a mod for craftable killer beehives for regular dont starve, I got the idea to do it miself...

It worked!

At least almost all what i intended worked, I  am now able to craft killer beehives, but not in the way in intended.

I got two issues:

The first one is that the icon for the hive is not displayed correctly (this issue isnt important for me), it just gets the icon from the item that is above of him.

The second and real problem is when i craft the beehive, it is placed imediatelly where i crafted it. It doesnt allows me to choose where to put it like a normal structure. Im "noob" programmer on this game, and i mean i just started about one hour ago.

That would be nice if someone more knowledge on thi could help to solve this problems. thanks ya'all.

PD: Here is the code :P 

 

STRINGS = GLOBAL.STRINGS
RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH

STRINGS.RECIPE_DESC.WASPHIVE = "Protect a zone from even yourself" 


Recipe("wasphive", { Ingredient("killerbee", 4, Ingredient("honey", 10), Ingredient("honeycomb", 3) }, RECIPETABS.TOWN, TECH.SCIENCE_ONE )

  • Like 1

Share this post


Link to post
Share on other sites
inferjus4    1217

This is how some of the structure recipes look in recipes.lua file:

Spoiler

image.thumb.png.68f973152c47837122d2bd4e6481d286.pngimage.thumb.png.4b4f805b29ec826ce7d6eeef4b33e5b0.png

Most of them after TECH.SCIENCE_ONE or TECH.SCIENCE_TWO have "name_placer" written. I don't know what it is, but maybe there is a problem. Maybe try to write "beebox_placer" or something else at the end of your recipe and try if the mod works.

 

EDIT You can find recipes.lua in scripts folder.

 

EDIT 2 

Recipe("wasphive", {Ingredient("killerbee", 4), Ingredient("honey", 10), Ingredient("honeycomb", 3)}, RECIPETABS.TOWN, TECH.SCIENCE_ONE, "beebox_placer")

This recipe now lets me build killer bee hive just like any other structure.

Spoiler

image.thumb.png.716bb52bfee95b499d38caee579fac0b.png

When I tried to use "wasphive_placer" game crashed when I tried to place a building.
Same thing happens when you try to replace "beebox_placer" with "wasphive".

 

EDIT 3

Try to check out code of Fish Farm mod or other mods which add structures to the game, it should help you with solving some issues.

Spoiler

image.thumb.png.e986c106e1473427369814ce7c731b04.png

 

Buildable Cave Entrance mod may be even better for it, because just like your mod, it uses sprites from the game.

Spoiler

image.thumb.png.6a7acd44649083808131d5a7aa8aaabf.png

 

EDIT 4

Basically if you want to have custom "wasphive_placer" icon you need to make folder in mod files that would provide a sprite for it. Check out files of the mods I mentioned in EDIT 3.

Edited by inferjus4
  • Like 1

Share this post


Link to post
Share on other sites
inferjus4    1217

I made some progress in terms of sprites:

Spoiler

image.thumb.png.ebfb71fe6a2b23b9d1b48ba6356b3641.png

I guess I should make background transparent, so it looks better.

 

EDIT Yup, that helped. Now I will try to make placer sprite work properly.

Spoiler

image.thumb.png.e51844ccc7e8b56811231bcbaabec3b3.png

 

 

Edited by inferjus4

Share this post


Link to post
Share on other sites
inferjus4    1217

It took a lot of work, but I did it! There is an icon, placer and everything needed!

Spoiler

image.thumb.png.845245e3c1d56a2c3f2ce838b73bad58.png

 

EDIT Now I am trying to make recipe appear in worlds with DLCs available. It seems to work in vanilla DS, but not in games where DLCs are on.

 

EDIT 2 I fixed it. Now I will be finishing the mod.

Edited by inferjus4

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