I put together this shell script (runs on Linux and Mac) that will go through all your game files and attempt to rename a unit. It will rename all appropriate files and go through all your files and replace all instances of the old unit name with the new name.
Disclaimer - this works for me, but YMMV. Back up your data before trying this.
save this program as "renameUnit.sh" and place it inside your mod's folder.
for file in `find . -name "*.lua"` do sed -i "s/$1/$2/g" $file done
for file in `find . -name "*.s3o"` do sed -i "s/$1/$2/g" $file done
for infile in `find . \( ! -regex '.*/\..*' \)` do newname=`echo $infile | sed "s/$1/$2/"` if [ "$infile" != "$newname" ] then mv $infile $newname #### ^^^ important! ^^^ #if you use a version-control system like SVN or Git, # change that line to from "mv" to "git mv", # "svn mv", or whatever your VCS requires. #### fi done
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum