does game. keep info over map changes?
i tried using game.keep_my_blasted_info = "blah" and then changing it to something like "blah53" then changing the map to a different one and printing my var and it was blah again:(.
scripting: game.keep_my_blasted_info
Moderator: Moderators
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
nope it keeps the info:D
i got it to work. the reason it didnt work before was for some reason one of them didnt keep but all my arrays did. so i set a cvar instead of that variable.
So i can have settings for my mod and not have it loose them when the map changes. But all the settings can be reset by cvar.
The cvar each map checked it it had loaded all the settings and created tem and if not then it did it. but when map changes it kept doing i. i cvard it not to and it had kept all of the settings even though the game.mod_loaded changed:D
i got it to work. the reason it didnt work before was for some reason one of them didnt keep but all my arrays did. so i set a cvar instead of that variable.
So i can have settings for my mod and not have it loose them when the map changes. But all the settings can be reset by cvar.
The cvar each map checked it it had loaded all the settings and created tem and if not then it did it. but when map changes it kept doing i. i cvard it not to and it had kept all of the settings even though the game.mod_loaded changed:D
I didnt want to have a load of cvars so for the next camper version i have created a cvars within cvars system to handle the users settings along with a settings text file it loads them from,if(level.camper_setup!=1)
{
level.camper_setup=1
local.setup = getcvar "camper_reset"
if(local.setup=="")
{
local.gametype = getcvar "g_gametype"
if(local.gametype=="0")
{
end
}
local.found_map = NIL
local.mapget = waitexec camper.txt::maplist
for(local.i=1;local.i<=local.mapget.size;local.i++)
{
if(local.mapget[local.i][1]== getcvar("mapname"))
{
local.found_map = 1
}
}
if(local.found_map!=1)
{
setcvar "camper" "0"
end
}
waitthread register game.campersettings
local.campersettings = waitexec camper.txt
waitthread register local.campersettings
game.commands = waitexec camper.txt::commands
game.types = waitexec camper.txt::types
}
local.map = getcvar("mapname")
game.informed=1 //camper mod is on to start with so game.informed is 1
local.master = spawn ScriptMaster
local.master aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps local.map
local.master aliascache final_countdown sound/items/final_countdown.wav soundparms 1.5 0.0 1.0 0.0 10000 2000 local loaded maps local.map
local.master aliascache streamed_dfr_scripted_M3L1_016a sound/dialogue/m3l1/A/dfr_scripted_M3L1_016a.wav soundparms 1.5 0.0 1.0 0.0 200 1500 dialog streamed subtitle "You stay in one spot, you're a dead man!" loaded maps local.map
game.camper_debug = thread getcmd "debug"
thread cvarscheck
}
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
Just a heads up, sure you already know. More and more people are changing the attributes of unnamedsoldier.cfg to Read Only. So any mods that use cvars to set variables will breakdown for that user. This has started becoming popular because it's an easy way to prevent a server from 'tagging' you. A lot of servers were changing peoples names and what not, so now the word is out, just change unnamedsoldier.cfg to read only and all the problems stop. No more alias's being added in that cfg file. No more cvars being set and written and to that cfg file.
Peace out,
Area51 Admin
G3mInI
Peace out,
Area51 Admin
G3mInI
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:

