Whenever i start my game up the particle effects and sounds auto play, they dont play in the scripted area, bt they just play instantly. Have i did soemthign wrong? its just the particle and sound effects that dont work right.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true,
1);
AddEntityCollideCallback("Player", "RoomThreeArea", "CollideRoomThree",
true, 1);
AddEntityCollideCallback("Player", "playsound", "playsound", true, 1);
AddEntityCollideCallback("Player", "abc", "abc", true, 1);
AddEntityCollideCallback("Player", "def", "def", true, 1);
AddEntityCollideCallback("Player", "ghi", "ghi", true, 1);
AddEntityCollideCallback("Player", "jkl", "jkl", true, 1);
AddEntityCollideCallback("Player", "mno", "mno", true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 10.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 10.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 1.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 1000000000000.0f,
"");
SetEntityActive("servant_grunt_1", true);
}
void CollideRoomThree(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("1", true);
SetEntityActive("2", true);
SetEntityActive("3", true);
SetEntityActive("4", true);
SetEntityActive("5", true);
SetEntityActive("6", true);
SetEntityActive("7", true);
SetEntityActive("8", true);
SetEntityActive("9", true);
SetEntityActive("10", true);
SetEntityActive("11", true);
SetEntityActive("12", true);
SetEntityActive("13", true);
SetEntityActive("14", true);
SetEntityActive("15", true);
SetEntityActive("16", true);
SetEntityActive("17", true);
SetEntityActive("18", true);
SetEntityActive("19", true);
SetEntityActive("20", true);
GiveSanityDamage(25, true);
StartScreenShake(0.1, 4.0, 0.1, 0.5);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion.ps", "mp",
false);
}
void playsound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("guardian_distant2.snt", "guardian_distant2.snt",
"player", 0, false);
}
void abc(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(500, "BloodSplat", true, false);
}
void def(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "111", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "222", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "333", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "444", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "555", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "666", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "777", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "888", false);
CreateParticleSystemAtEntity("", "ps_water_dump.ps", "999", false);
PlaySoundAtEntity("05_rock_fall_2.snt", "05_rock_fall_2.snt", "player", 0,
false);
PlaySoundAtEntity("guardian_ontop.snt", "guardian_ontop.snt", "player", 0,
false);
StartScreenShake(0.1, 4.0, 0.1, 0.5);
}
void ghi(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(500, "BloodSplat2", true, false);
}
void jkl(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("amb_alert.snt", "amb_alert.snt", "player", 0, false);
GiveSanityDamage(25, true);
}
void mno(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_20", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_21", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_22", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_23", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_24", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_25", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_26", 3.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_27", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_28", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_29", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_30", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_31", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_32", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_33", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_34", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_35", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_36", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_37", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_38", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_39", 5.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_40", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_41", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_42", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_43", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_44", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_45", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_46", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_47", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_48", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_49", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_50", 3.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_51", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_52", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_53", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_54", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_55", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_56", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_57", 1.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_58", 1.0f, "");
SetEntityActive("servant_brute_1", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}