Frictional Games Forum (read-only)
iron maiden bursts open? - 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: iron maiden bursts open? (/thread-16505.html)



iron maiden bursts open? - Hartmann - 06-26-2012

What is the script for making a iron maiden burst open? i looked for quite a while but i cant make it work


RE: iron maiden bursts open? - modoscar - 06-26-2012

(06-26-2012, 01:14 PM)Hartmann Wrote: What is the script for making a iron maiden burst open? i looked for quite a while but i cant make it work
Try this

void OnStart()
{
AddEntityCollideCallback("Player", "kista1", "kista1", true , 1);
}

void kista1(string &in asParent, string &in asChild, int alState)


{
SetEntityActive("maidenopen", true);
SetEntityActive("maidenclosed", false);
CreateParticleSystemAtEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1", false);
PlaySoundAtEntity("maidenopen", "24_iron_maiden", "maidenopen ", 0 , false);
StartScreenShake(0.3, 0.3, 0, 0.3);
AddPlayerSanity( -10 );
}

To make this work you need to make 2 iron maidens on the exact same location, one opened one closed.
Call them "maidenopen" and "maidenclosed" and have the "maidenopen" not active.
Also make 2 script areas, one in this case called "kista1" in front of the iron maiden. Make the second area inside the iron maiden and call it "ScriptArea_1"

So, when the playes comes near the iron maiden it will open, scream and a red smoke will come out of it. And the screen will shake a little bit. It will also remove 10 sanity.


RE: iron maiden bursts open? - Cruzore - 06-26-2012

Look at how Frictional Games made it in their map.
Here's a small copy of it:
(collide callback for this function not included)
void OpenIronMaiden(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Scary iron maiden opening", false);

SetSwingDoorDisableAutoClose("iron_maiden_2", true);
SetSwingDoorClosed("iron_maiden_2", false, false);

/////////////////////////////////////////////
// Open iron maiden doors
AddBodyImpulse("iron_maiden_2_leftDoor", -0.7, 0 , -0.7, "world");
AddBodyImpulse("iron_maiden_2_rightDoor", -0.7, 0 , 0.7, "world");

AddTimer("TimerExtraMaidenImpulse", 0.1, "TimerExtraMaidenImpulse");

PlaySoundAtEntity("AreaIronMaidenEffect", "24_iron_maiden", "AreaIronMaidenEffect", 0.0f, false);

PlayerReact(0.5f);

CreateParticleSystemAtEntity("maidensmoke","ps_iron_maiden_event_smoke.ps", "AreaIronMaidenEffect", false);
StartScreenShake(0.1f, 0.1f, 0.0f, 0.1f);

// Disable trigger area and activate room sanity drain
SetEntityActive("AreaIronMaidenOpen", false);
SetEntityActive("AreaInsanityEffect_1", true);

GiveSanityDamage(10.0f, true);
SetRadialBlurStartDist(0.4f);
FadeRadialBlurTo(0.2f, 0.4f);

AddTimer("TimerActiveMaidenEmotion",1.5f,"TimerActiveMaidenEmotion");
}

So, for the burst open part, experiment with this:

AddBodyImpulse("iron_maiden_2_leftDoor", -0.7, 0 , -0.7, "world");
AddBodyImpulse("iron_maiden_2_rightDoor", -0.7, 0 , 0.7, "world");

the iron_maiden_2 part should be the name of your iron maiden. leftDoor and rightDoor stay. Be sure to experiment with the numbers, since the bursting is in coordinates of world, and you might have placed it a other way than the one in the game.


RE: iron maiden bursts open? - Hartmann - 06-26-2012

(06-26-2012, 02:36 PM)modoscar Wrote:
(06-26-2012, 01:14 PM)Hartmann Wrote: What is the script for making a iron maiden burst open? i looked for quite a while but i cant make it work
Try this

void OnStart()
{
AddEntityCollideCallback("Player", "kista1", "kista1", true , 1);
}

void kista1(string &in asParent, string &in asChild, int alState)


{
SetEntityActive("maidenopen", true);
SetEntityActive("maidenclosed", false);
CreateParticleSystemAtEntity("", "ps_iron_maiden_event_smoke.ps", "ScriptArea_1", false);
PlaySoundAtEntity("maidenopen", "24_iron_maiden", "maidenopen ", 0 , false);
StartScreenShake(0.3, 0.3, 0, 0.3);
AddPlayerSanity( -10 );
}

To make this work you need to make 2 iron maidens on the exact same location, one opened one closed.
Call them "maidenopen" and "maidenclosed" and have the "maidenopen" not active.
Also make 2 script areas, one in this case called "kista1" in front of the iron maiden. Make the second area inside the iron maiden and call it "ScriptArea_1"

So, when the playes comes near the iron maiden it will open, scream and a red smoke will come out of it. And the screen will shake a little bit. It will also remove 10 sanity.
thanks! that was a good scare