Author Topic: A few questions  (Read 1083 times)

Er, didn't work. See anything else that may be wrong?
Code: [Select]
   function thunderVehicle::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e)
   {
if(%col.getClassName() $= "TerrainBlock")
      {
         %obj.setvelocity("0 0 100");
      }
      Parent::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e);
   }

Sorry to bother

What exactly about it did not work?

Syntax error?
Did not set velocity?
Did not detect terrain collision?

If it's not a syntax error, throw in this before the if(%col and so on.
echo(%col.getClassName());

It printed sometime, but only once. It printed
Munf Munf: %col.getClassName();

   function thunderVehicle::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e)
   {

   messageall('',"\c3Munf Munf\c6: %col.getClassName();");

   if(%col.getClassName() $= "TerrainBlock")
      {
         %obj.setvelocity("0 0 100");
      }
      Parent::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e);
   }

I guess it didn't recognize the collision. Either that or we're doing something about that wrong

messageall('',"\c3Munf Munf\c6: " @ %col.getClassName());
Would be the correct way of doing that.

   function thunderVehicle::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e)
   {

messageall('',"\c3Munf Munf\c6: " @ %col.getClassName());
   if(%col.getClassName() $= "TerrainBlock")
      {
         %obj.setvelocity("0 0 10");
      }
      Parent::onCollision(%this,%obj,%col,%a,%b,%c,%d,%e);
   }

The subfunction still isn't working, but the messageAll is. Sadly, so far it only recognizes 2 things: player and "static shape"(window). Terrain must not be a class. Any other ideas?

The terrain is a class, however the function might not be called when it hits terrain.

The terrain is a class, however the function might not be called when it hits terrain.
Your 15000th post.