Scripting 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 Help!! (/thread-20664.html) |
Scripting Help!! - 7heDubz - 03-08-2013 void OnStart { FadeOut(0) PlayMusic("forest(fw).ogg", False, 1.0, 1.5, 1, false); SetMessage("Messages", "opening1", 3.0f); SetMessage("Messages", "opening2", 3.0f); } This is my whole script. Yet I'm getting the error (2,1) Expected "(" This means it wants it to be {( And then when i did that, it still said i needed one! This makes no sense.... Help!! RE: Scripting Help!! - Linus Ă…gren - 03-08-2013 You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic. RE: Scripting Help!! - 7heDubz - 03-08-2013 (03-08-2013, 01:26 PM)junkfood2121 Wrote: You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic. how didnt i see this.. well it doesnt line up with the problem code it gave me i guess thats why.. <3's and giggles thanks man Fixed it but its still giving me the same errorcode... void OnStart { FadeOut(0); PlayMusic("forest(fw).ogg", false, 1.0, 1.5, 1, false); SetMessage("Messages", "opening1", 3.0f); SetMessage("Messages", "opening2", 3.0f); } void OnEnter { } void OnLeave { } I have been missing () after the Void OnStart Thats why it never showed. Sorry to waste your time! At least the other errors were shown to me xD RE: Scripting Help!! - The chaser - 03-08-2013 (03-08-2013, 01:27 PM)WIWWM Wrote:(03-08-2013, 01:26 PM)junkfood2121 Wrote: You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic. It's: Code: void OnStart In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work. RE: Scripting Help!! - 7heDubz - 03-08-2013 (03-08-2013, 03:24 PM)The chaser Wrote:(03-08-2013, 01:27 PM)WIWWM Wrote:(03-08-2013, 01:26 PM)junkfood2121 Wrote: You forgot a ; after FadeOut(0) and you have a big letter on false at PlayMusic. it wouldnt. and i did change it thanks It woudnt work because you didnt put a () after OnEnter void OnEnter() void OnStart() ECT either way, let this thread RIP please RE: Scripting Help!! - Adrianis - 03-08-2013 (03-08-2013, 03:24 PM)The chaser Wrote: In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work. That shouldn't matter because it's contained within the string delimiter "", there are all sorts of keywords you can use within a string that don't cause problems because the compiler knows to treat it as a character not an operator RE: Scripting Help!! - ExpectedIdentifier - 03-08-2013 (03-08-2013, 06:09 PM)Adrianis Wrote:(03-08-2013, 03:24 PM)The chaser Wrote: In the PlayMusic thing you had a (). If that's how your file is called, change the name, because the () are a part of the C++ syntax. This script is the good script, it should work. If I remember correctly, there are some characters that can cause errors even if it is within a string, I know in PHP you have to put a \ before a ' for it to accept it is a character, so you never know it could cause errors RE: Scripting Help!! - Adrianis - 03-09-2013 (03-08-2013, 06:44 PM)sonataarctica Wrote: If I remember correctly, there are some characters that can cause errors even if it is within a string, I know in PHP you have to put a \ before a ' for it to accept it is a character, so you never know it could cause errors Yeh right, in other languages it's different. I can't speak for PHP as I've never used it, but normally that's because the character in question is the string delimiter, and so to include it within a string as a character you need to use an escape sequence like \ - that's the case in Javascript certainly. C has special escape sequences you can use for formatting and such, can't speak for C++ however. But irrespective of all that, I made a sound file with () in the name and it worked just fine, so Angelscript doesn't have that problem at least! RE: Scripting Help!! - 7heDubz - 03-09-2013 OK Need some more help.. i cant seem to figure out how PlaySoundAtEntitiy works.. nor the .snt files! help with detailed steps please! RE: Scripting Help!! - PutraenusAlivius - 03-09-2013 (03-09-2013, 01:07 AM)WIWWM Wrote: OK Need some more help.. PlaySoundAtEntity is a function that will play a sound at a specific entity. Could be a chair, or the Player. The .snt's are properties for sounds to play. It shows what is the volume, range and directory? Is this what you mean? Because it's not clear enough. |