Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

mikey99222

HELP! CUSTOM ITEM NOT WORKING

Recommended Posts

mikey99222    6

i have attached the log file, but i keep getting an error, mainly

 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

 

repeatedly, any ideas, help much appreciated!

 

 

 

 

log.txt

Share this post


Link to post
Share on other sites
Jjmarco    53

@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.

 

Share this post


Link to post
Share on other sites
mikey99222    6

@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
 

Share this post


Link to post
Share on other sites
Jjmarco    53

@mikey99222, those lines are under a return! After a return, none of the code under it will be interpreted. That's why you get that error, because nothing should be there. Just put them above the return.

Share this post


Link to post
Share on other sites
mikey99222    6

@mikey99222, those lines are under a return! After a return, none of the code under it will be interpreted. That's why you get that error, because nothing should be there. Just put them above the return.

thankyou

Share this post


Link to post
Share on other sites
mikey99222    6
[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?

Share this post


Link to post
Share on other sites
mikey99222    6

 

[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

Share this post


Link to post
Share on other sites
rezecib    3,083

@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.

Share this post


Link to post
Share on other sites
mikey99222    6

@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

Share this post


Link to post
Share on other sites
mikey99222    6

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

Share this post


Link to post
Share on other sites
Kzisor    1,051

@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. 

Share this post


Link to post
Share on other sites
mikey99222    6

@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

Share this post


Link to post
Share on other sites
Kzisor    1,051

@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.

Share this post


Link to post
Share on other sites
mikey99222    6

@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 :)

Share this post


Link to post
Share on other sites
Kzisor    1,051

@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.

 

Share this post


Link to post
Share on other sites
mikey99222    6

@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.

Share this post


Link to post
Share on other sites
Kzisor    1,051

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.

Share this post


Link to post
Share on other sites
mikey99222    6

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

Share this post


Link to post
Share on other sites