Skip to content

Commit

Permalink
adj
Browse files Browse the repository at this point in the history
  • Loading branch information
Piglit committed Mar 28, 2024
1 parent ccd0bd7 commit 45b3d76
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
10 changes: 5 additions & 5 deletions scripts-piglit/scenario_80_shattered_horizon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ function init()
buoy = CpuShip():setTemplate("NavSat"):setCallSign("Kármán Buoy"):setFaction("Endor"):setPosition(-400, -20000)
buoy:setDescription("A navigation buoy that marks the line between atmosphere and space.")
buoy:setRotation(-90):orderIdle():setScanned(true):setCommsFunction(nil):setCanBeDestroyed(false)
buoy2 = CpuShip():setTemplate("NavSat"):setCallSign("KB-02"):setFaction("Endor"):setPosition(zx[1], zy[1])
buoy2 = CpuShip():setTemplate("NavSat"):setCallSign("KB-02"):setFaction("Endor"):setPosition(zx[14], zy[14])
buoy2:setDescription("A navigation buoy that marks the line between atmosphere and space.")
buoy2:setRotation(-90):orderIdle():setScanned(true):setCommsFunction(nil):setCanBeDestroyed(false)
buoy3 = CpuShip():setTemplate("NavSat"):setCallSign("KB-03"):setFaction("Endor"):setPosition(zx[15], zy[15])
buoy3 = CpuShip():setTemplate("NavSat"):setCallSign("KB-03"):setFaction("Endor"):setPosition(zx[12], zy[12])
buoy3:setDescription("A navigation buoy that marks the line between atmosphere and space.")
buoy3:setRotation(-90):orderIdle():setScanned(true):setCommsFunction(nil):setCanBeDestroyed(false)

gm_dummy = CpuShip():setTemplate("NavSat"):setCallSign("Ground Crew"):setFaction("Endor"):setPosition(9999999,9999999):orderIdle():setCommsFunction(nil)

ground=PlayerSpaceship():setTemplate("Ground Station"):setFaction("Endor"):setCallSign("Tantal-3"):setPosition(0, -radius-800)
Expand Down Expand Up @@ -111,8 +111,8 @@ function init()
-- place asteroids and satellites
px,py = planet1:getPosition()
placeRandomAroundPoint(Asteroid,3000,orbit+radius,2*orbit+radius,px,py)
placeRandomAroundPoint(VisualAsteroid,4000,orbit+radius,2*orbit+radius+5000,px,py)
placeRandomAroundPoint(Asteroid,50,i16000,orbit+radius,px,py)
placeRandomAroundPoint(VisualAsteroid,1000,orbit+radius,2*orbit+radius+5000,px,py)
placeRandomAroundPoint(Asteroid,50,16000,orbit+radius,px,py)
placeArtifactsAroundPoint (16,orbit+radius,orbit+radius+500,px,py, true) -- broken ones
placeArtifactsAroundPoint (16,orbit+radius,orbit+radius+500,px,py, false) -- working ones
for dist=orbit+radius+8000,2*orbit,500 do
Expand Down
32 changes: 19 additions & 13 deletions shattered_horizon_laucher.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env python3

#apt install python3-dialog
#apt install python3-dialog python3-requests

from dialog import Dialog
import subprocess
import requests
import time
import random
import os

cwd = os.getcwd()
os.chdir("/dev/shm") # hack to enable tempdir


playerships = {
Expand Down Expand Up @@ -89,7 +93,6 @@ def spawn(callsign, template, offset):
pos = {-offset*200}
ship:setRotation(rotation)
ship:commandTargetRotation(rotation)
ship:setPosition(pos, pos)
ship:setTemplate("{template}")
ship:setCallSign("{cs}")
ship:setDescription("{callsign}")
Expand All @@ -99,14 +102,17 @@ def spawn(callsign, template, offset):
return script
# return _lua_exec(script)

spawn_script, scenario_file = menu()
if scenario_file == "scenario_80_shattered_horizon.lua":
paused = 0
else:
paused = 1
cmd = ["./EmptyEpsilon", f"server_scenario={scenario_file}", "httpserver=8080", "autoconnect=0", "autoconnectship=", "autoconnect_address=", f"startpaused={paused}"]
ee = subprocess.Popen(cmd)
time.sleep(1)

_lua_exec(spawn_script)
ee.communicate()
while True:
spawn_script, scenario_file = menu()
if scenario_file == "scenario_80_shattered_horizon.lua":
paused = 0
else:
paused = 1
cmd = ["./EmptyEpsilon", f"server_scenario={scenario_file}", "httpserver=8080", "autoconnect=0", "autoconnectship=", "autoconnect_address=", f"startpaused={paused}"]
os.chdir(cwd)
ee = subprocess.Popen(cmd)
time.sleep(1)

_lua_exec(spawn_script)
ee.communicate()
input("press enter to restart")

0 comments on commit 45b3d76

Please sign in to comment.