Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
How do you make cave in roar?
In the laboratory part of the original amnesia, you go near this cave in with rocks and it starts making a moan sound and lots of dust comes out of it! Now I used this code from the original script of the lab into my script
void CollideScreamCave(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("monster_scream","04_scream.snt", "AreaCaveMonster", 0, false);
StartScreenShake(0.02f, 2.0f, 0.5f, 2.0f);
CreateParticleSystemAtEntity("breathps", "ps_cave_monster_scream.ps", "AreaCaveMonster", false);
AddTimer("scream1", 0.5f, "TimerCaveScream");
AddTimer("scream2", 1.0f, "TimerCaveScream");
AddTimer("scream3", 3.0f, "TimerCaveScream");
AddTimer("scream4", 5.0f, "TimerCaveScream");
}
void TimerCaveScream(string &in asTimer)
{
if(asTimer == "scream1"){
PlayGuiSound("react_scare", 0.8f);
GiveSanityDamage(10.0f, false);
FadeSepiaColorTo(0.5f, 0.025f);
FadeRadialBlurTo(0.1f, 0.025f);
SetRadialBlurStartDist(0.2f);
}
else if(asTimer == "scream2"){
}
else if(asTimer == "scream3"){
PlayGuiSound("react_creath", 0.8f);
FadeSepiaColorTo(0, 0.1f);
FadeRadialBlurTo(0, 0.1f);
}
else{
PlayGuiSound("react_creath", 0.6f);
}
}
and I made a script box called "Areascreamcave" just like the original but when I go play in my level, the script is not working? does anybody know why? oh and how do you make random sounds just like in the prison?
(This post was last modified: 02-18-2014, 09:32 PM by Radical Batz.)
|
|
02-18-2014, 09:31 PM |
|
Slanderous
Posting Freak
Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation:
63
|
RE: How do you make cave in roar?
Post your map .hps file.
|
|
02-18-2014, 09:35 PM |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
RE: How do you make cave in roar?
void OnStart()
{
PlayMusic("12_amb.ogg", true, 1, 4, 1, true);
AddTimer("AreaRock_", RandFloat(3.0f,10.f), "TimerAreaRock");
GetPlayerHealth();
FadePlayerFOVMulTo(1, 1.0f);
SetPlayerMoveSpeedMul(1.0f);
SetPlayerRunSpeedMul(1.0f);
AddEntityCollideCallback("JumpscareDoor", "AreaJumpscare", "SanityDec", true, 1);
}
void PickUpOil(string &in asEntity, string &in type)
{
AddQuest("Oil", "pickupoil");
CompleteQuest("lantern", "pickuplantern");
}
void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("DungeonGrunt", true);
AddEnemyPatrolNode("DungeonGrunt", "Node_1",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_4",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_6",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_10",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_15",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_18",0.001f, "");
AddEnemyPatrolNode("DungeonGrunt", "Node_26",0.001f, "");
}
void SanityDec(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("react_scare3.ogg", 1);
SetEntityActive("DungeonGrunt", true);
GiveSanityDamage(15, true);
}
void TimerAreaRock(string &in asTimer)
{
int iRand = RandInt(1, 6);
PlaySoundAtEntity(asTimer+iRand, "24_rock.snt", asTimer+iRand, 1, false);
StartScreenShake(0.007f, 0.0f, 4.0f, 2.0f);
SetRadialBlurStartDist(0.8f);
FadeRadialBlurTo(0.1f, 0.03f);
AddTimer("EndRadial", 4.0f, "TimerEndRadial");
AddTimer(asTimer, RandFloat(15.0f, 30.0f), "TimerAreaRock");
}
void TimerEndRadial(string &in asTimer)
{
FadeRadialBlurTo(0.0f, 0.1f);
}
void CollideScreamCave(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("monster_scream","04_scream.snt", "AreaCaveMonster", 0, false);
StartScreenShake(0.02f, 2.0f, 0.5f, 2.0f);
CreateParticleSystemAtEntity("breathps", "ps_cave_monster_scream.ps", "AreaCaveMonster", false);
AddTimer("scream1", 0.5f, "TimerCaveScream");
AddTimer("scream2", 1.0f, "TimerCaveScream");
AddTimer("scream3", 3.0f, "TimerCaveScream");
AddTimer("scream4", 5.0f, "TimerCaveScream");
}
void TimerCaveScream(string &in asTimer)
{
if(asTimer == "scream1"){
PlayGuiSound("react_scare", 0.8f);
GiveSanityDamage(10.0f, false);
FadeSepiaColorTo(0.5f, 0.025f);
FadeRadialBlurTo(0.1f, 0.025f);
SetRadialBlurStartDist(0.2f);
}
else if(asTimer == "scream2"){
}
else if(asTimer == "scream3"){
PlayGuiSound("react_creath", 0.8f);
FadeSepiaColorTo(0, 0.1f);
FadeRadialBlurTo(0, 0.1f);
}
else{
PlayGuiSound("react_creath", 0.6f);
}
}
|
|
02-18-2014, 09:37 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: How do you make cave in roar?
The callback mentions the AreaJumpscare, yet you said you named your area Areascreamcave. If there's a callback for that collision, it is never called.
There are probably quite a few other errors, because that's what happens when you directly copy the code Frictional used.
|
|
02-18-2014, 10:19 PM |
|
Radical Batz
Posting Freak
Posts: 953
Threads: 145
Joined: Dec 2013
Reputation:
25
|
RE: How do you make cave in roar?
Ok, so what am i supposed to do to make it work?
|
|
02-19-2014, 02:18 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: How do you make cave in roar?
Well, you need to add a callback for it. Something like AddEntityCollideCallback("Player", "Areascreamcave", "CollideScreamCave", true, 1); to OnStart. That might work, but without analyzing the whole script I can't say for sure if it will.
|
|
02-19-2014, 03:08 PM |
|
|