Solved Level and variable questions

Question that is answered or resolved.

Smart Kitty

Well-known member
Heya again, I am trying to build a system that manages a variable per level. I have done a script for the level and set it as level updatescript and I have set a localvariable to avoid using globalvars when is not really necesary so built a test and seems like executing only one time? it starts at 0 and become 1 and it does not increases more, while the test is making it go up infinite. There's the script.


C:
void main(){

int level_progress = getlocalvar("lvlprogress");   

level_progress++;
drawstring(0, 0, 0, "" + level_progress, 5000);
    
}

void oncreate(){
 
 int level_progress = setlocalvar("lvlprogress", 0);
}

void ondestroy(){
    
 clearlocalvar();   
}
 
Holy cow, I think I need new glasses I was not setting the local var ~.~. Anyways if I use that same scripts for other levels the value of the script gonna be the same or it is unique per level?
 
Back
Top Bottom