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 Ringwaul
The script file should be within a System.ocg folder, for example:

GrappleHookMod.ocd\System.ocg\HookNoStick.c

Edit:
To deal damage to the clonk you should use a negative value of "DoEnergy(int change)" instead of DoDamage(). Damage is another variable unrelated to 'Energy' (used for 'health' for living objects). Damage is more script friendly for vehicles, because the object does not require to be alive. Have a look at the Airship's Hitbox object for a clean example of how 'damage' works.

For fall damage for the clonk, you'd probably want something like this:

var yhurt = 60;
if(GetYDir() >= yhurt) DoEnergy((GetYDir() - yhurt) * -1)

60 is a relatively fast falling speed (from a fall of around 200pixels, or the height of 10 clonks), so damage would start being taken from there (yhurt). The greater the clonk falls past 60px/s would equate to the damage taken (so a hit-speed of 75 would deal 15 damage).

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill