Author Topic: My vehicle runs people over only in LAN & Singleplayer  (Read 3325 times)

So this?
Code: [Select]
%client = %obj.client;
You said %obj wasn't defined, so getting the "client" variable off a nonexistant variable will set %client to nothing. Post the entire function.
« Last Edit: November 06, 2012, 02:10:20 AM by Trinick »

Code: [Select]
function Player::startSkiJumping(%obj)
{
//make a new ski vehicle and mount the player on it

%obj.getMinigameFromObject();

// %vector = %obj.getEyeVector();
// %rotation = %obj.getEulerRotation();
%client = %obj.client;
%position = %obj.getTransform();
%obj.schedule(350,Tuck);


%posZ += 0.3;

%vel = %obj.getVelocity();

%newvehicle = new WheeledVehicle()
{
dataBlock = skijumpvehicle;
client = %client;
minigame = %client.minigame;
};MissionCleanup.add(%newvehicle);
// %newvehicle.setTransform(%position SPC %vector SPC %rotation);
%newvehicle.setTransform(%position);
%newvehicle.addVelocity("0 0 10");
%newvehicle.schedule(150, mountObject, %obj, 0);
%newvehicle.addVelocity(%vel);
%newvehicle.changedatablock("skijumpvehicle");
}

function Player::getMinigameFromObject(%obj)
{
%obj.schedule(100,PrepareTrick);
}

function Player::PrepareTrick(%obj)
{
%obj.playthread(3,armreadyboth);
}

So then %obj is defined.. so is %client. So, use %client.minigame.

um, I thought I did. Where do you mean?

um, I thought I did. Where do you mean?
Oh, you did. And it still doesn't work? Well I dunno then, because it's in the same minigame as the client (as long as it's created after the client entered the minigame)

You should get rid of the function, Player::getMinigameFromObject, and just call %obj.schedule(100,PrepareTrick); instead.

Maybe I can do something here:
Code: [Select]
function skijumpVehicle::onAdd(%this,%obj)
{
//mount the nothing tire and ski spring
%obj.setWheelTire(0, nothingtire);
%obj.setWheelTire(1, nothingtire);
%obj.setWheelTire(2, nothingtire);
%obj.setWheelTire(3, nothingtire);

%obj.setWheelSpring(0, skiSpring);
%obj.setWheelSpring(1, skiSpring);
%obj.setWheelSpring(2, skiSpring);
%obj.setWheelSpring(3, skiSpring);
%obj.isshiftinggravity=1;
%obj.grav="0 0 -0.5";
skijumpcheck(%obj);
parent::onadd(%this,%obj);
}