André Campana
Junior Member
Posts: 36
Threads: 10
Joined: Jan 2015
Reputation:
2
|
Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
Hi Folks, it's MaxL here with another amnesia custom story development note. Today i show you a little thing i made for testing in my mod, which is a realistic Cave-In effect, i had some limitations on vanilla Amnesia, because we only have static statues, which means that they are not affected by external forces, you can throw a chair on them and they will stead steel. So using the model editor i made a "gravity version" of the Eagle statue, i made the same with the "cellar01_wood_unhinged_1". So down below you can check a video on 60 Fps of the final effect. I'll be also releasing the code for you guys check it out:
[video=youtube] http://youtu.be/j5danbEzTiE[/video]
//////////CUSTOM ENTITES AND STATICS USED!
/////REALISTIC CAVE-IN SIMULATION V1.01
void OnStart()
{
AddEntityCollideCallback("Player", "Explode", "Explode", true, 1); ///Check if the Player collides with area
}
void Explode(string &in asParent, string &in aschild, int alStates) ///If it does, starts the sequence
{
PlaySoundAtEntity("Crumble", "29_crumble.snt", "ParticleLook", 0, false);
AddEntityCollideCallback("cellar_unhinged", "Touch", "TouchDoor", false, 1);
AddEntityCollideCallback("stone_small01_1", "Touch", "Touch1", false, 1); ///1* It will check if each one of the small stones are touchhing the floor
AddEntityCollideCallback("stone_small01_2", "Touch", "Touch2", false, 1);
AddEntityCollideCallback("stone_small01_3", "Touch", "Touch3", false, 1);
AddEntityCollideCallback("stone_small01_4", "Touch", "Touch4", false, 1);
AddEntityCollideCallback("stone_small01_5", "Touch", "Touch5", false, 1);
AddEntityCollideCallback("stone_small01_6", "Touch", "Touch6", false, 1);
AddEntityCollideCallback("stone_small01_7", "Touch", "Touch7", false, 1);
AddEntityCollideCallback("stone_small01_8", "Touch", "Touch8", false, 1);
AddEntityCollideCallback("Player", "SetFire_1", "TakeDamage", false, 1);
StartPlayerLookAt("cellar_hinged", 5.0f, 5.0f, "");
AddTimer("Shake1", RandFloat(4,7), "ShakeoQuake"); ///The time to cave in is random!
CreateEntityAtArea("", "Brick01.ent", "Rock_1", true);
AddTimer("Time_1", RandFloat(3, 6), "Time1"); ///At the same time it will begin to spawn falling bricks on the roof
AddTimer("Time_2", RandFloat(3, 6), "Time2");
AddTimer("Time_3", RandFloat(3, 6), "Time3");
AddTimer("Time_4", RandFloat(3, 6), "Time4");
AddTimer("Time_5", RandFloat(3, 6), "Time5");
AddTimer("Time_6", RandFloat(3, 6), "Time6");
AddTimer("Time_7", RandFloat(3, 6), "Time7");
AddTimer("Time_8", RandFloat(3, 6), "Time8");
AddTimer("Time_9", RandFloat(3, 6), "Time9");
AddTimer("Time_10", RandFloat(3, 6), "Time10");
}
void Time1(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_1", true); ///SPAWNING FALLING BRICKS!
AddTimer("Time_1", RandFloat(3, 6), "Time1"); ///WATCH YER HEAD!
}
void Time2(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_2", true);
AddTimer("Time_2", RandFloat(3, 6), "Time2");
}
void Time3(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_3", true);
AddTimer("Time_3", RandFloat(3, 6), "Time3");
}
void Time4(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_4", true);
AddTimer("Time_4", RandFloat(3, 6), "Time4");
}
void Time5(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_5", true);
AddTimer("Time_5", RandFloat(3, 6), "Time5");
}
void Time6(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_6", true);
AddTimer("Time_6", RandFloat(3, 6), "Time6");
}
void Time7(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_7", true);
AddTimer("Time_7", RandFloat(3, 6), "Time7");
}
void Time8(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_8", true);
AddTimer("Time_8", RandFloat(3, 6), "Time8");
}
void Time9(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_9", true);
AddTimer("Time_9", RandFloat(3, 6), "Time9");
}
void Time10(string &in asTimer)
{
CreateEntityAtArea("", "Brick01.ent", "Rock_10", true);
AddTimer("Time_10", RandFloat(3, 6), "Time10");
}
void Touch1(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_1", false); ///Floor collide detection
}
void Touch2(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_2", false);
}
void Touch3(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_3", false);
}
void Touch4(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_4", false);
}
void Touch5(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_5", false);
}
void Touch6(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_6", false);
}
void Touch7(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_7", false);
}
void Touch8(string &in asParent, string &in asChild, int alStates)
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "stone_small01_8", false);
}
void TouchDoor(string &in asParent, string &in asChild, int alStates) ///If unhinged door touches floor
{
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
CreateParticleSystemAtEntity("", "ps_impact_dust_high.ps", "cellar_unhinged", false);
}
void ShakeoQuake(string &in asTimer) ///Cave-in itself
{
for (int c=1; c<=10; c++){
RemoveTimer("Time_"+c); ///Remove "falling bricks" timers
}
StopSound("Crumble", 0.1f);
SetPropHealth("cellar_unhinged", 0);
CreateParticleSystemAtEntity("", "ps_dust_elevator_crash.ps", "ParticleLook_1", false);
CreateParticleSystemAtEntity("", "ps_dust_elevator_crash.ps", "ParticleLook_1", false);
SetEntityActive("cellar_hinged", false);
SetEntityActive("cellar_unhinged", true);
SetEntityActive("stone_small01_1", true);
SetEntityActive("stone_small01_2", true);
SetEntityActive("stone_small01_3", true);
SetEntityActive("stone_small01_4", true);
SetEntityActive("stone_small01_5", true);
SetEntityActive("stone_small01_6", true);
SetEntityActive("stone_small01_7", true);
SetEntityActive("stone_small01_8", true);
AddPropImpulse("cellar_unhinged", 0, 0, -10, "world"); ///The door is thrown onto the eagle's foot!
AddPropImpulse("stone_small01_1", 0, 0, -20, "world");
AddPropImpulse("stone_small01_2", 0, 0, -20, "world");
AddPropImpulse("stone_small01_3", 0, 0, -20, "world");
AddPropImpulse("stone_small01_4", 0, 0, -20, "world");
AddPropImpulse("stone_small01_5", 0, 0, -20, "world");
AddPropImpulse("stone_small01_6", 0, 0, -20, "world");
AddPropImpulse("stone_small01_7", 0, 0, -20, "world");
AddPropImpulse("stone_small01_8", 0, 0, -20, "world");
StopPlayerLookAt();
PlaySoundAtEntity("ExlodeDoor", "break_wood_metal.snt", "cellar_unhinged", 0, false);
PlaySoundAtEntity("", "explosion_rock_large.snt", "ParticleLook", 0, false);
}
void OnEnter()
{
PlayMusic("general_rain.ogg", true, 1.0f, 0.1f, 1, true); ///Soothing Rain :)
}
|
|
05-15-2015, 06:46 AM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
I would imagine the wooden door to actually blow up into pieces were the forces that powerful. I also don't think a heavy stone statue like the eagle one would really be pushed by the door. Perhaps it would make more sense with an iron door. Oh, and perhaps the shaking effect is a bit too powerful?
Remember, jet fuel can't melt steel beams!
PS: As this is a guide/resource, it will probably thrive better in Development Resources or Development Articles. Note for the future of you want to create more
(This post was last modified: 05-15-2015, 07:42 AM by Mudbill.)
|
|
05-15-2015, 07:42 AM |
|
André Campana
Junior Member
Posts: 36
Threads: 10
Joined: Jan 2015
Reputation:
2
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
(05-15-2015, 07:42 AM)Mudbill Wrote: I would imagine the wooden door to actually blow up into pieces were the forces that powerful. I also don't think a heavy stone statue like the eagle one would really be pushed by the door. Perhaps it would make more sense with an iron door. Oh, and perhaps the shaking effect is a bit too powerful?
Remember, jet fuel can't melt steel beams!
PS: As this is a guide/resource, it will probably thrive better in Development Resources or Development Articles. Note for the future of you want to create more
If you look at the script, i tried to make that door blow up, but it didn't happened, i gotta check the model and fix that also
|
|
05-15-2015, 03:18 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
I think the reason it not working is because the unhinged version of the door is static and has no broken model. You'll have to use the normal cellar_door.
|
|
05-15-2015, 03:46 PM |
|
André Campana
Junior Member
Posts: 36
Threads: 10
Joined: Jan 2015
Reputation:
2
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
As i said, i created a no hinged version that has a body interacts with the global gravity, but i forgot to set the "broken" model of it
|
|
05-18-2015, 04:19 PM |
|
Slanderous
Posting Freak
Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation:
63
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
Pretty basic script, but I like the final effect, it's diffrent and more interesting than the overused SetEntityActive("Bunch of rocks") and PlayGuiSound("Explosion").
|
|
05-18-2015, 07:12 PM |
|
Amnesiaplayer
Senior Member
Posts: 539
Threads: 105
Joined: Jun 2014
Reputation:
0
|
RE: Amnesia - Periculosum Cibum [Realitic Cave-In Effect]
(05-15-2015, 07:42 AM)Mudbill Wrote: I would imagine the wooden door to actually blow up into pieces were the forces that powerful. I also don't think a heavy stone statue like the eagle one would really be pushed by the door. Perhaps it would make more sense with an iron door. Oh, and perhaps the shaking effect is a bit too powerful?
Remember, jet fuel can't melt steel beams!
PS: As this is a guide/resource, it will probably thrive better in Development Resources or Development Articles. Note for the future of you want to create more
Yeah, exactly, the door and the statue
|
|
05-22-2015, 06:56 PM |
|
|