Blockland Forums > Modification Help
ETA
Kalphiter:
--- Quote from: ThinkInvisible on June 10, 2012, 11:50:39 AM ---i am such an idiot
i was using the distance instead of distance/speed in the display
but it still goes crazy fast unless you move at a constant speed.
--- End quote ---
Show us the code
ThinkInvisible:
%vel = serverConnection.getControlOb ject().getVelocity();
%x = getWord(%vel, 0);
%y = getWord(%vel, 1);
%z = getWord(%vel, 2);
%speed = vectorLen(%vel);
$wppos = getwords($trackwaypoint[$trackedpoint], 1, 2);
$wpposf = "\c3" @ mfloor(getword($wppos, 0)) SPC mfloor(getword($wppos, 1));
$wpdist = vectorDist(getwords(serverconnection.getcontrolob ject().gettransform(), 0, 1) SPC "0", $wppos SPC "0");
$wpdistf = "\c3" @ mfloor($wpdist);
$etawp = $wpdist/%speed;
$etawpf = "\c3" @ mfloor($etawp) @ "SECS";
odd, tt seems to put a space after 'getcontrolob'
Kalphiter:
$etawp = vectorDist($trackwaypoint[$trackedpoint], serverConnection.getControlOb ject().getPosition()) / vectorLen(serverConnection.getControlOb ject().getVelocity();
Those lines compressed to 1. Check if getPosition is a function or not.
ThinkInvisible:
$wppos and $wpdist are used in the GUI
and of course it's a function, otherwise it would just display 0 or something
the problem is if speed changes the ETA goes crazy
seems to work better in a plane, though; can probably manage
Treynolds416:
--- Quote from: ThinkInvisible on June 10, 2012, 12:00:32 PM ---the problem is if speed changes the ETA goes crazy
--- End quote ---
That problem is by design. You can try to fix it by having a delay and using the average speed instead of the concurrent one