Not logged inOpenClonk Forum
Up Topic Mountain climbing scenario help

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Zapper

>I'm not sure i understand, aren't x and y position coordinates rather than speed values?


The x and y value in Hit(x, y) are the value of the old speed before hitting the landscape, since the speed was probably already reset there. Usually the unit is pixels/10frames so a speed of 35 would mean 3.5 pixels/frame. In Hit(x, y) the unit is pixels/100frames so instead of the expected 35 you would get a 350 (and to get the real value in pixels you might even want to divide it by 100 instead of 10).
Thinking about it, you could also just cap the value to the closest pixels around the impact point: x = BoundBy(x, -2, 2);
The reason why your GetMaterial(x, y) works even though the values are speed values instead of coordinates is, because the coordinates of GetMaterial are local coordinates - that means they are relative to the object from where you call the function.
So GetMaterial(3, 5) would use the coordinates that are equal to GetX()+3 | GetY()+5

>You wouldn't happen to know the ID for the fall damage or how to find it would you?


There is no fall damage object.
You could try appending your script to "Clonk" if that is what you mean. But I could imagine that there are some subtle problems with the Hit-callback there where you don't always get the correct parameters (since the speed was already reset before the callback). But that might also have been fixed since CR

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill