Not logged inOpenClonk Forum
Up Topic General / Help and Questions / How to disable the rotation animation?
- - By Yzubi Date 2018-08-22 21:25 Edited 2018-08-22 21:58
I want to create a "2D" character for OpenClonk, how can i disable the rotation when walking and swimming and make the character move to left/right instantly? (So it doesnt look like a "Paper Mario" character) thanks!
Parent - - By Clonkonaut Date 2018-08-24 02:12
It very much depends on how you want to go about creating that 2D character. You might need to modify the turning code or replace with other logic.

However, familiarising yourself with the code a bit is at some point a must when creating something as complex as a whole character.

The code handling the turning of the clonk are the first few functions in Objects.ocd\Clonk.ocd\Animations.ocd and are controlled by the "IntTurn" effect the clonk applies in Construction (Objects.ocd\Clonk.ocd\Script.c).
So you could either have Construction overload in your character and not apply the effect or remove the effect again. This will, however, only fix the issue of visually turning. If you want to instantly change direction (speed) as well, you will have to modify the Walk action and use appropiate values for Accel and Decel (see ActMap).

But, with your character, unless the 2D graphics is symmetrical, you'll have to think on how to turn it. If it is symmetrical, you can ignore the rest!

If you really must have a 3D mesh showing a 2D thing, you'd be better off modifying that turning effect to instantly apply a mesh transformation.

But, creating a 2D thing is also possible with using a spritesheet and sprite animation. If you look at objects like rocks, firestone or other small items, you can see that those use .png files, so static spritesheets. Sprite animation is handled through the ActMap (see above for documentation link) and the interesting things would be Directions=2 and FlipDir=1 because then the character will automatically flip when running in a different direction.
Parent - - By Yzubi Date 2018-08-24 21:04
Thanks for the helpful and detailed response!

How can i modify the turning effect to instantly apply the mesh transformation? And why that option would be beter?

I disabled the "IntTurn" effect and put Directions=2 and FlipDir=1 settings in the OpenClonk editor, it works wonderfully when in ground, but the character go to the wrong direction when jumping  (I did not found the "Flipdir" option for jump in the Editor, it exists?)
Parent - By Caesar [jp] Date 2018-08-26 14:36
Have you done the Directions and FlipDir thing to all the animations that have a left/right direction? There should be at least Walk, Jump, Hangle, Dig, Swim, … Maybe also Scale, and probably some Kneel animation.
Parent - By Clonkonaut Date 2018-08-27 12:39
I fear that you're approaching this from the wrong angle, so I have to clarify:
The editor is not capable of creating ingame objects just scenarios. Meaning, you can place objects into a scenario, save it and then start it again while all placed object are recreated.
You cannot, however, create a new object which can then be used in multiple scenarios or even in one scenario while being created multiple times during gameplay.

So, in order to make such a new object, you will have to unpack Objects.ocd using the c4group.exe in your OpenClonk directory, coping around some stuff from the clonk object definition and then dig into the code of the object with a text editor of your choosing. As I said, that does mean you'll have to familiarise yourself with the coding language used in Clonk.
Up Topic General / Help and Questions / How to disable the rotation animation?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill