setVehicleTransform

Author Topic: setVehicleTransform  (Read 1713 times)

setPlayerTransform but for vehicles+bots and the players+bots mounted on them.

http://forum.blockland.us/index.php?topic=61795.0

I don't know if it works

RTB2 add-on, it doesn't work, but Chrono must fix/re-upload it
« Last Edit: January 12, 2013, 06:10:04 AM by MrLoL² »

I PM'd Chrono a while ago and he hasn't responded. I really need this add-on.

i have it, just it's broken
i think in the script it's not defining %client or something when the event is called
Code: [Select]
function fxDTSBrick::setVehicleTransform(%obj,%dir,%velocityop,%client)
{
if(%client.lasttelbricktouched.timeout == 0)
{
switch (%dir)
{
case 0 :
%prot = getwords(%client.lastTouchVehicle.gettransform(),3,6);
case 1 :
%prot = "1 0 0 0";
%velo = 0;
case 2 :
%prot = "0 0 1 1.57079";
%velo = 1;
case 3 :
%prot = "0 0 1 3.14159";
%velo = 2;
case 4 :
%prot = "0 0 1 -1.57079";
%velo = 3;
}
%or = getwords(%obj.gettransform(),0,2);
%lscale = 0.1*%obj.getdatablock().bricksizez;
%finalsend = "0 0" SPC %lscale;
%fr = vectoradd(%or,%finalsend);
%finaltransform =  %fr SPC %prot;
%turn =%client.player.getvelocity();
%client.lastTouchVehicle.settransform(%finaltransform);
if(%velocityop == 0)
%client.lastTouchVehicle.setvelocity("0 0 0");
Teleportertimeout(%obj);
}
else return;
}

registerOutputEvent("fxDTSBrick","setVehicleTransform","list Vehicle 0 North 1 East 2 South 3 West 4\tbool",1);
function Teleportertimeout(%obj)
{
%obj.timeout = 1;
schedule(500,0,eval,%obj@".timeout = 0;");
}

package roto2overwrite
{
function FxDTSBrick::onVehicleTouch(%this,%vehicle)
{
if(!%vehicle.getControllingObject().client)
{
%vehicle.spawnbrick.getGroup().client.lastTelBrickTouched = %this;
%vehicle.spawnbrick.getGroup().client.lastTouchVehicle = %vehicle;
}
else
{
%vehicle.getControllingObject().client.lasttelbricktouched = %this;
%vehicle.getControllingObject().client.lastTouchVehicle = %vehicle;
}
Parent::onvehicletouch(%this,%vehicle);
}
};
ActivatePackage(roto2overwrite);

gives errors on lines 8, 28, and 30 due to a null object

i have it, just it's broken
Well could you post it so someone else can try and fix it?

I'll see if I can get the old version fixed, if not I'll go ahead and re-write it.

I really do need this event so I can respawn players who have fallen off my race track back on the track.

Well could you post it so someone else can try and fix it?
wait, did you just not see the whole post or something?
not quite sure what you're trying to say here

wait, did you just not see the whole post or something?
not quite sure what you're trying to say here
Is that small thing seriously the whole script?


Does that work? Nvm I mistook the name of the add-on
« Last Edit: January 19, 2013, 04:54:06 PM by Filipe »

Is that small thing seriously the whole script?
reasons demian does not make add-ons

Does that work?
http://forum.blockland.us/index.php?topic=202664.0
no...? that's a completely different thing, what


Does that work?
http://forum.blockland.us/index.php?topic=202664.0
He's asking for an event to teleport vehicles and bots...think of the setplayertransform event.