Invoking Nex in BASH script

Discuss anything to do with Nexuiz here.

Moderators: Nexuiz Moderators, Moderators

Thu Nov 27, 2008 10:43 am

  • I'm wanting to make a script to capture & encode demos. The encoding part is done, I just have 2 issues. Opening nex & running a timedemo, it'll close once done, this doesn't happen with playdemo, it waits for further input. Also some demos need reloading on initialisation to display the map.

    So how do I automatically quit after, "/path/to/nexuiz/nexuiz-linux-glx.sh -benchmark +forceqmenu 1 +cl_capturevideo 1 +cl_capturevideo_fps 24 +playdemo demos/team/test.dem" ?

    & anything to overcome the occasional missing map on the 1st initialisation?

    Any suggestions would be appreciated.
    lost
    Member
     
    Posts: 36
    Joined: Fri Jun 27, 2008 9:12 pm

Thu Nov 27, 2008 3:19 pm

  • You may not need a shellscript to do this. data/quake.rc can be used to queue demos that you want:

    startdemos demos/demo1 demos/demo2 demos/demo3....

    How about:
    startdemos demos/demo1
    cl_capturevideo 0
    cl_capturevideo 1; startdemos demos/demo2
    cl_capturevideo 0
    cl_capturevideo 1; startdemos demos/demo3
    cl_capturevideo 0

    Or something similar?
    Ed
    Forum addon
     
    Posts: 1172
    Joined: Wed Mar 01, 2006 12:32 am
    Location: UK

Thu Nov 27, 2008 3:56 pm

  • lost wrote:Also some demos need reloading on initialisation to display the map.

    Move these maps from your "data/dlcache" folder to "data" to fix this.
    User avatar
    [-z-]
    Site Admin and Nexuiz Ninja
     
    Posts: 1794
    Joined: Mon Nov 13, 2006 12:20 am
    Location: Florida

Thu Nov 27, 2008 5:02 pm

  • Thank you [-z-], the maps are now loading flawlessly.

    Ed, that was something that I was unaware of, thanks for the insight.

    All I need now is the ability to exit Nexuiz once a single demo has been played, much like what happens when you invoke Nex via the cli to run a timedemo.

    Further suggestions would be greatly appreciated.

    Thanks again.
    lost
    Member
     
    Posts: 36
    Joined: Fri Jun 27, 2008 9:12 pm

Sat Nov 29, 2008 11:42 am

  • Maybe you should have a look at this:
    http://svn.icculus.org/nexuiz/trunk/mis ... iew=markup

    IIRC it is editing the demo so you specify a start and end time. The demo is modified to have a very fast slowmo value until you get to the time you want, then it is set back to "slowmo 1" and capturing starts (so the DEMO gets the cl_capturevideo 1 thing somehow ... injected ... I dunno how to express it).

    If you have a look at that script you can see at which places it injects "cl_capturevideo 0". you could edit it so that it also injects a "quit" command so that Nexuiz automatically closes after the recording was done.

    I'm sure divverent can give you more hints about this.

    Actually a tutorial on how to use it and how it works would be cool (for the ones who aren't smart enought to decipher the code in that script on their own, such as me)
    IRC quote:
    [kojn] I've been coming a bit more recently
    [kojn] she took it the dirty way
    GreEn`mArine
    Forum addon
     
    Posts: 1509
    Joined: Tue Feb 28, 2006 9:33 pm
    Location: Germany

Mon Dec 01, 2008 10:48 am

  • Thank you, that looks good. :)
    lost
    Member
     
    Posts: 36
    Joined: Fri Jun 27, 2008 9:12 pm

Mon Dec 01, 2008 11:15 am

  • Injecting a quit is not necessary.

    The "black map when playing back demos" problem in the engine is worked around now, so if the map is in dlcache, the demo will find it.

    Then, you simply play back the demo using the -demo command line option. That will automatically quit when the demo is over.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Mon Dec 01, 2008 1:12 pm

  • -demo

    It felt as though I was missing something simple. It works great, thank you divVerent.
    lost
    Member
     
    Posts: 36
    Joined: Fri Jun 27, 2008 9:12 pm

Mon Dec 01, 2008 11:03 pm



Return to Nexuiz - General Discussion




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest