Author Topic: Fixing the old vehicle gravity jeep function  (Read 459 times)

A while back I made a functioning speedkart edit where they all had the gravity jeep ability to climb walls and ceilings.  I thought it'd be fun to demo that again today, but it seems to have broken over time.  They behave just like regular speedkarts now with no gravity affect. Anyone see how this could be fixed?

Code: [Select]
function shiftgravitycheck(%obj)
{
 if(!%obj.isshiftinggravity)
  return;

 %pos=%obj.getposition();
 %ray=containerraycast(%pos,vectoradd(%pos,vectorscale(%obj.getupvector(),"-4 -4 -4")),$GravityJeepTypemasks,%obj);
 %normal=getwords(%ray,4,6);

 if(%normal!$="")
  %obj.grav=vectorscale(%normal,"-0.5 -0.5 -0.5");

 %obj.setvelocity(vectoradd(%obj.getvelocity(),vectoradd("0 0 0.5",%obj.grav)));
 schedule(25,0,shiftgravitycheck,%obj);
}

wtf is $GravityJeepTypemasks

dont you mean $TypeMasks::VehicleObjectType ?

wtf is $GravityJeepTypemasks

dont you mean $TypeMasks::VehicleObjectType ?
Code: [Select]
$GravityJeepTypemasks = $typemasks::fxbrickobjecttype | $typemasks::interiorobjecttype | $typemasks::terrainobjecttype | $typemasks::StaticObjectType;that's in Vehicle_GravityJeep

Looks like I forgot to include that variable.  Whoops