Create an account

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Load map immediately after game starts

There is a way to start Xonotic via a command in your shell/terminal:
/absolute/file/path/to/game/executable -basedir /absolute/file/path/to/game/

Now how is it possible to add a command which immediately loads a specific map after the game has started? I tried several things like adding "map mapname" or -map mapname after the command mentioned above but nothing worked so far.

Has anybody an idea how to achieve this?

/path/to/xonotic +chmap mapname

EDIT: you can pass any command or cvar that way. xonotic +bot_number 1 +chmap mapname

Ah, so it was the plus as a prefix. Very nice! Thanks! Smile

Plus is for cvars, minus is for commandline options. You can use this things like -window, -width, -height, -bpp they're mostly the same as for GLQuake/WinQuake. Do you need basedir in this example?
I'm at least a reasonably tolerable person to be around - Narcopic

It depends on the way the binary itself is launched. The default basedir is $PWD, and the shell script wrapper takes care of fixing that.

(09-05-2012, 11:58 AM)Mr. Bougo Wrote: It depends on the way the binary itself is launched. The default basedir is $PWD, and the shell script wrapper takes care of fixing that.

What I was thinking, in which case running the shell script would be better except in a few odd circumstances where parameters don't get passed properly.
I'm at least a reasonably tolerable person to be around - Narcopic

Indeed. The shell script accepts the same parameters anyway.

It is need when you want to launch the game from a dock app or (which actually is the subject of interest) my upcoming GUI for q3map2 which also allows the user to directly start up the game and play the map without even typing commands or clicking things before being able to play the map.

Maddin, how did you install Xonotic? Unless you're using a non-default basedir you shouldn't need to specify it.

How do I access this terminal thingy for Xonotic? I needed it so I could input a command that effects texture compression...

There's the shell (that's typically used in Linux or Mac OS -- the windows command line is a shell too but it sucks). If you want to access the Xonotic terminal, that's shift escape, or the key above tab on the left.

What Maddin is referring to is the shell (you can usually access it with a terminal emulator, more commonly just called "terminal"). But the command he wants to feed to Xonotic is a Xonotic terminal command, which you can just type the usual way after shift escape.

I am using autobuild for this purpose. The parent directory location is '/home/user/Games/Xonotic/Xonotic'. If you are wondering why I have it in a sub folder: The autobuild scripts are in '/home/user/Games/Xonotic' therefore the game is created in a sub folder. Tongue

Why don't you use or These are meant to select the right build and basedir for you!

Hmm right, why didn´t I do that? Undecided Big Grin

+1 for you again Mr.Bougo, you´re just the best!


Ah, now I know why I didn´t. For some reason the sdl script won´t be executed (it´s a link maybe that´s why?) from my dock and using glx I haven´t got sound.

The sdl script is a symlink to the glx one (the script selects the exec version based on it's own filename), so if you'd copy the glx script and change it's name then you should get the same effect.

BTW: that's a mighty strange dock you got there, that can't use a symlink
My contributions to Xonotic: talking in the forum, talking some more, talking a bit in the irc, talking in the forum again, XSkie

It´s Avant Window Navigator (AWN)... I like it. Big Grin Thanks for the tip, the con of this method is that I have to do that each time I upgrade Xonotic as such files are deleted during updating.

To prevent the rsync updater deleting your files, you can modify the rsync script and add a line like
excludes="$excludes --exclude=/your_file"
to your architecture section.

Again, I´m bumping into this problem but now while using Windows. What I want to do is launching the game via a batch file and immediately load some map. I tried this...
C:/path/to/xonotic/executable -basedir C:/path/to/xonotic/ +chmap stormkeep
.. but the Xonotic console tells me that it can´t load some compressed files and that it needs zlib.dll (or something like that) to work properly. I guess that it has some dependancy struggle, but how can I fix that?

Launch the executable from the game directory and omit basedir:
cd C:/path/to/xonotic/
executable +chmap stormkeep
The reason for this is that dll files are included in the basedir, but these are loaded from the current directory, which is why you first have to set the current directory.

Thank you, it works!

Though I should mention that you have to use backslashes, otherwise the commandline fails to read the path (because it´s not UNIX).

Still, Mr. Bougo rocks!

Possibly Related Threads...
Thread Author Replies Views Last Post
Question [NEED HELP] Certain maps crash my game :( flexo 4 1,361 12-07-2020, 09:25 AM
Last Post: Ecthelion
  [NEED HELP] cant start the game/ session lock problem skyghost47 1 309 10-24-2020, 11:50 PM
Last Post: BuddyFriendGuy
  [NEED HELP] Sound dissapears mid game mastablasta 0 226 10-01-2020, 12:27 PM
Last Post: mastablasta
Exclamation [SOLVED] macOS Sierra: -basedir /path/to/game iqxonotic 11 32,816 09-09-2020, 02:04 PM
Last Post: dixius99
  [SOLVED] Textures don't load at other side of warpzone bananovenc 6 676 06-11-2020, 12:56 PM
Last Post: bananovenc
  [BUG] some textures won't load with git builds lister 2 1,021 01-17-2020, 06:09 PM
Last Post: LuckyStripe
  [BUG] The game seems doesn't recognize virtual 7.1 noctiveqc 2 900 02-17-2019, 02:10 AM
Last Post: martin-t
Exclamation [BUG] *ubuntu 18.04/nVidia v415-Desktop Screen Corruption After Exiting Game? JeZxLee 2 1,328 01-06-2019, 05:15 AM
Last Post: SpiKe
  [NEED HELP] Custom Game Modes 3agle427 5 1,554 12-30-2018, 12:44 AM
Last Post: Lyberta
  [SOLVED] Menu fails to load after recent update Bloodthorn 2 1,222 09-25-2018, 08:11 AM
Last Post: Bloodthorn

Forum Jump:

Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-