1class IntroSceneCharacter
extends Managed
31 return m_CharacterId ==
GameConstants.DEFAULT_CHARACTER_MENU_ID;
43 m_CharacterId = char_id;
75 return m_Characters[gender];
107 m_CharGender = gender;
131 return m_CharacterObj.GetPosition();
139 int count = m_CharacterDta.GetCharactersCount();
146 if ( m_CharacterId + 1 < count )
148 return m_CharacterId + 1;
161 int count = m_CharacterDta.GetCharactersCount();
168 if ( m_CharacterId > -1 )
170 return m_CharacterId - 1;
196 if ( character_id ==
GameConstants.DEFAULT_CHARACTER_MENU_ID )
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);
237 string default_name = Widget.TranslateString(
GameConstants.DEFAULT_CHARACTER_NAME );
246 m_CharacterDta.GetLastServerAddress(characterID,address);
247 port = m_CharacterDta.GetLastServerPort(characterID);
248 m_CharacterDta.GetLastServerName(characterID,
name);
253 steamQueryPort = m_CharacterDta.GetLastSteamQueryPort(characterID);
270 m_CharacterObj.PlaceOnSurface();
271 m_CharacterObj.SetOrientation(m_CharacterRot);
301 m_CharacterDta =
g_Game.GetMenuData();
302 m_CharacterPos = char_pos;
303 m_CharacterRot = char_rot;
305 if (!default_char && m_CharacterDta.GetLastPlayedCharacter() > -1 )
307 m_CharacterId = m_CharacterDta.GetLastPlayedCharacter();
308 m_CharacterDta.GetCharacterName(m_CharacterId,
g_Game.GetPlayerGameName());
312 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" gender", m_CharGenderList);
313 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" top", m_CharShirtList);
314 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" bottom", m_CharPantsList);
315 g_Game.ConfigGetTextArray(
"cfgCharacterCreation" +
" shoe", m_CharShoesList);
318 m_Characters.Clear();
324 for (
int i = 0; i < characters.Count(); i++)
326 string char_cfg_name = characters.Get(i);
327 if (
GetGame().IsKindOf(char_cfg_name,
"SurvivorMale_Base") )
329 m_Characters[
ECharGender.Male].Insert( char_cfg_name );
333 m_Characters[
ECharGender.Female].Insert( char_cfg_name );
353 if ( m_CharacterObj )
355 g_Game.ObjectDelete(m_CharacterObj);
356 m_CharacterObj = NULL;
365 if ( character_id == -1 )
367 Error(
"IntroSceneCharacter->CharacterLoad: character_id = "+ character_id +
" Cant Load Character!!!");
375 m_CharacterObj =
PlayerBase.Cast( m_CharacterDta.CreateCharacterPerson( character_id ) );
377 if ( m_CharacterObj )
380 m_CharacterObj.PlaceOnSurface();
381 m_CharacterObj.SetPosition(char_pos);
382 m_CharacterObj.SetOrientation(char_rot);
393#ifdef PLATFORM_CONSOLE
397 BiosUser user = user_manager.GetSelectedUser();
400 name = user.GetName();
406 m_CharacterDta.GetCharacterName(m_CharacterId,
name);
418 if ( !m_CharacterObj )
423 g_Game.ObjectDelete(m_CharacterObj.GetInventory().FindAttachment(slot));
429 m_CharacterObj.LocalTakeEntityAsAttachmentEx(entity, slot);
435 string character_name;
442 m_CharacterDta.GetCharacterName(char_id, character_name);
444 return character_name;
449 string character_name;
456 m_CharacterDta.GetCharacterName(m_CharacterId, character_name);
458 return character_name;
472 m_CharacterDta.SetCharacterName(m_CharacterId,
name);
474 m_CharacterDta.SaveCharactersLocal();
484 m_CharacterDta.RequestSetDefaultCharacterData();
const int ECE_PLACE_ON_SURFACE
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override TStringArray ListAvailableCharacters()
proto native BiosUserManager GetUserManager()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
PlayerBase GetCharacterObj()
ref TStringArray m_CharGenderList
void SetAttachment(string type, int slot)
string GetCharacterName()
void CreateDefaultCharacter()
TStringArray GetCharShoesList()
void CreateNewCharacter()
void SetCharacterGender(ECharGender gender)
void SetCharacterID(int char_id)
void CreateNewCharacterById(int character_id)
void CharacterLoad(int character_id, vector char_pos, vector char_rot)
void GetLastPlayedServer(int characterID, out string address, out string name, out int port)
TStringArray GetCharShirtsList()
void CreateNewCharacterRandom()
void SaveCharName(string name)
void SetToDefaultCharacter()
ref TStringArray m_CharShirtList
bool IsDefaultCharacter()
void SetupPlayerName(bool new_name)
ref TStringArray m_CharPantsList
void GetLastPlayedServerEx(int characterID, out string address, out string name, out int port, out int steamQueryPort)
PlayerBase m_CharacterObj
void SaveDefaultCharacter()
void CreateNewCharacterByName(string character_name, bool randomize_equip=true)
TStringArray GetCharGenderList()
TStringArray GetCharPantsList()
TStringArray GetCharList(ECharGender gender)
void IntroSceneCharacter()
ref TStringArray m_CharShoesList
string GetCharacterNameById(int char_id)
void LoadCharacterData(vector char_pos, vector char_rot, bool default_char=false)
Generates random equip for the new IntroSceneCharacter, whatever is defined in 'cfgCharacterCreation'...
ECharGender GetCharacterGender()
void ~IntroSceneCharacter()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
array< string > TStringArray