Simulate commercial/civilian maritime traffic

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
C7M3s0g1T8
Posts: 7
Joined: Sun Dec 18, 2022 3:05 pm

Simulate commercial/civilian maritime traffic

Post by C7M3s0g1T8 »

I would like to incorporate civivlian and commerical maritime traffic/shipping lanes such as can be seen on https://www.marinetraffic.com/en/ais/home/. For a non-programmer, what is a logical way to set this up with lua scripts?

I think I would need to:
1. create a zone or multiple zones (with Reference Points) for the ships to be created in and navigate within
2. have a lua script that generates multiple civilian/commercial ship DBIDs randomly within the zone(s) at the start of the scenario
3. create waypoints and destinations using Reference Points
4. prevent the ship creation script from running a second time upon loading a save of the scenario

but what else needs to be established?

Keywords: civilian maritime, commercial maritime, shipping lanes
User avatar
lumiere
Posts: 267
Joined: Tue Mar 19, 2019 10:38 am

Re: Simulate commercial/civilian maritime traffic

Post by lumiere »

1-3. Examine and testing "/lua/BrassDrum/CivilianShipping.lua" file script used in standalone scenario of same name is good way to start with. This generates neutral surface unit and sets waypoint based on RP. Please note some functions used will work only after loading LuaInit.lua.

4. Just turn off ship generation event "event is repeatable" checkbox.

Other factor to consider I could came up:

-Proper ship type by location: There is no Junk or sailboat at the center of Pacific ocean and they should be around coastal. Strait of Hormuz may be full of tankers rather than passenger liner.

-Generating too many ships could cause the simulation to lag.
"How Do You Stay Calm With A 7,000 Ton Nuclear Predator Listening For Your Heartbeat?"
Post Reply

Return to “Lua Legion”