Player::setCustomization: Difference between revisions

From RAGE Multiplayer Wiki
m (Correct comment mistake)
(Add "Face Feature" table)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This method set player customization.
This method set player customization (NB: This resets your weapons also).
==Parameters==
==Parameters==
* '''gender: <span style="color:#008017>Boolean</span>'''
* '''gender: <span style="color:#008017>Boolean</span>'''
Line 15: Line 15:
* '''hightlightColor: <span style="color:#008017>Number</span>'''
* '''hightlightColor: <span style="color:#008017>Number</span>'''
* '''faceFeatures: <span style="color:#008017>Float[]</span>. <b>IMPORTANT</b>: The array must contain 20 elements'''
* '''faceFeatures: <span style="color:#008017>Float[]</span>. <b>IMPORTANT</b>: The array must contain 20 elements'''
{| 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 ==
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
player.setCustomization(Boolean gender, Number shapeFirst, Number shapeSecond, Number shapeThird, Number skinFirst, Number skinSecond, Number skinThird, Number shapeMix, Number skinMix, Number thirdMix, Number eyeColor, Number hairColor, Number hightlightColor, Number[] faceFeatures)
player.setCustomization(Boolean gender, Number shapeFirst, Number shapeSecond, Number shapeThird, Number skinFirst, Number skinSecond, Number skinThird, Number shapeMix, Number skinMix, Number thirdMix, Number eyeColor, Number hairColor, Number hightlightColor, Number[] faceFeatures)
</syntaxhighlight>
</pre>
</div>
}}


== Example ==
== Example ==
<syntaxhighlight lang="javascript">
{{ServersideCode|
<pre>
var bGender = true;
var bGender = true;
if(player.model != 1885233650) {
if(player.model != 1885233650) {
Line 34: Line 163:


var NoseWidth = 0, NoseHeight = 0, NoseLength = 0, NoseBridge = 0, NoseTip = 0, NoseBridgeShift = 0;
var NoseWidth = 0, NoseHeight = 0, NoseLength = 0, NoseBridge = 0, NoseTip = 0, NoseBridgeShift = 0;
var BrowHeight = 0, BrowWidth = 0, CBoneHeight = 0, CBoneWidth = 0, CheekWidth = 0, Eyes = 0, Lips;
var BrowHeight = 0, BrowWidth = 0, CBoneHeight = 0, CBoneWidth = 0, CheekWidth = 0, Eyes = 0, Lips = 0;
var JawWidth = 0, ChinLength = 0, ChinPos = 0, ChinWidth = 0, ChinShape = 0, NeckWidth = 0;
var JawWidth = 0, jawHeight = 0, ChinLength = 0, ChinPos = 0, ChinWidth = 0, ChinShape = 0, NeckWidth = 0;


player.setCustomization(bGender, MotherBlend, FatherBlend, 0, MotherBlend, FatherBlend, 0, fBlendShape, fBlendSkin, 0, 1, HairColour, HairHighlight,  
player.setCustomization(bGender, MotherBlend, FatherBlend, 0, MotherBlend, FatherBlend, 0, fBlendShape, fBlendSkin, 0, 1, HairColour, HairHighlight,  
Line 41: Line 170:
NoseWidth, NoseHeight, NoseLength, NoseBridge, NoseTip, NoseBridgeShift,  
NoseWidth, NoseHeight, NoseLength, NoseBridge, NoseTip, NoseBridgeShift,  
BrowHeight, BrowWidth, CBoneHeight, CBoneWidth, CheekWidth, Eyes, Lips,
BrowHeight, BrowWidth, CBoneHeight, CBoneWidth, CheekWidth, Eyes, Lips,
JawWidth, ChinLength, ChinPos, ChinWidth, ChinShape, NeckWidth
JawWidth, jawHeight, ChinLength, ChinPos, ChinWidth, ChinShape, NeckWidth
]
]
);
);
</syntaxhighlight>
</pre>
}}


==See Also==
==See Also==
{{Player_block}}
{{Player_block}}
[[Category:Player Appearance]]
[[Category:Server-side Function]]

Latest revision as of 11:56, 3 May 2021

This method set player customization (NB: This resets your weapons also).

Parameters

  • gender: Boolean
  • shapeFirst: Number
  • shapeSecond: Number
  • shapeThird: Number
  • skinFirst: Number
  • skinSecond: Number
  • skinThird: Number
  • shapeMix: Number
  • skinMix: Number
  • thirdMix: Number
  • eyeColor: Number
  • hairColor: Number
  • hightlightColor: Number
  • faceFeatures: Float[]. IMPORTANT: The array must contain 20 elements
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

Server-Side
player.setCustomization(Boolean gender, Number shapeFirst, Number shapeSecond, Number shapeThird, Number skinFirst, Number skinSecond, Number skinThird, Number shapeMix, Number skinMix, Number thirdMix, Number eyeColor, Number hairColor, Number hightlightColor, Number[] faceFeatures)

Example

Server-Side
var bGender = true;
if(player.model != 1885233650) {
	bGender = false;
}

var MotherBlend = 21, FatherBlend = 41, fBlendShape = 0.5, fBlendSkin = 0.5, HairHighlight = 0, HairColour = 0;

var NoseWidth = 0, NoseHeight = 0, NoseLength = 0, NoseBridge = 0, NoseTip = 0, NoseBridgeShift = 0;
var BrowHeight = 0, BrowWidth = 0, CBoneHeight = 0, CBoneWidth = 0, CheekWidth = 0, Eyes = 0, Lips = 0;
var JawWidth = 0, jawHeight = 0, ChinLength = 0, ChinPos = 0, ChinWidth = 0, ChinShape = 0, NeckWidth = 0;

player.setCustomization(bGender, MotherBlend, FatherBlend, 0, MotherBlend, FatherBlend, 0, fBlendShape, fBlendSkin, 0, 1, HairColour, HairHighlight, 
	[
		NoseWidth, NoseHeight, NoseLength, NoseBridge, NoseTip, NoseBridgeShift, 
		BrowHeight, BrowWidth, CBoneHeight, CBoneWidth, CheekWidth, Eyes, Lips,
		JawWidth, jawHeight, ChinLength, ChinPos, ChinWidth, ChinShape, NeckWidth
	]
);

See Also