Use map_var from different maps

mazy

First time out of the vault
im on the map and want load or set map_var from different maps. know anybody how do that?
 
Give an exmaple of what you want to do.

Typically, you can only load / alter a map variable for the map you are on.
 
If you want to use a map variable from another map, then I guess all you need is to include the proper header file in your script.
 
I'm pretty certain you can only alter a map var for the map you're currently on. If they could work over multiple maps, then they would be global.
 
i need a lot of global variables and im afraid there is maximum number or too much variables may be problem. so i want to use map_vars as global_vars (map.gam with 50 mvars looks better then vault13.gam with 10 000 gvars) . . . fallout need some life
 
mazy said:
i need a lot of global variables and im afraid there is maximum number or too much variables may be problem. so i want to use map_vars as global_vars (map.gam with 50 mvars looks better then vault13.gam with 10 000 gvars) . . . fallout need some life
May I ask why you need so many variables? What are you trying to accomplish?

Despite your needs, my statement about map vars hold true (afaik).
 
As CP and Killap pointed out already, you cannot change the values of map variables which are tied to another map. In fact, if you try to do so, you may not be able to compile your scripts, or the game will not function the way you want it to.

Map_vars are for single maps only. If you want to use a map_var on several maps, make it a global_var.

The limit on global variables is 715 or 716, IIRC, anyway, below 720. After that, the game just "doesn't see" them.

Hope that helps.
 
map.gam with 50 mvars looks better then vault13.gam with 10 000 gvars

What are you doing that needs so many variables?

@ ardent...

MR is cureently on 850 variables and its fine.
 
i try to write script that once a day change statistics of maps as per dudes actions, random events, . . . as i sad follout need more life
 
Chris Parks said:
@ ardent...

MR is cureently on 850 variables and its fine.

Well, for the first few weeks of my modding, nothing that had to do with global variables worked for me. And I started my globals at no. 1000, because I thought this would be a neat mark that my mod starts here.

Then I searched NMA forums, and there was a thread somewhere that said the limit was 715 or so. So I changed my globals to start at 695, i.e. one after the last global_var in original F2. It worked. I quickly reached 715 and they stopped working again, so I began renaming the original ones and do so ever since.

I was pretty much convinced the 715 limit was a valid one, but maybe I did something wrong. Anyway, thanks for the tip :-)

@ mazy:

Maybe you could use map_vars as you intended, but change the values you want on entering that particular map?

I don't know your mod, obviously, but I guess the majority of things that should happen on a map need only be changed when the PC is actually there...

Perhaps if you gave us more details, or an example, we would be able to help you in a more effective manner.
 
you can also use sfall globals,afaik sfall has no limits on numbers,dont even have to register them
 
Gronichonha !
I use normal variable, local variable and global variable but not yet map variable.
I havent felt the obligation yet.
What is the utility of such variable?
Thanks

Brother Soifran
 
Chris Parks said:
@ ardent...

MR is cureently on 850 variables and its fine.

And I've got over 1150 in my project. Still working.

brother_soifran said:
What is the utility of such variable?

They allow for something to occur on specific maps only, without adding to the vault13.gam file. Just open up one of the .gam files in the maps folder, and you can see some examples.
 
mazy said:
i try to write script that once a day change statistics of maps as per dudes actions, random events, . . . as i sad follout need more life
Are these interactions with critters? If so, these could be accomplished with local variables. In any event, if you are finding yourself using 50+ variables per map, you need to reconsider how you are going about things.
 
a few questions:
value of gvar must be only int?
normal is max int 32k but in command.h is line #define MAXINT 4294967295. can be this max value?
can i split string value (var="ab..." -> var1="a" var2="b" ... )?
 
sorry for boring. after few axperiments i answer myself:
gvar must be int between -2 000 000 000 and 2 000 000 000 cca but spliting string vars still mystery
 
Not exactly related to the topic, but I figure it isn't much off-topic.

I wanted to make a small release of my mod and wonder a thing - after compiling a script, does the person using my version of them need to have global vars I've added in their vault13.gam? I suppose so, but I just wanted to ask out of curiosity (saves some effort).
 
Ravager69 said:
I wanted to make a small release of my mod and wonder a thing - after compiling a script, does the person using my version of them need to have global vars I've added in their vault13.gam? I suppose so, but I just wanted to ask out of curiosity (saves some effort).

99% yes.

I once changed the name of a global_var and the script wouldn't work any longer, because it couldn't find the global_var's name in vault13.gam.

I used a regular version of F2, so I don't know how it works with sFall.
 
i dont know if anybody take interest but this resolved my problem:

procedure Split_Global begin
variable texa;
variable texb;
variable texc;
variable tex01:=-1;
variable tex02:=-1;
variable tex03:=-1;
variable tex04:=-1;
variable tex05:=-1;
variable tex06:=-1;
variable tex07:=-1;
variable tex08:=-1;
variable tex09:=-1;
variable tex00;
variable x:=0;

texc:=global_var(GVAR_XXX);
display_msg(" " + texc + " ");
while (x<9) do begin
texa:=texc;
texb:=texa/10;
texc:=texb;
tex00:=0;
while (texb==texc) do begin
texa:=texa-1;
texb:=texa/10;
if (texb==texc) then begin tex00:=tex00+1; end
end
if ((tex01==-1)and(tex02!=-1)) then begin tex01:=tex00; end
if ((tex02==-1)and(tex03!=-1)) then begin tex02:=tex00; end
if ((tex03==-1)and(tex04!=-1)) then begin tex03:=tex00; end
if ((tex04==-1)and(tex05!=-1)) then begin tex04:=tex00; end
if ((tex05==-1)and(tex06!=-1)) then begin tex05:=tex00; end
if ((tex06==-1)and(tex07!=-1)) then begin tex06:=tex00; end
if ((tex07==-1)and(tex08!=-1)) then begin tex07:=tex00; end
if ((tex08==-1)and(tex09!=-1)) then begin tex08:=tex00; end
if (tex09==-1) then begin tex09:=tex00; end
x+=1;
end
end

i mean that one gvar with 9 number can store 9 vars with range 1-9
 
Back
Top