Jump to content

Recommended Posts

Hello!

I'm in the process of making a character mod for a snowman, and I'd like him to be able to use a modded item (Packed ice) on mini-glaciers to make them into packed glaciers, which will not melt.

However, the rock_ice prefab is very complex, and I was hoping someone could help or walk me through it so I can understand better for future scripting. I know I will have to add a new stage to the ice (That being the "packed" stage), but I don't know how to make that stage caused by upgrading with packed ice, and I do not know how to make the glacier stop melting while in that stage.

Any ideas?

Some things I've observed about ice. You may already know some of this, but in case it helps:

  • Rock_ice.lua refers to a "mini-glacier" while inv_rocks_ice.lua refers to the item "ice" which can be picked up, put in an ice box, crafted with, etc. Make sure you think of these as two completely separate items--no relation, except that one happens to drop the other. While both do melt, they don't appear to share code from what I can tell.
  • To craft your item form of packed ice, you can add a new crafting recipe and treat your ice as a whole separate prefab based on inv_rock_ice.lua (you can steal code from there if you want it to melt in your inventory, create water when it melts, etc.)
  • I don't know how to add a new stage to the rock_ice prefab from a mod, however, I think you can work around that. Try something along these lines:
    1. Create a new prefab, let's call it rock_packed_ice
    2. Give it similar properties/base it off something simpler like "rock1" from rocks.lua, because it doesn't need to be able to melt or change back to smaller sizes like rock_ice, which is where most of the complexity of that file comes in
    3. Make your item something which can be used on rock_ice. Allow it to be used only if the rock_ice is in a certain stage (tall?) if desired
    4. When your item is used on rock_ice, cause the rock_ice to despawn, and a rock_packed_ice to appear in its place
    5. If rock_packed_ice is mined, cause it to despawn and a rock_ice in its largest stage to appear in its place

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