Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kaltokri opened this issue Dec 29, 2023 · 0 comments
Open
Assignees
Labels
Demo Mission Issue with Demo Mission Enhancement Moose code enhancement.

Comments

@kaltokri
Copy link
Collaborator

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()
@kaltokri kaltokri added Enhancement Moose code enhancement. Demo Mission Issue with Demo Mission labels Dec 29, 2023
@kaltokri kaltokri self-assigned this Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Demo Mission Issue with Demo Mission Enhancement Moose code enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant