News:

Come Chat with us live! Learn how HERE!

Main Menu

a few map rotation questions

Started by Pbhead, November 14, 2008, 03:26:52 PM

Pbhead

hey,


I am trying to learn how to make my own maprotation.cfg file,  anyway, i want to make a rotation that changes depending on what the server is up to...

So, what i need is some way to know how many players are on the server, and also who won last game... Basicly... how can I call this infomation from somewhere else so I can use it.

Second, can I use arrays in my maprotation file... or at least can I create my own varibles in maprotation.cfg that will be stored so that i can use them again a while later.

I am trying to grasp as much as i can, but its hard to find info on exactly how to do these sorts of things, and the standard maprotation files are preety bland, and so I cant get any knowlege off of it.


Thanks for your help.

David

This is just about the only question where "RTFM" is a good answer.  Linky: http://tremulous.net/manual/#x1-150003.4

number of clients is there, as is who won last.  And that's all there is.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Pbhead

#2
dam it... I was looking everywhere trying to find something like that...  i guess google isnt perfect. heh. thanks.


erm... still missing a few things though... how would I define say.... a counter like "i" that is persistant, and... what is the word for "if lastWin (draw, or timelimit hit or whatever)" --figured a way around this... Still need the process to define counters.

kevlarman

you can't, maprotation.cfg is already very complex (it eats 17mb of memory just by itself), and adding things like counters is extremely non-trivial because the memory doesn't persist through mapchanges.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Pbhead

hmm... well... can I put my counters somewhere else... like... in a different file, and then call them from there?

so... if somewhere else (any ideas where? heh...), i made a counter called g_counter, then could i use this?:


mapRotation1
{

if g_counter = 1

(map 1)

{

set g_counter 2

goto mapRotation1

}

if g_counter = 2

(map 2)

{

set g_counter = 3

goto mapRotation1
}

if g_counter = 3

(map 3)

{

set g_counter = 1

goto mapRotation1
}

}




Now, i know that that code may seem silly, and overcomplicated, since i could do the exact same thing alot simpler, but would it work?

David

ATM there is no support for anything like that, although you could probably add cvar's and exec without too much insane difficulty.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kevlarman

Quote from: Pbhead on November 14, 2008, 06:32:58 PM
Now, i know that that code may seem silly, and overcomplicated, since i could do the exact same thing alot simpler, but would it work?
no it won't (and be careful with conditional and even unconditional jumps, too many of them and the game will crash)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Pbhead

Quote from: kevlarman on November 14, 2008, 08:16:32 PM
Quote from: Pbhead on November 14, 2008, 06:32:58 PM
Now, i know that that code may seem silly, and overcomplicated, since i could do the exact same thing alot simpler, but would it work?
no it won't (and be careful with conditional and even unconditional jumps, too many of them and the game will crash)

why not? what am i missing? is it a simple syntax error, or is it something more serious...

I know you can use "set" to set ingame things, like g_speed and g_gravity and shizz... so why cant i create my own thing that is useless as far as the game is conserned, but i can use "set" on it and then use "if".....  or is that the problem... can "if" only do very certain things...

SO, is that the problem, "if" can only be used on numClients and lastWin and random?  ok... so I need to expand the ablities of "if"... now how am i supposed to do that... hmmm.... 


SO... the new point of this thread... how do I change the "if" command so i can use it to do other things besides the things its programed to do?  (oh, why couldnt they just program the file in C instead of creating... effectively their own... program that reads the text file...)

kevlarman

Quote from: Pbhead on November 15, 2008, 03:30:39 AM
SO, is that the problem, "if" can only be used on numClients and lastWin and random?  ok... so I need to expand the ablities of "if"... now how am i supposed to do that... hmmm.... 
correct
Quote
SO... the new point of this thread... how do I change the "if" command so i can use it to do other things besides the things its programed to do?  (oh, why couldnt they just program the file in C instead of creating... effectively their own... program that reads the text file...)
because maprotation.cfg should be understandable to people other than programmers, and because writing what is effectively a C interpreter from scratch isn't exactly easy (for something 95% of people won't use), and because the structure that is created from maprotation.cfg already eats 17MB out of the ~100-150MB that a server uses.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Archangel


Amanieu

Because the guy who wrote the map rotation system ran out of coffee
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P