Page 1 of 1

Game type in spearhead changing

Posted: Tue Aug 23, 2005 10:28 am
by GaTeCRaSHeR
Hi all,


Who know how i could change the game type name? in the mohaa browser,

Now it names is "Team-Match", Some mods can changed that to "free-tag"
but also to "custom-maps server"

How can i edit that to in spearhead,
I add this line to my cfg file but i dont work

seta g_gametypestring "Custom-Maps"



Greetz GateCrasher

Posted: Tue Aug 23, 2005 12:09 pm
by ViPER
you want all maps to say it?

Posted: Tue Aug 23, 2005 1:08 pm
by GaTeCRaSHeR
Yes :D

Posted: Tue Aug 23, 2005 6:40 pm
by ViPER
i've never tried it from .cfg

try set instead of seta

if that doesn't work you need to put this in you map scripts.

Code: Select all

setcvar "g_gametypestring" "Custom-Maps"
do you have a map mod? I recomend you make a global script and call it from each custom map in your map mod pk3. That way if you ever need to add something to all your custom maps you only need to do it once in your global scr. make one for your stock maps too.

Posted: Tue Aug 23, 2005 8:29 pm
by GaTeCRaSHeR
That's what is want to do,
:D

But i am not so familer with the scriptings side of mapping :(
can u give me a little description how i have to make that ,
That would be very cool :)

Thanks,

Gatecrasher.

Posted: Tue Aug 23, 2005 8:50 pm
by lizardkid
your best bet is to rcon it, editing maps from console can get hairy, especially when they're in pk3s.

rcon seta g_gametypestring "custom"

if you wanted to script it, you'd have to put the line

set g_gametypestring "custom"

after the level waittill prespawn. in every map.

in short: you're better off using rcon.

Posted: Tue Aug 23, 2005 11:13 pm
by ViPER
this will not be easy, just let me know if u have any questions

you will need a few things

1. winzip or winrar to make your mod pk3

i use winzip and notepad to do all my scripting.

get the .scr for each custom map from thier pk3s and drag them in your own project file.

in your project file make a maps file and in it make a dm file and a obj file.

so you have in your project folder you have these folders

maps

and in maps you have

dm

obj

put all your scrs in the right folder - if dm - dm if obj - obj

drag your maps folder into a new zip file named

zzzzz-mymods.pk3

now you can open the map sripts to view them with notepad - make changes and save them. drag your saved scrs into your folder and then back to your zip.

Posted: Tue Aug 23, 2005 11:29 pm
by GaTeCRaSHeR
I want also to use it for the stock maps if that is possible

i have now this in the mainta map

test.pk3
-- global
------ DMprecache.scr



That DMprecache i thougt that the are for all DM maps :shock:

and this is the script file self

Code: Select all

Main:
	level waittill prespawn
	setcvar "g_gametypestring" "OYL MODS"
	thread Adve
	thread Advec
end

Adve: 

while(1) 
{  

    wait 60
    iprintln "Welkom To GaTeCRaSHeR Compo Server!" 
    iprintln "www.dutch-division.nl"
    iprintln "Play Fair!!!!!"
    iprintln " *** G A M E   O N  *** "


} 
end

Advec:

while(1)
{
	wait `60
	centerprint "welcome"
}
end
but it gifes an error in my console

Code: Select all

-------------------- Actual Spawning Entities Done ------------------ 374 ms
0 teams with 0 entities
Adding script: 'dm/mohdm1.scr'
	level waittill prespawn (global/dmprecache.scr, 2)
	level ^

^~^~^ Script Error: invalid waittill prespawn for 'Level'
`
but if i view the lan game its working :)

But its not working on the server where should be working

Posted: Wed Aug 24, 2005 4:02 am
by ViPER
i dont think you need the dmprecach in your mod .pk3 - if you want all the stock maps also, you can get them out of pak1 and 2 from mainta just as i described earlier.

so you will have -

maps/dm
with a script for each AA dm map and each SH dm map plus all your custom dm map scrs

maps/obj
with a script for each AA obj map and each SH obj and tow map
plus all your custom obj map scrs


add a scr in a global folder and call it something like common.scr
and one called something like custom.scr

so you will have -

global/common.scr

and

global/custom.scr

here is your common.scr

Code: Select all

Main: 
   thread gtype 
   thread Adve 
   thread Advec 
end 

gtype:
setcvar "g_gametypestring" "OYL MODS" 
end

Adve: 

while(1) 
{  

    wait 60 
    iprintln "Welkom To GaTeCRaSHeR Compo Server!" 
    iprintln "www.dutch-division.nl" 
    iprintln "Play Fair!!!!!" 
    iprintln " *** G A M E   O N  *** " 


} 
end 

Advec: 

while(1) 
{ 
   wait 60   //you really want this ??? every 60 seconds?
   centerprint "welcome" 
} 
end 
here is your custom.scr

