Page 1 of 1
scripting: game.keep_my_blasted_info
Posted: Thu Jan 13, 2005 2:34 am
by Elgan
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:(.
Posted: Fri Jan 14, 2005 5:07 pm
by Bjarne BZR
No, I think it keeps its info over rounds, not map changes.
Posted: Fri Jan 14, 2005 9:04 pm
by Green Beret
yea,that has been my expierience too.
Posted: Sat Jan 15, 2005 1:16 am
by Elgan
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
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
}
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,
Posted: Sat Jan 15, 2005 2:38 am
by Green Beret
ur a friggin genious

Posted: Sat Jan 15, 2005 2:54 am
by Elgan
is that sarcasm

Posted: Sat Jan 15, 2005 5:26 am
by Elgan
i meant map changes on server. if they reset through console it looses it all
unless i cvar it all i dont see how i cna stop it loosing it:'(!!!!!!!!!!!!!1 so if admin changes map via cmds i will have to reset it. as long as thye dont mess it should be fine.
Posted: Sat Jan 15, 2005 5:56 am
by G3mInI
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
Posted: Sat Jan 15, 2005 6:00 am
by Elgan
custom cvars are memory.
this is a server side script;) and im not using the unnamed.cfg. i cud use it and get some cool setting thingy but im not. i have a text file the server sets the ammounts in.
Posted: Sat Jan 15, 2005 3:46 pm
by Green Beret
Elgan wrote:is that sarcasm

No it was a compliment,sorry if you took it wrong
