clearglobalvar() or indexedvar

jonsilva

New member
hello
ive used clearglobalvar(); in some levels but i think it also cleans the indexedvars

the indexedvars ive made seem to be working when i load a game or exit to windows then enter game load again the indexedvar is always there but when i use clearglobalvar() i think everythig is gone globalvars and indexedvars...

is clearglobalvar() cleaning indexedvars ?
my indexedvars seem to be working when i pass from lvl1 to lvl2 to lvl1 and use load game even if i exit the game... is there something wrong here ? 
 
Hmmm.... I read before that utunnels is merging indexed variables and global variables but I don't know if that's really implemented

Anyways, have you tried running simple test such as using update.c to show the value of your indexed variables? with this you can see if clearglobalvar() does it or not?
 
have you tried running simple test such as using update.c
i dont really know how to get update.c working the only scripts i know how to made are @script charaters.txt or animationscript.

but its funny the test ive made was in the map go into home / map then kingcafe.
map had a clearglobalvar right above setglobalvar map 1and everything worked the indexedvar was there and globalvar was clean and i was changing levels...
but when i go into a level (pitt stadium 4lvls) then iam back on the map again the indexedvar is gone...

you can check my demo... iam not asking for you to understand everything thats in there... but just look at bgs/99king/img/imgking.txt... there an indexedvar there that tells if the 1st image already appeared then goes to 2nd... and so on 3rd, 4rd.... you can look at it real quick theres no confusion in there

thas the only indexedvar i made in the game "float Kday2 = getindexedvar("kday");"

ive removed the rest of the images and follows but when kday is 2 it goes to follow1 when kday its 3 its goes to follow2....
 
If you don't have update.c, you can create one with this:

Code:
void main()
{
    drawstring(50,150,3, getindexedvar("kday"));
}

50 = x coordinate of the text measured from left edge
150 = y coordinate of the text measured from top edge
3 = font4 will be used for the text

Oh yes update.c is costy, this example is for testing only so if you're done with testing, you should disable it by renaming it to something else
 
ha thanks i rebember now
youve already posted this once to check the killgun entityvar

ive just replaced the indexedvars with globalvar
spawn  ghosttime
@script
void main()
{
setglobalvar("Kgnextday", NULL());
setglobalvar("challenge", NULL());
setglobalvar("killelle", NULL());
setglobalvar("bn1", NULL());
setglobalvar("bn2", NULL());
setglobalvar("bn3", NULL());
setglobalvar("bn4", NULL());
setglobalvar("rsh1", NULL());
setglobalvar("rsh2", NULL());
}
@end_script
health 5
coords  30 240
at      10

i think the problem was when i went to map1.txt the indexedvar was always there
but after going into a stage (pitt stadium) then returning to the map again with new unlocks the indexedvar was gone because i was in a new map (map2.txt)...i think the indexedvar was in map1.txt...

 
Back
Top Bottom