C: MO - Using Lua to generate accurate bridges

Channel:
Subscribers:
38,400
Published on ● Video Link: https://www.youtube.com/watch?v=4HtmwQUtrQ0



Duration: 0:00
328 views
15


In this video, we use the following script to make a little bridge that is highly customizable. The code:
local side = "RED"
local unit_name_prefix = "Bridge section"
local unit_type = "Facility"
local dbid = 4126
local start_lat = 12.292593
local start_lon = -61.584550
local num_units = 50
local spacing = 0.00036

for i = 0, num_units - 1 do
local unit_name = unit_name_prefix .. "-" .. (i + 1)
local lat = start_lat - (i * spacing)
ScenEdit_AddUnit({
type = unit_type,
unitname = unit_name,
dbid = dbid,
side = side,
latitude = lat,
longitude = start_lon,
proficiency = "Regular"
})
end