Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Script to compile OpenTTD1.1.5 server from source 12 years 3 weeks ago #540

#!/bin/bash
 
# To install OpenTTD1.1.5 dedicated server from source (on debian squeeze, perhaps any linux)
 
# INSTRUCTIONS:
 
#- save this text as installopenttdsource.sh
#- allow execution of installopenttdsource.sh: in a terminal as superuser (root) type:
#chmod u+x installopenttdsource.sh
#- now you can run this script like this:
#./installopenttdsource.sh
 
# END OF INSTRUCTIONS.
 
#Ask for installation folder:
read -e -i '/home/user' -p 'Download directory (must exist) like /home/YOURUSERNAME: ' DOWNLOADDIR
echo 'DOWNLOADDIR='$DOWNLOADDIR
 
read -e -i 'openttd-1.1.5-dedicated' -p 'Program Folder name, like openttd-1.1.5-dedicated: ' INSTALLDIR
echo 'INSTALLDIR='$INSTALLDIR
echo ''
 
echo 'note: All portnrs are ok, except 3978, openttd uses that already to get to the main server list'
read -e -i '3979' -p 'Port nr to host on, like 3979: ' PORTNR
echo 'PORTNR='$PORTNR
 
read -e -i 'OpenTTD Test Server' -p 'Server name, like OpenTTD Test Server: ' SERVERNAME
echo 'SERVERNAME='$SERVERNAME
 
read -e -i 'someverysecretpassword' -p 'Admin Password, like someverysecretpassword: ' ADMINPASS
echo 'ADMINPASS='$ADMINPASS
 
 
read -p "Press [Enter] key to continue installing prerequisites (or ctrl-c to quit)"
 
#install some zippers:
apt-get install -y zip
#apt-get install -y gzip
#apt-get install -y xz-utils
 
#install some prerequisites:
apt-get install -y liblzma-dev
apt-get install -y build-essential
apt-get install -y libsdl1.2-dev
apt-get install -y zlib1g-dev
apt-get install -y liblzo2-dev
apt-get install -y timidity
apt-get install -y dpatch
apt-get install -y libfontconfig-dev
apt-get install -y libicu-dev
 
read -p "Press [Enter] key to continue downloading source... (or ctrl-c to quit)"
 
#get the source:
cd $DOWNLOADDIR
rm -r $DOWNLOADDIR/$INSTALLDIR
wget binaries.openttd.org/releases/1.1.5/openttd-1.1.5-source.zip
unzip -d $DOWNLOADDIR openttd-1.1.5-source.zip
rm openttd-1.1.5-source.zip
cp -r $DOWNLOADDIR/openttd-1.1.5 $DOWNLOADDIR/$INSTALLDIR
rm -r $DOWNLOADDIR/openttd-1.1.5
cd $DOWNLOADDIR/$INSTALLDIR
 
read -p "Press [Enter] key to continue to configure... (or ctrl-c to quit)"
 
#######################################################################
# You could alter the openttd source code at this point, if you like! #
#######################################################################
 
#configure:
./configure --enable-dedicated
 
read -p "Press [Enter] key to continue to make... (or ctrl-c to quit)"
 
#compile:
make
 
read -p "Press [Enter] key to continue to opengfx... (or ctrl-c to quit)"
 
#perhaps install it into the system's main menu (or not):
#make install
 
#add free gfx (needed for both dedicated server and normal):
wget binaries.openttd.org/extra/opengfx/0.4.3/opengfx-0.4.3-all.zip
unzip -d $DOWNLOADDIR/$INSTALLDIR/bin/data opengfx-0.4.3-all.zip
rm opengfx-0.4.3-all.zip
 
read -p "Press [Enter] key to continue creating configfiles... (or ctrl-c to quit)"
 
#Create & edit openttd.cfg file:
#(see wiki.openttd.org/Openttd.cfg for more info on these and many more options...)
 
echo '
[difficulty]
competitor_speed = 0
construction_cost = 2
diff_level = 3
disasters = 0
economy = 0
initial_interest = 4
line_reverse_mode = 0
max_loan = 500000
max_no_competitors = 14
number_industries = 2
number_towns = 1
quantity_sea_lakes = 1
subsidy_multiplier = 1
terrain_type = 2
town_council_tolerance = 2
vehicle_breakdowns = 2
vehicle_costs = 2
 
[game_creation]
landscape=tropic
starting_year=1980
land_generator = 1
variety=3
tree_placer = 2
tgen_smoothness = 3
map_x=10
map_y=10
 
[vehicle]
disable_elrails = false
dynamic_engines = true
mammoth_trains = true
max_aircraft=0
max_roadveh=300
max_ships=150
max_train_length=20
max_trains=600
never_expire_vehicles = true
road_side = right
train_acceleration_model = 1
 
[construction]
autoslope = true
build_on_slopes = true
extra_dynamite = true
freeform_edges = true
longbridges = true
raw_industry_construction=1
road_stop_on_competitor_road = false
road_stop_on_town_road = false
 
[station]
station_spread=false
 
[economy]
exclusive_rights=false
give_money=false
multiple_industry_per_town = true
same_industry_close = true
smooth_economy = true
station_noise_level = false
town_layout=3
 
[order]
gotodepot=true
gradual_loading=false
improved_load=true
timetabling=false
 
[gui]
loading_indicators=true
quick_goto=true
show_track_reservation = true
station_num_tracks=10
station_platlength=20
station_show_coverage = true
 
[network]
server_port='$PORTNR'
autoclean_companies=true
autoclean_novehicles=12
autoclean_protected=64
autoclean_unprotected=36
lan_internet=0
max_clients=20
max_companies=15
max_spectators=30
pause_on_join = false
server_lang=ENGLISH
server_name='$SERVERNAME'
admin_password='$ADMINPASS'
server_advertise=true
server_admin_chat=true
 
' > $DOWNLOADDIR/$INSTALLDIR/bin/openttd.cfg
 
#Done. Now, we can host/start the game:
echo 'Ready to host '$SERVERNAME' at port '$PORTNR'.'
echo '==============================================='
echo 'to start hosting type:'
echo 'cd '$DOWNLOADDIR'/'$INSTALLDIR'/bin'
echo './openttd -D'
echo ''
echo 'to stop hosting: press ctrl-c'
echo 'check ports 3978 & '$PORTNR' on your router'
echo '==============================================='
 

Please Log in or Create an account to join the conversation.

Re: Script to compile OpenTTD1.1.5 server from source 12 years 3 weeks ago #541

Nice MatenMens :-)

I have seen your private message, but didn't had the time to respond yet. Will do so asap :-)

Thanks for the script, im sure it will help SOME people :-)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.026 seconds
Best hosting deal on hostgator coupon or play poker on party poker
Copyright 2020 Script to compile OpenTTD1.1.5 server from source - BTPro - OpenTTD Community.