Area Triggers 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: Area Triggers Help! (/thread-9815.html) Pages:
1
2
|
Area Triggers Help! - JetlinerX - 08-17-2011 Hey all! So I am trying to make this happen here: Player walks through level transfer door into new map. Player goes to end of map and finds note. When player returns to the same level transfer door they entered from, the following "area" is triggered with the following events: { GiveSanityDamage(20, true); SetPlayerActive(false); AddPlayerBodyForce(-40000, 25000, 0, false); FadePlayerRollTo(75, 3, 2); StartPlayerLookAt("level_celler_1", 2, 2, ""); SetPlayerCrouching(true); AddTimer("", 2, ""); AddTimer("", 10, ""); GivePlayerDamage(10, "BloodSplat", false, false); SetLanternDisabled(true); PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false); FadeRadialBlurTo(1, 0.5); } How is it possible for me to make these events triggered by the area, and is it possible to make the area in-active until the player finds the note at the end of the level? RE: Area Triggers Help! - Your Computer - 08-17-2011 (08-17-2011, 05:10 AM)JetlinerX Wrote: How is it possible for me to make these events triggered by the area, and is it possible to make the area in-active until the player finds the note at the end of the level? AddEntityCollideCallback(): pass "Player" and the area name into the two entity parameters. This only after the user has interacted with the note. For that you should be able to use SetEntityPlayerInteractCallback(). RE: Area Triggers Help! - JetlinerX - 08-17-2011 I'm actually pretty new to scripting, can you make that a tad more simple please? RE: Area Triggers Help! - Your Computer - 08-17-2011 (08-17-2011, 05:19 AM)JetlinerX Wrote: I'm actually pretty new to scripting, can you make that a tad more simple please?
Be sure to end each statement with a semicolon. RE: Area Triggers Help! - JetlinerX - 08-17-2011 Soooo... Like this? SetEntityPlayerInteractCallback("note_attic_desk1, "OnPickup", true); AddEntityCollideCallback("Player", "scarearea1", "WHAT GOES HERE?!", true, 1); { GiveSanityDamage(20, true); SetPlayerActive(false); AddPlayerBodyForce(-40000, 25000, 0, false); FadePlayerRollTo(75, 3, 2); StartPlayerLookAt("level_celler_1", 2, 2, ""); SetPlayerCrouching(true); AddTimer("", 2, "viimenen2"); AddTimer("", 10, "viimenen6"); GivePlayerDamage(10, "BloodSplat", false, false); SetLanternDisabled(true); PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false); FadeRadialBlurTo(1, 0.5); } RE: Area Triggers Help! - Your Computer - 08-17-2011 (08-17-2011, 05:44 AM)JetlinerX Wrote: Soooo... Like this? Code: void OnStart(){ RE: Area Triggers Help! - JetlinerX - 08-17-2011 Oh! Okay! But what should the second callback function be?! RE: Area Triggers Help! - Your Computer - 08-17-2011 (08-17-2011, 06:01 AM)JetlinerX Wrote: Oh! Okay! But what should the second callback function be?! I'm not sure what you're asking here. The name of callback functions can be just about anything so long as they match the names specified in SetEntityPlayerInteractCallback() and AddEntityCollideCallback(), which they do in the code example i provided. RE: Area Triggers Help! - JetlinerX - 08-17-2011 Oh, so they dont have to be something like: OnPickup, OnIgnite etc? My bad! I shall test now, and report back! So I am getting these errors: ExcuteString (1,1):ERR No Mathing Signatures to OnStart() and 41,2 ERR Unexpected end of file (I dont have a line 41) Here is my code, whats wrong? Code: void OnStart () RE: Area Triggers Help! - JetlinerX - 08-17-2011 Anyone know? |