#!/bin/sh # test script to produce x/y coordinates for each frame of a ship orbiting # a planet set -e LIBDIR=/usr/local/games/netrek-server-vanilla cd ${LIBDIR} # reset galaxy lib/tools/setgalaxy r 2>/dev/null 1>/dev/null # make all planets visible to all teams for x in `seq 0 39`; do lib/tools/setplanet $x reveal; done # move ear to centre and flatten to one army lib/tools/setplanet ear y 50000 x 50000 armies 1 # move test slot to an orbit position and stop it moving lib/tools/setship 0 speed 0 wait-for-stop position 49200 50000 sleep 1 # pause lib/tools/setgame pause # orbit earth lib/tools/setplanet ear be-orbited-by 0 # invent a file name for the text DATE=`date +%s` FILE_LOG=/tmp/orbit-positions-${DATE}.log FILE_PNG=/tmp/orbit-positions-${DATE}.png # number of positions to plot # (direction during orbit changes by 2 units of 256, every five # frames, therefore there will be 640 frames for a full rotation) POSITIONS=641 # plot positions of ship by single-stepping rapidly for x in `seq ${POSITIONS}`; do lib/tools/setgame single-step lib/tools/setship 0 show-position >> ${FILE_LOG} done lib/tools/setgame resume echo ${FILE_LOG} gnuplot <