Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make Iron maiden slam doors shut.
2pikachuno Offline
Junior Member

Posts: 2
Threads: 2
Joined: Aug 2012
Reputation: 0
#1
How to make Iron maiden slam doors shut.

So I'm working on a custom story and for the gameplay the player needs to go into an iron maiden so he can hide from the monster. But I want to program it so that when the player gets inside the iron maiden it will slam the doors shut on the player so the iron maiden is definitely closed. Any ideas how this can be achieved with a script. I have it set up so far that when the player enters the iron maiden a collision script is set to run but I just can't get the doors slam shut. Any advice or ideas?
08-23-2012, 05:37 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: How to make Iron maiden slam doors shut.

I looked at the entity in the level editor and it has all of the same options as a door; try using setswingdoorclosed or setswingdoorlocked (this will automatically close it+make it unopenable, unless unlocked). Just make sure you have the entity collide callback far enough back in the maiden so there's no chance the place could be on the outside when the even occurs.

Hope that helped

I rate it 3 memes.
08-23-2012, 05:40 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#3
RE: How to make Iron maiden slam doors shut.

Grab it and push them shut =D
08-23-2012, 05:55 AM
Find
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#4
RE: How to make Iron maiden slam doors shut.

I also created a story where you couldn't open the door of the iron maiden once inside , that's how i did:

Creates a script area (inside the iron maiden) that call once it collide with the player. Use SetSwingDoorClosed to make the door close by itself .Then , you can call StartPlayerLookAt("iron_maiden_1") to make the player look at the door , than , SetPlayerActive(false) , which would make the player unable to move and to interact with the iron maidan door.

In my custom story , once i called SetPlayerActive , i created a timer that waits 1 second , than , i added footsteps noise from outside of the iron maiden , you can do this , it's an awesome scare Big Grin


I would really appreciate +rep if it helped you out Smile
(This post was last modified: 08-23-2012, 10:31 AM by onv.)
08-23-2012, 10:30 AM
Find
lolmaster Offline
Member

Posts: 170
Threads: 9
Joined: Jul 2012
Reputation: 6
#5
RE: How to make Iron maiden slam doors shut.

...Or, if you actually want them to shut on their own, you can examine the games script for when the iron maiden opens and reverse it.

I have found it:

///////////////////////////////////////////////////
// Iron Maiden doors opening scare
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");
}

void TimerExtraMaidenImpulse(string &asTimer)
{
AddBodyImpulse("iron_maiden_2_leftDoor", -0.7, 0 , -0.7, "world");
AddBodyImpulse("iron_maiden_2_rightDoor", -0.7, 0 , 0.7, "world");
}


08-23-2012, 01:38 PM
Find




Users browsing this thread: 1 Guest(s)