[SCRIPT] Explosion Script - 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: [SCRIPT] Explosion Script (/thread-13684.html) |
Explosion Script - GoranGaming - 03-01-2012 I am creating a explosion script for my map. But it doesn't seem to work. void ExplodeFunc(string &in asEntity) { AddDebugMessage("Explosive Timer Started", false); AddTimer("ExplodeT", 6, "ExplodeTFunc"); } void ExplodeTFunc(string &in asTimer) { AddDebugMessage("Exploded", false); SetEntityActive("cave_in_1", false); SetEntityActive("cave_in_destroyed_1", true); StartScreenShake(0.08, 2.5f, 0, 1.0f); FadeImageTrailTo(0.5, 1); FadeLightTo("BoomLight", 1, 1, 1, 1, 8, 0.1f); FadeLightTo("DangerLight", 0, 0, 0, 0, 0, 0.5f); } void PlaceExFunc(string &in asItem, string &in asEntity) { PlaySoundAtEntity("placejar", "puzzle_place_jar.snt", "ExSta", 0, false); RemoveItem(asItem); AddDebugMessage("Explosives Placed", false); SetEntityActive("ExSta", true); SetEntityActive("ExPress", true); //SetEntityActive("cave_in_1", false); //SetEntityActive("cave_in_destroyed_1", true); } void OnStart() { //EDITOR GiveItemFromFile("lantern", "lantern.ent"); for(int i=0;i< 10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent"); PlayMusic("04_amb.ogg", true, 10, 2, 1, true); AddUseItemCallback("ExEnt", "ExEnt", "PlaceEx", "PlaceExFunc", true); SetEntityPlayerInteractCallback("ExPress", "ExplodeFunc", true); } void OnEnter() { } void OnLeave() { StopMusic(1, 1); } Can you tell me what is wrong with it. Also, here is the map: http://www.mediafire.com/?vgv6s9wq7klwosi / GoranGaming RE: Explosion Script - SilentStriker - 03-01-2012 Does it give you any errors? RE: Explosion Script - GoranGaming - 03-01-2012 No it does not RE: Explosion Script - GoranGaming - 03-01-2012 Anyone!? RE: Explosion Script - Your Computer - 03-01-2012 Be specific about what doesn't work. RE: Explosion Script - GoranGaming - 03-01-2012 Ok, it works now. I could place the explosives, but it wouldn't explode. It works now. |