Jump to content

HELP! CUSTOM ITEM NOT WORKING


Recommended Posts

@mikey99222, this has nothing to do with those warnings. The error I see is "[string "../mods/michaelwand/scripts/prefabs/wand.lua"]:50: '<eof>' expected near 'STRINGS'".

Something in wand.lua at line 50 isn't right. You may have made a syntax error at this line.

i have this there

 

49:return  Prefab("common/inventory/wand", fn, assets, prefabs)
50:STRINGS.NAMES.WAND = "Michael's lightning sword"
51:STRINGS.CHARACTERS.MICHAEL.DESCRIBE.WAND = "kinex, are you sure this is safe?"
52:STRINGS.CHARACTERS.GENERIC.DESCRIBE.WAND= "Michael must be a genius!"
 
Thank you for fast reply
 
Link to comment
Share on other sites

[00:00:35]: Unload BE done

[00:00:36]: Mod: Michael (MICHAEL) Registering prefabs

[00:00:36]: Mod: Michael (MICHAEL)  Registering prefab file: prefabs/michael

[00:00:36]: Mod: Michael (MICHAEL)    michael

[00:00:36]: Mod: Michael (MICHAEL)  Registering default mod prefab

 

is the error i now get :( help?

Link to comment
Share on other sites

 

[00:00:35]: Unload BE done
[00:00:36]: Mod: Michael (MICHAEL) Registering prefabs
[00:00:36]: Mod: Michael (MICHAEL)  Registering prefab file: prefabs/michael
[00:00:36]: Mod: Michael (MICHAEL)    michael
[00:00:36]: Mod: Michael (MICHAEL)  Registering default mod prefab
 
is the error i now get :( help?

 

 

after this it just crashes, nothing under that in the log

 

log.txt

Link to comment
Share on other sites

@mikey99222, In certain cases, particularly with assets (images/animations), the game will crash without giving an error message in the log. Without special knowledge, your best bet is to comment out code or temporarily replace it with code from the most analogous parts of the game (e.g. the game's spear file) to see exactly what is causing the problem.

  • Like 1
Link to comment
Share on other sites

@mikey99222, In certain cases, particularly with assets (images/animations), the game will crash without giving an error message in the log. Without special knowledge, your best bet is to comment out code or temporarily replace it with code from the most analogous parts of the game (e.g. the game's spear file) to see exactly what is causing the problem.

 

thank you, i shall try this

Link to comment
Share on other sites

thank you, i shall try this

 

I have fixed that, but i am having a new error :( any help?

 

when i go to hover over the recipie, it crashes, i commented out the recipie and replaced with sticks, the light on the .WAR tab goes green. however, even c_give("wand") crashes my game. help?

 

 

log.txt

Edited by mikey99222
Link to comment
Share on other sites

@mikey99222, you should probably post your actual code if you want the most help you can get. Without any code posted most modders are unable to help you to the maximum of their ability. Post your entire mod so that we are able to use it and see exactly what the cause of the issue is, rather than simply guessing at it. 

Link to comment
Share on other sites

@mikey99222, you should probably post your actual code if you want the most help you can get. Without any code posted most modders are unable to help you to the maximum of their ability. Post your entire mod so that we are able to use it and see exactly what the cause of the issue is, rather than simply guessing at it. 

ok, here it is

 

michaelwand.zip

Link to comment
Share on other sites

@mikey99222, try moving this line:

Asset("ATLAS", "images/inventoryimages/wand.xml" ),
 

 

Into your prefab file instead of having it in the modmain.lua file.

 

Also add this line to import the .tex file as an asset. This goes in your prefab file as well.

Asset("IMAGE", "images/inventoryimages/wand.tex"),

 

Also add these lines to your prefab file under the inventoryitem component to see if it will help.

 

inst.components.inventoryitem.atlasname = "images/inventoryimages/wand.xml"

    inst.components.inventoryitem.imagename = "wand"

 

 

After making these changes, test it again and see if it still displays issues.

Link to comment
Share on other sites

@mikey99222, try moving this line:

Asset("ATLAS", "images/inventoryimages/wand.xml" ),
 

 

Into your prefab file instead of having it in the modmain.lua file.

 

Also add this line to import the .tex file as an asset. This goes in your prefab file as well.

Asset("IMAGE", "images/inventoryimages/wand.tex"),

 

Also add these lines to your prefab file under the inventoryitem component to see if it will help.

 

inst.components.inventoryitem.atlasname = "images/inventoryimages/wand.xml"

    inst.components.inventoryitem.imagename = "wand"

 

 

After making these changes, test it again and see if it still displays issues.

 

thank you, i shall try this :)

Link to comment
Share on other sites

@mikey99222, Okay remove the Assets code from your modmain, you don't need it there. Those go in your prefab file. The error is indicating that your not setting the correct inventory image.

 

WARNING! Could not find region 'wand.tex' from atlas 'images/inventoryimages.xml'. Is the region specified in the atlas?

 

This indicates that your region area in your wand.tex and wand.xml file are not correct. You should recreate the wand.tex and wand.xml file and make it look like the following if you want it for inventory item.

 

Link to comment
Share on other sites

@mikey99222, Okay remove the Assets code from your modmain, you don't need it there. Those go in your prefab file. The error is indicating that your not setting the correct inventory image.

 

WARNING! Could not find region 'wand.tex' from atlas 'images/inventoryimages.xml'. Is the region specified in the atlas?

 

This indicates that your region area in your wand.tex and wand.xml file are not correct. You should recreate the wand.tex and wand.xml file and make it look like the following if you want it for inventory item.

 

attachicon.gifinventoryimages.zip

 

still broken, shows this if it is any help :(

 

post-583283-0-77700200-1422984642_thumb.

 

log.txt

michaelwand.zip

 

after i uploaded this i recreated the TEX file, same error.

Edited by mikey99222
Link to comment
Share on other sites

still broken, shows this if it is any help :(

 

attachicon.gifCapture.JPG

 

attachicon.giflog.txt

attachicon.gifmichaelwand.zip

 

after i uploaded this i recreated the TEX file, same error.

 

The issue still lies in the fact that the game cannot find the region specified in the .xml file.

 

WARNING! Could not find region 'wand.tex' from atlas 'images/inventoryimages.xml'. Is the region specified in the atlas?

 

This means that you're .tex file is inaccurately sized or your .xml is not pointing to the proper region where the image is located. Use the zip file I provided to create an exact replica for placement of your item. Once that is completed copy the .xml I provided and change the name inside of it to suit your .tex file and remember to rename your .xml file to the same as your .tex file. If you create an exact replica you should have it working.

Link to comment
Share on other sites

The issue still lies in the fact that the game cannot find the region specified in the .xml file.

 

WARNING! Could not find region 'wand.tex' from atlas 'images/inventoryimages.xml'. Is the region specified in the atlas?

 

This means that you're .tex file is inaccurately sized or your .xml is not pointing to the proper region where the image is located. Use the zip file I provided to create an exact replica for placement of your item. Once that is completed copy the .xml I provided and change the name inside of it to suit your .tex file and remember to rename your .xml file to the same as your .tex file. If you create an exact replica you should have it working.

 

I made a replica... in the region, however even after renaming it all and the dug_reeds in the atlas, it did not work...

 

log.txt

michaelwand.zip

Link to comment
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
 Share

×
  • Create New...