[SCRIPT] [unsolved]Lantern use script problem. - 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] [unsolved]Lantern use script problem. (/thread-19064.html) Pages:
1
2
|
[unsolved]Lantern use script problem. - Red - 11-03-2012 I have a problem with this script piece: Code: void CollideLanternArea(string &in asParent,string &in asChild,int alState) The slimes won't disapear when i use my lantern and every time when i turn it on or off it makes that "puzzle_acid" sound. I want the sound only heard once and the slimes disapear when i turn my lantern ON in the "LanternArea". EDIT: and there appeared to be an another problem: When i turn the lantern off or on several times, the game crahes.(in the "LanternArea") Sorry for my bad english RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012 I guess you have to use the "abLit" in an if-statement. void SlimeOff(bool abLit) { if(abLit == true) { for(int i; i<8; i++)SetPropActiveAndFade("slime_"+i,false,1.5); FadeLightTo("PointLight_18", 0,0, 0, 0, 0, 3); if(GetlocalVarInt("PlayAcidSound") == 0) { PlayGuiSound("puzzle_acid",3); SetLocalVarInt("PlayAcidSound", 1); } } } RE: Lantern use script problem. - Red - 11-03-2012 (11-03-2012, 03:31 PM)beecake Wrote: I guess you have to use the "abLit" in an if-statement.Gonna try. EDIT: That script is not working "No matching singatures to GetLocalVarInt(string@)'" RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012 My fault!! I forgot a capital: GetlocalVarInt should be GetLocalVarInt RE: Lantern use script problem. - Red - 11-03-2012 (11-03-2012, 03:41 PM)beecake Wrote: My fault!! I forgot a capital: GetlocalVarInt should be GetLocalVarIntYep, the sound is now working, but the slimes wont disapear and the game crashes etc. RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012 How does it crash? Any error? RE: Lantern use script problem. - Red - 11-03-2012 (11-03-2012, 03:56 PM)beecake Wrote: How does it crash?wait i'll check. EDIT: The game just freezes and the cursor appears. It happens when i turn off or on the lantern several times in the "LanternArea" like i said before. EDIT TO EDIT: I got the crash fixed, i don't know how but it just doesn't crash anymore. But now the next problem why the slimes wont disapear? RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012 Are the names correct? RE: Lantern use script problem. - Red - 11-03-2012 (11-03-2012, 04:16 PM)beecake Wrote: Are the names correct?Yes they are. RE: Lantern use script problem. - FlawlessHappiness - 11-03-2012 Oh! It isn't calling because you missed this: if(HasItem("lantern_1") == true) That is my guess... |