| 
		
	
		| Hartmann   Member
 
 Posts: 52
 Threads: 18
 Joined: Jun 2012
 Reputation: 
0
 | 
			| iron maiden bursts open? 
 
				What is the script for making a iron maiden burst open? i looked for quite a while but i cant make it work
			 |  |  
	| 06-26-2012, 01:14 PM |  |  
	
		| modoscar   Junior Member
 
 Posts: 9
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: iron maiden bursts open? 
 
				 (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.
			 
				
(This post was last modified: 06-26-2012, 02:38 PM by modoscar.)
 |  |  
	| 06-26-2012, 02:36 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: iron maiden bursts open? 
 
				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.
 
				
(This post was last modified: 06-26-2012, 02:56 PM by Cruzore.)
 |  |  
	| 06-26-2012, 02:55 PM |  |  
	
		| Hartmann   Member
 
 Posts: 52
 Threads: 18
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: iron maiden bursts open? 
 
				 (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 workTry 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
			 |  |  
	| 06-26-2012, 10:01 PM |  |  |