Skip to content

Add dynamic mission script approach to documentation and demo mission #2083

@kaltokri

Description

@kaltokri

With the lua code below it is possible to to create a hybrid betwenn dynamic and static mission script Integration.
This allows a fast development of mission scripts without reintegration after every change.
But as soon as a good level is reached the script can be reintegrated and shared with others or uploaded to a server easily.
So we should add it to documentation under Advanced and add one demo mission as show case.

MissionScript = lfs.writedir() .. '/Missions/hello-world-dyn.lua'

-- Use script file from hard disk instead of the one included in the .miz file
if string.find( debug.getinfo(1).source, lfs.tempdir() ) then
  local f=io.open(MissionScript,"r")
  if f~=nil then
    io.close(f)

    env.info( '*** LOAD MOOSE MISSION SCRIPT FROM HARD DISK *** ' )
    dofile(MissionScript)
    do return end
  end
end

--
-- Simple example mission to show the very basics of MOOSE
--
MESSAGE:New( "Hello World! This messages is printed by MOOSE", 35, "INFO" ):ToAll():ToLog()

Metadata

Metadata

Assignees

Labels

Demo MissionIssue with Demo MissionEnhancementMoose code enhancement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions