Difference between revisions of "CEM3: Custom Speed Coefficients"
Jump to navigation
Jump to search
Default:
Example 4:
Line 3: | Line 3: | ||
<dt>Description:</dt> | <dt>Description:</dt> | ||
<dd>As of v0.1.4 it is possible for mission / addon makers to modify the speed coefficients | <dd>As of v0.1.4 it is possible for mission / addon makers to modify the speed coefficients.</dd> | ||
{{CMF Feature|IMPORTANT| If the cem_movement_speeds array has more more than or less than 8 sub-arrays, CE: Movement will throw an error.}} | {{CMF Feature|IMPORTANT| If the cem_movement_speeds array has more more than or less than 8 sub-arrays, CE: Movement will throw an error.}} | ||
{{CMF Feature|IMPORTANT| If a cem_movement_speeds sub-array is missing cem_movement_speed in position 2, CE: Movement will throw an error.}} | {{CMF Feature|IMPORTANT| If a cem_movement_speeds sub-array is missing cem_movement_speed in position 2, CE: Movement will throw an error.}} |
Revision as of 23:22, 9 May 2023
Description
- Description:
- As of v0.1.4 it is possible for mission / addon makers to modify the speed coefficients.
- Locality:
- Local for each player
Syntax
- Syntax:
- cem_movement_speeds = [[animation, speedCoef, cem_movement_speed], ...]
- Parameters:
- animation: String - The animation to use, as of v0.1.4 only "WALK" and "JOG" is supported
- speedCoef: Number - The animation speed coefficient, 1 is normal speed.
[["WALK", 0.5, cem_movement_speed], ["WALK", 0.7, cem_movement_speed], ["WALK", 1, cem_movement_speed], ["WALK", 1.2, cem_movement_speed], ["WALK", 1.5, cem_movement_speed],
["WALK", 1.8, cem_movement_speed], ["JOG", 0.9, cem_movement_speed], ["JOG", 1, cem_movement_speed]];
Examples
- Example 1:
// Sets speeds locally for player cem_movement_speeds = [["WALK", 0.3, cem_movement_speed], ["WALK", 0.5, cem_movement_speed], ["WALK", 0.8, cem_movement_speed], ["WALK", 1, cem_movement_speed], ["WALK", 1.3, cem_movement_speed], ["WALK", 2, cem_movement_speed], ["JOG", 0.5, cem_movement_speed], ["JOG", 1.5, cem_movement_speed]];
- Example 2:
// Sets speeds for all players cem_movement_speeds = [["WALK", 0.3, cem_movement_speed], ["WALK", 0.5, cem_movement_speed], ["WALK", 0.8, cem_movement_speed], ["WALK", 1, cem_movement_speed], ["WALK", 1.3, cem_movement_speed], ["WALK", 2, cem_movement_speed], ["JOG", 0.5, cem_movement_speed], ["JOG", 1.5, cem_movement_speed]]; publicVariable "cem_movement_speeds";
// Sets speeds target player
[[],{cem_movement_speeds = [["WALK", 0.3, cem_movement_speed], ["WALK", 0.5, cem_movement_speed], ["WALK", 0.8, cem_movement_speed], ["WALK", 1, cem_movement_speed],
["WALK", 1.3, cem_movement_speed], ["WALK", 2, cem_movement_speed], ["JOG", 0.5, cem_movement_speed], ["JOG", 1.5, cem_movement_speed]]}] remoteExec ["call", _target]