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
#1
Bug  TC Mod editor is not updating enemy's

So I was working on my TC mod and tried to add enemy that spawns when player enters script area
but problem is that my script does not work "unless I use F2 to reload whole map"


void OnStart()
{



//-- CallBacks --//
    {
    //-- Collide Callbacks --//
    AddEntityCollideCallback("Player", "NowWillFall", "objectsfall", true, 1);
    AddEntityCollideCallback("Player", "LetsSpawn", "spawnpig", true, 1);
    AddEntityCollideCallback("servant_grunt_1", "DespawnPig", "despawnpig", true, 1);
    
    
    }


    
SetMapDisplayNameEntry("Mansion - Employe District - Longue 2");

}
void OnEnter()
{    

    //AUTOSAVE//
    {
        AutoSave();
    }
}
void OnLeave()
{
    StopMusic(4.0f, 0);

}


                            //////////////////////////
                            ////Specyfic Functions///
                            /////////////////////////
void objectsfall (string &in asParent, string &in asChild, int alState)
    {
    SetEntityActive("buzzsaw_1", true);
    SetEntityActive("vase02_2", true);
    SetEntityActive("wine01_7", true);
    SetEntityActive("hammer_1", true);
    PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
    GiveSanityDamage(2, true);
    }
    
void spawnpig (string &in asParent, string &in asChild, int 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", 0, false);
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
    GiveSanityDamage(2, true);
    }
    
void despawnpig (string &in asParent, string &in asChild, int alState)
    {
    SetEntityActive("servant_grunt_1", false);
    }
11-26-2018, 10:37 PM
Find Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#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 Reply
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 Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#4
RE: TC Mod editor is not updating enemy's

Perhaps try deleting those entities and creating them from scratch. Update the script with new names.

Can also try to make a small example of the problem if possible. A great way to do this is to make a new, empty map with only floor, boxlight and start area, add the monster to the floor (disable triggers), then see if you can reproduce the issue within this map. If you can reproduce it, then we may have an issue on our hands. If not, it'll act as a good example to help you find out what's different between your levels.

11-30-2018, 12:04 AM
Find Reply
Romulator Offline
Not Tech Support ;-)

Posts: 3,621
Threads: 62
Joined: Jan 2013
Reputation: 195
#5
RE: TC Mod editor is not updating enemy's

The image of the errors won't really help because those errors are "normal" in the sense they shouldn't affect the spawning of the entities.

Could you run through this scenario again, try activating the enemy twice again (once before reloading with F2, once after reloading with F2), then exit Amnesia. Then post your mod's hpl.log file, you can find it on a Windows system at Documents/Amnesia/<Main> where <Main> is either the Main folder or your mod's folder, if you defined a new path for it in the main_init.cfg.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 11-30-2018, 02:24 AM by Romulator.)
11-30-2018, 02:23 AM
Find Reply
Millu30 Offline
Junior Member

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

(11-30-2018, 02:23 AM)Romulator Wrote: The image of the errors won't really help because those errors are "normal" in the sense they shouldn't affect the spawning of the entities.

Could you run through this scenario again, try activating the enemy twice again (once before reloading with F2, once after reloading with F2), then exit Amnesia. Then post your mod's hpl.log file, you can find it on a Windows system at Documents/Amnesia/<Main> where <Main> is either the Main folder or your mod's folder, if you defined a new path for it in the main_init.cfg.

Ok so I'm using TC mod and here is link to Error Log
https://pastebin.com/khCA7hMH 
Skipping that Gauges and mcindustrial that are showing errors "I will fix this errors at the end" 
All the enemies are showing Error this is due to crash that dinkynwrench caused on map loading and I had to remove it.
Screen of my Debug [Image: AEUF2vx.png]
Note: 3th enemy is dinkynwrench which is removed from map for Crashing on Loading the rest 4 and 5 will go to that path node "at least they should"

Here is error log after removing dinkynwrench enemy 
https://pastebin.com/DGYjwEjx 
Also forgot to remove it from script but that don't have matter right now

[video=youtube]https://youtu.be/o6KnR6PlZZ4[/video]
Inform me if video does not work

After that I have replaced Grunt to Brute in map than loaded it and exit with save before loading enemies script
that quickly changed it back to Grunt in editor and script and now

https://pastebin.com/LL2tStnG

Grunt is showed as Null_Biped wtf? :L
(This post was last modified: 11-30-2018, 06:43 PM by Millu30.)
11-30-2018, 06:40 PM
Find Reply
Romulator Offline
Not Tech Support ;-)

Posts: 3,621
Threads: 62
Joined: Jan 2013
Reputation: 195
#7
RE: TC Mod editor is not updating enemy's

Looks to me like you haven't copied over everything needed to ensure the enemy works. You're missing a lot of animations, and because your entities are looking for animations in a full conversion folder, I'm assuming you haven't added the Full Conversion folder to your resources.cfg file?

Where Amnesia.exe is located, open up your resources.cfg file, and add the following line to the bottom of the file, before the </Resources> bracket. Assuming all your Machine for Pigs assets are somewhere in your F_Mod folder, this will cache them for your mod.

PHP Code: (Select All)
<Directory Path="/F_Mod" AddSubDirs="true" />. 

To provide further support, where did you purchase your game from? Furthermore, why are you choosing to make a full conversion -- so far I have seen nothing which suggests you need to deviate from a custom story.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
11-30-2018, 07:05 PM
Find Reply
Millu30 Offline
Junior Member

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

I'm Using TC because I had to change Inventory Size, Lamp, some player/game stats/mechanics, game menu and fonts. I've got both games on Steam when they were on sale but used GOG one for now
Also I have added my mod to resources now and that haven't fixed anything :L
(This post was last modified: 11-30-2018, 08:52 PM by Millu30.)
11-30-2018, 07:38 PM
Find Reply




Users browsing this thread: 1 Guest(s)