Sign in to follow this  
Jashbebz

Equitable Prefab Not showing While Held or Dropped

Recommended Posts

Jashbebz    0

Hello! I have recently attempted to make a mod, a simple weapon/tool mod, and after some time I got it to eventually load with the game, only problem is: it doesn't display anything in hand or on the ground when dropped.

Heres the anim file and modinfo and modmain:

 

anim.zip

modinfo.lua

modmain.lua

Share this post


Link to post
Share on other sites
Lumina    2153

Ok, so you need to explain how you created the anim file.

You explained to me before that you did the image in photoshop and exported it in.tex with math tool. This part, ok. But the anim itself ? When does it come from ?
Also, could you put the gladius.lua ?

 

Because there are two main methods to create a new anim.

One is using spriter. For weapons, i don't know exactly how you do this because you need to have specifics symbols and all. But with this, your anim is "myweapon", your build is "myweapon" and all is fine.

 

The other is to use an existing anim as a base, and the anim will be "existingitem", you'll need to rename the build "myweapon", and you'll need to specify the correct informations in the myweapon.lua file.

 

(These are the main lines of the idea, a day i should do a post explaining it, because it's an important part of creating a new items).

 

For example, i'm making a plant based on cactus, i exported the .png to tex, renamed the build, my bank and build look like that :


    inst.AnimState:SetBank("cactus")
    inst.AnimState:SetBuild("myplant")

 

Another plant use a custom anim, using spriter, and my bank and build look like that :


    inst.AnimState:SetBank("myotherplant")
    inst.AnimState:SetBuild("myotherplant")

 

Also, if you are using another file as a base, your tex file MUST be the same size than the tex file of the original file. Let's say i want to make a bush. I decide to use berrybush as a template.

Then my image should be 512*512, and the elements into my image should be when the berrybush original elements are (more or less), or my image won't show up.

And, finally, specific case when doing a weapon, there is a line :


    owner.AnimState:OverrideSymbol("swap_object", "swap_nameofyourprefab", "swap_nameofthebank")

This part should be this way : first, swap_object, because it's the part you override (you don't have to change it), then "swap_nameofyourprefab" (the build name), then "swap_nameofthebank".

The bank is the name of the anim you are using. If you did your anim on spriter, usually, "swap_nameofyourprefab" and "swap_nameofthebank" will be the same, like "swap_mycustomweapon", and you'll have a "inst.AnimState:SetBank("mycustomweapon")

But let say you just used the spear as a template, and make a fire spear, you'll have something like

    owner.AnimState:OverrideSymbol("swap_object", "swap_firespear", "swap_spear")

And theses lines :


    inst.AnimState:SetBank("spear")
    inst.AnimState:SetBuild("firespear")
    inst.AnimState:PlayAnimation("idle")

 

So it's important to explain what method you used, based on what file, so people could understand why it's not working.

 

Note : it's late here and the bank/build/spriter/tex stuff is a little hard to explain, sorry if it's not clear of if there is mistake.

Share this post


Link to post
Share on other sites
Jashbebz    0
25 minutes ago, Lumina said:

Ok, so you need to explain how you created the anim file.

You explained to me before that you did the image in photoshop and exported it in.tex with math tool. This part, ok. But the anim itself ? When does it come from ?
Also, could you put the gladius.lua ?

 

Because there are two main methods to create a new anim.

One is using spriter. For weapons, i don't know exactly how you do this because you need to have specifics symbols and all. But with this, your anim is "myweapon", your build is "myweapon" and all is fine.

 

The other is to use an existing anim as a base, and the anim will be "existingitem", you'll need to rename the build "myweapon", and you'll need to specify the correct informations in the myweapon.lua file.

 

(These are the main lines of the idea, a day i should do a post explaining it, because it's an important part of creating a new items).

 

For example, i'm making a plant based on cactus, i exported the .png to tex, renamed the build, my bank and build look like that :



    inst.AnimState:SetBank("cactus")
    inst.AnimState:SetBuild("myplant")

 

Another plant use a custom anim, using spriter, and my bank and build look like that :



    inst.AnimState:SetBank("myotherplant")
    inst.AnimState:SetBuild("myotherplant")

 

Also, if you are using another file as a base, your tex file MUST be the same size than the tex file of the original file. Let's say i want to make a bush. I decide to use berrybush as a template.

Then my image should be 512*512, and the elements into my image should be when the berrybush original elements are (more or less), or my image won't show up.

And, finally, specific case when doing a weapon, there is a line :



    owner.AnimState:OverrideSymbol("swap_object", "swap_nameofyourprefab", "swap_nameofthebank")

This part should be this way : first, swap_object, because it's the part you override (you don't have to change it), then "swap_nameofyourprefab" (the build name), then "swap_nameofthebank".

The bank is the name of the anim you are using. If you did your anim on spriter, usually, "swap_nameofyourprefab" and "swap_nameofthebank" will be the same, like "swap_mycustomweapon", and you'll have a "inst.AnimState:SetBank("mycustomweapon")

