Jump to content

Why are my items showing in the world as the items inventory icon and not the WorldStaticModel / WorldItems model? **RESOLVED**


ANJ_

Recommended Posts

Now I know without showing all my code, files, filepathing, and naming conventions that the problem can be hard to diagnose, but as far as I can tell none of that should be an issue, I have even compared working item mods folders/files/and code and haven't seen any discrepancies yet when my item is either dropped on the ground or placed on the ground the game completely ignores the [itemname_ground.fbx] file and just places an image of the inventory icon for that item. Does anybody know what I might be doing wrong? I'm very new to Project Zomboid and am working on my first mod so it's a learning process but I'm banging my head against the wall on this one.

 

I've tried different naming conventions, I've tried copying/pasting other peoples codes or the games codes within the /media/scripts folder while replacing the referenced [itemname_ground.fbx] files with my .fbx located within the same folder space, I've compared working default worldstaticmodels/ground models with my own, I can't seem to find any differentiation between any of the files models or codes with my mod and the default files yet for some reason it just won't work.

 

 

**RESOLVED**

 

And for anyone who may be experiencing this same problem, you have to create a script text file in your Scripts folder, naming convention is unimportant though I'd name it something like WorldItems_MyModName or something, and it should look something like this

 

module Base
{

    model YourItem_Ground
    {
        mesh = WorldItems/YourItem_Ground,
        texture = Clothes/YourItem_Texure,
        scale = 0.01,
    }
}

 

"YourItem_Ground" referencing your items .FBX or .X file for the ground/worldstatic model

and "YourItem_Texture" referencing that items respective .png texture file. 

 

Note of course that if any of your files are found in different folders you have to target those, for instance if you had a bag texture file in the textures/Clothes/Bag folder then your code should reflect that, written as Texture = Clothes/Bag/YourItem_Texture

 

The scale you may have to mess around with in order to get the size of your model right.

 

Hope this helps someone

Edited by ANJ_
Link to comment
Share on other sites

  • ANJ_ changed the title to Why are my items showing in the world as the items inventory icon and not the WorldStaticModel / WorldItems model? **RESOLVED**
  • 5 months later...

How does this work for multiple models in the module base? I had this issue with my first model but i saw this post and it fixed my issue. But then i tried adding another model to my game and it is just showing the inventory icon again for the second model. Any direction would be appreciated 

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
×
×
  • Create New...