The player doesnt move forward. - 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: The player doesnt move forward. (/thread-14288.html) |
The player doesnt move forward. - kartanonperuna - 03-27-2012 The bolded part doesnt seem to work.Hes supposed to walk forward till he hits the script area which activates something else.Problem is he doesnt walk.Please help me. //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "looktrigger", "Voicetrigger2", true, 1); AddEntityCollideCallback("Player", "looktrigger2", "Voicetrigger3", true, 1); AddEntityCollideCallback("Player", "kill", "Voicetrigger4", true, 1); AddEntityCollideCallback("Player", "monstertrigger", "monsterthingy", true, 1); AddEntityCollideCallback("Player", "talkandkill", "yeah", true, 1); AddEntityCollideCallback("Player", "kill2", "yeah2", true, 1); AddUseItemCallback("", "ceremony_knife_1", "mansion_1", "KeyOnDoor3", true); AddUseItemCallback("", "key_study_1", "mansion_3", "KeyOnDoor4", true); StartPlayerLookAt("lookstart", 2, 5, ""); AddEntityCollideCallback("Player", "pick", "unlock", true, 1); AddEntityCollideCallback("Player", "what", "dude", true, 1); SetEntityCallbackFunc("ceremony_knife_1", "BoneSawItem"); } void BoneSawItem(string &in asEntity, string &in type) { StopPlayerLookAt(); } void knife(string &in asTimer) { StopPlayerLookAt(); } void dude(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "grabknife.snt", "Player", 8, false); AddTimer("Timer_3", 8, "awakeningdude"); } void awakeningdude(string &in asTimer) { SetEntityActive("pick", true); } void KeyOnDoor3(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false); } void KeyOnDoor4(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_3", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false); RemoveItem("key_study_1"); } void unlock(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "dagger.snt", "Player", 3, false); } void Voicetrigger2(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("look2", 2, 5, ""); AddTimer("Timer_3", 1, "awakening3"); SetPlayerMoveSpeedMul(0); SetPlayerCrouching(true); } void awakening3(string &in asTimer) { PlaySoundAtEntity("", "candle.snt", "Player", 1, false); SetEntityActive("candle", false); SetEntityActive("candle2", true); AddTimer("Timer_3", 1, "awakening4"); } void awakening4(string &in asTimer) { StartPlayerLookAt("look1", 2, 5, ""); PlaySoundAtEntity("", "lure.snt", "Player", 20, false); AddTimer("Timer_3", 15, "awakening5"); } void awakening5(string &in asTimer) { StopPlayerLookAt(); SetEntityActive("looktrigger2", true); SetPlayerMoveSpeedMul(1); } void Voicetrigger3(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("look4", 2, 5, ""); AddTimer("Timer_3", 5, "awakening6"); SetPlayerMoveSpeedMul(0); PlaySoundAtEntity("", "huh.snt", "Player", 2, false); } void awakening6(string &in asTimer) { FadeOut(0.5); TeleportPlayer("drop"); AddTimer("Timer_3", 3, "awakening0"); } void awakening0(string &in asTimer) { StartPlayerLookAt("look5", 2, 5, ""); SetEntityActive("vase1", false); SetEntityActive("vase2", true); FadeIn(0.5); AddTimer("Timer_3", 1, "awakening1"); PlaySoundAtEntity("", "vase.snt", "Player", 1, false); } void awakening1(string &in asTimer) { StartPlayerLookAt("look2", 2, 5, ""); AddTimer("Timer_3", 5, "awakeningcloset"); PlaySoundAtEntity("", "whosthere.snt", "Player", 7, false); } void awakeningcloset(string &in asTimer) { StartPlayerLookAt("lookcloset", 2, 5, ""); AddTimer("Timer_3", 3, "awakeningtele"); FadeOut(1); } void awakeningtele(string &in asTimer) { StartPlayerLookAt("look3", 2, 5, ""); FadeIn(1); TeleportPlayer("closet"); PlaySoundAtEntity("", "brokenvase.snt", "Player", 7, false); SetSwingDoorClosed("closet1", true, true); SetEntityActive("block2", true); SetEntityActive("merc2", true); SetEntityActive("axe2", true); SetEntityActive("kill", true); SetEntityActive("merc", false); SetEntityActive("axe", false); SetPlayerMoveSpeedMul(0); AddTimer("Timer_3", 12, "awakeningkill"); } void awakeningkill(string &in asTimer) { SetPlayerMoveSpeedMul(1); } void awakening7(string &in asTimer) { StartPlayerLookAt("look6", 2, 5, ""); SetEntityActive("looktrigger2", true); } void Voicetrigger4(string &in asParent, string &in asChild, int alState) { AddTimer("Timer_3", 2, "awakeningdead"); FadeOut(0.1); PlaySoundAtEntity("", "stab.snt", "Player", 1, false); } void awakeningdead(string &in asTimer) { FadeIn(6); PlaySoundAtEntity("", "fall.snt", "Player", 3, false); PlaySoundAtEntity("", "sorry.snt", "Player", 3, false); SetEntityActive("deadmerc", true); SetEntityActive("leg1", true); SetEntityActive("leg2", true); SetEntityActive("axe3", true); SetEntityActive("merc2", false); SetEntityActive("axe2", false); StopPlayerLookAt(); SetEntityActive("block", false); SetEntityActive("block2", false); SetEntityActive("key_study_1", true); SetEntityActive("blood", true); SetEntityActive("blood2", true); SetEntityActive("blood3", true); SetEntityActive("blood4", true); } void monsterthingy(string &in asParent, string &in asChild, int alState) { AddEnemyPatrolNode("thomas", "go", 10, ""); StartPlayerLookAt("lookthomas", 2, 5, ""); MovePlayerForward(15.0f); AddTimer("Timer_2", 1, "run"); SetPlayerActive(false); } void run(string &in asTimer) { MovePlayerForward(15.0f); AddTimer("Timer_1", 0, "run"); } void yeah(string &in asParent, string &in asChild, int alState) { MovePlayerForward(0.0f); SetPlayerMoveSpeedMul(0); SetPlayerRunSpeedMul(0); RemoveTimer("Timer_1"); RemoveTimer("Timer_2"); AddTimer("Timer_3", 5, "stop"); AddTimer("Timer_3", 10, "yeah3"); } void stop(string &in asParent, string &in asChild, int alState) { SetEnemyDisabled("thomas", false); } void yeah3(string &in asParent, string &in asChild, int alState) { MovePlayerForward(15.0f); SetPlayerMoveSpeedMul(1); SetPlayerRunSpeedMul(1); AddTimer("Timer_3", 1, "run2"); } void run2(string &in asTimer) { MovePlayerForward(15.0f); AddTimer("Timer_3", 0, "run3"); } void run3(string &in asTimer) { MovePlayerForward(15.0f); AddTimer("Timer_3", 0, "run2"); } void yeah2(string &in asParent, string &in asChild, int alState) { FadeOut(0.1); PlaySoundAtEntity("", "stab.snt", "Player", 1, false); } //////////////////////////// // Run when entering map void OnEnter() { PlayMusic(".ogg", true, 1.0f, 1.0f, 1, false); } //////////////////////////// // Run when leaving map void OnLeave() { } RE: The player doesnt move forward. - ClayPigeon - 03-27-2012 The MovePlayerForward function was added on Justine (v1.2 update) If you don't have it, it won't work. Get it here: http://www.frictionalgames.com/forum/thread-7403.html RE: The player doesnt move forward. - kartanonperuna - 03-27-2012 I do have it. RE: The player doesnt move forward. - Strembitsky - 03-27-2012 Maybe try increasing 15.0f? I have never dealt with this function before but maybe it needs to be much, much higher. RE: The player doesnt move forward. - Unearthlybrutal - 03-27-2012 Tota mää käytin "When the pain is side issue part kakkosessa" ja hyvin toimi: I used this in "When the pain is side issue part 2" and it worked fine: Spoiler below!
RE: The player doesnt move forward. - JetlinerX - 03-27-2012 Sorry I cant be much help, but does that actually force the player to walk forward without key pressing? RE: The player doesnt move forward. - Obliviator27 - 03-28-2012 (03-27-2012, 10:14 PM)JetlinerX Wrote: Sorry I cant be much help, but does that actually force the player to walk forward without key pressing?Yeah, it does. Forces the player to walk forwards, and has to be called in a timer that recalls itself 60 times/second (Timer with 0 as a time) RE: The player doesnt move forward. - Xanthos - 03-28-2012 This is in the justine patch? I keep dying in the water part. I can't go fast enough to spin the wheel all the way around and crawl under and pull the lever. I'm soo slow with games. RE: The player doesnt move forward. - kartanonperuna - 03-28-2012 What has that to do to with anything here?^ Fuck yeah!Works now.Heres the problem: void yeah3(string &in asParent, string &in asChild, int alState) ^^^ Its supposed to be: void yeah3(string &in asTimer) RE: The player doesnt move forward. - JetlinerX - 04-02-2012 Ah crap! No idea how I didnt catch that. Hahaha. |