Not logged inOpenClonk Forum
Up Topic General / Help and Questions / How do I make a clonk unable to jump
- - By schoeggu [ch] Date 2013-08-15 08:28 Edited 2013-08-15 15:15
Hello, I want some clonks to be unable to jump, climb, dig, etc.
What I did was make a function that removes the specified entries from a clonks ActMap.

This works fine for climb, scale, dig etc.
But it gets weird when removing the jump action.
I guess that is because falling down is also done in with the jump action, if i understood the code correctly.
So when removing the jump action from the ActMap the clonk can just walk over the cliff and floats around in the air.

Is there a way to just prevent the user from initiating the jump?
And is there a way to lower the height of a jump?

Oh, and what is the difference between the -> and ->~ operators?

Thank you and regard
Joel
Reply
Parent - - By Mortimer [de] Date 2013-08-15 17:32
I think you could write an appendto script for the Clonk and redefine ControlJump there:
#appendto Clonk
func ControlJump()
{
    return false;
}

->~ is the failsafe variant of ->. It won't cause an error when the function to be called is not actually known to the target object.
Reply
Parent - By schoeggu [ch] Date 2013-08-15 22:52
Thank you, it worked fine.
Reply
Parent - - By Clonkonaut [de] Date 2013-08-15 17:43
Actually, you just try and disable the unwanted functions by using the technique (or similar) Mortimer mentioned.

Deleted any action from the ActMap might have very unforeseen consequences to the overall behaviour of the clonk.
Reply
Parent - - By schoeggu [ch] Date 2013-08-15 22:55
I tried that, but i didn't find any usefull function to override. There is for example StartScale() but this is only for animation.
Is there anything I don't see?
Reply
Parent - By Maikel Date 2013-08-16 09:18
What you don't see is the engine internal code, which if I am correct controls at least hangling and scaling.

On the other hand throwing and jumping (the start of it) are controlled by script. There is also a difference between these actions, jumping and throwing are initiated on pressing a key or button. Scaling and hangling on the other hand are more like events which happen if you "attach" to a wall or ceiling.

You need to have a look at the engine code to see what precisely happens... but I think disabling via the ActMap is the most straightforward solution, maybe not the cleanest one.
Parent - By Caesar [de] Date 2013-08-18 22:33
Maybe, you just want to deactivate the clonk in the crew? Look at SetCrewEnabled, and probably SetCommand and some others.
Up Topic General / Help and Questions / How do I make a clonk unable to jump

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill