GSC reference › Built-in
DiffTrack()
Built-in (engine)
Server + client
Math
Returns a lagged value between <from> and <to> based on <rate> and <deltaTime>
Signature
DiffTrack(<to>, <from>, <rate>, <deltaTime>)
Parameters
| Name | Required? | Details |
|---|---|---|
| to | Required | Float, start of the range |
| from | Required | Float, end of the range |
| rate | Required | Floating point |
| deltaTime | Required | Time elapsed |
Real uses in BO3's scripts
Called 3 times in the decompiled scripts. A few, zombies first:
- scripts/shared/vehicle_death_shared.gsc, line 580
vel_x = difftrack(self.crash_vel[0], self.velocity[0], 1, 0.1); - scripts/shared/vehicle_death_shared.gsc, line 581
vel_y = difftrack(self.crash_vel[1], self.velocity[1], 1, 0.1); - scripts/shared/vehicle_death_shared.gsc, line 582
vel_z = difftrack(self.crash_vel[2], self.velocity[2], 1, 0.1);
Related built-ins
- DiffTrackAngle()Returns a lagged angle between <from> and <to> based on <rate> and <deltaTime>.
- AnimHasNotetrack()Queries the given animation for a note track
- GetNotetrackTimes()Gets an array of the times during an animation that the given notetrack occurs.
- GetFreerunTrackIndex()Returns the unique id for this mission
- GetNotetracksInDelta()Get a list of notetracks and times within a specific time delta of a specific time in an animation
- CreateTrack()Set the node enabled or disabled for vehicle pathfinding.
- Int()Casts a floating point number or a string to an integer
- RandomFloatRange()Returns a random floating point number r, where min <= r < max
- DistanceSquared()Returns the squared distance between two points - this is cheaper than the actual distance as it doesn't involve a square root
- RandomInt()Returns a random integer between 0 and max-1 inclusive
- RandomIntRange()Returns a random integer r, where min <= r < max
- AnglesToForward()Returns the forward vector corresponding to a set of angles.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).