BuildMod: Command line vmod creation

Discussion in 'Other' started by Noel Hibbard, Feb 5, 2015.

  1. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    At VEC when I run our batch build process it takes all the loose files from our ModDev folder, builds new MAS files and then packages them into new rfcmp files. The one thing I was sort of doing by hand was creating the vmod. Yesterday I decided it was time to fully automate that too. I wanted to share this tool incase others could find it useful.

    The tool reads an INI file that has all the details about your vmod such as mod name, DataPath, Output path, author name, ect ect. Here is a simple INI file:
    Code:
    [Config]
    DataPath=C:\Users\noelh\Documents\rFactor2\VECDev
    OutputPath=C:\Users\noelh\Dropbox\VECPackages
    ModMgrPath=C:\Users\noelh\Documents\rFactor2\VECPackaging\Tools\ModMgr.exe
    ModName=VEC
    Author=VirtualEndurance.net
    URL=http://VirtualEndurance.net
    DescriptionPath=VECDesc.txt
    rfmPath=VEC.RFM
    iconPath=VEC.DDS
    ComponentListPath=VECComponents.txt
    
    The paths in this file are relative to the working directory of BuildMod.exe. DescriptionPath points to a text file which contains the information that you would like to include in the description section of the vmod. ComponentListPath points to a text file that contains the list of components that you would like to include in the vmod. Here is an example:
    Code:
    VEC_Mid-Ohio
    URD_sounds
    VECSounds
    URD_C6r_ZR1
    URD_EGT_AM
    URD_EGT_Bayro
    URD_EGT_Darche
    URD_EGT_Ferruccio
    URD_EGT_Venom
    VEC_P1_919
    VEC_P1_R18
    VEC_P1_TS040
    VEC_P2_Lola
    VEC_URD_BMWZ4
    VEC_URD_C6RZR1
    VEC_URD_F458
    VEC_URD_P997
    VEC_URD_Vantage
    VEC_URD_ViperGTSR
    
    The version number isn't mandatory in this list because it will always grab the latest version of each component. So if you have several versions of a component installed, keep in mind that it will always grab the ones with the highest version number. If you would like to force it to use a specific version of a component then include the version number. Ex: VEC_Mid-Ohio 16.0304. Also, all teams are automatically included and all track layouts are automatically included. This tool was created mostly for my own work flow and all our components are custom for the league so we never need to exclude teams or layouts from our components.

    rfmpath and iconpath need to point to the icon/rfm that you want to use. Here is a zip with the default rfm/icon if your league doesn't have their custom files:
    https://www.dropbox.com/s/lbiq6d5gebp9n4e/Default-rFM-Icon.zip?dl=0

    Output path points to the folder where you want to store the final rfmod file. I point it to our Dropbox folder so it syncs to our race server and is ready for GetMod.

    The vmod version numbers are automated based on the date (YY.MMDD). For example today if I created a vmod it would have this version number. 15.0205. After creating a vmod with this tool it will then update the INI file with the last used version number. So if you create a second vmod on the same day it is smart enough to increment it for you. So it would get a version number like this: 15.02051... then 15.02052... If you build a mod tomorrow it would get 15.0206 and so on. This is just one last thing for admins to keep track of.

    The command line options look like this:
    Code:
    BuildMod --config=<pathToINI>
    You can optionally add --install=yes if you would like the tool to also install the vmod into the DataPath specified in the INI file. One less step for admins.

    Another optional parameter is --modname=<modname>. This option will override the modname specified in the INI file. I would use this if I want to make a vmod for a test server with a different name but with the same components.

    There is also an optional --version parameter if you would like to use your own version number in place of the automated version numbering scheme. Example: --version=1.23

    The vmod filename will look like this <modName>_v<versionNum>.rfmod. So for example: VEC_v15.0205.rfmod.

    You can download the tool here:
    https://www.dropbox.com/s/ahg4usy6hblkiid/BuildMod.zip?dl=0
    Hopefully this works well for others.

    Version History:
    1.0.0.0 - First release
    1.0.1.0 -
    • Added support for alpha characters in component version numbers.
    • Added the ability to specify an exact version number in the components list. Ex: "VEC_Mid-Ohio 16.0304".
    • Added support for the new packaging command line options in modmgr in 1052+.

    Click here to donate
     
    Last edited by a moderator: Feb 6, 2015
  2. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    I take that, thank you !!
     
  3. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Hi, I tested and I have an issue.

    And a request for a future version, is it possible to add the parameter --version= to be able to define what we want. Because I force the version on my rfmod linked to the vehicle component I include.
    Example : BuildMod.exe --config=myMod.ini --version=0.5700

    The issue (I think it's with ISI_Silvertone 1.35), (I use an old ModManager because of lost of vehiclue issue) :

    Exception non gérée*: System.InvalidCastException: La conversion de la chaîne "1
    .35" en type 'Double' n'est pas valide. ---> System.FormatException: Le format d
    e la chaîne d'entrée est incorrect.
    à Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value
    , NumberFormatInfo NumberFormat)
    à Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, N
    umberFormatInfo NumberFormat)
    --- Fin de la trace de la pile d'exception interne ---
    à Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, N
    umberFormatInfo NumberFormat)
    à BuildMod.Module1.Main()
     
  4. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I have to extract all the MAS files one be one looking for the GDB file to generate a list of layouts. It's possible that Silverstone has some encrypted MAS files which I didn't account for. I will look into this when I get to the office. I will also add --version.
     
  5. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Thank you.
     
  6. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    In US we would write a decimal point like 1.35... In a lot of Europe they would write the number like 1,35. So with my language settings you can convert a string like "1.35" to a decimal just fine. But if your language settings use a , for a decimal point then this string conversion fails. I've had this problem on something else I wrote and took a looooong time to track down. I am sort of taking a guess but I think this is what is going on in your case. Can you confirm if your language settings use a , for a decimal point?
     
  7. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    I don't know how to check this, but for sure it's a French Windows so configured with , for decimal by default I suppose.
     
  8. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I think I have it fixed. Give it a shot and let me know. I also added --version=0.5700 for you. Just download a new copy using the link in the first post.

    Thanks for the bug report.
     
  9. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    File generated with success (and with specific version :) ). Thank you.
    I test now if working online with all available team in the mod.
     
  10. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    The part is unfortunately out of my hands. It's the MAS2 tool that drops the teams and my tool simply generates the pkginfo.dat file and hands it off to MAS2 to mess up. :) So if it's missing teams.... don't yell at me. Hahaha.

    I have found that MAS2 from 798 doesn't have this bug. Right now my tool looks in <DataPath>\Support\Tools for MAS2.exe. Maybe I will change it a little to fisrt look for it in the same folder where you have BuildMod.exe. If it doesn't exist there then look in the Support folder for it. That way you can keep the old 798 version for use with BuildMod.
     
  11. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    All working well. I use an old version to avoid this kind of not yet fixed issue. I confirm again, the downloading of rfmod with a passworded server don't work on b910. With no password, working well.

    Thank you for your tools, now I'm full Noel Tools equipped to managed mods and install and auto-install :)
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I just updated the tool to first look in the same folder as buildmod for mas2.exe. This way my tool can use an older version of MAS2 without having to overwrite the one in your normal DataPath.

    If you want this version, just download again from the link in the first post.

    BTW, I have tried very hard to duplicate the server password problem and for the life of me I can't duplicate it. I've tried multiple servers using independent installs and I've tested multiple servers using a single install with multiple player profiles. Both of them work flawless with passwords. You aren't the only one with this problem so it's odd I am having a hard time duplicating it.

    We should continue to talk about this in this thread:
    http://isiforums.net/f/showthread.php/23265-no-password-downloads-mod-Password-mod-download-failed

    Maybe between you and Rich we can figure out what is going on here.
     
  13. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Yes, I will post here to give some details.
    I tried to get the build 798; but the archive link don't work now :( : http://rfactor.net/web/rf2/rfactor-2-downloads-archive/

     
  14. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
  15. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
  16. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    New version has been released. It no longer uses MAS2 to build the mod. In 1052 and newer ISI added new packaging command line options to modmgr.exe so I can now build a mod without doing unreliable UI automation of MAS2. I also added support for components with alpha characters in their version numbers. I also added the ability to force the tool to pick up a specific version of a component by including the version number in the components list.
     
  17. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Thank you, tested OK !!! :)
     
  18. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Hi Noel!

    Thank you for this great tool. I am trying to make it work but getting the following error, any ideas what it could be?

    Thanks mate :)

    upload_2016-12-30_14-57-54.png
     
  19. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    OK, it seems that if component name has a space, then it crashes. So then I found a track with no space in the name, it stops at 69% and the vmod is 0Kb...any idea why?

    Thanks!

    upload_2016-12-30_15-5-12.png
     

Share This Page