1class IntroSceneCharacter
extends Managed
43 m_CharacterId = char_id;
75 return m_Characters[gender];
107 m_CharGender = gender;
131 return m_CharacterObj.GetPosition();
146 if ( m_CharacterId + 1 < count )
148 return m_CharacterId + 1;
168 if ( m_CharacterId > -1 )
170 return m_CharacterId - 1;
202 CharacterLoad( character_id, m_CharacterPos, m_CharacterRot );
211 m_CharacterType = character_name;
224 if (m_CharacterType !=
"")
231 m_CharacterObj.PlaceOnSurface();
232 m_CharacterObj.SetPosition(m_CharacterPos);
233 m_CharacterObj.SetOrientation(m_CharacterRot);
263 m_CharacterObj.PlaceOnSurface();
264 m_CharacterObj.SetOrientation(m_CharacterRot);
294 m_CharacterDta =
g_Game.GetMenuData();
295 m_CharacterPos = char_pos;
296 m_CharacterRot = char_rot;
305 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" gender", m_CharGenderList);
306 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" top", m_CharShirtList);
307 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" bottom", m_CharPantsList);
308 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" shoe", m_CharShoesList);
311 m_Characters.Clear();
317 for (
int i = 0; i < characters.Count(); i++)
319 string char_cfg_name = characters.Get(i);
320 if (
GetGame().IsKindOf(char_cfg_name,
"SurvivorMale_Base") )
322 m_Characters[
ECharGender.Male].Insert( char_cfg_name );
326 m_Characters[
ECharGender.Female].Insert( char_cfg_name );
346 if ( m_CharacterObj )
348 g_Game.ObjectDelete(m_CharacterObj);
349 m_CharacterObj = NULL;
358 if ( character_id == -1 )
360 Error(
"IntroSceneCharacter->CharacterLoad: character_id = "+ character_id +
" Cant Load Character!!!");
370 if ( m_CharacterObj )
373 m_CharacterObj.PlaceOnSurface();
374 m_CharacterObj.SetPosition(char_pos);
375 m_CharacterObj.SetOrientation(char_rot);
386#ifdef PLATFORM_CONSOLE
411 if ( !m_CharacterObj )
416 g_Game.ObjectDelete(m_CharacterObj.GetInventory().FindAttachment(slot));
422 m_CharacterObj.LocalTakeEntityAsAttachmentEx(entity, slot);
428 string character_name;
437 return character_name;
442 string character_name;
451 return character_name;
const int ECE_PLACE_ON_SURFACE
proto native owned string GetName()
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
proto native BiosUserManager GetUserManager()
override TStringArray ListAvailableCharacters()
protected void CharacterUnload()
void CreateDefaultCharacter()
void SetAttachment(string type, int slot)
protected MenuData m_CharacterDta
bool IsDefaultCharacter()
protected ECharGender m_CharGender
TStringArray GetCharGenderList()
void CreateNewCharacter()
void SetToDefaultCharacter()
protected ref TStringArray m_CharGenderList
protected ref TStringArray m_CharShirtList
TStringArray GetCharList(ECharGender gender)
void SaveCharName(string name)
protected ref TStringArray m_CharPantsList
void LoadCharacterData(vector char_pos, vector char_rot, bool default_char=false)
Generates random equip for the new IntroSceneCharacter, whatever is defined in 'cfgCharacterCreation'...
void CreateNewCharacterByName(string character_name, bool randomize_equip=true)
TStringArray GetCharShirtsList()
string GetCharacterName()
TStringArray GetCharPantsList()
protected void CharacterLoad(int character_id, vector char_pos, vector char_rot)
void SaveDefaultCharacter()
void SetCharacterID(int char_id)
TStringArray GetCharShoesList()
ECharGender GetCharacterGender()
protected vector m_CharacterPos
string GetCharacterNameById(int char_id)
void CreateNewCharacterRandom()
void GetLastPlayedServer(int characterID, out string address, out string name, out int port)
protected string m_CharacterType
void SetCharacterGender(ECharGender gender)
void ~IntroSceneCharacter()
protected void SetupPlayerName(bool new_name)
protected ref TStringArray m_CharShoesList
protected PlayerBase m_CharacterObj
protected vector m_CharacterRot
PlayerBase GetCharacterObj()
void CreateNewCharacterById(int character_id)
void IntroSceneCharacter()
protected int m_CharacterId
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
const string DEFAULT_CHARACTER_NAME
const int DEFAULT_CHARACTER_MENU_ID
array< string > TStringArray
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].