Update Winter Chernarus (Deer Isle, Livonia) metadata from updated instructions.

Add cfgGameplay.json hack.
Fix JSON formatting.
This commit is contained in:
Daniel Ceregatti 2023-12-15 22:13:20 -08:00
parent 3a5bb797ea
commit 1554520704
5 changed files with 41 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{ {
"WorldsData":{ "WorldsData":{
"environmentMinTemps": [-7.0, -5.0, -3.0, -2.0, 0.0, 2.0, 5.0, 10.0, 7.0, 5.0, 1.0, -2.0], "environmentMinTemps": [-7.0, -5.0, -3.0, -2.0, 0.0, 2.0, 5.0, 10.0, 7.0, 5.0, 1.0, -2.0],
"environmentMaxTemps": [-3.0, -1.0, 2.0, 5.0, 7.0, 10.0, 12.0, 16.0, 13.0, 10.0, 7.0, 2.0], "environmentMaxTemps": [-3.0, -1.0, 2.0, 5.0, 7.0, 10.0, 12.0, 16.0, 13.0, 10.0, 7.0, 2.0]
} }
} }

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<weather reset="1" enable="1"> <weather reset="0" enable="0">
<overcast> <overcast>
<current actual="0.10" time="900" duration="1200" /> <current actual="0.10" time="900" duration="1200" />
<limits min="0.6" max="1.0" /> <limits min="0.6" max="1.0" />
@ -14,7 +14,7 @@
</fog> </fog>
<rain> <rain>
<current actual="0.2" time="120" duration="240" /> <current actual="0.2" time="120" duration="240" />
<limit min="0.1" max="1.0" /> <limits min="0.1" max="1.0" />
<timelimits min="120" max="240" /> <timelimits min="120" max="240" />
<changelimits min="0.0" max="0.1" /> <changelimits min="0.0" max="0.1" />
<thresholds min="0.6" max="1.0" end="10" /> <thresholds min="0.6" max="1.0" end="10" />
@ -24,4 +24,4 @@
<params min="0.0" max="0.6" frequency="30" /> <params min="0.0" max="0.6" frequency="30" />
</wind> </wind>
<storm density="0.0" threshold="1.0" timeout="0"/> <storm density="0.0" threshold="1.0" timeout="0"/>
</weather> </weather>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<types>
<type name="WinterStash">
<nominal>0</nominal>
<lifetime>1209600</lifetime>
<restock>0</restock>
<min>0</min>
<quantmin>-1</quantmin>
<quantmax>-1</quantmax>
<cost>100</cost>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="1" deloot="0"/>
<category name="containers"/>
</type>
</types>

View file

@ -1,3 +1,4 @@
TYPES=local
INIT=local INIT=local
CFGGAMEPLAY=local CFGGAMEPLAY=local
CFGWEATHER=local CFGWEATHER=local

View file

@ -221,7 +221,9 @@ mergexml(){
echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" echo "Merge JSON '${WORKSHOP_DIR}/${ID}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'"
rm -f /tmp/x /tmp/y rm -f /tmp/x /tmp/y
jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${WORKSHOP_DIR}/${ID}/${var,,}.json > /tmp/x
mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json # mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
# FIXME: This is a hack to fix the JSON file, as it expects mixed case
mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json
fi fi
done done
# These are merged directly into the upstream file, but are C # These are merged directly into the upstream file, but are C
@ -243,6 +245,22 @@ mergexml(){
) )
fi fi
done done
# These are copied verbatim
for var in "CFGWEATHER"
do
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
then
if [[ ${FOUND} = 0 ]]
then
MODNAME=$(get_mod_name ${ID})
echo
echo -e "${green}Adding mod integration ${MODNAME}${default}"
FOUND=1
fi
echo "Copy -> '${WORKSHOP_DIR}/${ID}/${var,,}.xml' -> '${MPMISSIONS}/${MAP}/${var,,}.xml'"
cp ${WORKSHOP_DIR}/${ID}/${var,,}.xml ${MPMISSIONS}/${MAP}/${var,,}.xml
fi
done
done done
if [ -d ${SERVER_PROFILE}/custom ] if [ -d ${SERVER_PROFILE}/custom ]
then then
@ -292,7 +310,8 @@ mergexml(){
echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'" echo "Merge JSON '${SERVER_PROFILE}/custom/${dir}/${var,,}.json' -> '${MPMISSIONS}/${MAP}/${var,,}.json'"
rm -f /tmp/x /tmp/y rm -f /tmp/x /tmp/y
jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x jq -s '.[0] * .[1]' ${MPMISSIONS}/${MAP}/${var,,}.json ${SERVER_PROFILE}/custom/${dir}/${var,,}.json > /tmp/x
mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json # mv /tmp/x ${MPMISSIONS}/${MAP}/${var,,}.json
mv /tmp/x ${MPMISSIONS}/${MAP}/cfgGameplay.json
fi fi
done done
if [[ ${FOUND} = 1 ]] if [[ ${FOUND} = 1 ]]