Sign in to follow this  
SpurdoTheDwarf

Getting error with custom item for custom character, help needed!

Recommended Posts

Hey all,

  Sorry to have multiple posts on the front page, this is the first mod I've made and I've got lots of questions for lots of problems. 

 

The problem I'm having is adding a custom weapon (specifically, a spear) to a custom character that was working fine before I began coding in the spear.

 

  Anyways, in my other post I was having trouble with the inventory images not being located. I think I managed to fix that, because now I can login to the main menu with my custom character enabled, and start up a game and choose said character without a hitch. But as soon as the world begins to load, within seconds after choosing my character, I get a crash. The log, which I will attack below, gives me the error that it "could not find region "FROMNUM" from atlas "FROMNUM" it asks if the region is specified in that atlas.

 

  Well, I don't even know where a "Fromnum" atlas would be, I can't find it in any of the mod folders or anything (probably really stupid of me to be looking for this but oh well). I tried re-creating the atlas-0 and build.bin for the spear in the Anim folder, but to no success. I am at the end of my rope with this and could really use a more experienced pair of eyes to check my code. As said, this is my very first mod in LUA. It makes me feel really stupid because I've coded mods for minecraft in java before, although that has its place in a different forum. If ANYONE has any clue what I'm doing wrong here, and can point that out to me so I can get an idea of what to do better next time, that would be fantastic. Below I am attaching the modmain.lua, the prefab file for the spear, and the error log from the documents folder of my computer (Documents/klei/donotstarvetogether/) 

log.txt

modmain.lua

globestaff_aristotlemeans.lua

Share this post


Link to post
Share on other sites
DarkXero    2886

Replace

inst.components.inventoryitem.imagename = "GlobeStaff"

for

inst.components.inventoryitem:ChangeImageName("globestaff_aristotlemeans")

Also, the log shows other error.

Share this post


Link to post
Share on other sites

Okay, so I can get into the game as the character now, so thanks a million for that, but now the spear is equipped but floating 20 feet from the charatcer, the inventory image is invisible, and everywhere the mouse moves says "right-click to unequip" Also, what are the other errors showing in the log?

post-669205-0-36443700-1435371381_thumb.

Share this post


Link to post
Share on other sites
DarkXero    2886

If the inventory image is invisible, the atlas may be referencing the tex the wrong way.

 

How did you make the staff? It's way off. And the unequip shouldn't be happening by any means.

 

I don't know what names you used in the spriter file but

owner.AnimState:OverrideSymbol("swap_object", "", "swap_spear_wathgrithr")

this is certainly weird. In general, "" is "symbol0" or something else.

 

We need to look at the staff assets.

Share this post


Link to post
Share on other sites
DarkXero    2886

Right, those assets are for the staff when it's on the floor.

Did you make a swap_globestaff based on swap_spear_wathgrithr?

 

The code is fine (only just a bit incomplete on that Override function), but for the spriter part:

http://forums.kleientertainment.com/topic/29427-tutorial-creating-a-handslot-equippable-item-from-scratch/

Edited by DarkXero

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