But let say you just used the spear as a template, and make a fire spear, you'll have something like


    owner.AnimState:OverrideSymbol("swap_object", "swap_firespear", "swap_spear")

And theses lines :



    inst.AnimState:SetBank("spear")
    inst.AnimState:SetBuild("firespear")
    inst.AnimState:PlayAnimation("idle")

 

So it's important to explain what method you used, based on what file, so people could understand why it's not working.

 

Note : it's late here and the bank/build/spriter/tex stuff is a little hard to explain, sorry if it's not clear of if there is mistake.

Okay, I think I'm getting this, here's the Gladius.lua file, its based off of this mod:Machete

Now, these lines you've posted above go into the Prefab.lua file correct? (For this one, Gladius.lua)

As of right now, what do I need to do it fix it? Is there anywhere else I can read up on how to do this? Extra reading material is always good! ;D

gladius.lua

Edited by Jashbebz
gladius.lua

Share this post


Link to post
Share on other sites
Jashbebz    0

Oh, you asked how I made the .tex:

I took the .tex from the machete mod, conveted it into .png, opened it into photoshop, and then finished it, exported it into .png, and then used Matt's Tools to make it into a .tex

 

It's a little crude, but I thought it would work xD

Share this post


Link to post
Share on other sites
Lumina    2153

Yes, the line i posted go in "gladius.lua"

You could show the machete.lua ? See the name of the bank ? And try to use the same name as a bank for your item. Something like :

    owner.AnimState:OverrideSymbol("swap_object", "swap_gladius", "swap_machete")

and


    inst.AnimState:SetBank("machete")
    inst.AnimState:SetBuild("gladius")
    inst.AnimState:PlayAnimation("idle")

?

The way you used could work, to create a new item, but when you do this, you could rename the build (build renamer), you could change the .tex (exporting the .tex in .png, photoshop, export the .png into .tex, like you did), but you could not change the bank. So when you create new texture with this method, you need to keep the name of the original bank, otherwise it couldn't work.

 

In game, you could look at hound prefab or rabbit prefab for examples. The fire hound and the ice hound both use the same anim as the classic hound, and have a custom build.

Share this post


Link to post
Share on other sites
Jashbebz    0
38 minutes ago, Lumina said:

Yes, the line i posted go in "gladius.lua"

You could show the machete.lua ? See the name of the bank ? And try to use the same name as a bank for your item. Something like :


    owner.AnimState:OverrideSymbol("swap_object", "swap_gladius", "swap_machete")

and



    inst.AnimState:SetBank("machete")
    inst.AnimState:SetBuild("gladius")
    inst.AnimState:PlayAnimation("idle")

?

The way you used could work, to create a new item, but when you do this, you could rename the build (build renamer), you could change the .tex (exporting the .tex in .png, photoshop, export the .png into .tex, like you did), but you could not change the bank. So when you create new texture with this method, you need to keep the name of the original bank, otherwise it couldn't work.

 

In game, you could look at hound prefab or rabbit prefab for examples. The fire hound and the ice hound both use the same anim as the classic hound, and have a custom build.

Okay, I tried doing the second method you mentioned:

Quote

So when you create new texture with this method, you need to keep the name of the original bank,

On a new project, I kept the name of everything the same as the original mod, only changing the .tex files and .png files, but it still didn't work :/

Thanks again for all your help!

GladiusTry.zip

Edited by Jashbebz

Share this post


Link to post
Share on other sites
Jashbebz    0
45 minutes ago, Lumina said:

Yes, the line i posted go in "gladius.lua"

You could show the machete.lua ? See the name of the bank ? And try to use the same name as a bank for your item. Something like :


    owner.AnimState:OverrideSymbol("swap_object", "swap_gladius", "swap_machete")

and



    inst.AnimState:SetBank("machete")
    inst.AnimState:SetBuild("gladius")
    inst.AnimState:PlayAnimation("idle")

?

The way you used could work, to create a new item, but when you do this, you could rename the build (build renamer), you could change the .tex (exporting the .tex in .png, photoshop, export the .png into .tex, like you did), but you could not change the bank. So when you create new texture with this method, you need to keep the name of the original bank, otherwise it couldn't work.

 

In game, you could look at hound prefab or rabbit prefab for examples. The fire hound and the ice hound both use the same anim as the classic hound, and have a custom build.

Could I just take the spear file from the game, ajust the .tex file, take everything else, use Build Rename and then export it?

Share this post


Link to post
Share on other sites
Jashbebz    0
3 minutes ago, Lumina said:

They seem to fit as far as i can tell, yes.

Okay, and to make the mod using a Build Rename what else do I need? As in, what's the formatting for the folders and other necessary items?

Share this post


Link to post
Share on other sites
Jashbebz    0
13 minutes ago, Lumina said:

They seem to fit as far as i can tell, yes.

I haven't ever done a build rename, much less a working mod, here's what I have so far, the atlas-0.tex is the new one I just made, I just kept everything named spear

Spear-Gladius.zip

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