Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: quixotecoyote on Fri 14/09/2007 07:41:46

Title: Can I clean up the global script?
Post by: quixotecoyote on Fri 14/09/2007 07:41:46
My global script is getting hard to read with character and inventory sections coming in random order.  Would it hurt anything if I cut and pasted the different sections around to group things together and make it easier to read?
Title: Re: Can I clean up the global script?
Post by: Lionmonkey on Fri 14/09/2007 07:46:42
No, but you have to do that very carefull. Cut and paste whole parametres with their functions, without forgetting anything, or else there will be many buggy loose ends.
Title: Re: Can I clean up the global script?
Post by: Khris on Fri 14/09/2007 10:31:10
Geez, Lionmonkey, "whole parametres with their functions"?
He was talking about sections, a simple "No" would've been enough... :=
Title: Re: Can I clean up the global script?
Post by: Lionmonkey on Fri 14/09/2007 12:19:56
Quote from: KhrisMUC on Fri 14/09/2007 10:31:10
Geez, Lionmonkey, "whole parametres with their functions"?
He was talking about sections, a simple "No" would've been enough... :=

I think you forgot to read my sig.
Title: Re: Can I clean up the global script?
Post by: Akatosh on Fri 14/09/2007 17:12:22
A rant about a MMOG I never, ever heard about, and "Cthulhu Cult" with a lot of arrows on it?

*scratches head in confusion*
Title: Re: Can I clean up the global script?
Post by: Ashen on Fri 14/09/2007 21:12:27
Keep it on topic or take it to PM, please guys.
Lionmonkey, 'whole parametres with their functions' is a little unclear - what are you talking about?

To answer the question: provided you move the whole function, and don't miss out and closing braces - } - or semi-colons - ; - from the end of lines (which I guess is what Lionmonkey meant) you should be OK. Just remember that functions and variables can't be called in the script before their declarations. If you're only going to be moving GUI Control functions or Character interactions, you probably don't have to worry about that - they're not called from script, so it doesn't overly matter where they are. If you've got your own custom functions or variables, however, you'll need to keep it in mind. (If you use your own function/variable in a Character interaction or GUI script, don't move the declaration below the Character/GUI script.)