Difference between revisions of "CEM3: Custom Speed Coefficients"

From cluster wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
<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>
<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| '''cem_movement_speeds''' must have exactly 8 speeds (Sub-Arrays).}}
{{CMF Feature|IMPORTANT| If a '''cem_movement_speeds''' sub-array is missing cem_movement_speed in position 2, CE: Movement will throw an error.}}


<dt>Locality:</dt>
<dt>Locality:</dt>
<dd>Local for each player</dd>
<dd>Local Argument, Local Effect</dd>
</dl>
</dl>


Line 17: Line 16:


<dt>Syntax:</dt>
<dt>Syntax:</dt>
<dd>cem_movement_speeds = [['''animation''', '''speedCoef''', cem_movement_speed], ''...'']</dd>
<dd>'''cem_movement_speeds''' = [[animation, speedCoef], ''...'']</dd>


<dt>Parameters:</dt>
<dt>Parameters:</dt>
<dd>animation: [https://community.bistudio.com/wiki/String String] - The animation to use, as of v0.1.4 only '''"WALK"''' and '''"JOG"''' is supported</dd>
<dd>animation: [https://community.bistudio.com/wiki/String String] - The animation to use, currently only '''"WALK"''' and '''"JOG"''' are supported</dd>


<dt></dt><dd>speedCoef: [https://community.bistudio.com/wiki/Number Number] - The animation speed coefficient, 1 is normal speed.</dd>
<dt></dt><dd>speedCoef: [https://community.bistudio.com/wiki/Number Number] - The animation speed coefficient, 1 is normal speed, 2 is double, etc.</dd>
</dl>
</dl>


<dt>Default:</dt>
<dt>Default:</dt>
<dd>{{code|lang=scilab|<nowiki>[["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],  
<dd>{{code|lang=scilab|<nowiki>[["WALK", 0.5], ["WALK", 0.7], ["WALK", 1], ["WALK", 1.2], ["WALK", 1.5], ["WALK", 1.8], ["JOG", 0.9], ["JOG", 1]];</nowiki>}}</dd>
["WALK", 1.8, cem_movement_speed], ["JOG", 0.9, cem_movement_speed], ["JOG", 1, cem_movement_speed]];</nowiki>}}</dd>


<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block; border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Examples</div>
<div style="padding:0.33em 2em;font-size:1.2em;font-weight:bold;display:block; border-bottom: #25A1A1 solid 1px; background-color:#E0FFFF;color:#25A1A1">Examples</div>
Line 34: Line 32:
</pre></div></dd><dt>Example 1:</dt>
</pre></div></dd><dt>Example 1:</dt>
<dd>{{code|lang=scilab|<nowiki>// Sets speeds locally for player
<dd>{{code|lang=scilab|<nowiki>// 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],  
cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]];</nowiki>}}</dd>
["WALK", 1.3, cem_movement_speed], ["WALK", 2, cem_movement_speed], ["JOG", 0.5, cem_movement_speed], ["JOG", 1.5, cem_movement_speed]];</nowiki>}}</dd>


</pre></div></dd><dt>Example 2:</dt>
</pre></div></dd><dt>Example 2:</dt>
<dd>{{code|lang=scilab|<nowiki>// Sets speeds for all players
<dd>{{code|lang=scilab|<nowiki>// 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],  
cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]];
["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";</nowiki>}}</dd>
publicVariable "cem_movement_speeds";</nowiki>}}</dd>
</dl>
</dl>
Line 46: Line 42:
</pre></div></dd><dt>Example 4:</dt>
</pre></div></dd><dt>Example 4:</dt>
<dd>{{code|lang=scilab|<nowiki>// Sets speeds target player
<dd>{{code|lang=scilab|<nowiki>// 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],  
[[],{cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]]}] remoteExec ["call", _target]</nowiki>}}</dd>
["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]</nowiki>}}</dd>
</dl>
</dl>


[[Category:CE: Movement (CEM3)]]
[[Category:CE: Movement (CEM3)]]

Latest revision as of 00:05, 10 May 2023

Description
Description:
As of v0.1.4 it is possible for mission / addon makers to modify the speed coefficients.
cem_movement_speeds must have exactly 8 speeds (Sub-Arrays).
Locality:
Local Argument, Local Effect


Syntax
Syntax:
cem_movement_speeds = [[animation, speedCoef], ...]
Parameters:
animation: String - The animation to use, currently only "WALK" and "JOG" are supported
speedCoef: Number - The animation speed coefficient, 1 is normal speed, 2 is double, etc.
Default:
[["WALK", 0.5], ["WALK", 0.7], ["WALK", 1], ["WALK", 1.2], ["WALK", 1.5], ["WALK", 1.8], ["JOG", 0.9], ["JOG", 1]];
Examples
Example 1:
// Sets speeds locally for player
cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]];
Example 2:
// Sets speeds for all players
cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]];
publicVariable "cem_movement_speeds";
Example 4:
// Sets speeds target player
[[],{cem_movement_speeds = [["WALK", 0.3], ["WALK", 0.5], ["WALK", 0.8], ["WALK", 1], ["WALK", 1.3], ["WALK", 2], ["JOG", 0.5], ["JOG", 1.5]]}] remoteExec ["call", _target]