[MD Tool] MD Control (Scripts can send vars to MD) v1.13a - 20Jan2010
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Changed status from Proof of Concept to Development.
Cleaned up first posts a little.
Scripts are almost complete.
I will start on the MD once the foundational scripts are prepared.
Note to self: Is there the possibility of activating a MD via both MDC and standard conditionals? such as a nested check any in a check all?
Cleaned up first posts a little.
Scripts are almost complete.
I will start on the MD once the foundational scripts are prepared.
Note to self: Is there the possibility of activating a MD via both MDC and standard conditionals? such as a nested check any in a check all?
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Updated to BETA.
It is fully functioning and can be implemented now.
The key handling and variable handling is implemented in SE and later versions most likely will not require external changes.
The only thing remaining is to finish variable handling.
I can currently pass strings and numbers from SE to MD.
However, I currently do not know MD well enough to handle the variables correctly in MD.
Once this hurdle is overcome we will have basic variable handling SE to MD and MD to SE.
For example, passing strings will be handled by the ship and station names and numbers by capital ships and energy cells.
True and False is 1 and 0.
It is fully functioning and can be implemented now.
The key handling and variable handling is implemented in SE and later versions most likely will not require external changes.
The only thing remaining is to finish variable handling.
I can currently pass strings and numbers from SE to MD.
However, I currently do not know MD well enough to handle the variables correctly in MD.
Once this hurdle is overcome we will have basic variable handling SE to MD and MD to SE.
For example, passing strings will be handled by the ship and station names and numbers by capital ships and energy cells.
True and False is 1 and 0.
-
- Sith Lord
- Posts: 8255
- Joined: Wed, 6. Nov 02, 20:31
come back when you have passed [ external image ] 1 million lines of SE code padwanh2o.AvA wrote: Time for a break.. just browsed through 16k lines of director.xsd..

as a request if you keep are bare minimum template that pretty much just calls 'x' script it may temp lazy scriptors liker myself to delve into it.
you can then update another version as you go along as some of us may get off our backsides and help
LV's TC Scripts
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
Readme's For All My Scripts
I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced
si tacuisses, philosophus mansisses
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Coding a million lines is one thing.
Reading the director.xls is another...
One is fuuuuuun.
The other is "A Tale of Two Cities."

