Well, I've been stuck on something for a while. I have made an add-on that is extremely close to completion. The only thing in the way is the special scripts. It involves firing a raycast from the player to an object in the distance. I'm not sure how to do that, for another person is doing my code. He seems stuck too, so I might as well ask and see if I can get anything from the collective knowledge of Blockland's modders. Here is the code so far:
%obj = %obj.getMountedObject(0);
%client = %obj.client;
if($sim::time-3 < %client.lockOnDelay)
return;
%obj.client.play2d(genericbeep);
if(isObject(%client))
ServerCmdUnUseTool(%client);
%start = vectorAdd(%obj.getPosition(), "0 0 0");
%end = vectorAdd(%start, vectorScale(%obj.getEyeVector(), 1000));
%typemasks = $Typemasks::VehicleObjectType;
%target = containerRaycast(%start, %end, %typemasks, %obj);
The first %obj is the turret itself, getting the player mounted in seat 0. The issue is that, it registers the target when it's at eye level, but it does not work at all when the turret is raised. Does anyone know what I'm doing wrong?