forked from daid/EmptyEpsilon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pithlit
committed
Jul 19, 2024
1 parent
80cad77
commit 68ecfc1
Showing
4 changed files
with
76 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--[[ Places stations in the area | ||
Before: wh_terrain (otherwise there is no space for the stations anymore) | ||
--]] | ||
wh_stations = {} | ||
|
||
require "place_station_scenario_utility.lua" | ||
|
||
function wh_stations:init() | ||
local center_x, center_y = 100000,0 | ||
local placement_attempt_count = 0 | ||
self.stations = {} | ||
repeat | ||
local ox, oy = vectorFromAngle(random(0,360),random(40000,100000)) | ||
ox = ox + center_x | ||
oy = oy + center_y | ||
local obj_list = getObjectsInRadius(ox, oy, 20000) | ||
if #obj_list == 0 then | ||
local station = placeStation(ox, oy, "RandomHumanNeutral") -- Independent of random size | ||
if station ~= nil then | ||
table.insert(self.stations, station) | ||
else | ||
break | ||
end | ||
end | ||
placement_attempt_count = placement_attempt_count + 1 | ||
until(placement_attempt_count > 500) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters