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
adding animation to a path node help
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#1
adding animation to a path node help

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: (Select All)
////////////////////////////
// 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.
(This post was last modified: 04-15-2014, 02:21 AM by lothabread.)
04-14-2014, 08:07 PM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#2
RE: manpig wont move

regarding the manpigs:

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

If you don't draw first, you don't get to draw at all... -The False Shepherd
04-14-2014, 08:31 PM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#3
RE: manpig wont move

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

PHP Code: (Select All)
////////////////////////////
// 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.
(This post was last modified: 04-14-2014, 09:25 PM by lothabread.)
04-14-2014, 09:07 PM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#4
RE: adding animation to a path node help

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.
04-15-2014, 02:22 AM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#5
RE: adding animation to a path node help

help pls ; - ;
04-16-2014, 01:44 AM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#6
RE: adding animation to a path node help

Did you do this already?

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 ^^"

[Image: quote_by_rueppells_fox-d9ciupp.png]
04-16-2014, 06:31 PM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#7
RE: adding animation to a path node help

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: (Select All)
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.

(This post was last modified: 04-16-2014, 07:51 PM by MsHannerBananer.)
04-16-2014, 07:50 PM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#8
RE: adding animation to a path node help

okay, thank you and i will try that in a little bit as soon as i orginize the script Big Grin
04-17-2014, 12:53 AM
Find
lothabread Offline
Member

Posts: 106
Threads: 11
Joined: Apr 2012
Reputation: 2
#9
RE: adding animation to a path node help

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
04-17-2014, 06:55 PM
Find




Users browsing this thread: 3 Guest(s)