Frictional Games Forum (read-only)
Small Help needed - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Small Help needed (/thread-5572.html)

Pages: 1 2


Small Help needed - LoneWolf - 11-29-2010

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.



Code:
////////////////////////////
// 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()
{
}



RE: Small Help needed - Akumasama - 11-29-2010

Which particle effects are you talking about specifically?
It's kind of a pain in the ass to check everything. (I think that is)


RE: Small Help needed - LoneWolf - 11-29-2010

All of the particle effects and sounds play at the beginning when i start and dont play when i walk into the scripted area.


RE: Small Help needed - Akumasama - 11-29-2010

Yes, I understand that.
Ok hold on, I'll check the whole thing, see if I can find something.

You have a few white rows in your script, not sure if it's because of the forum though.

Code:
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);
Childname and Fuction are the same, not sure if that will work.

That's all I can find atm.
I'm geussing the problem is at the start, because those trigger the events.
Also double-check the placing and size of your script area's in the level editor.


RE: Small Help needed - LoneWolf - 11-29-2010

The script areas are all ok, and yes i name them both the same thing and it worked in my other maps so i dotn see this being the problem. Also i set all the particle effects and sound effects to inactive, so that they only become active when i walk through scripted area, weird thing is though there all active at start........


RE: Small Help needed - Akumasama - 11-29-2010

I'm not what's wrong then, sorry D:


RE: Small Help needed - LoneWolf - 11-29-2010

Okay, well everythings definetly the way it shoudl be in level editor, and everything looks right in the hps file i looked at other hps files ive done which work and they look similar.

Edit: I've tried changing the falses to trues and 1's to 0's it does absalutely nothing at all... somethings not quite right here. Whether the sound and partile effects are active or not they only play at the beginning and dont play in scripted area, i've checked their names everything is right, the sanity and screen shaking works when i go into the area, just not the sounds and particles so i believe something isnt quite right with what i'm doing... even though, as far as i know, its the exact same as my other levels (the way its laid out and done).





Also is this right for the particles ? CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "111", false);

I called it 111 btw.


RE: Small Help needed - Chilton - 11-29-2010

This may be a silly question, but the Active box is unticked in the editor, right?
Failing that, try renaming them all, and checking your syntaxes (The Syntaxes, NOT the functions)


RE: Small Help needed - LoneWolf - 11-29-2010

Yeah their all unticked, i've tricked ticking them also. No effect takes place. I'll try renaming them.
Nope it has nothing to do with the level editor, i renamed them. It didnt work. I deleted them all and then gave them different names obviously changing the name in hps file. Didnt work.

Also i copied pasted the scripts form previouse map hps. so i have no idea whats wrong now.


RE: Small Help needed - Chilton - 11-29-2010

Thats just strange. I just made a blank map with particles and sounds activated by a script along with some other effects, and it was all fine and dandy...

If the script involves timers, or interactions or something it could be the syntax, but this sounds like a basic collision;

Hm.