Author Topic: Vehicale spawning without spawn  (Read 943 times)

Is it possible to make a script to make a vehicale with out a spawn for it?

1. Take vehicle spawn.
2. Uncheck Ray Casting, Collision and Rendering.
3. Spawn vehicle.

1. Take vehicle spawn.
2. Uncheck Ray Casting, Collision and Rendering.
3. Spawn vehicle.

What about step 4. Lock topic.

Hint, hint.

~WhatevaGuy

You are about to make a remark about ~WhatevaGuy. But wait! before you do, slap yourself and save some time by abandoning the idea.

Hes talking bout like the AdminMod with the jeep.

Not sure what the admin mod is but sure.

F11 > World Creator > Vehicles  > VehicleNameHere

F11 > World Creator > Vehicles  > VehicleNameHere
Is it possible to make a script to make a vehicale with out a spawn for it?

So is it possible to make a script to do that?

Look through the script for the admin jeep mod. I remember it was some createobject(); function.

Since no one has just flat out answered yet,

YES.

Thank you so much for just answering the simple quetion.Now I would like to know how?

Code: [Select]
%vehicle = new WheeledVehicle()
{
        datablock = VehicleDatablock; //The vehicles datablock - eg. jeepVehicle
};
//%vehicle.setTransform(%transform) - set the transform of the vehicle
//%vehicle.mountObject(%player,0) - mount a player to slot 0 (driver)

Code: [Select]
function spawnVehicle(%vehiclename,%vehicle)
{
$VehicleSpawner::vehiclename=%vehiclename
$VehicleSpawner::vehiclename = new WheeledVehicle()
{
datablock = ""@%vehicle@"Vehicle"; //The vehicles datablock - eg. jeepVehicle
};
}
function TransformVehicle(%vehiclename)
{
$VehicleSpawner::vehiclename=%vehiclename
$VehicleSpawner::vehiclename.setTransform(localclientconnection.camera.getPosition();)
}
function MountVehicle(%vehiclename,%player,%mode)
{
if(%mode$="Driver")
{
$VehicleSpawner::vehiclename.mountObject(%player,0)
}
if(%mode$="Second")
{
$VehicleSpawner::vehiclename.mountObject(%player,1)
}
}
So would this work?

No, completely wrong in many ways.