Page MenuHomeFeedback Tracker

'speed' and 'velocity' commands are broken
Closed, ResolvedPublic

Description

they don't seem to be reporting the ACTUAL speed or velocity of the unit :(
Sorry for the audio :)
http://www.youtube.com/watch?v=r6RjlisE2_E

Details

Legacy ID
2570863427
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce

execute this code

onEachFrame {hint parseText format ["speed player<br/>%1<br/>velocity player<br/>%2", speed player, velocity player]};

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Fixed.
Killzone_Kid set Legacy ID to 2570863427.May 7 2016, 2:02 PM

here is work around

t1 = diag_tickTime;
p1 = position player;
onEachFrame {
_speed = ((position player) distance p1) / (diag_tickTime - t1);
t1 = diag_tickTime;
p1 = position player;
hint parsetext format ["speed player<br/>%1", _speed];
};

The thing is this measures actual speed in m/s the speed command seems to measure imaginary speed and in km/h? A bit odd considering everything in the game is metres and seconds.

zGuba added a subscriber: zGuba.May 7 2016, 2:02 PM
zGuba added a comment.May 9 2013, 3:31 PM

You should use time instead of diag_tickTime, and try handle division by zero errors ;) otherwise your speed won't be exact to ingame speed

just to confirm velocityModelSpace suffers the same problem

velocity of projectile's x & y stays frozen from their initial value, z appears to update correctly.

fixed, somewhere in between 2013-2016