Create an account


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

#1
There is a way to start Xonotic via a command in your shell/terminal:
Code:
/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?
Reply

#2
/path/to/xonotic +chmap mapname

EDIT: you can pass any command or cvar that way. xonotic +bot_number 1 +chmap mapname
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

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

#4
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
Reply

#5
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.
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

#6
(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
Reply

#7
Indeed. The shell script accepts the same parameters anyway.
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

#8
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.
Reply

#9
Maddin, how did you install Xonotic? Unless you're using a non-default basedir you shouldn't need to specify it.
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

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

#11
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.
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

#12
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
Reply

#13
Why don't you use xonotic-linux-glx.sh or xonotic-linux-sdl.sh? These are meant to select the right build and basedir for you!
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

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

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

Edit:

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.
Reply

#15
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
Reply

#16
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.
Reply

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

#18
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...
Code:
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?
Reply

#19
Launch the executable from the game directory and omit basedir:
Code:
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.
[Image:http://i.imgur.com/4XODR.png]640K ought to be enough for anybody.
     ― Linux Torvalds
Reply

#20
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!
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  [BUG] some textures won't load with git builds lister 1 218 06-27-2019, 05:41 PM
Last Post: lister
  [BUG] The game seems doesn't recognize virtual 7.1 noctiveqc 2 298 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 414 01-06-2019, 05:15 AM
Last Post: SpiKe
  [NEED HELP] Custom Game Modes 3agle427 5 568 12-30-2018, 12:44 AM
Last Post: Lyberta
  [SOLVED] Menu fails to load after recent update Bloodthorn 2 528 09-25-2018, 08:11 AM
Last Post: Bloodthorn
  [SOLVED] Game displays [x] joined the [y] team upon connecting Bloodthorn 3 700 09-17-2018, 01:52 AM
Last Post: Lyberta
Exclamation [SOLVED] macOS Sierra: -basedir /path/to/game iqxonotic 8 10,653 09-08-2018, 05:55 AM
Last Post: ComicsNights
  [SOLVED] Cannot run game anymore after new git update Bloodthorn 2 639 07-25-2018, 07:20 AM
Last Post: Bloodthorn
  [NEEDS INFO] Game Crash On Load Castor 0 721 05-31-2018, 09:06 AM
Last Post: Castor
  [SOLVED] Xonotic load downloaded maps Bla1 3 1,802 10-01-2017, 06:11 PM
Last Post: Mirio

Forum Jump:


Users browsing this thread:
1 Guest(s)

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