View Issue Details

IDProjectCategoryView StatusLast Update
0000540The Dark ModCodingpublic31.12.2020 03:39
Reportercrispy Assigned To 
PrioritylowSeverityminorReproducibilityN/A
Status newResolutionopen 
Product VersionSVN 
Summary0000540: Add entity scriptfunctions for getting/setting animation rates
DescriptionIndividual animations played by an entity can be sped up or slowed down by an arbitrary factor by setting the anim_rate_[animname] spawnarg. See http://wiki.thedarkmod.com/index.php?title=Animation_playback_speed for details.

The values of these spawnargs are cached at runtime for performance reasons, so changing the spawnargs directly at runtime won't do anything. It would be nice to be able to access and change these cached values.

The most obvious way of enabling this is to create scriptfunctions for getting and setting the animation rates for each animation.
Additional InformationIf the getter is called with an animation name for which an animation rate is not cached, then return the default of 1.0 (meaning no change; play the animation as it appears in the file).

There are a number of use cases for this; for example, it could be used to make fine adjustments to the AI's walking/running speed rather than abruptly transitioning from "slow" to "fast" over the course of a few frames. If we decide we want that.
TagsNo tags attached.

Relationships

related to 0003913 feedback SetRate frame command 

Activities

nbohr1more

nbohr1more

01.09.2016 19:16

developer   ~0008293

getTurnRate() exists so perhaps this is mostly implemented.

As of 2.03 is has been reported that "anim_rate_x" args aren't functioning as expected.
nbohr1more

nbohr1more

01.09.2016 21:10

developer   ~0008295

Last edited: 01.09.2016 21:10

View 2 revisions

Probably AI.h:

ID_INLINE float GetAnimRate() { return m_animRates; }
ID_INLINE void SetAnimRate(float newAnimRate) { m_animRates = newAnimRate; }

nbohr1more

nbohr1more

01.09.2016 21:15

developer   ~0008296

and AI_events.cpp

const idEventDef AI_SetAnimRate( "setAnimRate", EventArgs(), 'f', "Gets the animation rate of the AI.");
const idEventDef AI_SetAnimRate( "setAnimRate", EventArgs('f', "rate", ""), EV_RETURNS_VOID, "Set the animation rate of the AI");
nbohr1more

nbohr1more

30.12.2020 21:25

developer   ~0013321

Yep, m_animRates is an Entity property in Entity.h should work as expected.
nbohr1more

nbohr1more

31.12.2020 03:39

developer   ~0013324

Hmm... Seems to be a bit bigger task than just copying GetTurnRate.

Probably need to add an animRate property to AI.

Issue History

Date Modified Username Field Change
22.01.2008 08:57 crispy New Issue
01.09.2016 19:16 nbohr1more Note Added: 0008293
01.09.2016 19:16 nbohr1more Description Updated View Revisions
01.09.2016 21:10 nbohr1more Note Added: 0008295
01.09.2016 21:10 nbohr1more Note Edited: 0008295 View Revisions
01.09.2016 21:15 nbohr1more Note Added: 0008296
17.10.2017 13:46 nbohr1more Relationship added related to 0003913
30.12.2020 21:25 nbohr1more Note Added: 0013321
31.12.2020 03:39 nbohr1more Note Added: 0013324