Is there a limit to the amount of code you can write under a function

Started by Aljoho, Fri 16/05/2008 11:43:25

Previous topic - Next topic

Aljoho

In my game there is a huge function under which turning off a light switch will trigger about 150 lines of code, changing objects and making them invisible etc, but ive just gotten to the point upon which the light switch has started to nothing when i click on it. Is this because of a limit in the amount of things one function can do or because something else i did? just thought id check before doing some drastic code cutting ;)
A Tribute to my success -  A wonky ASCII Trophy
                              .__.
                              (|  |)
                               (  )
                              _)(_

GarageGothic

If there is a limit (which I have yet to encounter or hear of), it's more than 10.000. 150 lines is absolutely nothing in terms of script length. Most likely your problem is to be found in the script itself, not in its length. There is however a limit to how much memory can be assigned to variables within a function, but if this happens AGS will give you an error message. It shouldn't be a problem though unless you're declaring huge structs or arrays within a function (as a workaround they can be declared globally and called from inside the function).

Aljoho

A Tribute to my success -  A wonky ASCII Trophy
                              .__.
                              (|  |)
                               (  )
                              _)(_

SMF spam blocked by CleanTalk