.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $7.00
Bronze- Save $9.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #38  
Old October 21st, 2013, 06:41 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Linux Admining

YAY! after DAYS of messing with it I finally got an ugly ugly script that works!
Code:
AI="diffai "
t=0

cp /home/gandalf/dominions4/Files_EA.txt paste.txt
rm done.txt

# add uploaded gods as team leaders
for FYL in `ls -1 *.2h | cut -f1 -d.`
 do
  let t=t+1
  sed -i  "/$FYL/s/^/--team / ; s/$FYL.*$/$t 1 \\\/"   paste.txt
 done


# add one AI team
let t=t+1
   cnt=`grep -c _ paste.txt`
   chc=`echo $RANDOM % $cnt + 1 | bc`
   PRET=`grep _ paste.txt |head -$chc |tail -1|cut -f2 -d' '`
   grep $PRET paste.txt | sed "s/^/--$AI/;s/$PRET.*$/\\\/" >>done.txt
   sed -i  "/$PRET/s/^/--team / ; s/$PRET.*$/$t 1 \\\/"   paste.txt

for TT in `seq 1 $t`
 do
   cnt=`grep -c _ paste.txt`
   chc=`echo $RANDOM % $cnt + 1 | bc`
   DISC=`grep _ paste.txt |head -$chc |tail -1|cut -f2 -d' '`
echo $chc
echo $DISC
   grep $DISC paste.txt | sed "s/^/--$AI/;s/$DISC.*$/\\\/" >>done.txt
   sed -i  "/$DISC/s/^/--team / ; s/$DISC.*$/$TT 2 \\\/"   paste.txt
 done

for TT in `seq 1 $t`
 do
   cnt=`grep -c _ paste.txt`
   chc=`echo $RANDOM % $cnt + 1 | bc`
   DISC=`grep _ paste.txt |head -$chc |tail -1|cut -f2 -d' '`
echo $chc
echo $DISC
   grep $DISC paste.txt | sed "s/^/--$AI/;s/$DISC.*$/\\\/" >>done.txt
   sed -i  "/$DISC/s/^/--team / ; s/$DISC.*$/$TT 2 \\\/"   paste.txt
 done

grep "\-\-team" paste.txt >>done.txt
It is so that a --teamplay game of Dom4 can be started allowing everyone to send a full pretender. When the start button is pressed the game should crash (using --mapfile foo.map will do it). Then run this script and add the done.txt to the start script for the game.

What it does is:
if 4 pretender files were uploaded then it treats those as team leaders 1 2 3 4 and it adds an AI leader for a +1 team (in this case team 5). Then it randomly assigns 2 nations as AI Disciples for each team. So the 4 people that signed up all become pretenders with 2 AI disciples clustered near them.

UNFORTUNATELY I now have to figure out why Dom4 has a problem starting a game with AIs.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
 

Bookmarks

Tags
admin, automation, command line, hosting, linux, script, server, switches

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:47 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2021, Shrapnel Games, Inc. - All Rights Reserved.