Does anybody have an automated converter to turn 2.3/3.1-style body.txt file into a 3.2-style body.ini? If not, how was the body.ini file made, anyway?
Cause i wanted to run it on the Contingency mod to try it out on master.
If nobody has it, making a shell script for this shouldn't be hard, i could try.
Of course it has to look up the names.txt file as well.
body.txt => body.ini
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
-
Iluvalar
- Regular

- Posts: 1828
- Joined: 02 Oct 2010, 18:44
Re: body.txt => body.ini
No ! I have it, or at least I have the scripts to create the converter speedily. But I wont. The reason being : it multiply by 10x the size of the mods unnecessarily.
Asking the devs for the removal of body.ini would be faster and saner than to ask them for a script.
Asking the devs for the removal of body.ini would be faster and saner than to ask them for a script.
Heretic 2.3 improver and proud of it.
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: body.txt => body.ini
srsly?faster
I repeat: i'm not asking anybody to make a script, i can make one myself, i just don't want to re-do that if it already exists.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
Iluvalar
- Regular

- Posts: 1828
- Joined: 02 Oct 2010, 18:44
Re: body.txt => body.ini
Per asked me to do it, so I suppose nobody have one...
I guess, diy is always faster than asking for devs
.
But then, reverting to the 3.1 body reader in your master should still be easier than to write the converting script. (for .ini files that will probably be reverted imho)
I guess, diy is always faster than asking for devs
But then, reverting to the 3.1 body reader in your master should still be easier than to write the converting script. (for .ini files that will probably be reverted imho)
Heretic 2.3 improver and proud of it.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: body.txt => body.ini
I made one out of sed, arp and grep, but I don't have it anymore.
I don't think you can just revert without losing functionality.
I don't think you can just revert without losing functionality.
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: body.txt => body.ini
Ok, will have a try soon (:
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: body.txt => body.ini
If you make a converter, please let me know as I'll add links to the modding wiki.
I documented the two files a while back if that's any use: body.txt & body.ini
EDIT: Hrm, looks like I didn't actually document body.txt and just pasted in a link to some existing docs. Will try and get my docs updated in next 48 hours.
I documented the two files a while back if that's any use: body.txt & body.ini
EDIT: Hrm, looks like I didn't actually document body.txt and just pasted in a link to some existing docs. Will try and get my docs updated in next 48 hours.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: body.txt => body.ini
Ok this almost works. Now, how do i guess droidType? I mean, it can't be guessed, right? That's exactly what we loose when we try to get back to .txt?
Invocation example:
upd: now this works with the current data, but guessing droidType based on some other mod's data may still be quite inaccurate.
upd: fixed some dos-style newline trouble that caused the script to fail to understand the "designable" property, which is the last one in every line.
Code: Select all
#!/bin/bash
BODYTXT="$1"
NAMESTXT="$2"
function catcmd {
cat $BODYTXT | tr " " "_" | tr "," " " | tail -n +2 | tr -d "\r"
}
function ntharg {
n=$(( ($1 + 1) ))
echo ${!n}
}
function getarg {
echo `ntharg $*` | tr "_" " "
}
LIST=`catcmd | awk '{print $1}'`
for body in $LIST; do
echo "[$body]"
name=`cat $NAMESTXT | tr "\t" " " | tr -s [:blank:] | grep ^$body" " | sed s/"$body"// | tr -d '()_'`
echo "name ="$name
stats=`catcmd | grep ^$body`
echo "size = "`getarg 3 $stats`
echo "buildPower = "`getarg 4 $stats`
echo "buildPoints = "`getarg 5 $stats`
echo "weight = "`getarg 6 $stats`
echo "hitpoints = "`getarg 7 $stats`
echo "model = "`getarg 8 $stats | tr " " "_"`
echo "weaponSlots = "`getarg 10 $stats`
echo "powerOutput = "`getarg 11 $stats`
echo "armourKinetic = "`getarg 12 $stats`
echo "armourHeat = "`getarg 13 $stats`
flameModel=`getarg 24 $stats`;
if [ "$flameModel" != "0" ]; then
echo "flameModel = "$flameModel
fi
designable=`getarg 25 $stats`
if [ "$designable" = "1" ]; then
echo "designable = true"
else
echo "designable = false"
fi
if [ "`echo $name | grep Transport`" != "" ]; then
echo "droidType = TRANSPORTER"
elif [ "`echo $name | grep Engineer`" != "" ]; then
echo "droidType = CYBORG_CONSTRUCT"
elif [ "`echo $name | grep Mechanic`" != "" ]; then
echo "droidType = CYBORG_REPAIR"
elif [ "`echo $body | grep Cyb | grep Hvy`" != "" ]; then
echo "droidType = CYBORG_SUPER"
elif [ "`echo $body | grep Cyb`" != "" ]; then
echo "droidType = CYBORG"
elif [ "`echo $body | grep Person`" != "" ]; then
echo "droidType = PERSON"
fi
echo
done
Code: Select all
~/bin/script.sh stats/body.txt messages/strings/names.txt > stats/body.iniupd: fixed some dos-style newline trouble that caused the script to fail to understand the "designable" property, which is the last one in every line.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam