Frictional Games Forum (read-only)
Need some more help with my custom story! - 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: Need some more help with my custom story! (/thread-18881.html)



Need some more help with my custom story! - Zaapeer - 10-21-2012

Okay, so I've come to a part in my custom story where the player is supposed to cross like a big hole in the ground. In order to do so he needs to but a plank over it to be able to walk over. Now here's my problem: How do you make it so that when the plank touches a special area it automatically changes into a static object and places itself over the hole? I appreciate all the help I can can get, thanks! Smile


RE: Need some more help with my custom story! - The chaser - 10-21-2012

You mean that when the entity collides with an area despawns and automatically spawns the static_object or that the entity moves by itself and then it despawns and spawns the static object?


RE: Need some more help with my custom story! - TeamSD - 10-21-2012

Well this is one way.

First put this script in your hps. Put it in Void OnEnter for example.

void OnEnter()
{
AddEntityCollideCallback("ENTITYNAME", "AREANAME", "SCRIPT", false, 1);
}

Make an script area over to your "hole". And the board you want to be as a bridge. Make that board non active and check the "StaticPhysics" box.

Next we need the script to continue like this.

void SCRIPT(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ENTITYNAME", false);
SetEntityActive("your_static_board", true);
}

Now thats simply it. So here is the whole script spiced with a little puzzlemusic and sanity gain. You can of course leave them out of your script if you wan't. Smile Hopefully I was any help for you.

void OnEnter()
{
AddEntityCollideCallback("ENTITYNAME", "AREANAME", "SCRIPT", false, 1);
}

void SCRIPT(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ENTITYNAME", false);
SetEntityActive("your_static_board", true);
PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true);
GiveSanityBoost();
}


RE: Need some more help with my custom story! - Ongka - 10-21-2012

Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.


RE: Need some more help with my custom story! - The chaser - 10-22-2012

(10-21-2012, 11:48 PM)Ongka Wrote: Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.
I wanted to say this with method 2.


RE: Need some more help with my custom story! - Ongka - 10-22-2012

(10-22-2012, 06:41 AM)The chaser Wrote:
(10-21-2012, 11:48 PM)Ongka Wrote: Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.
I wanted to say this with method 2.
Your post was lacking an explanation how to do it and when entities collide with a sticky area and CanDetach is deactivated, they don't despawn and spawn a static object, it simply disables the interaction for the specific entity.


RE: Need some more help with my custom story! - The chaser - 10-22-2012

I know, but it's how I usually do it. Everyone has it's ways.


RE: Need some more help with my custom story! - Dutton - 10-22-2012

Relevent for my current project! thank you Smile


RE: Need some more help with my custom story! - Zaapeer - 10-24-2012

Thank you guys for all the help! Smile