Script Problem...please 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: Script Problem...please help? (/thread-9684.html) |
Script Problem...please help? - SonOfLiberty796 - 08-10-2011 Code: //////////////////////////// The problem is the "void SetMessage (and so on till the } bracket)". Everytime i run the map with this command, it crashes and gives me an error, however, when i remove it, it runs perfectly normal...can anyone help me and see whats the problem? thanks. BTW, i included a picture of the error it gives me. RE: Script Problem...please help? - palistov - 08-10-2011 (08-10-2011, 06:14 AM)Xvideogamer720X Wrote: void SetMessage(string& asTextCategory, string& asTextEntry, float afTime); Improper name and signatures there (bolded text). Looks like a copy-paste typo to me. Also, the semicolon after the void function's name causes an error. You also need to add an OnStart() function and an OnLeave() function. Also, I saw you added item callbacks and such in OnEnter. This is a bad idea, since if the player leaves the area and returns later on, they'll be able to use the items again, perhaps giving them unlimited sanity or allowing them to do other weird things. Put these callback declarations into your OnStart function instead. This way the player will only be able to use an item once (unless you add another callback with script). RE: Script Problem...please help? - SonOfLiberty796 - 08-10-2011 (08-10-2011, 07:22 AM)palistov Wrote:(08-10-2011, 06:14 AM)Xvideogamer720X Wrote: void SetMessage(string& asTextCategory, string& asTextEntry, float afTime); Alright then ill try that out right now. Oh by the way, i do have those OnStart and OnLeave functions (except onstart was onenter...but ill change that) its just i didnt include it in the text (to make the text shorter, because i think copying the WHOLE script is too much...isnt it? :p) Quote:Also, I saw you added item callbacks and such in OnEnter. This is a bad idea, since if the player leaves the area and returns later on, they'll be able to use the items again, perhaps giving them unlimited sanity or allowing them to do other weird things. Put these callback declarations into your OnStart function instead. This way the player will only be able to use an item once (unless you add another callback with script). Ohhhhhhhhhhhhh that explains why everyone uses OnStart! Thank you so much for explaining! EDIT1: Thank you soooooo much! It worked! Gah, i hate it when i cant find those small problems in the scripts (and trust me i was looking for them) and all the trouble was caused by the darn ";" sign -_- and not to mention i have other void commands and i could have just looked at them and see that they dont have the ";" sign -_- :p well anyways another problem solved thanks to you, friend! |