Files
assaultcube-/packages/convert_mapcfgs.sh
T
RandumKiwi 413f88197a Change packaging - textures.
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7078 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-01-12 21:40:40 +00:00

122 lines
8.1 KiB
Bash

#!/bin/bash
# A simple script using SED to make map configs
# compatible with the new layout.
while getopts "c:" copt; do
if [ "$copt" = "c" ]; then
if [ -e "$OPTARG" ]; then
echo "Converting your map cfg file..."
echo -e "\nConverting mapmodels..."
sed -i '/^mapmodel/s/\<laptop1\>/jcdpc\/laptop/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrap\/cbbox\>/jcdpc\/cardboardbox/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrap\/hanginlamp\>/jcdpc\/hanginglamp/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrap\/ventflap\>/jcdpc\/ventflap/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrap\/milkcrate2\>/ratboy\/toca_milkcrate_blue/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrap\/milkcrate1\>/ratboy\/toca_milkcrate_red/g' $OPTARG
sed -i '/^mapmodel/s/\<aard\>/makke\/aardapple_enginebox/g' $OPTARG
sed -i '/toxic/!s/\<barrel\>/makke\/barrel/g' $OPTARG
sed -i '/^mapmodel/s/\<barrel2\>/makke\/barrel_fallen/g' $OPTARG
sed -i '/^mapmodel/s/\<barrel-toxic\>/makke\/barrel_toxic/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrapbarrel\>/makke\/barrel_newsteel/g' $OPTARG
sed -i '/^mapmodel/s/\<rattrapbarrel2\>/makke\/barrel_newsteel_fallen/g' $OPTARG
sed -i '/^mapmodel/s/\<bench\>/makke\/bench_seat/g' $OPTARG
sed -i '/^mapmodel/s/\<bridge\>/makke\/platform/g' $OPTARG
sed -i '/^mapmodel/s/\<bridge_shine\>/makke\/platform_shine/g' $OPTARG
sed -i '/^mapmodel/s/\<bulb\>/makke\/lightbulb/g' $OPTARG
sed -i '/^mapmodel/s/\<can\>/makke\/coke_can/g' $OPTARG
sed -i '/^mapmodel/s/\<can2\>/makke\/coke_can_fallen/g' $OPTARG
sed -i '/^mapmodel/s/\<chair1\>/makke\/office_chair/g' $OPTARG
sed -i '/^mapmodel/s/\<coffeemug\>/makke\/coffee_mug/g' $OPTARG
sed -i '/^mapmodel/s/\<comp_bridge\>/makke\/platform_bridge/g' $OPTARG
sed -i '/^mapmodel/s/\<drainpipe\>/makke\/drainpipe/g' $OPTARG
sed -i '/^mapmodel/s/\<dumpster\>/makke\/dumpster/g' $OPTARG
sed -i '/^mapmodel/s/\<elektro\>/makke\/electric_meter/g' $OPTARG
sed -i '/^mapmodel/s/\<europalette\>/makke\/pallet/g' $OPTARG
sed -i '/^mapmodel/s/\<fag\>/makke\/cigarette/g' $OPTARG
sed -i '/^mapmodel/s/\<fence\>/makke\/fence_chainlink/g' $OPTARG
sed -i '/^mapmodel/s/\<fencegate_closed\>/makke\/fence_chainlink_closed_gate/g' $OPTARG
sed -i '/^mapmodel/s/\<fencegate_open\>/makke\/fence_chainlink_no_gate/g' $OPTARG
sed -i '/^mapmodel/s/\<fencepost\>/makke\/fence_chainlink_post/g' $OPTARG
sed -i '/^mapmodel/s/\<flyer\>/makke\/flyer_propaganda/g' $OPTARG
sed -i '/^mapmodel/s/\<tree01\>/makke\/flyer_environmental/g' $OPTARG
sed -i '/^mapmodel/s/\<gastank\>/makke\/fuel_tank/g' $OPTARG
sed -i '/^mapmodel/s/\<icicle\>/makke\/icicle/g' $OPTARG
sed -i '/^mapmodel/s/\<hook\>/makke\/hook/g' $OPTARG
sed -i '/^mapmodel/s/\<locker\>/makke\/locker/g' $OPTARG
sed -i '/^mapmodel/s/\<light01\>/makke\/fluorescent_lamp/g' $OPTARG
sed -i '/^mapmodel/s/\<wood01\>/makke\/broken_wood/g' $OPTARG
sed -i '/^mapmodel/s/\<wrench\>/makke\/wrench/g' $OPTARG
sed -i '/^mapmodel/s/\<strahler\>/makke\/wall_spotlight/g' $OPTARG
sed -i '/floppy/!s/\<streetlamp\>/makke\/street_light/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_rung\>/makke\/ladder_1x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_7x\>/makke\/ladder_7x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_8x\>/makke\/ladder_8x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_10x\>/makke\/ladder_10x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_11x\>/makke\/ladder_11x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladder_15x\>/makke\/ladder_15x/g' $OPTARG
sed -i '/^mapmodel/s/\<ladderx15_center3\>/makke\/ladder_15x_offset/g' $OPTARG
sed -i '/^mapmodel/s/\<gutter_h\>/makke\/grate_hor/g' $OPTARG
sed -i '/^mapmodel/s/\<gutter_v\>/makke\/grate_vert/g' $OPTARG
sed -i '/^mapmodel/s/\<minelift\>/makke\/mine-shaft_elevator/g' $OPTARG
sed -i '/^mapmodel/s/\<screw\>/makke\/bolt_nut/g' $OPTARG
sed -i '/^mapmodel/s/\<sail\>/makke\/sail/g' $OPTARG
sed -i '/^mapmodel/s/\<snowsail\>/makke\/sail_snow/g' $OPTARG
sed -i '/^mapmodel/s/\<wires\/2x8\>/makke\/wires\/2x8/g' $OPTARG
sed -i '/^mapmodel/s/\<wires\/3x8\>/makke\/wires\/3x8/g' $OPTARG
sed -i '/^mapmodel/s/\<wires\/4x8\>/makke\/wires\/4x8/g' $OPTARG
sed -i '/^mapmodel/s/\<wires\/4x8a\>/makke\/wires\/4x8a/g' $OPTARG
sed -i '/^mapmodel/s/\<poster\>/makke\/signs\/wanted/g' $OPTARG
sed -i '/^mapmodel/s/\<signs\/arab\>/makke\/signs\/arab/g' $OPTARG
sed -i '/toca/!s/\<signs\/biohazard\>/makke\/signs\/biohazard/g' $OPTARG
sed -i '/^mapmodel/s/\<signs\/caution\>/makke\/signs\/caution_voltage/g' $OPTARG
sed -i '/^mapmodel/s/\<signs\/maint\>/makke\/signs\/caution_maintainence/g' $OPTARG
sed -i '/^mapmodel/s/\<signs\/flammable\>/makke\/signs\/flammable/g' $OPTARG
sed -i '/^mapmodel/s/\<signs\/speed\>/makke\/signs\/speed/g' $OPTARG
sed -i '/^mapmodel/s/\<nocamp\>/makke\/signs\/no_camping/g' $OPTARG
sed -i '/^mapmodel/s/\<roadblock01\>/makke\/roadblock/g' $OPTARG
sed -i '/^mapmodel/s/\<roadblock02\>/makke\/roadblock_graffiti/g' $OPTARG
sed -i '/^mapmodel/s/\<nothing\>/makke\/nothing_clip/g' $OPTARG
sed -i '/^mapmodel/s/\<picture1\>/makke\/picture/g' $OPTARG
sed -i '/^mapmodel/s/\<plant01\>/makke\/plant_leafy/g' $OPTARG
sed -i '/^mapmodel/s/\<plant01_d\>/makke\/plant_leafy_dry/g' $OPTARG
sed -i '/^mapmodel/s/\<plant01_s\>/makke\/plant_leafy_snow/g' $OPTARG
sed -i '/^mapmodel/s/\<grass01\>/makke\/grass_short/g' $OPTARG
sed -i '/^mapmodel/s/\<grass01_d\>/makke\/grass_short_dry/g' $OPTARG
sed -i '/^mapmodel/s/\<grass01_s\>/makke\/grass_short_snow/g' $OPTARG
sed -i '/^mapmodel/s/\<grass02\>/makke\/grass_long/g' $OPTARG
sed -i '/^mapmodel/s/\<grass02_d\>/makke\/grass_long_dry/g' $OPTARG
sed -i '/^mapmodel/s/\<grass02_s\>/makke\/grass_long_snow/g' $OPTARG
echo -e "\nConverting textures..."
sed -i '/^texture/s/\<wotwot\/skin\/drainpipe.jpg\>/..\/models\/mapmodels\/wotwot\/makke_drainpipe_gritty\/skin.jpg/g' $OPTARG
sed -i '/^texture/s/\<wotwot\/skin\/commrack.jpg\>/..\/models\/mapmodels\/wotwot\/toca_commrack_dull\/skin.jpg/g' $OPTARG
sed -i '/^texture/s/\<wotwot\/skin\/monitor.jpg\>/..\/models\/mapmodels\/wotwot\/toca_monitor_dull\/skin.jpg/g' $OPTARG
sed -i '/^texture/s/\<wotwot\/skin\/milkcarton.jpg\>/..\/models\/mapmodels\/wotwot\/toca_milkcarton_dull\/skin.jpg/g' $OPTARG
sed -i '/^texture/s/\<wotwot\/skin\/guardrail2.jpg\>/..\/models\/mapmodels\/wotwot\/toca_guardrail2_dull\/skin.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/metal_overlaps.jpg\>/zastrow\/metal_overlaps.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/metal_plate_fill.jpg\>/zastrow\/metal_plate_fill.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/metal_siding_kinksb.jpg\>/zastrow\/metal_siding_kinksb.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/metal_siding_kinks.jpg\>/zastrow\/metal_siding_kinks.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/sub_doors512A10.jpg\>/zastrow\/sub_doors512A10.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/sub_doors512A16.jpg\>/zastrow\/sub_doors512A16.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/sub_doors512B05.jpg\>/zastrow\/sub_doors512B05.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/sub_window31.jpg\>/zastrow\/sub_window31.jpg/g' $OPTARG
sed -i '/^texture/s/\<mitaman\/zastrow\/sub_window33.jpg\>/zastrow\/sub_window33.jpg/g' $OPTARG
echo -e "\a\nConversion finished!"
echo "Please check your map config file carefully for any inconsistencies."
else
echo -e "\a\E[31m\033[1mERROR:\E[0m The path you've stated to the map config file is invalid."
fi
else
echo -e "\a\E[31m\033[1mERROR:\E[0m Invalid OPTION."
echo -e "Try running this script with the -c option, specifying the path to your maps config file."
fi
exit
done
# If no options are given, this will skip the while loop and output this error.
echo -e "\a\E[31m\033[1mERROR:\E[0m No OPTION given."
echo -e "Try running this script with the -c option, specifying the path to your maps config file."