So i have quite the conundrum, this is in relation to the script tweak i put out, and the question is:
What all can I do with globals? Are they static once they have been set? Can they be altered after server start? Can I modify a global variable anytime I want during server uptime?
I have defined three variables (global) in a total of 7 files in order to get my code to function. Ill go ahead and break it down here so that I can get an accurate answer and possibly figure this out. The last gentlemen to help me with this helped me blindly without fully understanding what I modified so I never discoverd if it is possible to do what Id like to. (i appreciate all of the good sir's help and hopefully this post here will get the answers needed!)
The three variables are DZE_ecoMult, DZE_buyMult and DZE_sellMult. I initialize the ecoMult in init.sqf with = (round(random 12)) to give a value between 0 and 11. This value then uses a switch case to modify the buy/sellMults which are then coded to modify the prices of the traders. What Id like to do, and havent been able to succeed in doing, is modify the buy/sellMults by modifying the ecoMult say every hour of server up time. I however, couldnt get it to do this. Would I have to de-globalize my globals in order to do this? OR can i keep them global and modify them? I do not quite understand the nature of the global....
Question
ViktorReznov
So i have quite the conundrum, this is in relation to the script tweak i put out, and the question is:
What all can I do with globals? Are they static once they have been set? Can they be altered after server start? Can I modify a global variable anytime I want during server uptime?
I have defined three variables (global) in a total of 7 files in order to get my code to function. Ill go ahead and break it down here so that I can get an accurate answer and possibly figure this out. The last gentlemen to help me with this helped me blindly without fully understanding what I modified so I never discoverd if it is possible to do what Id like to. (i appreciate all of the good sir's help and hopefully this post here will get the answers needed!)
The three variables are DZE_ecoMult, DZE_buyMult and DZE_sellMult. I initialize the ecoMult in init.sqf with = (round(random 12)) to give a value between 0 and 11. This value then uses a switch case to modify the buy/sellMults which are then coded to modify the prices of the traders. What Id like to do, and havent been able to succeed in doing, is modify the buy/sellMults by modifying the ecoMult say every hour of server up time. I however, couldnt get it to do this. Would I have to de-globalize my globals in order to do this? OR can i keep them global and modify them? I do not quite understand the nature of the global....
Link to comment
Share on other sites
16 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now