Its is time for another quick update.
So far I was able to finish the skeleton of my next mission. It is a long one so I need to add more staff into it before I can publish. One of the benefits to writing missions is you get the opportunity to test your own plugin and come up with new features.
Replacing Standard
I never want to break the work of others so any new standard or feature I try to implement alongside the original standard. The most profound addition to the current mission dialect is the use of the elements: <flight_plan> and <leg> over <goals> and <goal>.
When I use <goal> it is a little to dramatic for me, so it makes more sense, to me, that we should use "leg" as describing a part of a course.
I have added the support to only use these elements instead of the <goal> one and also modified all attributes to include the word "leg" instead of "goal", for example:
"next_goal" => "next_leg"
I'll have to update the designer guide to reflect all these additions.
So now we should think of a mission as a set of "flight_plan". In each leg we might have one or more objectives and in each objective we have one or more tasks.
I hope that this will make the mission concept easier to grasp.
You can still use the old names and the plugin should be able to parse them all, but I strongly suggest to transition to the new standard once it will be published.
The only exception is the Random Engine. All templates must be modified with the new standard.
New Features
Time-Lapse
While working on the new mission I found that the transition between one "leg" to the other was to abrupt. One of the things I wanted to allow is to change the time but not as an immediate change but to transition to the time asked in a short period of time. Example, if you finish a certain task, we would like to move the clock 2 hours into the future (never backwards). If previously I would have set the clock to the exact hour, the outcome would have been an abrupt change of the surrounding lightning.
Suggestion: provide how many minutes to add to current hour, provide in how many cycles (seconds) you would like the transition to take place and the plugin will change the time gradually over the cycles. This mimic time-lapse but in much shorter period of time. It will also transition the pilot to the new time and scenario.
To achieve that, I have added two new script functions: "fn_timelapse_add_minutes" and "fn_timelapse_to_local_hour".
The first function add minutes to current time, and the later will transition to the next closest local hour that you provide. The limit is 24 hours in one time-lapse and not more than 24 cycles (seconds) to finish the time-lapse.
Please pay attention that we are referring to local hour and not UTC/Zulu hour.
Moving items
Once of the things I wanted to add, long ago, was to allow a designer to move items between inventories.
Introducing the function: FN_MOVE_ITEM_FROM_INV. It will allow you to move and item to other inventories or to just discard them. Simple but effective.
Get task information outside "Leg" scope
Although I covered this topic more than once, I'll have to explain it again, and I'll try to add it in the designer guide: When using external scripts, their scope is not the same for all.
This means, that scripts that were called from inside Leg element will probably see most of the seeded parameters like "name of current Leg( former goal)/objective/trigger or task". But if you call a script from higher level like from a "Leg" then some information is not available since they are not in the right scope.
Example:
<link_to_trigger name="trigger_name" />
When we link to a trigger from a Leg (former goal) element, then the <task> and <objectives> are out of scope for that code. They do not exists for it, therefore we cant use some of the functions that were written for specific scope and should be deprecated to minimize confusion.
Example:
FN_GET_TASK_INFO() - Good only for <trigger/task> based scripts but not to <Leg/Goal> based scripts. The new and improve function is fn_get_task_info_in_objective. That way we can call it from any scope of code.
I hope to go over the list of functions that we can use in scripts and see if they can be used in all scopes, that way there would be less confusion when and how to use a certain function or not.
Cheers
Saar