Thursday, May 8, 2008

Dynamic Arrays

This post is about a couple of things that changed in AGS 3.0. First, the AGS_MAX_SOMETHING #defines were removed becuase CJ removed the editor/engine constraints on characters and other things. This made some modules break. Now, as I'm lazy its taken me ages to get around to a proper fix for this. One way is to use dynamic arrays, another new AGS 3.0 feature. Well, monkey_05_06 has already written up a great forum post on this issue, so I'll just link to his awesome posting. In short, you check if you're using AGS 3.0, define the AGS_MAX_WHATEVER to be blank, which declares a dynamic array instead of a fixed size, and then initialize the array to be the right size for the actual number of characters in the game (e.g. Game.CharacterCount) in game_start (surrounded by appropriate #ifdefs). Bob's your Uncle!

No comments:

Post a Comment

Please keep comments clean: foul language means your comment will not get published. Sorry for the captcha, was getting to much spam.