Project ObjectivesMFD

Jarod

Member
Joined
Dec 13, 2011
Messages
169
Reaction score
0
Points
16
I was uncomfortable making a request without giving anything so I made a little demonstrator of my idea.

edit : last readme and version http://www.orbiter-forum.com/showthread.php?p=335427&postcount=7

To the extent possible under law, Jarod has waived all copyright and related or neighboring rights to this work.
http://creativecommons.org/publicdomain/zero/1.0/

ObjectivesMFD

is a demonstrator to put objectives in Orbiter.
Want to put a satellite in a specific Mars orbit for 5 years ? You can track it.
Want to validate goals along your mission ? That would be the purpose of this completed MFD.

Examples of objectives :

- Vessel launched
- Vessel in specific orbit
- Vessel is landed (how far from objective ...)
- Vessel is docked to another given ship, station
- Vessel brought x tons of fuel
...

with or without duration, with or without precise location ...
Completion of an objective could be set like a score depending of distance from the objective for the landing, or distance from the ideal orbit altitude ...

Explanations :
In \Config\MFD\Objectives, you have a lua file XR2-01, it gives objectives that can be set to a vessel with the name XR2-01.
For the purpose of the demonstration, you can launch the scenario "In orbit, undocked from ISS" of the XR2 Ravenstar addon.
Objective is set to orbit Earth between 352 and 368 km during 30 days.

For your own vessel, just create a new lua file with the name of your vessel.

You launch the MFD, click SET, it loads the objective.
You can click TRK and you have the status of the objective.

Limitations of the demonstrator :
You can go beyond 100% completion of the objective (like the Mars rovers ;) )
There is no alert if completion of an objective stops before 100%, would be useful if objective is to stay in a given orbit but useless for others goals, so would need to be an option.
One goal per vessel is tracked by the MFD. Multiple goals per vessel would allow to complete goals along a mission.

Useful, useless ?
Please comment, use, modify. I'm not a great programmer so if anyone is up to the task, just steal the idea and do it :rofl:
 

Attachments

Last edited:
Thanks to you for giving it a try.
I understand I'm just showing a demonstrator, that's not even an alpha version, this is just to show the idea, but still I thought more people would comment about this.

So, I'll try to make a better config file, as it is you need to know Lua to put new conditions.
My goal is to have a config file where users can choose the variables they're interested in from a list, like the altitude and body in the exemple.
Make the definition of an objective like the definition of conditions, just a "Objective1 = condition1 and condition2" kind of thing.
This would still be a Lua file but readable like a traditional config file.

Since this is still the very early stages of programmation, what I would like is for people to just throw ideas, what would you like to be possible with this MFD ? how would you like it to appear in game ? That kind of thing.
It could take me a while to implement if I'm in charge of it, since I'm learning about Orbiter and Lua, but I'll give my best.
 

Attachments

Last edited:
Here is the 0.2 version with the readme and requirements :
Code:
01/02/2012
To the extent possible under law, Jarod has waived all copyright and related or neighboring rights to this work.
http://creativecommons.org/publicdomain/zero/1.0/

ObjectivesMFD 0.2

allows you to put objectives in Orbiter (this is not a finished addon).
Want to put a satellite in a specific Mars orbit for 5 years ? You can track it.
Want to validate goals along your mission ? Multiples goals are supported.

What is done ?
Cfg file is mostly conditions, very readable.
You can load a file with multiple objective for your vessel.
You can set an alert if conditions of an objective are no longer met.

Limitations of this version : 
Not every possible variable is available from the get-go, you need to use Lua scripting for cases not implemented.
Set a duration of 1 sec if you want to just check a condition without duration. (docked vessel ...)

Examples of objectives that could be implemented : (some need Lua code to be specified with the help of Orbiter/Html/Orbiter.chm help file, Orbiter Scripting category)

- Vessel launched
- Vessel in specific orbit
- Vessel is landed (how far from objective ...)
- Vessel is docked to another given ship, station
- Vessel brought x tons of fuel
...
with or without duration,
with or without precise location (not implemented)

Completion of an objective could be set like :
 - a score depending of distance from the objective for the landing, or distance from the ideal orbit altitude ... (not implemented)
 - a percentage of duration.

Explanations :
In \Config\MFD\Objectives, you have a config file XR2-01.cfg, it gives objectives that can be set to a vessel with the name XR2-01.
For the purpose of the demonstration, you can launch the scenario "In orbit, undocked from ISS" of the XR2 Ravenstar addon.
3 objectives are set, the first is to dock to ISS , the 2 others are to orbit Earth between some altitude during 6h.

