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
Millu30 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Nov 2018
Reputation: 0
#3
RE: TC Mod editor is not updating enemy's

(11-27-2018, 03:13 AM)Mudbill Wrote: 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.

Yep my code organising skills are bad 

anyway
I've checked with debug mode and after switching name of enemy and running script it says that this entity cannot be found like game is not updating for what it should look for (before that other events in that script didn't work too)
Items and props works normal but also dinkywretch_1 does not work it gives this error
[Image: XkI8Aw5.png] 
or simply freezes on loading screen when entering room or reloading
Note: it says servant_brute_1 but its actually dinkywrentch_1 I just changed model name so I will don't have to change it in code file
same think happens with its original name also its sometimes type 2 sometimes 5 or both
also all pigs are static and they don't go to defined path node
(This post was last modified: 11-29-2018, 11:08 PM by Millu30.)
11-29-2018, 10:57 PM
Find


Messages In This Thread
RE: TC Mod editor is not updating enemy's - by Millu30 - 11-29-2018, 10:57 PM



Users browsing this thread: 1 Guest(s)