Author Topic: Vehicle Summoners  (Read 842 times)

Would it be possible to make a script that would make the vehicle you specify drive itself to you? Not like that Horse Summoner... someone that I forgot... made, just one where the nearest unoccupied vehicle of that sort drives to you.

The AIWheeledVehicle class only existed in some weird patch for Torque, not in Blockland. Any other method for "self-driving" vehicles would have to use very hacky and possibly laggy code for setVelocity and stuff.

The AIWheeledVehicle class only existed in some weird patch for Torque, not in Blockland. Any other method for "self-driving" vehicles would have to use very hacky and possibly laggy code for setVelocity and stuff.
Yeah. It wouldn't work. Teleporting one to you, on the other hand, would work.

PS: I made the Horse Summoner.

This is a quick way to do it, it'll just make the car move towards the player and won't necessarily make it dodge obstacles

Code: [Select]

function serverCmdSummonCar(%client) {
   %car = // You choose how to figure out which car to summon

   sendCarToPlayer(%car, %client.player);
}

function sendCarToPlayer(%car, %player) {
   // Grab their position
   %carPos = %car.getPosition();
   %playerPos = %player.getPosition();

   // Subtract them and normalize it
   %vec = VectorNormalize( VectorSub(%carPos, %playerPos) );

   // Apply velocity
   %vel = VectorScale(%vec, 30);
   %car.setVelocity(%vel);
}


Where do you put it and in what file format?

That script won't work by itself. You have to edit it so it avoids obstacles and actually chooses a car to use, then it might work.

...make the vehicle you specify drive itself to you?
How do you specify a vehicle?

You have to edit it so it avoids obstacles...
That would be ridiculous.

If it doesn't avoid obstacles then it won't be very reliable as a 'summoner'.

soo would it be...


Code: [Select]

function serverCmdSummonCar(%client) {
   %car = jeep;

   sendCarToPlayer(%car, %client.player);
}

function sendCarToPlayer(%car, %player) {
   // Grab their position
   %carPos = %car.getPosition();
   %playerPos = %player.getPosition();

   // Subtract them and normalize it
   %vec = VectorNormalize( VectorSub(%carPos, %playerPos) );

   // Apply velocity
   %vel = VectorScale(%vec, 30);
   %car.setVelocity(%vel);
}


soo would it be...


Code: [Select]

function serverCmdSummonCar(%client) {
   %car = jeep;

   sendCarToPlayer(%car, %client.player);
}

function sendCarToPlayer(%car, %player) {
   // Grab their position
   %carPos = %car.getPosition();
   %playerPos = %player.getPosition();

   // Subtract them and normalize it
   %vec = VectorNormalize( VectorSub(%carPos, %playerPos) );

   // Apply velocity
   %vel = VectorScale(%vec, 30);
   %car.setVelocity(%vel);
}


No.  The word jeep isn't an object (unless you named it in F11 or something, or spawned a jeep with some other script and named it jeep).