Can I change the g_speed with a command in “mapname.script” ?
g_speed and scripting
there is a cvar script command,
cvar <cvarName> <operation> <value>
so you should be able to do
cvar g_speed set <value>
“G_ScriptParse(), Error (line 19) : unknown event: cvar.”
i never used a scriptfile.
here’s my script.
game_manager
{
spawn
{
alliedrespawntime 5
axisrespawntime 15
wm_set_defending_team axis
wm_set_round_timelimit 50
}
}
speed
{
cvar g_speed 1000;
}
You’re trying to use a command such as “cvar” as an event. An event is a piece of code that gets run whenever the event gets triggered. When the event gets triggered depends on what event it is.
A command on the other hand does something to do game / script etc…
Now you need to know first: When do you want to change the speed.
If you want to change it at the start of the map, then there is the “spawn” event in the “game_manager” scriptblock. This event gets run as soon as the map starts.
If you want it to change when someone presses a button for example, you have to use another scriptblock, and another trigger.
That said, I have read numerous time that the cvar command doesn’t work properly so it might not work for you at all.
“speed” is the scriptname of a func_button in my map…
so if i understood you it shall be totally right…
(I’m from germany, sorry for bad english)
if the cvar command is known or not has nothing to do with radiant, has it?
it depends on the ET-Version, i think.
why is it unknown?
is there any tutorial in german language?
Well, if “speed” is a button, then you are almost right.
But the same post applies here.
You are still trying to use a command as an event.
You need to have an event first, and inside this event, you put the command.
The event for a button is probably “activated” or something like that.
So it will look like this:
button //scriptname
{
activated //event
{
cvar ... // command
}
}
Also, you don’t want to put a “;” behind the value. I don’t know if this is a typo?
Maybe you are familiar with C coding? If so, you will probably have some understanding of events. The activated event can be seen as the “Clicked” event of a windows button for example. Inside the Button_Clicked codeblock (void I believe it’s called in C) you put the commands you need.
thanks. now i understood the difference between command and event.
btw: i can write with turbo pascal very well and a bit with c++
^the event is calles activate…
now another mistake occures in line 4???
why in line 4? the first ne was in line 19 or something like that.
“alliedrespawntime” is unknown. (i took this from another scriptfile)
I’m talented in making mistales 
“set_allied_respawntime” is unknown, too.(it was called this way in a tutorial)
^sorry, i had a writing mistake xD now no error occurres, but it doesn’t set g_speed to another value
i also look for a command that people cannot die due to falling down from too high places. the gravity should be the same and people shouldn’t be invincible. sorry for asking so much silly question 
This is shader sided thing. Just make it not “hurtable” when you land on it. There’s two ways to do it. You can give your shaders the info, or you can use common/cushion. I’d suggest using the last option if you can’t afford a lot of custom shaders and have no idea how to deal with them.
If you use common/cushion, make a new brush and apply it to it. It will make an invisible solid brush that won’t hurt you when you land on it.
thank you 
now i only have the problem with g_speed.
perhaps there is another command for it.
e.g. scriptfile: wm_allied_respawntime
devmap: g_bluelimbotime
can anyone help me?
There is no ‘script’ equivalent for g_speed like there is for “g_bluelimbotime”. That’s the reason you had to use the “cvar” command, which is supposed to change the cvar in the game.
As I said, it might not work at all no matter what you do. I have never tried it, anyone has?
I have found the following on Chruker’s forum:
You could add a note to the section:
CVAR variables
cvar <cvarName> bitreset <bit_index>
Clears the number ‘bit_index’ bit in the value of the cvar ‘cvarName’.cvar <cvarName> bitset <bit_index>
Sets the number ‘bit_index’ bit in the value of the cvar ‘cvarName’.cvar <cvarName> inc <value>
Adds ‘value’ to the value of the cvar ‘cvarName’.
NOTE: Use negative value to decrease.cvar <cvarName> random <value>
Sets the value of the cvar ‘cvarName’ to a random value between 0 and ‘value’.cvar <cvarName> set <value>
Sets the value of the cvar ‘cvarName’ to ‘value’.
The above cvar commands have no effect in the original ET except for cvar <cvarName> inc <value>. Fixed versions are available in mods like ETPub. In the original ET cvar <cvarName> inc <value> ignores <value> incrementing by 1 always.Thanks
http://games.chruker.dk/enemy_territory/forum_thread_view.php?forum_id=1&thread_id=16
It seems you can only make the value increase by 1 if you are testing in etmain.
Yes, original W:ET did not support any CVar changes other than “inc 1”, some mods adopted the fix I once posted.
IIRC, regular W:ET has no support for map configs but ETPro and most ETPub derivatives should offer it. Just make a file mapname.cfg (use your map’s name here) and put “set g_speed 100” in it.
Now you need to place this file into the folder to which g_mapConfigs points. If no such CVar is around, your mod doesn’t support map configs.
mmm…
i dont want a map that can be played only with special mods…
isn’t there another way?
my actual scriptfile:
game_manager
{
spawn
{
wm_allied_respawntime 5
wm_axis_respawntime 15
wm_set_defending_team axis
wm_set_round_timelimit 50
}
}
speed
{
activate //event
{
accum speed inc 100 //(i tried accum cause cvar didnt work)
}
}
Nope, there is no way other than asking the server admin to change the speed if you want to be 100% compatible with vanilla W:ET.
On the other hand, there is nearly nobody around anymore just playing the game unmodded so you might as well get away with supplying a map config script.
However, I would think twice about releasing your map if this cvar is actually necessary to enjoy your map…
Oh, and BTW: accum speed inc 100 is wrong, really.
You can do it in two ways:
- start W:ET and pick your mod from the Mods menu.
- start W:ET with a custom shortcut (you basically need to alter it to set the fs_game cvar to the name of the mod folder). Search this forum to learn how.