adding animation to a path node help - lothabread - 04-14-2014
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.
PHP Code: //////////////////////////// // 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.
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 , 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;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.
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.)
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
RE: adding animation to a path node help - lothabread - 04-17-2014
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
|