| Blockland Forums > Suggestions & Requests |
| setVehicleTransform |
| (1/3) > >> |
| Demian:
setPlayerTransform but for vehicles+bots and the players+bots mounted on them. |
| MrLoL²:
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 |
| Demian:
I PM'd Chrono a while ago and he hasn't responded. I really need this add-on. |
| phflack:
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: ---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); --- End code --- gives errors on lines 8, 28, and 30 due to a null object |
| Demian:
--- Quote from: phflack on January 13, 2013, 11:50:57 AM ---i have it, just it's broken --- End quote --- Well could you post it so someone else can try and fix it? |
| Navigation |
| Message Index |
| Next page |