Jump to content

Kerbal Maker Bash Script


cantab

Recommended Posts

This is just a dead simple bash script. It takes a file of first names and spits out roster entries that you can copy and paste into your persistence file. Good if you want to make a whole bunch of custom-named Kerbals at once, rather than having to make them one at a time in Crew Manifest or similar.

License: Public Domain

#!/bin/bash
# needs bash obviously. if you're on windows try cygwin to get it
# noobish coding here but it works
# takes one command line argument, the path to a file with the first names. plain text file, one name per line
# outputs to stdout, redirect to a file if you want
# you might want to do duplicate checking somehow
while read line
do
name=$line
brave=$(($RANDOM % 1000))
dumb=$(($RANDOM % 1000))
if ((RANDOM % 50 == 1)); then
bads=True
else
bads=False
fi
echo " KERBAL"
echo " {"
echo " name = $name Kerman"
echo " type = Crew"
echo " brave = 0.$brave"
echo " dumb = 0.$dumb"
echo " badS = $bads"
echo " state = Available"
echo " ToD = 0"
echo " idx = -1"
echo " CAREER_LOG"
echo " {"
echo " flight = 0"
echo " }"
echo " FLIGHT_LOG"
echo " {"
echo " flight = 0"
echo " }"
echo " }"
done < $1

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...