Author Topic: Questions  (Read 4735 times)

Bump, why isn't this working?
Code: [Select]
function firePaveStrike(%client, %obj, %target)
{
%pos = vectorAdd(%obj.gettransform(), "0 0 -3");
%bomb = new WheeledVehicle()
{
datablock = CrateVehicle;
initialposition = %pos;
client = %client;
};
missioncleanup.add(%bomb);
}
It used to be this and this one worked fine:
Code: [Select]
function firePavesrike(%client, %obj, %target)
{
%pos = vectorAdd(%obj.gettransform(), "0 0 -3");
%bomb = new projectile()
{
datablock = Airstrikeprojectile;
initialposition = %pos;
initialvelocity = VectorScale(VectorNormalize(vectorsub(VectorAdd(%target, getRandom(2,-2) SPC getRandom(2,-2) SPC getRandom(2,-1)), %pos)), 40);
client = %client;
};
missioncleanup.add(%bomb);
}
It isn't spawning the crate.

Are there any error messages?


Vehicles don't use initialposition.

You gotta use %bomb.setTransform(stuff); after it's created.

Vehicles don't use initialposition.

You gotta use %bomb.setTransform(stuff); after it's created.
Where would I set the transform to? I want it to be a little bit below the vehicle it is spawning from.

%pos would be a good place.

%pos would be a good place.
So I would put
Code: [Select]
%bomb.setTransform(%pos);?