Code: Select all

Main: 
   thread gtype 
   thread Adve 
   thread Advec 
end 

gtype:
setcvar "g_gametypestring" "Custom maps" 
end

Adve: 

while(1) 
{  

    wait 60 
    iprintln "Welkom To GaTeCRaSHeR Compo Server!" 
    iprintln "www.dutch-division.nl" 
    iprintln "Play Fair!!!!!" 
    iprintln " *** G A M E   O N  *** " 


} 
end 

Advec: 

while(1) 
{ 
   wait 60   //you really want this ??? every 60 seconds?
   centerprint "welcome" 
} 
end 
Now in every stock map script above level waittill spawn add this line

Code: Select all

exec global/common.scr
and in every custom map script above level waittill spawn add this line

Code: Select all

exec global/custom.scr
In the future when you want to change your message or add something to all your maps you just need to edit these global scripts.

I think thats it !

Posted: Wed Aug 24, 2005 7:48 am
by lizardkid
thats a terribly long way to do it, if you just want all your maps to say the same gametype just set it in rcon/server config.

Posted: Wed Aug 24, 2005 11:00 am
by GaTeCRaSHeR
I tried that but that does'nt work :S

Posted: Wed Aug 24, 2005 11:04 am
by ViPER
its a good way to start your own mod pak - next step is to start adding other stuff like models, sounds, animations and map fixes.

lots of cool stuff you can start doing once you set up a global map scr system too.

on my servers i have a mod rotation that rotates multiple mods for each map each map rotation. i run more than 150 mods on 2 servers.

My global counts the players on the server and will select the appropriate mod or gametype for the number of people playing.

i also use my global.scr to run my weapons limiter, etc.

it's not the easy way, but its a good foundation for building your own map mod pak.

Posted: Thu Aug 25, 2005 1:09 am
by GaTeCRaSHeR
Hi viper thanks for your help :) and its works , nice job :) :lol:

I added the line exec global\gatemod.scr in all the stock scripts of the maps and the game type was "My Mod NaMe"

ok but now its hard to change it every time when i want to called it else or when i want to change the custom text below the compas

So i created 2 files gatemod.scr and i config file gate-config.cfg

GATEMOD.SCR :

Code: Select all

Main: 
   waitexec gate-config.cfg
   local.gametype = getcvar(GCR_regel1)
   local.astext = getcvar(GCR_regel2)
   thread gtype
   thread Adve 
end 

gtype: 
setcvar "g_gametypestring" local.gametype
setcvar "g_obj_alliedtext2" local.astext
end 

Adve: 

while(1) 
{  
    wait 120
    iprintln "On This server are some custom maps"  
    iprintln "please visit or site to download them"
} 
end 

GATE-CONFIG.CFG

Code: Select all

setcvar GCR_regel1 "*|My Mods|*"
setcvar GCR_regel2 "Testing"
ok i still needed to fix that message strings but now the still work fine

Only the game-type in game is NILL :S

and i have try it a view times but not succeed,

What could be wrong?


the map script file will exec gatemod.scr
and the gatemod.scr must wait when the config gile is load
in the config file are te custom strings that will be set with cvar
and then the gatemod.scr will get them like this
local.gametype = getcvar(GCR_regel1)

Only it not works :S

Posted: Thu Aug 25, 2005 6:00 am
by ViPER
i think u need to pass your local.variables through the thread - like this

Code: Select all

Main: 
   waitexec gate-config.cfg 
   local.gametype = getcvar(GCR_regel1) 
   local.astext = getcvar(GCR_regel2) 
   thread gtype local.gametype local.astext
   thread Adve 
end 

gtype local.gametype local.astext: 
setcvar "g_gametypestring" local.gametype 
setcvar "g_obj_alliedtext2" local.astext 
end 

Adve: 

while(1) 
{  
    wait 120 
    iprintln "On This server are some custom maps"  
    iprintln "please visit or site to download them" 
} 
end 
or stuff your locals like this -

Code: Select all

Main: 
   waitexec gate-config.cfg 
   thread gtype 
   thread Adve 
end 

gtype: 
local.gametype = getcvar(GCR_regel1) 
local.astext = getcvar(GCR_regel2) 
setcvar "g_gametypestring" local.gametype 
setcvar "g_obj_alliedtext2" local.astext 
end 

Adve: 

while(1) 
{  
    wait 120 
    iprintln "On This server are some custom maps"  
    iprintln "please visit or site to download them" 
} 
end 
Also, I init my cvars at the end of my server.cfg (not saying waitexec to cfg is wrong, i just like to see all the vars in server cfg for me and my admins)

end of server.cfg

Code: Select all

set GCR_regel1 "*|My Mods|*" 
set GCR_regel2 "Testing"

Posted: Thu Aug 25, 2005 9:12 am
by GaTeCRaSHeR
Thanks to all
and viper :)

It works :D