scripting: game.keep_my_blasted_info

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

scripting: game.keep_my_blasted_info

Post 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:(.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

No, I think it keeps its info over rounds, not map changes.
Admin .MAP Forums
Image
Head above heels.
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

yea,that has been my expierience too.
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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,
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

ur a friggin genious 8-)
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

is that sarcasm :evil:
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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.
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post 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
*Area51*G3mInI****Gen

http://www.area51moh.com
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post 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.
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Elgan wrote:is that sarcasm :evil:
No it was a compliment,sorry if you took it wrong :oops:
Image
Post Reply