Author Topic: GSF Sea Copter script not working  (Read 654 times)

Wen I htt the space bar, the GSF Copter does nothing.

Wen I htt the space bar, the GSF Copter does nothing.
that's becuse it dosen't do any thing when you press the space bar

that's becuse it dosen't do any thing when you press the space bar


DERP

that's becuse it dosen't do any thing when you press the space bar
used to, broke in one of the versions, i think v13

I tried to fix this issue Here, but none of the supplied solutions worked.

I tried to fix this issue Here, but none of the supplied solutions worked.
idea, what about the output for vehicle events, if you can get teh space part to work (maybe look at a bot like the horse?), and see if you can fix it from there?

I tried to fix this issue Here, but none of the supplied solutions worked.
Yes, because you are horrible.

that's becuse it dosen't do any thing when you press the space bar


It used to engage vertical ascent.

Yes, because you are horrible.
I tried to fix this issue Here, but none of the supplied solutions worked.
Learn to read and piss off cigarette.

well tezuni, would it work?

well tezuni, would it work?

The vehicle velocity events functions are:
Code: [Select]
function Vehicle::setVelocity(%this,%vel)
{
%this.setVelocity(%vel);
}

function Vehicle::addVelocity(%this,%vel)
{
%this.setVelocity(vectorAdd(%this.getVelocity(),%vel));
}

Here is the completely rewritten script by Clockturn:
Code: [Select]
function gsfseacopterVehicle::OnTrigger(%this, %obj, %triggerNum, %val)
{
   if(%val)
   {
      if(%triggerNum == 2)
      {
         %vel = %obj.getVelocity();
         if(getWord(%vel,2) < 30)
    %obj.setVelocity(vectorAdd(%vel,"0 0 3"));

      }
   }
}

package SeaCopterTrigger
{
   function Armor::onTrigger(%datablock,%player,%slot,%val)
   {
      Parent::onTrigger(%datablock,%player,%slot,%val);
      %mount = %player.getObjectMount();
      if(%slot == 2 && isObject(%mount))
      {
         if(%val)
         {
            %mountdatablock = %mount.getDatablock();
            if(%mountdatablock.getName() $= "GSFSeaCopterVehicle")
            {
               %mountdatablock.climbUp(%mount);
            }
         } else {
            cancel(%mount.climbUpSchedule);
         }
      }
   }
};
ActivatePackage(SeaCopterTrigger);

function GSFSeaCopterVehicle::climbUp(%datablock,%vehicle)
{
   %vel = %vehicle.getVelocity();
   if(getWord(%vel,2) < 20)
   {
      %vehicle.setVelocity(vectorAdd(%vel,"0 0 1"));
   }
   %vehicle.climbUpSchedule = %datablock.schedule(50,"climbUp",%vehicle);
}

Here is the original: (Broke after v13)
Code: [Select]
function gsfseacopterVehicle::OnTrigger(%this, %obj, %triggerNum, %val)
{
   if(%val){
      if(%triggerNum == 2){
      %pmount = %client.player.getObjectMount();
      %pmount.setVelocity("0 0 20");
  }
   }
}

function gsfseacopterImage1::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}

function gsfseacopterCheck(%obj)
{
// return;
if(!isObject(%obj))
return;

%speed = vectorLen(%obj.getVelocity());
if(%speed < %obj.dataBlock.mingsfseacopterSpeed)
{
if(%obj.getMountedImage(3) !$= "")
{
%obj.unMountImage(2);
}
}
else
{
if(%obj.getMountedImage(3) $= 0)
{
%obj.mountImage(gsfseacopterImage1,2);
}
}


schedule(2000,0,"gsfseacopterCheck",%obj);
}


function gsfseacoptervehicle::onadd(%this,%obj)
{

   %obj.playThread(0,"spin");
       gsfseacopterCheck(%obj);
}

I've tried using all of these and modifying them, but with no results.  I've given up on it, but I encourage anyone else to take a shot.