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
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.
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.
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.
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.
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!
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.
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
Question [NEED HELP] After a successful build & compile (0.8.5): This script is not properly set up yet. John 1 1,110 01-27-2024, 12:07 AM
Last Post: John
  Why ClanArena ends after round 6 despite server setting to infinite? zwz 2 2,224 08-11-2023, 10:20 AM
Last Post: zwz
  [NEED HELP] Models, items, and sky black after 0.8.5 update htsm92 0 900 08-15-2022, 07:34 PM
Last Post: htsm92
  [NEED HELP] Menu Won't Load, Game Crashes EdwardHamHam 1 3,210 07-21-2022, 01:44 AM
Last Post: BuddyFriendGuy
  [SOLVED] reload map changes in game Nyx 6 2,961 08-19-2021, 12:46 PM
Last Post: Julius
  [NEED HELP] Load my cfg file Rage_ATWM 1 1,345 05-12-2021, 01:01 PM
Last Post: Rage_ATWM
  [NEED HELP] Change mapinfo to make a CTF map a CTS map. Bhagwa-Yodhak-69 3 2,687 09-08-2020, 06:03 AM
Last Post: _para
  [SOLVED] Textures don't load at other side of warpzone bananovenc 6 3,540 06-11-2020, 12:56 PM
Last Post: bananovenc
  [BUG] some textures won't load with git builds lister 2 2,773 01-17-2020, 06:09 PM
Last Post: LuckyStripe
Exclamation [BUG] *ubuntu 18.04/nVidia v415-Desktop Screen Corruption After Exiting Game? JeZxLee 1 3,390 01-06-2019, 05:15 AM
Last Post: SpiKe

Forum Jump:


Users browsing this thread:
1 Guest(s)

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