Recommended Posts

SugarCarrot    1

So, i decided to add an item to my character mod, but here's the problem.


TeJ4ti61N_U.jpg

 

I dunno, what to do with recipe icon, bc i added the way to .xml and .tex files in AddRecipe function and stuff, but it still won't show.

Maybe i'm just a little bit dummy, but i'll be very pleased, if someone will help. o~o

Paul McCartney.zip

Edited by SugarCarrot

Share this post


Link to post
Share on other sites
Ultroman    656

Try removing this line (line 21 in love.lua):

inst.components.inventoryitem.imagename = "love"

 

Share this post


Link to post
Share on other sites
SugarCarrot    1
15 hours ago, Ultroman said:

Try removing this line (line 21 in love.lua):


inst.components.inventoryitem.imagename = "love"

 

Eh, it still isn't working. Maybe i should add some variables or something?  ^. _^.

Share this post


Link to post
Share on other sites
Ultroman    656

Try moving the love files (just the tex and xml) to the appropriate folder for inventoryimages: /images/inventoryimages/

Then, update your references to love.tex and love.xml in the mod. Remember, they're referenced in both modmain.lua and love.lua

Also, are you sure your tex file is valid?

Share this post


Link to post
Share on other sites
SugarCarrot    1
On 16.01.2020 at 6:22 PM, Ultroman said:

Try moving the love files (just the tex and xml) to the appropriate folder for inventoryimages: /images/inventoryimages/

Then, update your references to love.tex and love.xml in the mod. Remember, they're referenced in both modmain.lua and love.lua

Also, are you sure your tex file is valid?

I've done that, but s t i l l . . .

And yes, the .tex file is working. But ok, i reconvert .png to .tex again, updated .tex files, but how i said, here's this problem anyway. 

Share this post


Link to post
Share on other sites
Ultroman    656

I made it work :) You had two problems, or three, depending on how you look at it.

  1. You've posted this in the DS forum, but your character is for DST. The codebases are very different, e.g., DS has no AddRecipe function, so I was very confused by your code :)
  2. Your AddRecipe call was written for an old version of the AddRecipe function. It has a lot more parameters now, so the placement of the "image" parameter has changed since whatever post you used as source for your recipe code was written. I have fixed that and added some comments about the "image" parameter. AddRecipe also doesn't have a parameter for the atlas (the XML file) for the image, like DS does, so you have to set the "atlas" variable of the recipe afterwards. This is because of how Klei takes advantage of their strict folder structure, to save thousands of lines of code when adding all their many recipes. Since our image is a custom image, and not a part of their atlases, we have to tell the game to use our custom atlas, instead of automatically trying to find our image in the game's original atlases.
  3. You had an AddComponent call above the TheWorld.ismastersim check in your love.lua, which makes clients crash when using the character. This is one of the reasons you should always test your mods on a server with caves, or at least a server where you will be the client of the server and not the host (which adding caves does).

Paul McCartney.zip

Edited by Ultroman

Share this post


Link to post
Share on other sites
SugarCarrot    1
On 19.01.2020 at 4:23 AM, Ultroman said:

I made it work :) You had two problems, or three, depending on how you look at it.

  1. You've posted this in the DS forum, but your character is for DST. The codebases are very different, e.g., DS has no AddRecipe function, so I was very confused by your code :)
  2. Your AddRecipe call was written for an old version of the AddRecipe function. It has a lot more parameters now, so the placement of the "image" parameter has changed since whatever post you used as source for your recipe code was written. I have fixed that and added some comments about the "image" parameter. AddRecipe also doesn't have a parameter for the atlas (the XML file) for the image, like DS does, so you have to set the "atlas" variable of the recipe afterwards. This is because of how Klei takes advantage of their strict folder structure, to save thousands of lines of code when adding all their many recipes. Since our image is a custom image, and not a part of their atlases, we have to tell the game to use our custom atlas, instead of automatically trying to find our image in the game's original atlases.
  3. You had an AddComponent call above the TheWorld.ismastersim check in your love.lua, which makes clients crash when using the character. This is one of the reasons you should always test your mods on a server with caves, or at least a server where you will be the client of the server and not the host (which adding caves does).

Paul McCartney.zip

Guesss i got that, so yeah, big thanks for your advices and help, dude! u-u <3 

  • Like 1

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