From cd308e1f9629a6bff0dcde225bd12a983a05dba5 Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Sun, 24 Dec 2023 11:19:09 -0800 Subject: [PATCH] Fix cfgGameplay.json hack. Update docs. --- files/mods/3115714092/README.md | 47 ++++++++++++++++++++++++++++----- server/bin/dz | 14 +++++++--- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/files/mods/3115714092/README.md b/files/mods/3115714092/README.md index 0ab340f..25b48f9 100644 --- a/files/mods/3115714092/README.md +++ b/files/mods/3115714092/README.md @@ -5,14 +5,47 @@ The files used to integrate the [HypeTrain mod](https://steamcommunity.com/sharedfiles/filedetails/?id=3115714092) came from [here](https://steamcommunity.com/workshop/filedetails/discussion/3115714092/4032475029247848861/). -## Install +## Mod Integration Files -5 files are required to run the mod. Two are map-specific and the rest are common to all maps. They are: +5 files are required to run the mod. Two are map-specific and the rest are common to all maps: -* `cfgeventgroups.xml` - This is map-specific. The one included in this repository is for Chernarus. -* `cfgeventspawns.xml` - Same as above. -* `cfgspawnabletypes.xml` - Common to all maps. -* `events.xml` - Common to all maps. -* `types.xml` - Common to all maps. +These are map-specific. The ones included in this repository is for Chernarus. +* `cfgeventgroups.xml` +* `cfgeventspawns.xml` + +These files are commong to all maps: + +* `cfgspawnabletypes.xml` +* `events.xml` +* `types.xml` The `start.sh` script is for doing extra stuff, but programatically. See the comments within it for details. + +## Generic Mod Installation (Windows) + +Using the [Central Economy](https://community.bistudio.com/wiki/DayZ:Central_Economy_mission_files_modding) method: + +* Create a new folder in your mpmissions map folder. Name it HypeTrain. +* Put the 3 files common to the server in that folder + +``` ++C:\ + +DayZ Server + +mpmissions + +dayzOffline.chernarusplus + +HypeTrain + -cfgspawnabletypes.xml + -events.xml + -types.xml +``` +Edit the server's `cfgeconomycore.xml` and add the following under ``: + +``` + + + + + +``` + +The other two files must be manually merged to the mpmissions equivalents: diff --git a/server/bin/dz b/server/bin/dz index 610c84d..0860c4d 100755 --- a/server/bin/dz +++ b/server/bin/dz @@ -146,6 +146,10 @@ mergexml(){ -o -name "cfgweather.xml" \ -o -name "init.c" \ \) -exec cp -v {} ${SERVER_FILES}{} \; + + # FIXME!!! HACK to account for cfgGameplay mixed case + cp ${MPMISSIONS}/${MAP}/cfggameplay.json ${MPMISSIONS}/${MAP}/cfgGameplay.json + # Follow https://community.bistudio.com/wiki/DayZ:Central_Economy_mission_files_modding # Remove any existing files, via the mod_ and custom_ prefixes rm -rf ${MPMISSIONS}/${MAP}/mod_* @@ -222,10 +226,11 @@ mergexml(){ fi echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" rm -f /tmp/x /tmp/y - jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x -# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json # FIXME: This is a hack to fix the JSON file, as it expects mixed case + jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/cfgGameplay.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json +# jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/wtf +# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json fi done # These are merged directly into the upstream file, but are C @@ -319,9 +324,10 @@ mergexml(){ fi echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" rm -f /tmp/x /tmp/y - jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x -# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json + jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/cfgGameplay.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json +# jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x +# mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json fi done if [[ ${FOUND} = 1 ]]