Page 1 of 1

Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 1:28 am
by Baker
This works for single player in all the instances I have tried:

1) startmap_named_start = 0,
2) startmap_undergate_intro_rockgate,
3) startmap_start_in_name,
4) startmap_same_as_gamedir,
5) startmap_alphabest,

If the gamedir contains a map named "start", you have the start map.
Failing that, if the gamedir contains a map named "undergate", "intro" or "rockgate", you have the start map.
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))
Failing that, use any map that has the same name as the gamedir (gamedir lunsp1, use map lunsp1)
Failing that, due to lack of information use the highest alphabetical match.

(This is, of course, excluding health boxes and such.)

And, to my surprise, this method revealed to me that NE_RUINS has a map named start. 99% of the time I played that typing game "ne_ruins; map ne_ruins"

Re: Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 8:36 am
by szo
Baker wrote:[...]
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))
This is stupid/wishful thinking/whatever else you prefer (no offense)
Baker wrote:Failing that, use any map that has the same name as the gamedir (gamedir lunsp1, use map lunsp1)
This is stupid too (even more stupid, again no offense). I almost always name my mod directory as "a" or "x".

Re: Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 9:13 am
by Spirit
Curl the Quake Injector XML and choose the first <startmap> ;)

Re: Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 9:19 pm
by Baker
szo wrote:
Baker wrote:[...]
Failing that, use any map that has the name "start" in it (strstr (mapname, "start"))
This is stupid/wishful thinking/whatever else you prefer (no offense)
My stupid and wishful thinking moves mountains and gets results! :D I'm MH jr. :mrgreen:
Spirit wrote:Curl the Quake Injector XML and choose the first <startmap> ;)
Actually, I'm trying to avoid Quaddicted metadata for anything that doesn't explicitly require it.

Examples: Unpacking a zip. It is easily possible to poke around the zip contents.

This is another example, it works flawlessly so far. And I think I have a method for determining -quoth, -hipnotic and such automatically.

The metadata at Quaddicted is invaluable, but it lacks a couple of things (is a map coopable?)

Re: Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 9:55 pm
by Spike
baker, startmap_sp+startmap_dm aliases in a couple of engines will be executed by the 'new game' option if they exist in preference to using 'map start'. these are explicit and so should have the highest priority.
these should thus have the highest priority, but may additionally set other cvars so you'd need to parse it carefully if you're explicitly after the map name for some reason.

no matter what you try, there is no foolproof way. A mod might even have two (maybe).

Re: Automatically Determining Gamedir Start Map

Posted: Wed Aug 20, 2014 9:59 pm
by Baker
Spike wrote:baker, startmap_sp+startmap_dm aliases in a couple of engines will be executed by the 'new game' option if they exist in preference to using 'map start'. these are explicit and so should have the highest priority.
these should thus have the highest priority, but may additionally set other cvars so you'd need to parse it carefully if you're explicitly after the map name for some reason.

no matter what you try, there is no foolproof way. A mod might even have two (maybe).
What is an example of a mod that uses that feature? Lardarse told me about the feature ages ago, but I don't know of a test case mod.

[If you know of a test case ...]

Re: Automatically Determining Gamedir Start Map

Posted: Thu Aug 21, 2014 10:03 am
by Spirit
Baker wrote: Examples: Unpacking a zip. It is easily possible to poke around the zip contents.
Wait until you find the zips that require manually sorting files into subdirectories.
Baker wrote: The metadata at Quaddicted is invaluable, but it lacks a couple of things (is a map coopable?)
That's what tags are for. ;)