void Character::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM, char* ObjectFile ) { //load in the animated mesh char TempBuffer[255]; GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer); MeshA.Init( Screen, MM, TempBuffer ); //Store some pointery things WMPtr = WM; MMPtr = &MM; Health = GetIniValue(ObjectFile, "properties", "health"); //Load in the character's primary weapon GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { //Create the weapon Weapon* DefaultWeapon = new Weapon; DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer ); //Add it to the world WMPtr->Add( DefaultWeapon ); //also add it locally this->AddEntity(DefaultWeapon ); } //load in the side arm GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { Weapon* SideWeapon = new Weapon; SideWeapon->Init( Screen, WM, MM, AM, TempBuffer ); WMPtr->Add( SideWeapon ); this->AddEntity(SideWeapon ); } CurrentState = "idle"; //CharacterScript = GetSSLKernel()->TaskMan.BuildScript( "..\\scripts\\enemy.shil", NULL ); /* Value V; V.SetNum( ID ); GetSSLKernel()->TaskMan.AddFunctionParameter( CharacterScript, V ); GetSSLKernel()->TaskMan.CallAppFunction( CharacterScript, "SetCharacterHandle", 1 ); GetSSLKernel()->TaskMan.RunActiveScripts( 100);*/ }
void NetworkAvatar::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM, char* ObjectFile ) { //load in the animated mesh char TempBuffer[255]; GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer); MeshA.Init( Screen, MM, TempBuffer ); //Store some pointery things WMPtr = WM; MMPtr = &MM; //Load in the character's primary weapon GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { //Create the weapon Weapon* DefaultWeapon = new Weapon; DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer ); //Add it to the world WMPtr->Add( DefaultWeapon ); //also add it locally this->AddEntity(DefaultWeapon ); } //load in the side arm GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { Weapon* SideWeapon = new Weapon; SideWeapon->Init( Screen, WM, MM, AM, TempBuffer ); WMPtr->Add( SideWeapon ); this->AddEntity(SideWeapon ); } //load in the third weapon GetIniValue(ObjectFile, "weapon", "third", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { Weapon* SideWeapon = new Weapon; SideWeapon->Init( Screen, WM, MM, AM, TempBuffer ); WMPtr->Add( SideWeapon ); this->AddEntity(SideWeapon ); } //load in the fourth weapon GetIniValue(ObjectFile, "weapon", "fourth", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { Weapon* SideWeapon = new Weapon; SideWeapon->Init( Screen, WM, MM, AM, TempBuffer ); WMPtr->Add( SideWeapon ); this->AddEntity(SideWeapon ); } //load in the fifth weapon GetIniValue(ObjectFile, "weapon", "fifth", TempBuffer); if( strcmpi(TempBuffer, "nostring") != 0) { Weapon* SideWeapon = new Weapon; SideWeapon->Init( Screen, WM, MM, AM, TempBuffer ); WMPtr->Add( SideWeapon ); this->AddEntity(SideWeapon ); } }