Bypassing teamwin
Moderator: Moderators
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Bypassing teamwin
I've noticed teamwin seems to clear all game variables. This is a big problem since I'm using a lot of relevant game variables. Therefor I've designed something which does everything the teamwin command should do. Therefor I don't need g_gametype 4 anymore.
But I ran into 2 problems:
1) I can make everyone to vote yes on restarting the map to "fake" the restart of the round. But that also clears all vars. I use bsptransition now, it saves my game variables but it takes a long time before it starts reloading the map and the players have to see the loadbar etc again... Which could confuse/agitate them.
Any suggestions?
2) When I play obj, I just play, I never even looked at that tiny yellow "score ( 0 (0) )" thing in the upper right corner. So in objective matches, what decides when a round restarts? Just the roundlimit (besides getting all objectives where teamwin would be applied)?
And what decides the mapchange in objective matches? The fraglimit or when the roundlimit runs out?
Thanks in advance
But I ran into 2 problems:
1) I can make everyone to vote yes on restarting the map to "fake" the restart of the round. But that also clears all vars. I use bsptransition now, it saves my game variables but it takes a long time before it starts reloading the map and the players have to see the loadbar etc again... Which could confuse/agitate them.
Any suggestions?
2) When I play obj, I just play, I never even looked at that tiny yellow "score ( 0 (0) )" thing in the upper right corner. So in objective matches, what decides when a round restarts? Just the roundlimit (besides getting all objectives where teamwin would be applied)?
And what decides the mapchange in objective matches? The fraglimit or when the roundlimit runs out?
Thanks in advance
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
Game variables? You mean children of the game object (game.* stuff)? Weird, it's supposed to be persistent, even between map changes, the limitation being that it can only hold variables of primitive types (i.e. strings, integers, floats and vectors, no objects/entities).
Ad. 2) As far as I know, when timelimit is hit, the game calls a win for level.clockside, which can be either allies, axis or kills (the latter winning it for the team with more kills, obviously). Other than that, a round can only be ended by a teamwin command from the script, or when there's not enough players to continue it (e.g. an entire team leaves the server).
Ad. 2) As far as I know, when timelimit is hit, the game calls a win for level.clockside, which can be either allies, axis or kills (the latter winning it for the team with more kills, obviously). Other than that, a round can only be ended by a teamwin command from the script, or when there's not enough players to continue it (e.g. an entire team leaves the server).
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Well that's the weird part, it does persist through mapchanges but if teamwin is used before the map changes, the game. vars are cleared (same rule applies for the restart function, which actually does the same as teamwin, kills all vars and scriptthreads then restarts at waitill spawn).
An easy way to find this out is by doing this:
When teamwin kicks in and you respawn, you'll see that println in the console, meaning the game var doesn't exist anymore.
2) Hmm, forgot about the clockside... I guess I'll have to evacuate my game. vars into cvars before using teamwin. There's no way I can know for sure how many kills a team got.
An easy way to find this out is by doing this:
Code: Select all
if (game.myvar == NIL)
{
println "ERROR: game.myvar is NIL!!!"
game.myvar = 0
}
setcvar "g_gametype" "4"
wait 8
teamwin allies2) Hmm, forgot about the clockside... I guess I'll have to evacuate my game. vars into cvars before using teamwin. There's no way I can know for sure how many kills a team got.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
SilentAngel
- Captain
- Posts: 239
- Joined: Wed Mar 12, 2008 8:27 pm
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Ending a match as well as teamwin results in a roundrestart and that's clearing the vars. But I already have solved this problem.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
It does not matter how, when or where you initialize them. They get cleared when the round restarts.
Elgan already came to this conclusion after I searched for this problem when encountering it myself.
Elgan already came to this conclusion after I searched for this problem when encountering it myself.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
That's most likely because your game vars get defined in your main: thread. Then you have no problem. But if they are defined once and are supposed to persist through several maps, then you could have a problem if on one of those maps the round restarts.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
That will keep them to the default values. The whole point of the game vars is so I can change them through the console as admin. Therefor I have a cvar which saves the latest values before a teamwin and returns them to the corresponding game var.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.


