Player::setFaceFeature: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
m (fix a typo)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Sets the various freemode face features, e.g. nose length, chin shape. Scale ranges from -1.0 to 1.0.<br><br>Index can be 0 - 19
Sets the various freemode face features, e.g. nose length, chin shape. Scale ranges from -1.0 to 1.0.
Index can be 0 - 19.
{| class="wikitable"
 
! Index
! Face feature     
! Min             
! Max           
|-
 
| 0   
| Nose width       
| -1.0 narrow     
| 1.0 wide       
|-
 
| 1   
| Nose height     
| -1.0 top         
| 1.0 bottom     
|-
 
| 2   
| Nose length     
| -1.0 grand       
| 1.0 petite     
|-
 
| 3   
| Nose bridge     
| -1.0 round       
| 1.0 hollow     
|-
 
| 4   
| Nose tip         
| -1.0 upward     
| 1.0 downward   
|-
 
| 5   
| Nose bridge shift
| -1.0 to the right
| 1.0 to the left
|-
 
| 6   
| Brow height     
| -1.0 top         
| 1.0 bottom     
|-
 
| 7   
| Brow width       
| -1.0 inward     
| 1.0 outward   
|-
 
| 8   
| Cheekbone height 
| -1.0 top         
| 1.0 bottom     
|-
 
| 9   
| Cheekbone width 
| -1.0 narrow     
| 1.0 wide       
|-
 
| 10   
| Cheeks width     
| -1.0 wide       
| 1.0 narrow     
|-
 
| 11   
| Eyes             
| -1.0 opened     
| 1.0 closed     
|-
 
| 12   
| Lips             
| -1.0 wide       
| 1.0 narrow     
|-
 
| 13   
| Jaw width       
| -1.0 narrow     
| 1.0 wide       
|-
 
| 14   
| Jaw height       
| -1.0 top         
| 1.0 bottom     
|-
 
| 15   
| Chin length     
| -1.0 small       
| 1.0 long       
|-
 
| 16   
| Chin position   
| -1.0 inward     
| 1.0 outward   
|-
 
| 17   
| Chin width       
| -1.0 narrow     
| 1.0 grand     
|-
 
| 18   
| Chin shape       
| -1.0 simple chin 
| 1.0 double chin
|-
 
| 19   
| Neck width       
| -1.0 narrow     
| 1.0 wide       
|}
<br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">player.setFaceFeature(index, scale);</syntaxhighlight>
<syntaxhighlight lang="javascript">player.setFaceFeature(index, scale);</syntaxhighlight>
Line 9: Line 138:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
function updateAppearance(genderChanged) {
 
    if (genderChanged) {
        mp.players.local.model = characterData.gender ? mp.game.joaat("mp_m_freemode_01") : mp.game.joaat("mp_f_freemode_01");
 
        setTimeout(sUpdateAppearance, 100);
    }
 
    else
        sUpdateAppearance();
    }
 
    function sUpdateAppearance() {
       
        for (var i = 0; i < 20; i++)
            mp.players.local.setFaceFeature(i, characterData.faceFeatures[i]);
    }
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Player Appearance]]
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]
[[Category:Server-side Function]]

Latest revision as of 19:56, 7 February 2020

Sets the various freemode face features, e.g. nose length, chin shape. Scale ranges from -1.0 to 1.0. Index can be 0 - 19.

Index Face feature Min Max
0 Nose width -1.0 narrow 1.0 wide
1 Nose height -1.0 top 1.0 bottom
2 Nose length -1.0 grand 1.0 petite
3 Nose bridge -1.0 round 1.0 hollow
4 Nose tip -1.0 upward 1.0 downward
5 Nose bridge shift -1.0 to the right 1.0 to the left
6 Brow height -1.0 top 1.0 bottom
7 Brow width -1.0 inward 1.0 outward
8 Cheekbone height -1.0 top 1.0 bottom
9 Cheekbone width -1.0 narrow 1.0 wide
10 Cheeks width -1.0 wide 1.0 narrow
11 Eyes -1.0 opened 1.0 closed
12 Lips -1.0 wide 1.0 narrow
13 Jaw width -1.0 narrow 1.0 wide
14 Jaw height -1.0 top 1.0 bottom
15 Chin length -1.0 small 1.0 long
16 Chin position -1.0 inward 1.0 outward
17 Chin width -1.0 narrow 1.0 grand
18 Chin shape -1.0 simple chin 1.0 double chin
19 Neck width -1.0 narrow 1.0 wide


Syntax

player.setFaceFeature(index, scale);

Required Arguments

  • index: int
  • scale: float

Return value

  • Undefined

Example

function updateAppearance(genderChanged) {

    if (genderChanged) {
        mp.players.local.model = characterData.gender ? mp.game.joaat("mp_m_freemode_01") : mp.game.joaat("mp_f_freemode_01");

        setTimeout(sUpdateAppearance, 100);
    }

    else
        sUpdateAppearance();
    }

    function sUpdateAppearance() {
        
        for (var i = 0; i < 20; i++)
            mp.players.local.setFaceFeature(i, characterData.faceFeatures[i]);
    }
}

See also