Sign in to follow this  
SolarMisae

[Solved]Character's Custom item "Inspect" option not working.

Recommended Posts

SolarMisae    0

So I managed to create a custom character using the extended character template, and it's more or less working as I want but one thing I can't figure out is bugging me. While creating his custom starting weapon, despite it functioning mechanically just fine, I wanted to add special "inspect" text to it, and a unique one for wx as well to match his usual "all caps" speak. Now the first two strings for the item name and description in the recipe tab are working in-game just fine, but the two lines of text I added for the "inspect" for all players + wx's special one just won't. The item also does not seem to function with the Food Values+Item tooltips mod properly, as it will either display no text (not even the "equip" option though it can still be equipped normally) or if I hover over another weapon or tool, or any item with stats really, the hover text will match the last item I hovered. This is after hovering over the torch, then hovering the weapon.

OhzJAYg.png

The strings I'm using for the descriptions and inspect options in my modmain.lua are as follows:

STRINGS.NAMES.SHADOWRAPIER = "Shadow Rapier"
STRINGS.RECIPE_DESC.SHADOWRAPIER = "Don't poke your eye out."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.SHADOWRAPIER = "Dark and pointy."
STRINGS.CHARACTERS.WX78.DESCRIBE.SHADOWRAPIER = "EXTREMELY POINTY. USE WITH CAUTION."

I pulled these from another character mod called "Wolfe" who has a unique craftable weapon as well. Is there something wrong with these strings? (Well i mean obviously there is, but what...) or is it something in the other files such as the item's .lua file? If needed I will provide the full modmain.lua, item.lua and character.lua files.

Thanks in advance!

Edited by SolarMisae

Share this post


Link to post
Share on other sites
Lumina    2149

You don't have a GLOBAL in your lines. It's possible that the mod you used as an example has the line in modmain.lua with this line before :


		
        STRINGS = GLOBAL.STRINGS

Or has the line in a place when no global is needed (not sure about it). You can also do :

GLOBAL.STRINGS.NAMES.SHADOWRAPIER = "Shadow Rapier"
GLOBAL.STRINGS.RECIPE_DESC.SHADOWRAPIER = "Don't poke your eye out."
GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SHADOWRAPIER = "Dark and pointy."
GLOBAL.STRINGS.CHARACTERS.WX78.DESCRIBE.SHADOWRAPIER = "EXTREMELY POINTY. USE WITH CAUTION."

If you have something like this but just forgot to show it here, i don't know. I also don't know about the compatibility with others mods.

Edited by Lumina

Share this post


Link to post
Share on other sites
SolarMisae    0

I do indeed have the GLOBAL string listed above in my modmain, maybe it's in the wrong location. i don't know why the crafting tab name and description works but the inspect option doesn't. I've attached the horrific frankenstein of a modmain.lua file I've created so far, perhaps this will help.

modmain.lua

Edited by SolarMisae

Share this post


Link to post
Share on other sites
Lumina    2149

I'm not seeing anything wrong, but i could miss something obvious or anything. I suggest you attach your entire mod, maybe it will help if someone wants to see what is wrong.

Share this post


Link to post
Share on other sites
ptr    41

1.To see your inspection speech, please press "Alt" key, which is necessary for inventory items with actions other than inspection. It is because inspection has very low action priority.

2.The compatibility issue is simply due to no network. You should add

inst.entity:AddNetwork()

behind CreateEntity().

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