For your own vessel, just create a new cfg file with the name of your vessel.

You launch the MFD, click SET, it loads the objectives.
You can click TRK and you have the status of the objectives.
PRV and NXT allows you to browse through multiple objectives.
CLR deletes the eventual alert.

Requirements:
ScriptMFD in modules need to be checked
MFD\ObjectivesMFD.cfg need to be added to Config\MFD\ScriptMFD.cfg
 

Attachments

Perfect, been looking for this to eliminate the clipboard filled with useless stuff. zThanks.
 
Here we go with version 0.3, I guess this can qualify as an alpha or even beta version.
edit: I know that for now it doesn't save between sessions, I'll take care of it soon.

Changelog :
***********
distance from objective implemented
no more "specific" Lua code in config file
lots of CTD taken care of
a goal can depend on the completion of an other

Please comment.

Code:
02/02/2012
To the extent possible under law, Jarod has waived all copyright and related or
neighboring rights to this work.
http://creativecommons.org/publicdomain/zero/1.0/

ObjectivesMFD 0.3
*****************
allows you to put objectives in Orbiter (this is not a finished addon).
Want to put a satellite in a specific Mars orbit for 5 years ? You can track it.
Want to validate goals along your mission ? Multiples goals are supported.


What is done ?
**************
Cfg file is only conditions ans statements, no Lua specific code, very readable.
You can load a file with multiple objectives for your vessel.
You can set an alert if conditions of an objective are no longer met.

You can use the following datas for your conditions :
Alt() current vessel's altitude
gravitybody() gravity reference object name for the ship
surfacebody() surface reference object name for the ship
dockedto() name of the docked ship to your ship
ApR(), ApA(), PeR(), PeA() with the same meaning as in OrbitMFD
objectivecompleted(num) returns true if goal[num] is completed
landedon() name of the planet/moon the ship is landed on
distancefrom(target-ship) returns distance in meters between your ship and
 target-ship

Limitations of this version : 
*****************************
Not every possible variable is available from the get-go, you need to use Lua
scripting for cases not implemented.
Examples of objectives that could be implemented : (some need Lua code to be
specified with the help of Orbiter/Html/Orbiter.chm help file, Orbiter
 Scripting category)
I try to add new cases with each new version so that the user doesn't need to
 use Lua.

- Vessel launched
- Vessel in specific orbit
- Vessel is landed (how far from objective ...)
- Vessel is docked to another given ship, station
- Vessel brought x tons of fuel
...
with or without duration,
with or without precise location.

Completion of an objective can be set like :
 - distance from the objective for the landing
 - a percentage of duration.

 
Explanations of the included example:
*************************************
In \Config\MFD\Objectives, you have a config file XR2-01.cfg, it gives
objectives that can be set to a vessel with the name XR2-01.
For the purpose of the demonstration, you can run the scenario "In orbit,
 undocked from ISS" and "Landed on Brighton Beach" of the XR2 Ravenstar addon.
4 objectives are set :
- the first is to dock to ISS 
- the second is to orbit Earth on a 400km orbit during 6 hours only after
 docking/undocking from ISS
- the third is to orbit Earth on a 200 km orbit during 6 hours, can be completed 
before docking to ISS
- the fourth is to land near the ship "SH-01" (100m max), this is a Shuttle-A on
 the Moon, run "Landed on Brighton Beach" to start near it.

You launch the MFD, click SET, it loads the objectives.
You can click TRK and you have the status of the objectives.
PRV and NXT allows you to browse through multiple objectives.
CLR deletes the eventual alert.


How to write a config file :
*****************************
For your own vessel, just create a new cfg file with the name of your vessel.

	condition1 = (dockedto() == "ISS")

	description[num] = "Description of"
	description2[num] = "an objective"
	goal[num] = condition1 and (condition2 or condition3)
	achievedon[num] = distance / duration / condition
	score[num] = distancefrom("name_of_target") / seconds / 0
	alert[nm] = false / true


Requirements:
*************
ScriptMFD in modules need to be checked
MFD\ObjectivesMFD.cfg need to be added to Config\MFD\ScriptMFD.cfg


Changelog :
***********
distance from objective implemented
no more "specific" Lua code in config file
lots of CTD taken care of
a goal can depend on the completion of an other
 

Attachments

Last edited:
Back
Top