Forum

Map Cycling?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Map Cycling?

Postby MonkRocker » Sun Aug 08, 2010 3:08 am

QuakeC n00b here. Was trying to think of a good way to implement some sort of map list/map cycling.

Was thinking of something along the lines of

Code: Select all
sv_map_list = "dm2;dm4;dm6;e2m1;"


in a .cfg file somewhere which is read by qc and sets nextmap appropriately.

One thing I'm having trouble figuring out: where does one define a new sv_ var? I've been poking around the code but have yet to see any. Hints on where to look? Or is this something that's handled by the engine and not QuakeC at all?

Is there a better way to do what I'm trying to do? I'd much rather be able to set a time/fraglimit and blast through 10 maps without having to type a new map command at the end of every level. I like the idea of having it in a cfg file because it's easy to edit and use.


Thanks in advance.
MonkRocker
 
Posts: 6
Joined: Sat Aug 07, 2010 5:06 pm

Postby Spike » Sun Aug 08, 2010 10:06 am

the cheap way is to do: localcmd("exec "); localcmd(mapname); localcmd(".cfg\n");
and then put the line 'changelevel $newmap' inside $oldmap.cfg

QuakeWorld mods traditionally do something similar, but using the server's localinfo for it.

Or you can use FRIK_FILE for it with a single file.
Or you can use DP_CON_SET to create cvars in your server.cfg or whatever which can then be read with one of the numerous cvar_string extensions in combination with the FRIK_FILE extension to parse parts of the cvar.

Custom cvars cannot normally be created from mods. You can hijack existing otherwise-unused cvars to do what you want, if you want (temp1, scratch*, saved*, nomonsters are cvars that the engine does not itself use).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby MonkRocker » Sun Aug 08, 2010 3:25 pm

Spike wrote:the cheap way is to do: localcmd("exec "); localcmd(mapname); localcmd(".cfg\n");
and then put the line 'changelevel $newmap' inside $oldmap.cfg

QuakeWorld mods traditionally do something similar, but using the server's localinfo for it.

Or you can use FRIK_FILE for it with a single file.
Or you can use DP_CON_SET to create cvars in your server.cfg or whatever which can then be read with one of the numerous cvar_string extensions in combination with the FRIK_FILE extension to parse parts of the cvar.

Custom cvars cannot normally be created from mods. You can hijack existing otherwise-unused cvars to do what you want, if you want (temp1, scratch*, saved*, nomonsters are cvars that the engine does not itself use).


Whoa. That's a barrage of information there. Let's pretend for the sake of discussion that my experience level is working through a few cut/paste tutorials, and MauveBib's tutorials for beginners. Since....it's true. ;) Modding weapons I get the hang of, and I am starting to understand the basic flow of things, but beyond that...

If I understand you correctly, your first method seems to mean that I'd need a separate .cfg file for each map I want to cycle through?
That doesn't seem very "elegant".

Your second idea sounds interesting but: FRIK_FILE? DP_CON_SET? I assume the latter is related to Darkplaces. Where would I find more info about these two things?

Thanks!

Edit: More specifically. Where would I find FRIK_FILE? I looked on FrikaC's project pages and didn't see it. I found some QC Wiki documentation for it, but no link to the actual files. The QuakeC world is a world of dead links. :(
MonkRocker
 
Posts: 6
Joined: Sat Aug 07, 2010 5:06 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest