Announcement

Collapse
No announcement yet.

virtuoso_q1 gamepack for NetRadiant

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    all you are doing is adding -rogue before -game, that's the only difference in the command line that you gave me.

    The run.bat is not as complicated as it looks

    the first line says "change the directory to one level up from the folder this bat is in"

    so if you have C:/Quake/Virtuoso/run.bat
    when you run the bat it will change the working directory to C:/Quake/ (which is where the engine is)

    The next line is a dynamic command line that is provided by the build menu

    default_build_menu.xml
    Code:
    <var name="Engine">darkplaces.exe</var>
    <var name="Run">"[EnginePath]/Virtuoso/run.bat</var>
    
    <build name="Run Map">
        <command>[Run] [Engine] [GameName] "[MapFile]"</command>
    </build>
    The Run Map option works like this:

    1) run.bat is started and 3 variables are stuck in it

    variable 1: [Engine] - this is a token that is defined at the top of your build menu
    variable 2: [GameName] - this is determined by your game pack and in this case will always be Virtuoso
    variable 3: "[MapFile]" - this is the full qualified path to your map

    Those three variables are considered %1, %2 & %3 by the bat. Where a little bit of confusion may arise is, there is no %3 in the bat, but actually there is. %~n3 is %3 with a ~n in it. ~n means strip the file extension and path from whatever %3 is.

    and that's it. It's really a very simple script. It just grabs the vars you put in and places them in the right spot to a complete a proper command line for the engine. Then it executes that line.

    RE:

    %1 = [Engine] = darkplaces.exe (by default)
    %2 = [GameName] = Virtuoso (by default with the virtuoso game pack)
    %~n3 = "[MapFile]" = C:/Quake/Virtuoso/maps/yourMap.map (apply ~n) = yourMap

    Code:
    cd /d %~dp0..\
    %1 -game %2 +map %~n3
    becomes
    Code:
    cd C:/Quake
    darkplaces.exe -game Virtuoso +map yourMap
    @cd C:/Quake - this is a bit of a poetic example. As I stated earlier it is really going up one directory level from wherever run.bat is stored. In the case of virtuoso, run.bat is stored one directory level deeper than the engine. So the cd line is really just trying to get to the engine directory and always will as long as virtuoso is on the same level as ID1.

    cd - change directory
    /d - directory
    %~dp0 - this program (ie run.bat)
    ..\ - go back one directory level
    Last edited by MadGypsy; 09-24-2013, 03:23 PM.
    http://www.nextgenquake.com

    Comment


    • #32
      Upgraded Run Map Script

      run.bat
      Code:
      cd /d %~dp0..\
      
      if "%4"=="" goto REG
      if not "%4"=="" goto SPC
      
      :REG
      %1 -game %2 +map %~n3
      EXIT
      
      :SPC
      %1 %4 -game %2 +map %~n3
      EXIT
      Whew, this script is getting long.

      This is simple. We just check to see if a 4th variable exists. If it doesn't then the script hops to :REG, executes a command line and then exits the command shell. If %4 does have a value, the script hops to SPC and executes a command line that incorporates the value of %4. Now we need to go add a 4th variable to some new Run Map builds in the build_menu.


      Open whatever build_menu.xml you are using. Below the "Run Map" build, paste in the following code and save the document.
      Code:
      	<build name="Run Rogue Map">
      		<command>[Run] [Engine] [GameName] "[MapFile]" -rogue</command>
      	</build>
      	<build name="Run Hip Map">
      		<command>[Run] [Engine] [GameName] "[MapFile]" -hipnotic</command>
      	</build>
      This is also very simple. It is just a copy/paste of Run Map but, the name has been changed and the (%)4th variable that we need has been added (-rogue/-hipnotic).

      That's it. You should have 3 Run Map options now when you open radiant.

      After running a map, you can also check junk.txt to see if the switches were accepted by darkplaces.

      I'll included these changes in future releases of virtuoso.
      Last edited by MadGypsy; 09-24-2013, 08:31 PM.
      http://www.nextgenquake.com

      Comment

      Working...
      X