lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
adding animation to a path node help
well im back 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.
//////////////////////////// // Run when starting game //Debug ////////////////////////////////////////////////////////////////////////////////////////////////////// void OnStart() { if(ScriptDebugOn()) { GiveItemFromFile("lantern", "lantern.ent"); SetPlayerLampOil(100.0f); for(int i = 0;i < 10;i++) { GiveItemFromFile("tinderbox", "tinderbox.ent"); } } SetSanityDrainDisabled(true);
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////// //set up //////////////////////////////////////////////////////////////////////////////////////////////////// AddEntityCollideCallback("pigknife" , "pigcut", "givepigkey", true, 1); AddEntityCollideCallback("Player" , "activatepiggy", "hideMann", true, 1); //////////////////////////////////////////////////////////////////////////////////////////////////// }
//////////////////////////////////////////////////////////////////////////////////////////////////// // Run when entering map //////////////////////////////////////////////////////////////////////////////////////////////////// void OnEnter() {
} /////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// //General ///////////////////////////////////////////////////////////////////////////////////////////////////// void givepigkey(string &in asParent, string &in asChild, int alState) { SetEntityActive("pigkeys", true); PlaySoundAtEntity("", "PigCut.snt", "Player", 0, false); }
void hideMann(string &in asParent, string &in asChild, int 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 |
|
RaideX
Member
Posts: 212
Threads: 33
Joined: May 2013
Reputation:
7
|
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 |
|
lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
RE: manpig wont move
Fixed it , now i just needa fix some audio issues.
//////////////////////////// // Run when starting game //Debug ////////////////////////////////////////////////////////////////////////////////////////////////////// void OnStart() { if(ScriptDebugOn()) { GiveItemFromFile("lantern", "lantern.ent"); SetPlayerLampOil(100.0f); for(int i = 0;i < 10;i++) { GiveItemFromFile("tinderbox", "tinderbox.ent"); } } SetSanityDrainDisabled(true);
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////// //set up //////////////////////////////////////////////////////////////////////////////////////////////////// AddEntityCollideCallback("pigknife" , "pigcut", "givepigkey", true, 1); AddEntityCollideCallback("Player" , "activatepiggy", "hideMann", true, 1); AddEntityCollideCallback("engineer_1" , "disableflappers", "hideflap", true, -1); AddEntityCollideCallback("engineer_1" , "enableflappers", "showflap", true, 1); AddEntityCollideCallback("engineer_1" , "byepiggy", "disablepig", true, 1); //////////////////////////////////////////////////////////////////////////////////////////////////// }
//////////////////////////////////////////////////////////////////////////////////////////////////// // Run when entering map //////////////////////////////////////////////////////////////////////////////////////////////////// void OnEnter() {
} /////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////// //General ///////////////////////////////////////////////////////////////////////////////////////////////////// void givepigkey(string &in asParent, string &in asChild, int alState) { SetEntityActive("pigkeys", true); PlaySoundAtEntity("", "PigCut.snt", "Player", 0, false); PlaySoundAtEntity("", "engineer_merge.snt", "dangerpig", 0, false); }
void hideMann(string &in asParent, string &in asChild, int alState) { SetEntityActive("engineer_1", true); PlaySoundAtEntity("", "door_level_wood_open.snt", "level_cellar_wood01_1", 0, false); 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 asParent, string &in asChild, int 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 asParent, string &in asChild, int 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 asParent, string &in asChild, int alState) { SetEntityActive("engineer_1", false); PlaySoundAtEntity("", "door_level_wood_close.snt", "level_cellar_wood01_1", 0, false); }
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 |
|
lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
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 |
|
lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
RE: adding animation to a path node help
help pls ; - ;
|
|
04-16-2014, 01:44 AM |
|
CarnivorousJelly
Posting Freak
Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation:
80
|
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 ^^"
|
|
04-16-2014, 06:31 PM |
|
MsHannerBananer
Member
Posts: 218
Threads: 34
Joined: Sep 2013
Reputation:
10
|
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:
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.)
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.
|
|
04-16-2014, 07:50 PM |
|
lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
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
|
|
04-17-2014, 12:53 AM |
|
lothabread
Member
Posts: 106
Threads: 11
Joined: Apr 2012
Reputation:
2
|
RE: adding animation to a path node help
Okay 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 |
|
|