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 MrFoamy

>I think that feature would be considered as a bug then ;-). You would have to write an #appendto script to the grappler which you then put into System.ocg/Grappler.c (or something) of your scenario which overwrites the parts of the grappler where it is about attaching to surfaces. Could be not-so-easy to do.


I've got the code working so that the hook wont attach to digable terrain but amusingly the bit i've got stuck on is making it work as an #appendto file. What have i done wrong?

my code:

// Stop the grappling hook working on diggable terrain

#appendto Hook

public func Hit(x, y)
{
  if(GetMaterialVal("DigFree","Material",GetMaterial(x, y)))
  {
    return;
  }
 
  else
  {
    Stick();
  }
   
}



EDIT: I've also tried to get the fall damage to work but i'm having some trouble. If i use "Explode" instead of "DoDamage" then it works perfectly. Do i need to be sending something else for the damage instruction?

func Hit(int iXSpeed, int iYSpeed)
{
  if(iYSpeed < 350) return;
  if(GetAction() != "Walk") return;
  if(iYSpeed >= 450) DoDamage(500);
  var iKneelDownSpeed = 18; // Fall damage
  SetXDir(0);
  SetAction("Kneel");
  PlayAnimation("KneelDown", 5, Anim_Linear(0, 0, GetAnimationLength("KneelDown"), iKneelDownSpeed, ANIM_Remove), Anim_Linear(0, 0, 1000, 5, ANIM_Remove));
  ScheduleCall(this, "EndKneel", iKneelDownSpeed, 1);
}

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill