Jump to content

Guide for publishing mods on mod.io


Itms
 Share

Recommended Posts

If you want your mod to be available in the 0 A.D. mod downloader, you need to follow these steps.

1) Prepare your mod as explained in the Modding Guide. You should end up with a .zip file. If you created a .pyromod file, copy it and rename the copy to modname.zip so it can be uploaded on mod.io.

2) Sign up or login on mod.io. Go to Mods > Add Mod, and specify 0 A.D. in the field Game. Add all the information you want to make available for visitors. Complete the submission steps until your mod is shown as waiting for moderator approval.

3) When you are ready, send me a PM here on the forums, or an email. I will get the mod from mod.io, test it and take a look at its code. When I have checked the mod is not dangerous, I will sign the file. I will answer the PM/email with the signature. I can also report bugs in the mod, and mistakes you may have made when uploading the file on mod.io.

Important Notice:
Wildfire Games signs mods in order to mitigate the attacks that can be conducted against file repositories and the clients that download from them. Signing a file does not imply that the mod is official, nor that Wildfire Games participated in its creation in any way. It does not mean that it is exempt of bugs or oversights either. The only guarantee signing brings is that the file you are downloading is exactly the one that the signatory tested.

4) I will put the signature in the metadata of the file on mod.io, then make the mod live. Right after this is done, your mod will appear in the mod downloader!

Happy modding B)

  • Like 16
Link to comment
Share on other sites

  • Itms pinned this topic

Common Mistakes:

  • name/label confusion in mod.json - for instance https://0ad.mod.io/ja-lang
    • "name" should be a lowercase identifier, it usually matches the URL of your mod on mod.io: for instance "ja-lang"
    • "label" is a human-readable name, it usually matches the title of the mod on mod.io: for instance "Japanese Language Pack"
  • top-level extra directory. Your zip should contain directly mod.json and the rest of the files, it should not contain a sub-directory with the files. The best way to avoid the issue is to use the archive builder. In order to test whether you made the mistake, try opening the mod with 0 A.D. If you land on the mod selection page and your mod was added to the list (appearing in green), things are good.
  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...
  • 7 months later...

Hello folks, I am trying to make a build using the modding guide but my output is an empty compressed file, can someone help?

This is the command I am using (using `.pyromod` extension fails too):

 

pyrogenesis -mod=balanced-maps -archivebuild=~/.local/share/0ad/mods/balanced-maps -archivebuild-output=balanced-maps.zip -archivebuild-compress

 

Edited by badosu
Link to comment
Share on other sites

3 hours ago, badosu said:

Hello folks, I am trying to make a build using the modding guide but my output is an empty compressed file, can someone help?

This is the command I am using (using `.pyromod` extension fails too):

 


pyrogenesis -mod=balanced-maps -archivebuild=~/.local/share/0ad/mods/balanced-maps -archivebuild-output=balanced-maps.zip -archivebuild-compress

 

Pretty sure ~ won't work try the absolute path :)

Link to comment
Share on other sites

  • 1 year later...
  • 5 weeks later...
  • 2 years later...
On 03/04/2019 at 3:15 PM, Itms said:

Common Mistakes:

  • name/label confusion in mod.json - for instance https://0ad.mod.io/ja-lang
    • "name" should be a lowercase identifier, it usually matches the URL of your mod on mod.io: for instance "ja-lang"
    • "label" is a human-readable name, it usually matches the title of the mod on mod.io: for instance "Japanese Language Pack"
  • top-level extra directory. Your zip should contain directly mod.json and the rest of the files, it should not contain a sub-directory with the files. The best way to avoid the issue is to use the archive builder. In order to test whether you made the mistake, try opening the mod with 0 A.D. If you land on the mod selection page and your mod was added to the list (appearing in green), things are good.

Example sh-script . maybe need adapted / changed a bit that may help somebody:

#!/bin/bash

# This script performs the following actions:
#
# Extracts the value of the mod_name variable from the mod.json file using the jq command-line tool.
# Removes the existing ${mod_name}_temp directory and creates a new one.
# Copies directories directly within the copy_dir_from directory to the ${mod_name}_temp directory.
# Copies non-hidden files from the copy_dir_from directory to the mod_temp directory, excluding specific files.
# Creates a zip file (${mod_name}_temp.zip) for the mod by compressing the contents of the ${mod_name}_temp directory.
# Creates a second temp directory (autocivP_temp2) and copies the mod.json file and the ${mod_name}_temp.zip file into it.
# Creates a zip file (${mod_name}.zip) for the mod by compressing the contents of the ${mod_name}_temp2 directory.
# Opens a web browser (Firefox) with a specific URL related to the mod.
# Note: The script assumes that the jq command-line tool is installed and to run it from inside your mod

# use this from inside your mod folder

#!/bin/bash

# links:
# https://wildfiregames.com/forum/topic/24333-guide-for-publishing-mods-on-modio/?do=findComment&comment=554945
# may some interesting stuff also here: https://github.com/ModIO/

# alternative may you want create mods also by using this script that use pyrogenesis:
# rm ~/Downloads/autocivP.pyromod
# rm ~/game/0ad/a27/a27build/binaries/system/autocivP.pyromod
# cd ~/game/0ad/a27/a27build/binaries/system/
# ./pyrogenesis -mod=mod -mod=public -mod=autocivP -archivebuild=/home/seeh/.local/share/0ad/mods/autocivP -archivebuild-output=autocivP.pyromod -archivebuild-compress
# cp ~/game/0ad/a27/a27build/binaries/system/autocivP.pyromod ~/Downloads/autocivP.pyromod
# rm ~/game/0ad/a27/a27build/binaries/system/autocivP.pyromod
# cp ~/Downloads/autocivP.pyromod ~/Downloads/autocivP.zip
# doublecmd ~/game/0ad/a27/a27build/binaries/system/ ~/Downloads/


# This SH-script performs the following actions:
#
# Extracts the value of the mod_name variable from the mod.json file using the jq command-line tool.
# Removes the existing ${mod_name}_temp directory and creates a new one.
# Copies directories directly within the copy_dir_from directory to the ${mod_name}_temp directory.
# Copies non-hidden files from the copy_dir_from directory to the mod_temp directory, excluding specific files.
# Creates a zip file (${mod_name}_temp.zip) for the mod by compressing the contents of the ${mod_name}_temp directory.
# Creates a second temp directory (autocivP_temp2) and copies the mod.json file and the ${mod_name}_temp.zip file into it.
# Creates a zip file (${mod_name}.zip) for the mod by compressing the contents of the ${mod_name}_temp2 directory.
# Opens a web browser (Firefox) with a specific URL related to the mod.
# Note: The script assumes that the jq command-line tool is installed and its run inside your mod folder

clear

# Extract the value of the mod_name variable from mod.json
mod_name=$(jq -r '.name' mod.json)

echo "${mod_name}"
# clear

dir_mod="$PWD"
dir_mods="$PWD/.."
dir_temp="${dir_mods}/${mod_name}_temp"
echo "41: dir_temp= $dir_temp"
dir_temp2="${dir_mods}/${mod_name}_temp2"

# Clean the file path
dir_mod=$(realpath "$(readlink -f "$dir_mod")")
dir_mods=$(realpath "$(readlink -f "$dir_mods")")
echo "47: dir_temp= $dir_temp"
dir_temp=$(realpath "$(readlink -f "$dir_temp")")
dir_temp2=$(realpath "$(readlink -f "$dir_temp2")")

echo "PWD= $PWD"
echo "dir_mod= $dir_mod"
echo "dir_mods= $dir_mods"
echo "53: dir_temp= $dir_temp"
echo "53: dir_temp2= $dir_temp2"

#!/bin/bash

# use this from inside your mod

# Remove existing autocivP_temp directory and create a new one
rm -rf $dir_temp
mkdir $dir_temp

copy_dir_from="${dir_mod}" # Use absolute path of the source directory
echo "copy_dir_from= $copy_dir_from"


# Copy directories directly within $copy_dir_from
find $copy_dir_from/* -maxdepth 0 -type d -exec cp -r {} $dir_temp \;


# Copy non-hidden files, excluding tempList.text and tsconfig.json
find $copy_dir_from -maxdepth 1 -type f -not -name ".*" -not -name "tempList.text" -not -name "tsconfig.json"  -not -name "error_unsolved.txt" -exec cp {} $dir_temp \;

# Display the directories within autocivP_temp
# find $dir_temp -type d

echo ${dir_mod}
echo ${dir_mods}


# Display the current working directory
pwd

# List the files and directories within autocivP_temp
# ls -l $dir_temp

# Count the number of files and folders in autocivP_temp (excluding the autocivP_temp directory itself)
num_files=$(find $dir_temp -type f | wc -l)
num_folders=$(find $dir_temp -type d | wc -l)
num_folders=$((num_folders - 1))
echo "Number of files in ${dir_temp}: $num_files"
echo "Number of folders in ${dir_temp}: $num_folders"

# Create a zip file for mod
rm -rf ${dir_mods}/${mod_name}_temp.zip
rm -rf ${dir_mods}/${mod_name}.zip

cd ${dir_temp}
echo "zip -r ${dir_mods}/${mod_name}_temp.zip ."
zip -r ${dir_mods}/${mod_name}_temp.zip .


# Create a second temp directory
rm -rf $dir_temp2
mkdir $dir_temp2

# Copy the mod.io file to the second temp directory
cp ${dir_mod}/mod.json $dir_temp2

# Copy the ${mod_name}_temp.zip to the second temp directory
cp ${dir_mods}/${mod_name}_temp.zip $dir_temp2/${mod_name}.zip

# Zip the autocivP_temp_2 directory
# echo dir_temp2=/absolute/path/to/${mod_name}/$dir_temp2

sleep 1
cd ${pwd}
sleep 1
cd $dir_temp2
sleep 1
zip -r ${dir_mods}/${mod_name}.zip .

# Sleep for 1 second before continuing
sleep 1

firefox https://mod.io/g/0ad/m/${mod_name}

 

Edited by seeh
  • Like 2
Link to comment
Share on other sites

please somebody test this script ( modBuildScript.sh ). for me the results looks good and it also works inside 0ad as expected. @andy5995 @Atrik@Lopess @Itms , ( thanks @andy5995 for the this GitHub action . i should look at this later. ty very much )

Preparing for mod.Io upload:


when i create it by using Pyromod first, means using my createAutoCivPyromod.sh

alias cdCreateAutoCivPyromod    "cd ~/.local/share/0ad/; pwd; ./createAutoCivPyromod.sh"

rm ~/Downloads/autocivp.pyromod
rm ~/game/0ad/a27/a27build/binaries/system/autocivp.pyromod
cd ~/game/0ad/a27/a27build/binaries/system/
./pyrogenesis -mod=mod -mod=public -mod=autocivp -archivebuild=/home/seeh/.local/share/0ad/mods/autocivp -archivebuild-output=autocivp.pyromod -archivebuild-compress
cp ~/game/0ad/a27/a27build/binaries/system/autocivp.pyromod ~/Downloads/autocivp.pyromod
rm ~/game/0ad/a27/a27build/binaries/system/autocivp.pyromod
cp ~/Downloads/autocivp.pyromod ~/Downloads/autocivp.zip
doublecmd ~/game/0ad/a27/a27build/binaries/system/ ~/Downloads/

 thats the results created by createAutoCivPyromod.sh

 

that the results look different -> thats the results created by my modBuildScript.sh :

when i activate in 0ad it (autocivp_temp or autocivp_temp2 - folder)  0ad it works like expected ( some told me e.g. @Manimal  it should be a zip inside this zip for the modIo upload. i was seeing some do so. i not sure .... maybe the autocivp_temp.zip is best? idk)

 

UPDATE ( 23-0803_1914-00 ) :

compare to https://mod.io/g/0ad/m/autociv/autociv_v26.0.1.2.zip (left) to autocivp_temp2.zip ( right )

,

==> conclusion. The claim that there should be a zip in the zip is probably wrong when it comes to preparing a zip file for the upload to mod.io 
if this conclusion is correct then: 1) i simple could use the autocivp_temp2.zip produced by the modBuildScript.sh( i will do this now: ..api.mod.io/..3105810..4124897 )
2 ) ..._temp2.zip in the modBuildScript.sh script should be renamed to ..._readyForUploadToModIo.zip

Example of this claim:

 

modBuildScript.sh

modBuildScript-updated_at_23-0803_1948-59.sh

Edited by seeh
Link to comment
Share on other sites

On 03/08/2023 at 3:33 AM, seeh said:

it should be a zip inside this zip for the modIo upload.

No, if you have a .pyromod file with the correct directory structure, just rename the file so it has a .zip extension (and remove the .pyromod extension).

See Distributing Your Mods

If you think something is missing from the docs, you might want to consider adding it.

Your script looks overly-complicated imo. This is the script used by the GitHub action:

entrypoint.sh

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

 

 

On 13/05/2018 at 6:38 PM, Itms said:

Signing a file does not imply that the mod is official, nor that Wildfire Games participated in its creation in any way. It does not mean that it is exempt of bugs or oversights either. The only guarantee signing brings is that the file you are downloading is exactly the one that the signatory tested.

4) I will put the signature in the metadata of the file on mod.io, then make the mod live. Right after this is done, your mod will appear in the mod downloader!

Happy modding B)

interesting. i understood it means hmmm:

When a file is signed, it means that
- someone has checked and confirmed that the file is safe and hasn't been changed.
-- But just because a file is signed doesn't mean it's official or perfect.
- It only means that the signed file is the same one that was tested by the signer.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...