But.. GEEZ 1 million lines of hobby code.
I bow before you. *bows*
I don't think I can shrink the MD template or the SE lines any more than they are, at least not until I start getting bug reports or some constructive feedback/tips.
Variables will be passed via two arrays.
SE:
$key = 123456
$var.str.array = array alloc: size=Max 16 (names of ships/stations)
$var.num.array = array alloc: size=Max 10 (# of ecells in the stations)
=<RefObj> call script 'md.control.key' : key=$key strings=$var.str.array numbers=$var.num.array
(strings and numbers are not implemented in the beta)
MD:
Paste your MD between the comment lines and replace all XXXXXX with your key and then break the key into the single Xs.
Reading the director.xls is another...
One is fuuuuuun.
The other is "A Tale of Two Cities."

But.. GEEZ 1 million lines of hobby code.
I bow before you. *bows*
I don't think I can shrink the MD template or the SE lines any more than they are, at least not until I start getting bug reports or some constructive feedback/tips.
Variables will be passed via two arrays.
SE:
$key = 123456
$var.str.array = array alloc: size=Max 16 (names of ships/stations)
$var.num.array = array alloc: size=Max 10 (# of ecells in the stations)
=<RefObj> call script 'md.control.key' : key=$key strings=$var.str.array numbers=$var.num.array
(strings and numbers are not implemented in the beta)
MD:
Paste your MD between the comment lines and replace all XXXXXX with your key and then break the key into the single Xs.
Code: Select all
<cues>
<!--Replace all XXXXXX with your Key. (for example: 987654)-->
<cue name="MDControl_XXXXXX">
<condition>
<check_all>
<!--Change X to the 1st number in your key. (for example: Key=987654 X=9)-->
<object_is_docked object="MDControl.ControlShip0" dockobject="MDControl.ControlStationX"/>
<!--Change X to the 2nd number in your key. (for example: Key=987654 X=8)-->
<object_is_docked object="MDControl.ControlShip1" dockobject="MDControl.ControlStationX"/>
<!--Change X to the 3rd number in your key. (for example: Key=987654 X=7)-->
<object_is_docked object="MDControl.ControlShip2" dockobject="MDControl.ControlStationX"/>
<!--Change X to the 4th number in your key. (for example: Key=987654 X=6)-->
<object_is_docked object="MDControl.ControlShip3" dockobject="MDControl.ControlStationX"/>
<!--Change X to the 5th number in your key. (for example: Key=987654 X=5)-->
<object_is_docked object="MDControl.ControlShip4" dockobject="MDControl.ControlStationX"/>
<!--Change X to the 6th number in your key. (for example: Key=987654 X=4)-->
<object_is_docked object="MDControl.ControlShip5" dockobject="MDControl.ControlStationX"/>
</check_all>
</condition>
<cues>
<cue name="MDControl_XXXXXX_Resetships">
<condition>
<cue_is_complete cue='MDControl_XXXXXX'/>
</condition>
<action>
<do_all>
<run_script script="md.control.reset"/>
<reset_cue cue="MDControl_XXXXXX"/>
</do_all>
</action>
<!--Begin: Paste your MD below this comment-->
<cues>
<cue name="Your MD name">
<condition>
<check_all>
<cue_is_complete cue="MDControl_XXXXXX_Resetships"/>
</check_all>
</condition>
</cue>
<!--End: Paste your MD above this comment-->
</cues>
</cue>
</cues>
</cue>
</cues>
-
- EGOSOFT
- Posts: 12103
- Joined: Fri, 21. May 04, 17:15
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
It's resetting the very top cue:Ketraar wrote:<cue name="Your MD name"> Will never trigger since its a child cue of <cue name="MDControl_XXXXXX_Resetships"> and you have a reset in it, which will reset <cue name="MDControl_XXXXXX_Resetships"> and all its child cues.
<cue name="MDControl_XXXXXX">
The example MD has:
Code: Select all
<cue name="MDControl_987654_Reset">
<condition>
<cue_is_complete cue="MDControl_987654"/>
</condition>
<action>
<do_all>
<run_script script="md.control.reset"/>
<reset_cue cue="MDControl_987654"/>
<incoming_message popup="1" author="MDControl_987654_Reset" text="987654 - Reset"/>
</do_all>
</action>
<!--Begin the 3rd party MD-->
<cues>
<cue name="MDControl_ALPHA_Test">
<condition>
<cue_is_complete cue="MDControl_987654_Reset"/>
</condition>
<action>
<incoming_message popup="1" author="MDControl_ALPHA_Test" text="3rd Party MD - Running"/>
</action>
</cue>
</cues>
<!--End of the 3rd party MD-->
When I run the example I receive that message. it seems like it is running the child cue, even after the top parent cue is reset.
-
- EGOSOFT
- Posts: 12103
- Joined: Fri, 21. May 04, 17:15
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Uploaded BETA v0.81
MD template just got smaller.
I shrank it down to just the top cue.
After removing this line from the below example:
<reset_cue cue="MDControl_987654"/>
It activated once, then never again.
After placing it back in, it activates and displays the child cue's message every time I execute the script.
Even after creating a child cue of a child cue of cue name"MDControl_BETA_Test" all the child cues sent their messages. Perhaps you are thinking of destroy_cue, complete_cue, or cancel_cue?
I have never tested those three.
However, reset_cue seems to only reset the specified cue, whether it is in the Doing cue or not, and allows the Doing cue's child cues to continue.
MD template just got smaller.
I shrank it down to just the top cue.
After removing this line from the below example:
<reset_cue cue="MDControl_987654"/>
It activated once, then never again.
After placing it back in, it activates and displays the child cue's message every time I execute the script.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
<documentation>
<author name="h2o.AvA" alias="Ava" contact="PM me on forums.egosoft.com"/>
<content reference="MD Control" name="MD Control BETA Test" description="Example: showing fully functional incoming Key activation"/>
<version number="0.81" date="22-11-2010" status="testing"/>
</documentation>
<cues>
<!-- cue name = MDControl_Key : Key = 987654 -->
<cue name="MDControl_987654">
<condition>
<check_all>
<object_is_docked object="MDControl.ControlShip0" dockobject="MDControl.ControlStation9"/>
<object_is_docked object="MDControl.ControlShip1" dockobject="MDControl.ControlStation8"/>
<object_is_docked object="MDControl.ControlShip2" dockobject="MDControl.ControlStation7"/>
<object_is_docked object="MDControl.ControlShip3" dockobject="MDControl.ControlStation6"/>
<object_is_docked object="MDControl.ControlShip4" dockobject="MDControl.ControlStation5"/>
<object_is_docked object="MDControl.ControlShip5" dockobject="MDControl.ControlStation4"/>
</check_all>
</condition>
<action>
<do_all>
<run_script script="md.control.reset"/>
<incoming_message popup="1" author="MDControl_987654" text="987654 - Started"/>
<reset_cue cue="MDControl_987654"/>
</do_all>
</action>
<!--Begin the 3rd party MD-->
<cues>
<cue name="MDControl_BETA_Test">
<condition>
<cue_is_complete cue="MDControl_987654"/>
</condition>
<action>
<incoming_message popup="1" author="MDControl_BETA_Test" text="3rd Party MD - Running"/>
</action>
</cue>
</cues>
<!--End of the 3rd party MD-->
</cue>
</cues>
</director>
I have never tested those three.
However, reset_cue seems to only reset the specified cue, whether it is in the Doing cue or not, and allows the Doing cue's child cues to continue.
-
- Posts: 1842
- Joined: Mon, 10. Aug 09, 02:09
so, would it be posible to pass, for example, a ship ID to MD?
what I am thinking here is some kind of mission like 'protecting assault' for IR, so shipyard launching assault can give player a mission to protect it.
Jack08 was talking about missions like this done via script, yet, I really would like to see it as MD mission
what I am thinking here is some kind of mission like 'protecting assault' for IR, so shipyard launching assault can give player a mission to protect it.
Jack08 was talking about missions like this done via script, yet, I really would like to see it as MD mission
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Not at this time.
However, you could have IR start the mission and have the MD create the ships 200km from anything and is near an IR created control object which IR scans its vicinity locking onto and integrating all the MD created ships into IR.
Might not be the best way, but it is one way I just thought of off the top of my head.
Summarized:
It is doable.
IR can start the MD, however the MD needs to create the ships. Have the SY create the ships first, then destroy those as it tells MD to create the ships, so that the SY doesn't get free ships.
edit:
I found an easier way. Have the SY create the ships then when IR is ready to start the mission, have the ships jump to a location 200km from anything. Then start the MD, the MD creates an object at that location then does "find_ship" and assigns all the ships an MD name which MD can then use. Destroy the created object and jump the ships back to the SY or whereever and begin the mission.
However, you could have IR start the mission and have the MD create the ships 200km from anything and is near an IR created control object which IR scans its vicinity locking onto and integrating all the MD created ships into IR.
Might not be the best way, but it is one way I just thought of off the top of my head.
Summarized:
It is doable.
IR can start the MD, however the MD needs to create the ships. Have the SY create the ships first, then destroy those as it tells MD to create the ships, so that the SY doesn't get free ships.
edit:
I found an easier way. Have the SY create the ships then when IR is ready to start the mission, have the ships jump to a location 200km from anything. Then start the MD, the MD creates an object at that location then does "find_ship" and assigns all the ships an MD name which MD can then use. Destroy the created object and jump the ships back to the SY or whereever and begin the mission.
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Changed status to Release v1.0, since this is fully working.
v1.1 will have the ability to send your number and string variables to md.
Use this format to prepare for v1.1:
$var.array = array alloc: size=16
Fill the array with your variables, no arrays with the array please.
Your MD will receive number and string variables as follows:
$var.array[0] will be assigned to {XXXXXX}.var0
$var.array[15] will be assigned to {XXXXXX}.var15
Strings and numbers will be assigned to those vars, so your MD can be setup however you want.
With the XXXXXX as your key. Post your key or block of keys and I'll add them to one of the first posts as reserved.
v1.1 will have the ability to send your number and string variables to md.
Use this format to prepare for v1.1:
$var.array = array alloc: size=16
Fill the array with your variables, no arrays with the array please.
Your MD will receive number and string variables as follows:
$var.array[0] will be assigned to {XXXXXX}.var0
$var.array[15] will be assigned to {XXXXXX}.var15
Strings and numbers will be assigned to those vars, so your MD can be setup however you want.
With the XXXXXX as your key. Post your key or block of keys and I'll add them to one of the first posts as reserved.
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Updated V1.2[color]
Now compatible with XTC.
Queue was not working.
Until it is, I've slowed it down.
At this point in time you must use "= [object/null]->call script 'md.control.key' parameters: key=$key.number vars=$variable.array"
I've also released the first SE/MD which utilizes MD Control.
Check out:
Dynamic Colored Sector Names
Now compatible with XTC.
Queue was not working.
Until it is, I've slowed it down.
At this point in time you must use "= [object/null]->call script 'md.control.key' parameters: key=$key.number vars=$variable.array"
I've also released the first SE/MD which utilizes MD Control.
Check out:
Dynamic Colored Sector Names
-
- Posts: 349
- Joined: Sun, 12. Oct 08, 04:04
Apparently when you send an array to a script via a script argument it will destroy itself unless you clone it before sending it to another script.
Update 1.13
Queue is working (Finally..I spammed it with 240 requests at the same time and it accomplished every single one in the order they arrived.)
Now it is time to work on passing strings and seeing if I can get MD to think that a string is actually a number.
It's a pity that MD can't do anything with ID Codes, except display them.. why can't it search for them?
Update 1.13
Queue is working (Finally..I spammed it with 240 requests at the same time and it accomplished every single one in the order they arrived.)
Now it is time to work on passing strings and seeing if I can get MD to think that a string is actually a number.
It's a pity that MD can't do anything with ID Codes, except display them.. why can't it search for them?
-
- Posts: 691
- Joined: Thu, 10. May 07, 17:45
One simple Question, the MD can read the Shipname i guess?, so..,
Skrip ends with:
and the Md reads out the name of the ship/ or starts the Cue with condition has this name.
also you can check later the amount of E cells or something other in its cargo bay, then , at hte ent of the cue you set back the shipnae to default.
when i thik about it you can get a lot moe infos trug this fron SE to Md, you even dont need an own sektor, Nav beacons also can have names, you dont need to dock at Stations an add 10 lines of code on every single cue to start, on or to lines are enough.
you could make it so that the SE enters whole strings, variables and mor trough this system:
Nav beacon 1: startcondition for cues
Nav beacon 2- 11: Variables 1-10
nav beacon 11-21: Strings 1-10
and so on, with not mutch brainwork for the programmer and not much lines in the code.
not much lines in the code means, not much CPU power.
Pm me, we have to talk
[/code]
Skrip ends with:
Code: Select all
$se_to_md-> set name to "start cue 123"
also you can check later the amount of E cells or something other in its cargo bay, then , at hte ent of the cue you set back the shipnae to default.
when i thik about it you can get a lot moe infos trug this fron SE to Md, you even dont need an own sektor, Nav beacons also can have names, you dont need to dock at Stations an add 10 lines of code on every single cue to start, on or to lines are enough.
you could make it so that the SE enters whole strings, variables and mor trough this system:
Nav beacon 1: startcondition for cues
Nav beacon 2- 11: Variables 1-10
nav beacon 11-21: Strings 1-10
and so on, with not mutch brainwork for the programmer and not much lines in the code.
not much lines in the code means, not much CPU power.
Pm me, we have to talk
