Jump to content

floating/sinking code for custom items?


Recommended Posts

Hey! I havea custom item that, when dropped in water, doesnt have the floating ripple animation. My question is

1) what is the code for making an item flaot and have the floating animation

2) On the other hand, what is the code that makes an item sink when its in water?

 

Thank you for your future help!

Link to comment
Share on other sites

This function makes that items floats.

MakeInventoryFloatable(inst, "idle_water", "idle")

And absence ot this function makes items sink.

 

idle_water is the name of water animation and idle is the name of land animation.

If you don't have them, they should be added in your Spriter Project,

 

About ripples, try this /109159-how-to-make-water-ripples-for-custom-items/.

Link to comment
Share on other sites

When I add the code,

MakeInventoryFloatable(inst, "idle_water", "idle")

It does the splashing animation, but no ripples.

 

When i Omit the code above, I just get the ground placing animation, and it doesnt disappear.

 Any suggestions?

 

Link to comment
Share on other sites

4 hours ago, zetake said:

From this post, I'm a bit confused as to where to put the 

            <timeline id="1" name="ripple2">
            <timeline id="2" name="shadow_0">
            <timeline id="3" name="shadow_1">
            <timeline id="4" name="shadow_2">

Link to comment
Share on other sites

1 hour ago, zetake said:

Check out log animation file.

I mean decompile log,zip and look at spriter animation file. (.scml)

image.thumb.png.ba8212268869655cbcf3dae00290f485.pngThis is what im getting when i decompile the log.zip and look at the spriter file.

 

 

Link to comment
Share on other sites

After testing it a lot I came to conclusion.

Every floatable item has its own ripple animation.

The same animation is used, only with a changed size/width depending on a item, with some exceptions.

OverrideSymbol doesn't change animation, it just changes textures used in animation.

Folders in animations are the Symbols.

 

You can find ripple textures in ripple_build.zip.

 

There is custom ripple animation in log.zip.

But it doesn't look smooth after compiling.

So I don't know where you can find ripple animation to use.

Can someone provide ripple animation file?

And tell how to properly compile it? (Optional)

EDIT1: Compiler messes up animations.

EDIT2: Game animations are in 30fps, but compiler change them to 40fps.

That's why it looks wrong.

There are 2 options to make it look right.

1. Compile animation in 30fps.

I don't know how to do it with Spriter files, but you can do it in BinaryConverter.

But with BinaryConverter you can only do it manually.

I mean you have to change x, y, scale_x and scale_y up to 180 tags each one of them.

In text editor to match your custom item.

At least values of them can be generated in Spriter.

Can someone tell how to compile Spriter animations in 30fps?

2. Make 40fps animation.

Can someone provide 40fps ripple animation?

EDIT3: Change of fps in animations is done properly.

Issue is with x, y tags of water_ripple.

In project file they are the same for every key.

But after compilation, they get changed.

Any solutions?

EDIT4: Nevermind.

Even with everything done good, animation still looks wrong.

Less wrong, but still not right.

So I guess it has to be 30fps or you need to make new textures for 40fps.

 

So to have ripple animation, you have to add idle_water animation to your custom item Spriter file.

And in Spriter you need to change your item position to match ripple animation.

And you also need to change ripple animation size/width to match your custom item.

 

By default ripple textures are used from ripple_build.zip.

Only if symbols in your animation are named "water_ripple" and "water_shadow"

 

So it doesn't make sense to add those textures again with your mod.

But I couldn't find better way than replacing ripple textures with 1x1 empty images.

What is the way to omit textures but keep properties of them when compiling animations?

EDIT: Figured out how it's done.

You need to have 2 compiled animations.

1. without symbols and textures that you don't won't to include.

2. with added symbols and textures.

Now you just replace anim.bin in 1st animation with the anim.bin from 2nd animation.

 

And again same situation, when you need to add basic game elements to your mod, but game doesn't support it.

So instead of using game assents, you end up using copy of them.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...