I am working on a little gate that will hook to a pod controller, GPS, and a hover control unit to teleport 1000 or so units in one of six directions. (I was using 100 for debugging)
This is what I have for the expression gate
The W A S D Space Ctrl are the hookups to the pod.Code:N@Teleport I@W A S D Space Ctrl GX GY GZ Yaw O@X Y Z Jump Jump = W + A + S + D + Space + Ctrl Con = 100 X = GX + (W*Con*cos(Yaw)) + (S*Con*cos(180+Yaw)) + (A*Con*cos(90+Yaw)) + (D*Con*cos(Yaw-90)) Y = GY + (W*Con*sin(Yaw)) + (S*Con*sin(180+Yaw)) + (A*Con*sin(90+Yaw)) + (D*Con*sin(Yaw-90)) Z = GY + (Space*Con) - (Ctrl*Con) + 15
GX GY GZ are the hookups to the GPS
The outputs are
X Y Z for the coords (World pos) for it to jump to.
Jump is the setjumptarget and jump hookup.
I know that this isn't perfect or anything, but I was screwing with it to get the thing to work, so bear with me.
The idea was that when the pilot press one of those keys (W A S D Space Ctrl ) the ship would teleport relative to it's rotation and current position.
I was testing to see if the W and S would make it teleport "forward" and "backwards" like I want it to; however, it kept on adding only to the X output and the Y output was ignored. Furthermore, the X output always added or subtracted 100 units rather than, for instance, ~71 when the angle was 45.
I used the debug tool on the gate and the "W" and "S" were being read. Besides, the darn thing teleported so it must be my math or lack of skill with expression games. Anyone have any ideas?
If any of you need any other information just post the question.
Bookmarks