Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TC Mod editor is not updating enemy's
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: TC Mod editor is not updating enemy's

Your indentation is very strange. You also use several unnecessary code blocks. I fixed that for you:

PHP Code: (Select All)
void OnStart()
{
    
//-- CallBacks --//
    
    //-- Collide Callbacks --//
    
AddEntityCollideCallback("Player""NowWillFall""objectsfall"true1);
    
AddEntityCollideCallback("Player""LetsSpawn""spawnpig"true1);
    
AddEntityCollideCallback("servant_grunt_1""DespawnPig""despawnpig"true1);
    
    
SetMapDisplayNameEntry("Mansion - Employe District - Longue 2");
}

void OnEnter()
{
    
//AUTOSAVE//
    
AutoSave();
}

void OnLeave()
{
    
StopMusic(4.0f0);
}

//////////////////////////
////Specyfic Functions///
/////////////////////////
void objectsfall(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("buzzsaw_1"true);
    
SetEntityActive("vase02_2"true);
    
SetEntityActive("wine01_7"true);
    
SetEntityActive("hammer_1"true);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
GiveSanityDamage(2true);
}

void spawnpig(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true);
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"0.001"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0.001"");
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
GiveSanityDamage(2true);
}

void despawnpig(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"false);


Although I don't really see any immediate problem with your script. It's odd that you say you have to reload the map to fix it. It makes me think it doesn't have anything to do with the script, because the script should behave the same each time.

11-27-2018, 03:13 AM
Find


Messages In This Thread
RE: TC Mod editor is not updating enemy's - by Mudbill - 11-27-2018, 03:13 AM



Users browsing this thread: 1 Guest(s)