#!/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/\/jcdpc\/laptop/g' $OPTARG sed -i '/^mapmodel/s/\/jcdpc\/cardboardbox/g' $OPTARG sed -i '/^mapmodel/s/\/jcdpc\/hanginglamp/g' $OPTARG sed -i '/^mapmodel/s/\/jcdpc\/ventflap/g' $OPTARG sed -i '/^mapmodel/s/\/ratboy\/toca_milkcrate_blue/g' $OPTARG sed -i '/^mapmodel/s/\/ratboy\/toca_milkcrate_red/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/aardapple_enginebox/g' $OPTARG sed -i '/toxic/!s/\/makke\/barrel/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/barrel_fallen/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/barrel_toxic/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/barrel_newsteel/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/barrel_newsteel_fallen/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/bench_seat/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/platform/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/platform_shine/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/lightbulb/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/coke_can/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/coke_can_fallen/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/office_chair/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/coffee_mug/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/platform_bridge/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/drainpipe/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/dumpster/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/electric_meter/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/pallet/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/cigarette/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fence_chainlink/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fence_chainlink_closed_gate/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fence_chainlink_no_gate/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fence_chainlink_post/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/flyer_propaganda/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/flyer_environmental/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fuel_tank/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/icicle/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/hook/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/locker/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/fluorescent_lamp/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/broken_wood/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wrench/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wall_spotlight/g' $OPTARG sed -i '/floppy/!s/\/makke\/street_light/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_1x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_7x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_8x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_10x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_11x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_15x/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/ladder_15x_offset/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grate_hor/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grate_vert/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/mine-shaft_elevator/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/bolt_nut/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/sail/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/sail_snow/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wires\/2x8/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wires\/3x8/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wires\/4x8/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/wires\/4x8a/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/wanted/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/arab/g' $OPTARG sed -i '/toca/!s/\/makke\/signs\/biohazard/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/caution_voltage/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/caution_maintainence/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/flammable/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/speed/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/signs\/no_camping/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/roadblock/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/roadblock_graffiti/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/nothing_clip/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/picture/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/plant_leafy/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/plant_leafy_dry/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/plant_leafy_snow/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_short/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_short_dry/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_short_snow/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_long/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_long_dry/g' $OPTARG sed -i '/^mapmodel/s/\/makke\/grass_long_snow/g' $OPTARG echo -e "\nConverting textures..." sed -i '/^texture/s/\/..\/models\/mapmodels\/wotwot\/makke_drainpipe_gritty\/skin.jpg/g' $OPTARG sed -i '/^texture/s/\/..\/models\/mapmodels\/wotwot\/toca_commrack_dull\/skin.jpg/g' $OPTARG sed -i '/^texture/s/\/..\/models\/mapmodels\/wotwot\/toca_monitor_dull\/skin.jpg/g' $OPTARG sed -i '/^texture/s/\/..\/models\/mapmodels\/wotwot\/toca_milkcarton_dull\/skin.jpg/g' $OPTARG sed -i '/^texture/s/\/..\/models\/mapmodels\/wotwot\/toca_guardrail2_dull\/skin.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/metal_overlaps.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/metal_plate_fill.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/metal_siding_kinksb.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/metal_siding_kinks.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/sub_doors512A10.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/sub_doors512A16.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/sub_doors512B05.jpg/g' $OPTARG sed -i '/^texture/s/\/zastrow\/sub_window31.jpg/g' $OPTARG sed -i '/^texture/s/\/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."