Scripting, need urgent help! - 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: Scripting, need urgent help! (/thread-9259.html) |
RE: Scripting, need urgent help! - seth1466 - 07-28-2011 Yay we are making good progress thanks to everyone ^^ RE: Scripting, need urgent help! - JetlinerX - 07-28-2011 All code has been figured out, I will post with any new problems! Thanks so much everyone! RE: Scripting, need urgent help! - JetlinerX - 07-29-2011 Anyway to delay the sounds just a tad so they dont sound so immediate, and the character doesnt have a 100% on time reaction? RE: Scripting, need urgent help! - DRedshot - 07-29-2011 Yep its possible, to make sounds more natural i usually put the FadeIn time to about 0.5f, but if you want to delay it, then instead of putting - "PlayGuiSound" put - AddTimer("" , 0.1f , "Delay"); then put void Delay(string &in asTimer) { PlayGuiSound("" , ); } of course it doesnt have to be GuiSound, it can also be PlaySoundAtEntity RE: Scripting, need urgent help! - Apjjm - 07-29-2011 (07-29-2011, 12:58 AM)JetlinerX Wrote: Anyway to delay the sounds just a tad so they dont sound so immediate, and the character doesnt have a 100% on time reaction? Delaying sounds? Try this Code: int getDigit(uint8 digit) { That above is a general purpose delay sound play function, you can mod the parameters to suit any functions actually. This was written out in the reply window, so might have a syntax error in it, but aside from that it will work. It works by creating an integer var, which is an "index". Then when the function is called the index value is incremented and remembered. We then append the index number onto the end of each variable's name so it has a unique name. This index "key" is then put in the timers name too! When the timer expires, the callback function is called, and the index is parsed out of the timer's name. This is then used to access all the variables we just stored, and pass them into the function. RE: Scripting, need urgent help! - xiphirx - 07-29-2011 Isn't that a little too over-the-top there apjjm? Code: void OnEnter() (untested, should work) ? RE: Scripting, need urgent help! - Apjjm - 07-29-2011 (07-29-2011, 01:51 AM)xiphirx Wrote: Isn't that a little too over-the-top there apjjm?Not necessarily. What happens if you want queue more than one sound with the delay function? Having just one var for each argument then is not sufficient - but your idea is better if you can guarantee only one sound will be delayed at a time. RE: Scripting, need urgent help! - xiphirx - 07-29-2011 That's true. Mine isn't flexible like yours.. but I was more or less talking about the string to int conversion lol. I would think that AngelScript wouldn't be so type strict... right? D: RE: Scripting, need urgent help! - Apjjm - 07-29-2011 (07-29-2011, 02:37 AM)xiphirx Wrote: That's true. Mine isn't flexible like yours.. but I was more or less talking about the string to int conversion lol. I would think that AngelScript wouldn't be so type strict... right? D: It moans when if you try to convert/cast it though , so i had to make that int parsing code, sadly. Slightly OT but recently just had to revisit that script to make: Code: int[] parseNameToIntArray(string str) { RE: Scripting, need urgent help! - JetlinerX - 07-29-2011 Ehhh... All that is really confusing! Ill try my best I guess... |