Frictional Games Forum (read-only)
adding animation to a path node help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: adding animation to a path node help (/thread-25080.html)



adding animation to a path node help - lothabread - 04-14-2014

well im back Big Grin again. and umm i do believe i have my script set up perfectly fine for this but, could somebody maybe check it for me ? my engineer wont move after i walk into an area.

PHP Code:
////////////////////////////
// Run when starting game
//Debug
//////////////////////////////////////////////////////////////////////////////////////////////////////
void OnStart()
{
    if(
ScriptDebugOn())
          {
               
GiveItemFromFile("lantern""lantern.ent");
               
SetPlayerLampOil(100.0f);
 
               for(
int i 0;10;i++)
               {
                    
GiveItemFromFile("tinderbox""tinderbox.ent");
               }
          }
    
SetSanityDrainDisabled(true);

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//set up
////////////////////////////////////////////////////////////////////////////////////////////////////
    
AddEntityCollideCallback("pigknife" "pigcut""givepigkey"true1);
    
AddEntityCollideCallback("Player" "activatepiggy""hideMann"true1);
////////////////////////////////////////////////////////////////////////////////////////////////////
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// Run when entering map
////////////////////////////////////////////////////////////////////////////////////////////////////
void OnEnter()
{

}
/////////////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////////////
//General
/////////////////////////////////////////////////////////////////////////////////////////////////////
void givepigkey(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("pigkeys"true);
    
PlaySoundAtEntity("""PigCut.snt""Player"0false);
}

void hideMann(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("engineer_1"true);
    
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_1"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_5"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_10"0.0f"");


all help is appreciated ^^

Oh and also how is it i would go about increasing the volume of a sound ? i tried changing the values in the .snt but that didnt seem to work.


RE: manpig wont move - RaideX - 04-14-2014

regarding the manpigs:

try opening the entity file and resave the pig. Then it should work.


RE: manpig wont move - lothabread - 04-14-2014

Fixed it Big Grin, now i just needa fix some audio issues.

PHP Code:
////////////////////////////
// Run when starting game
//Debug
//////////////////////////////////////////////////////////////////////////////////////////////////////
void OnStart()
{
    if(
ScriptDebugOn())
          {
               
GiveItemFromFile("lantern""lantern.ent");
               
SetPlayerLampOil(100.0f);
 
               for(
int i 0;10;i++)
               {
                    
GiveItemFromFile("tinderbox""tinderbox.ent");
               }
          }
    
SetSanityDrainDisabled(true);

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//set up
////////////////////////////////////////////////////////////////////////////////////////////////////
    
AddEntityCollideCallback("pigknife" "pigcut""givepigkey"true1);
    
AddEntityCollideCallback("Player" "activatepiggy""hideMann"true1);
    
AddEntityCollideCallback("engineer_1" "disableflappers""hideflap"true, -1);
    
AddEntityCollideCallback("engineer_1" "enableflappers""showflap"true1);
    
AddEntityCollideCallback("engineer_1" "byepiggy""disablepig"true1);
////////////////////////////////////////////////////////////////////////////////////////////////////
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// Run when entering map
////////////////////////////////////////////////////////////////////////////////////////////////////
void OnEnter()
{

}
/////////////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////////////////
//General
/////////////////////////////////////////////////////////////////////////////////////////////////////
void givepigkey(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("pigkeys"true);
    
    
PlaySoundAtEntity("""PigCut.snt""Player"0false);
    
PlaySoundAtEntity("""engineer_merge.snt""dangerpig"0false);
}

void hideMann(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("engineer_1"true);
    
    
PlaySoundAtEntity("""door_level_wood_open.snt""level_cellar_wood01_1"0false);
    
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_1"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_5"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_10"0.0f"");
}

void hideflap(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("enableflappers"true);
    
SetEntityActive("byepiggy"true);
    
    
SetEntityActive("plastic_curtains_silent_1"false);
    
SetEntityActive("plastic_curtains_silent_2"false);
    
SetEntityActive("plastic_curtains_silent_3"false);
    
SetEntityActive("plastic_curtains_silent_4"false);
    
SetEntityActive("plastic_curtains_silent_5"false);
    
SetEntityActive("plastic_curtains_silent_6"false);
    
SetEntityActive("plastic_curtains_silent_7"false);
    
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_10"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_5"0.0f"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_11"0.0f"");
}

void showflap(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("plastic_curtains_silent_1"true);
    
SetEntityActive("plastic_curtains_silent_2"true);
    
SetEntityActive("plastic_curtains_silent_3"true);
    
SetEntityActive("plastic_curtains_silent_4"true);
    
SetEntityActive("plastic_curtains_silent_5"true);
    
SetEntityActive("plastic_curtains_silent_6"true);
    
SetEntityActive("plastic_curtains_silent_7"true);
}

void disablepig(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("engineer_1"false);
    
    
PlaySoundAtEntity("""door_level_wood_close.snt""level_cellar_wood01_1"0false);


mainly i want to raise "pigcut" audio and "engineer_merge.snt" wont play at all, that along with the curtains not disabling when the engineer walks into the specified area.


RE: adding animation to a path node help - lothabread - 04-15-2014

okay i have the other issues out of the way now, but my question is. how is it i go about having the engineer do a notice animation at node 10 ? i have the animation scripted in, but he just stands there, never to move again.


RE: adding animation to a path node help - lothabread - 04-16-2014

help pls ; - ;


RE: adding animation to a path node help - CarnivorousJelly - 04-16-2014

Did you do this already?

Code:
AddEnemyPatrolNode("engineer_1", "PathNodeArea_10", 0.0f, "<type the animation name here>");

Possibly change the amount of time to something like 2.0f.

Other than that, I can't think of anything; I haven't done a ton of monster scripting ^^"


RE: adding animation to a path node help - MsHannerBananer - 04-16-2014

As far as I'm aware, you can't actually script a monster to use it's animations. The monster does animations based on situational circumstances, via hearing you or seeing you. I saw somewhere that the asAnimation in the PathNode syntax was virtually useless, as it never worked.

However, should you look to try regardless, then you need to change your asAnimation in the PathNode syntax to one of the animations of the man-pig. So something like this:

PHP Code:
AddEnemyPatrolNode("engineer_1""PathNodeArea_10"0.0f"notice1.anm"); 

(I'm actually not sure if you need the extension for the animation. Regardless of it working or not, experiment a little.) Big Grin

You should also follow Kia's advice for the time. 2.0f is about 2 seconds, and if the animation does work, the monster needs more time to complete the animation before moving onto the next PathNode.


RE: adding animation to a path node help - lothabread - 04-17-2014

okay, thank you and i will try that in a little bit as soon as i orginize the script Big Grin


RE: adding animation to a path node help - lothabread - 04-17-2014

Okay Big Grin that did not work, he stands there, plays the audio that goes with the animation and then stands there indefinately, so i just decided not to add an animation thank you anyways for your help I appreciate it