Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rocco on Sat 04/02/2006 19:50:20

Title: Generate array size on the fly? (SOLVED)
Post by: Rocco on Sat 04/02/2006 19:50:20
i try something like this



int enemycount = (lastenemy_slot - firstenemy_slot);
 
enemies enemy[enemycount];



and get an error -> Error (line 26): Array size must be constant value
but const int didnt work and readonly int is also no solution.
Title: Re: generate array size on the fly
Post by: monkey0506 on Sat 04/02/2006 20:05:17
It's currently not possible.  Unfortunately.  You can use #define-s that are constant (you can't use expressions), enumerated values, or literal constants.  You can't use any form of expression...
Title: Re: generate array size on the fly
Post by: Rocco on Sat 04/02/2006 23:36:59
ok thx, this is not a big problem.
unfortunatly, a big problem is the limitation of 20 Overlays.
Title: Re: Generate array size on the fly? (SOLVED)
Post by: Gilbert on Sun 05/02/2006 04:52:33
Related tracker entry. (http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=500)