|
Problemes with more than 20 variables... Displaying 1-5 of 5 total.
1
ErayMan
|
I'm trying to make a little battle system, but there is that problem that bother me a lot. In the combat menu, I'm showing 24 different variable(Name, Hp, Mp, etc), but the game will crash until I get rid of 4 variables, and reduce the number to 20. Is there a way to get the game more stable, or can i be able to put more than 20 things?
thanks
-ErayMan
Beans are an excellent source of proteines! So please, be nice with them ...
Posted on 2000-12-24 12:40:48
|
andy
|
Currently, there's a limit of 20 local variables per function.
You'll have to use globals instead for the time being. (gah!)
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2000-12-24 13:38:34
|
ErayMan
|
I tried a couple of things and it seems that it's not only the variable that makes crash, but if i keep something like 20 variables, and everythings is working, but i add:
printstring(0,"Fight");
a couple of time(for the other options), well it crash.
is it cause vcc 2.01 isn't good enought to compile big file, or is it really because i have too much variables, event if they are globals
(p.s they are declared global in an include file, don't know if it matter or not..)
well, thanks
-ErayMan
Beans are an excellent source of proteines! So please, be nice with them ...
Posted on 2000-12-24 16:27:24
|
andy
|
That IS odd.
There is a limit to the number of globals, but it's closer to 4 billion than it is to 20. ;)
VCC can handle source files up to a megabyte in size, I think, which is about twice the size of VERGE's source.
Globals are any variables that aren't defined in a function, so yeah, variables in #included files are globals as well.
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2000-12-24 17:50:02
|
grenideer
|
Anytime you're not quite sure what's making it crash, and there seem to be a few symptoms, it is more likely that you messed up somewhere. I don't think anyone could help without you posting the code.
How many variables are being called in the parameters of the function? And how many inside? That may not be your problem at all, but just asking.
Posted on 2000-12-24 18:22:55
|
Displaying 1-5 of 5 total.
1
|
|