Jump to content

Quick Question on Dress Perish Times


Recommended Posts

I want to give a character the ability to craft special Dress items that last longer that cost a bit more resources. Now, when the original Hats file says "(TUNING.TOPHAT_PERISHTIME)" is that how long it takes for the Top Hat to perish, or the rate it perishes?

Would "inst.components.fueled:InitializeFuelLevel(TUNING.TOPHAT_PERISHTIME * 2)" make the hat last twice as long, last half as long, or do nothing because that's the wrong way to modify it?

Link to comment
Share on other sites

12 minutes ago, icantevenname said:

I want to give a character the ability to craft special Dress items that last longer that cost a bit more resources. Now, when the original Hats file says "(TUNING.TOPHAT_PERISHTIME)" is that how long it takes for the Top Hat to perish, or the rate it perishes?

You can go and find the variable in the tuning.lua file among the game scripts. This is the line for the tophat

TOPHAT_PERISHTIME = total_day_time*8,

Since it's a multiple of the total_day_time variable, we can assume that it is the time it takes for it to perish, in this case, 8 days.

12 minutes ago, icantevenname said:

Would "inst.components.fueled:InitializeFuelLevel(TUNING.TOPHAT_PERISHTIME * 2)" make the hat last twice as long, last half as long, or do nothing because that's the wrong way to modify it?

That will reset the fuel level, and using that calculation, the hat would last for 16 days.

Unless some mod loaded before yours has changed the value of that tuning variable.

Edited by Ultroman
Link to comment
Share on other sites

21 minutes ago, icantevenname said:

So if I put in "inst.components.fueled:InitializeFuelLevel(total_day_time*10)" into the character's hat script, it would last 10 days, right?

No, because you don't have a total_day_time variable anywhere. There is, however, TUNING.TOTAL_DAY_TIME

Link to comment
Share on other sites

1 hour ago, Ultroman said:

No, because you don't have a total_day_time variable anywhere. There is, however, TUNING.TOTAL_DAY_TIME

Two things, how do I get it so I can set the exact numbers of days to perish? And my hat won't show up when worn, can you point me to something that'll help?

Link to comment
Share on other sites

9 minutes ago, icantevenname said:

Two things, how do I get it so I can set the exact numbers of days to perish?

inst.components.fueled:InitializeFuelLevel(TUNING.TOTAL_DAY_TIME * 10) -- 10 days

If your item doesn't show when worn, it has something to do with your animation files (build name might be wrong), the references to them (TEX files are referenced in the XML files next to them, and both files are referenced in your item's Lua), or that you're using the wrong override symbols in the OnEquip function for your item. See if you can identify any of these problems, and if you can't find anything amiss, post a zip of your mod so I can take a look.

Link to comment
Share on other sites

1 hour ago, Ultroman said:

If your item doesn't show when worn, it has something to do with your animation files (build name might be wrong), the references to them (TEX files are referenced in the XML files next to them, and both files are referenced in your item's Lua), or that you're using the wrong override symbols in the OnEquip function for your item. See if you can identify any of these problems, and if you can't find anything amiss, post a zip of your mod so I can take a look.

I'm starting to suspect that it's because I made the .smcl's from scratch...

Link to comment
Share on other sites

Just now, icantevenname said:

I'm starting to suspect that it's because I made the .smcl's from scratch...

Maybe. If there were discrepancies they should show in the log for the auto compiler (if you use the auto compiler to compile the anim builds).The log is in steamapps\common\temp

Link to comment
Share on other sites

4 minutes ago, Ultroman said:

Maybe. If there were discrepancies they should show in the log for the auto compiler (if you use the auto compiler to compile the anim builds).The log is in steamapps\common\temp

Nothing seems to stick out. Maybe the compiler figured that I meant to do that. I guess I didn't make the .scml correctly. Is there something I can look at that'll help?

Link to comment
Share on other sites

Those are zips of your folders in your "exported" folder, I hope. I'm not too familiar with this whole textures and animations part. In this thread, a guy posted his entire mod, WITH the "exported" folder, so you can see how he has made his riskysword. There may be some differences, but you can look at the structure of everything, to ensure that your files have what they should. I'll see if I can find a hat example.

To find more examples, you can check out the newcomer post about how to search the forums efficiently, and search for: invisible item

Updated...

Edited by Ultroman
Link to comment
Share on other sites

1 hour ago, icantevenname said:

Problem is that I'll have no idea on what I'm doing if I try again.

That's probably the reason why it isn't working in the first place :)

Try and try again until it works. You should be able to find tutorials for using Spriter on Youtube or this forum.

I'm sorry I can't be of more help, but I have very little understanding of this particular part.

Link to comment
Share on other sites

On 7/12/2019 at 12:46 AM, Ultroman said:

That's probably the reason why it isn't working in the first place :)

Try and try again until it works. You should be able to find tutorials for using Spriter on Youtube or this forum.

I'm sorry I can't be of more help, but I have very little understanding of this particular part.

I'll ask other modders who have made hats. Thanks for your time, though.

Though, I had a thought. Is there an FAQ on modding around here? I feel like that would be rather useful.

Link to comment
Share on other sites

If you look in the newcomer post, I've linked to some of the great resources on the forum. There are FAQs and tutorials galore, but much of it is out-dated by now. I'm trying to muster up some example mods and new tutorials in cooperation with some of the other modders, so hopefully within the next few months we'll have new and better learning material. Here is a Spriter tutorial done by a Don't Starve modder 5 years ago. Not sure how it holds up, but it's there. Please do report back whether you found it useful.

Link to comment
Share on other sites

 

2 hours ago, Ultroman said:

If you look in the newcomer post, I've linked to some of the great resources on the forum. There are FAQs and tutorials galore, but much of it is out-dated by now. I'm trying to muster up some example mods and new tutorials in cooperation with some of the other modders, so hopefully within the next few months we'll have new and better learning material. Here is a Spriter tutorial done by a Don't Starve modder 5 years ago. Not sure how it holds up, but it's there. Please do report back whether you found it useful.

The tutorial for Spriter is still very relevant, however she is using the pro version of the software.

Animation is extremely time consuming, fortunately most people are interested in simple build/symbol swaps with very simple static idle animations.
 

Edit:

As somebody who bought the pro version, it is very helpful especially with merging spriter projects together saving me a lot of time. But is highly unneeded for the majority of spriter projects where I still use the free version just because it loads by default still for some reason.

Edit 2:

On 7/10/2019 at 8:34 PM, icantevenname said:

What am I looking at here? Because I am just seeing two of the same file.

Hats by default use a swap_symbol composed of 4 images
Usually named

  • swap_hat-0 (front)
  • swap_hat-1 (side)
  • swap_hat-2 (back)
  • swap_hat-3 (ground)

If you have invisible images you are probably missing symbols or have blank ones. Assuming it compiled properly to be visible on the ground.

Its also possible your code for overriding the symbol could have typos or incorrect paths to the assets.
 

--Onequipfn
owner.AnimState:OverrideSymbol("swap_hat", "rare_tophat", "swap_hat")
--symbol we are overiding
--build name (aka .zip)
--symbol in build (folder name of the images in the spriter file)

Technically you can name the folder w.e. you want, as long as you don't break the links in your spriter project, but it is just convenient to keep things familiar.

Edited by IronHunter
  • Like 1
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...