[SCRIPT] Assist me while I learn to 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] Assist me while I learn to script (/thread-37662.html) |
Assist me while I learn to script - Toggle - 01-26-2016 This is pretty much just me asking how to do things at this point. So far, so good. RE: Level Editor Crash - Mudbill - 01-27-2016 Could you post the LevelEditor.log instead from Documents\HPL2 ? RE: Level Editor Crash - Toggle - 01-27-2016 Thread has been recycled. RE: No Matching Signatures - Toggle - 01-29-2016 Also, is there a way to write a code so that if a player breaks a certain item in the environment, one of those glass display cases for example, a message pops up? RE: No Matching Signatures - Mudbill - 01-29-2016 Use GetPropHealth() to check the state of an entity. If that "health" == 0, then it has been broken. IIRC there is also an OnBreak callback for the normal SetEntityCallbackFunc function. That one is probably even better to use. RE: No Matching Signatures - Spelos - 01-29-2016 I'll just go ahead and put a more... newcomer-friendly version of what Mudbill posted earlier. The events you're looking for are void SetEntityCallbackFunc(string& asName, string& asCallback); for the break callback and void SetMessage(string& asTextCategory, string& asTextEntry, float afTime); PHP Code: OnStart() Your extra_english.lang should contain something like this: PHP Code: <LANGUAGE> RE: No Matching Signatures - Toggle - 01-29-2016 You are just so helpful, you kind and wonderful person, you. I am becoming a big fan. RE: Assist me while I learn to script - Toggle - 01-29-2016 Okay, next question is.. Do I need to use timers to play a sound at regular intervals UNTIL the player goes over to interact with the script area? Or is there a different way to accomplish that? Not a loop, though. What I want is for the sound to play every 30 seconds or so, until the player gets in the proper place, at which time the sound should stop. RE: Assist me while I learn to script - Radical Batz - 01-29-2016 (01-29-2016, 08:29 PM)Toggle Wrote: Okay, next question is.. Do I need to use timers to play a sound at regular intervals UNTIL the player goes over to interact with the script area? Or is there a different way to accomplish that? Not a loop, though. What I want is for the sound to play every 30 seconds or so, until the player gets in the proper place, at which time the sound should stop. You can use an if statement but if you want to make it easier. You can like just when the player collides with an area to where you want him to go then you can use a StopSound{"name of the sound", 1); to stop the sound that's playing. For that you need an addentitycollidecallback in void OnStart RE: Assist me while I learn to script - Spelos - 01-29-2016 Final product: A sound (GUI, that means it's not in 3D) plays Every 30 seconds or so... until the Player collides with an area. What you will need:
3D The actual script: PHP Code: void OnStart() |