Help with Credits - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Help with Credits (/thread-10862.html) |
Help with Credits - i3670 - 10-19-2011 Hi I'm trying this script atm. but it gives me an error message: main(198,1) : ERR : Unexpected token '{' void OnStart() { AddEntityCollideCallback("Player", "Ending_Area_1", "StartCredits", true, 1); } "197" void StartCredits(string &in asParent, string &in asChild, int alState); "198" { "199" StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", 1); "200" } Help plox so close to wrapping my custom story up. RE: Help with Credits - Tanshaydar - 10-19-2011 While writing a function block, you don't put a ';' end of the line. So, void StartCredits(string &in asParent, string &in asChild, int alState); Should be without ';' like this: void StartCredits(string &in asParent, string &in asChild, int alState) RE: Help with Credits - i3670 - 10-19-2011 Got a new error message main(240,2) : ERR : Unexpected end of file "237" void StartCredits(string &in asParent, string &in asChild, int alState) "238" { "239" StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", 1); "240" } RE: Help with Credits - Your Computer - 10-19-2011 (10-19-2011, 08:17 PM)i3670 Wrote: Got a new error message You're going to need to post your entire script for this one. RE: Help with Credits - i3670 - 10-19-2011 Ok it's gonna be a long one //////////////////////////// // Run first time starting map void OnStart() { AddUseItemCallback("", "upstair_key_1", "upstair_door_1", "UseKey1",true); AddUseItemCallback("", "upstair_key_2", "upstair_door_2", "UseKey2",true); AddUseItemCallback("", "cellar_key_1", "cellar_door_1", "UseKey3",true); AddUseItemCallback("", "cellar_key_2", "cellar_door_2", "UseKey4",true); AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1); SetEntityPlayerInteractCallback("mansion_2", "func_slam_2", true); AddEntityCollideCallback("Player", "MusicArea_1", "MusicControl", false, 0); AddEntityCollideCallback("Player", "Sound_Area_1", "SoundTrigger1", true, 1); AddEntityCollideCallback("Player", "Sound_Area_2", "SoundTrigger2", true, 1); AddEntityCollideCallback("Player", "Sound_Area_3", "SoundTrigger3", true, 1); AddEntityCollideCallback("Player", "Sound_Area_4", "SoundTrigger4", true, 1); AddEntityCollideCallback("Player", "Sound_Area_5", "SoundTrigger5", true, 1); AddEntityCollideCallback("Player", "Sound_Area_6", "SoundTrigger6", true, 1); AddEntityCollideCallback("Player", "Sound_Area_7", "SoundTrigger7", true, 1); AddEntityCollideCallback("Player", "Sound_Area_", "SoundTrigger", true, 1); AddEntityCollideCallback("Player", "Sound_Area_", "SoundTrigger", true, 1); AddEntityCollideCallback("Player", "Monster_Area_1", "CollideMonsterArea1", true, 1); AddEntityCollideCallback("Player", "Monster_Area_2", "CollideMonsterArea2", true, 1); AddEntityCollideCallback("Player", "Scare_Area_1", "Scaretrigger1", true, 1); AddEntityCollideCallback("Player", "Scare_Area_2", "Scaretrigger2", true, 1); AddEntityCollideCallback("Player", "Scare_Area_3", "Scaretrigger3", true, 1); AddEntityCollideCallback("Player", "Scare_Area_4", "Scaretrigger4", true, 1); AddEntityCollideCallback("Player", "Scare_Area_5", "Scaretrigger5", true, 1); AddEntityCollideCallback("Player", "Ending_Area_1", "StartCredits", true, 1); } void UseKey1(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); RemoveItem(asItem); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); SetEntityActive("grunt_1", true); PlaySoundAtEntity("", "notice01.snt","chair_wood_3", 0, false); ShowEnemyPlayerPosition("grunt_1"); } void UseKey2(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); RemoveItem(asItem); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); } void UseKey3(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); RemoveItem(asItem); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); } void UseKey4(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); RemoveItem(asItem); PlaySoundAtEntity("", "unlock_door", "Player", 0, false); } void func_slam(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("cellar_door_1", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(45.0f, true); } void MusicControl(string &in asParent, string &in asChild, int alState) { if(alState == 1) PlayMusic("02_amb_strange.ogg", true, 1.0f, 5, 0, true); if(alState == -1) StopMusic(3, 0); } void SoundTrigger1(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "12_girl_cry.snt", "wood_beam_1", 0, false); GiveSanityDamage(5.0f, true); SetLampLit("torch_static01_2", true, true); } void SoundTrigger2(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false); GiveSanityDamage(10.0f, true); SetLampLit("torch_static01_3", true, true); } void SoundTrigger3(string &in asParent , string &in asChild , int alState) { SetSwingDoorClosed("mansion_1", true, true); PlaySoundAtEntity("", "enabled.snt", "mansion_1", 0, false); PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false); GiveSanityDamage(10.0f, true); } void SoundTrigger4(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "general_chain_rattle.snt", "table_wood01_dyn_1", 0, false); } void SoundTrigger5(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "song_1.snt", "Player", 0, false); } void SoundTrigger6(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "00_laugh.snt", "Player", 0, false); } void SoundTrigger7(string &in asParent , string &in asChild , int alState) { PlaySoundAtEntity("", "owl.snt", "Player", 0, false); } void func_slam_2(string &in asParent, string &in asChild, int alState) { SetPropHealth("mansion_2", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } void CollideMonsterArea1(string &in asParent, string &in asChild, int alState) { SetEntityActive("grunt_2", true); AddEnemyPatrolNode("grunt_2", "PathNodeArea_1", 0.1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_2", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_3", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_4", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_5", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_6", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_7", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_8", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_9", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_10", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_11", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_12", 1, ""); AddEnemyPatrolNode("grunt_2", "PathNodeArea_13", 5, ""); } void CollideMonsterArea1(string &in asParent, string &in asChild, int alState) { SetEntityActive("grunt_1", true); AddEnemyPatrolNode("grunt_1", "PathNodeArea_14", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_15", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_16", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_17", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_18", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_19", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_20", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_21", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_22", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_23", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_24", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_25", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_26", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_27", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_28", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_29", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_30", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_31", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_32", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_33", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_34", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_35", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_36", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_37", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_38", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_39", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_40", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_41", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_42", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_43", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_44", 0.1, ""); AddEnemyPatrolNode("grunt_1", "PathNodeArea_45", 0.1, ""); FadeEnemyToSmoke("grunt_1", false); void Scaretrigger1(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("cellar_door_2", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0.6, false); PlaySoundAtEntity("", "react_scare", "Player", 0.4, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0.2, false); PlaySoundAtEntity("", "guardian_activated.snt", "stone_table_1", 0, false); SetEntityActive("corpse_male_2", true); SetEntityActive("slime_6way_1", true); SetEntityActive("slime_pile_1", true); SetEntityActive("slime_egg_1", true); SetEntityActive("slime_pile_large_1", true); SetEntityActive("grunt_body_part2_1", true); SetEntityActive("slime_3way_1", true); SetEntityActive("slime_egg_2", true); SetEntityActive("slime_3way_2", true); SetEntityActive("slime_6way_2", true); SetEntityActive("corpse_pile2_1", true); SetEntityActive("candle_floor_small_5", true); SetEntityActive("note_generic_1", true); SetEntityActive("painting02_insane_1", true); SetEntityActive("corpse_bloody_1", true); GiveSanityDamage(45.0f, true); } void Scaretrigger2(string &in asParent, string &in asChild, int alState) { SetEntityActive("armour_nice_complete_13", true); PlaySoundAtEntity("", "scare_thump_flash.snt", "armour_nice_complete_13", 0, false); PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false); } void Scaretrigger3(string &in asParent, string &in asChild, int alState) { SetEntityActive("corpse_male_3", true); PlaySoundAtEntity("", "react_scare.snt", "Player", 1, false); PlaySoundAtEntity("", "scare_male_terrified.snt", "Player", 0, false); } void Scaretrigger4(string &in asParent, string &in asChild, int alState) { SetEntityActive("grunt_3", true); ShowEnemyPlayerPosition("grunt_3"); } void Scaretrigger5(string &in asParent, string &in asChild, int alState) { SetEntityActive("corpse_male_4", true); PlaySoundAtEntity("", "scare_male_terrified.snt", "Player", 0, false); } void StartCredits(string &in asParent, string &in asChild, int alState) { StartCredits("05_paper_transformation.ogg", true, "Ending", "MainCredits", 1); } RE: Help with Credits - Your Computer - 10-19-2011 The code block for CollideMonsterArea1 was not closed. RE: Help with Credits - i3670 - 10-19-2011 Thank you Your Computer your the best |