Mission Director Basics and Installation

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Sat, 12. Apr 08, 01:01

Thanks for verifying and clarification. I do hope this "feature" is changed for next release (TC). Having message backlog appear when returning from Khaak sector is not good. Certainly there are cases where popup's may be useful in Khaak sectors as well as others. I suppose messages could be supressed in such sectors, but that seems a bit unreasonable. :)

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Sat, 12. Apr 08, 13:22

Hi guys - I'm back with another question...

I suppose this could be non-MD specific. Can the player dock at an M1 that isn't theirs? Like docking at a station? I fear the answer to this is no...If so, can anyone suggest a workaround using the MD? In a ship not capable of jumping, I would hope it would dock with the capship, and then the capship would jump automatically.

The solution could be - briefly change the ownership of the capship to the player, then once the player docks, use the warp command, then the player undocks and ownership is returned to normal?

Thanks.
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13087
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Sat, 12. Apr 08, 17:21

Unfortunately, that is not possible. I'm quite sure that temporarily setting a ship to the player race will open up a heap of exploits too. You could just warp the player and put some fiction behind it, perhaps make it cost money and energy cells.
Come watch me on Twitch where I occasionally play several of the X games

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Wed, 16. Apr 08, 10:33

I am a brand new newbee... so excuse me if I am posting idiot questions...
I tried the "Hello World" script and nothing happened until I changed the name of the player in Thereshallbewings...
I want to make a "distributable plot" that should take place before, during or after the normal plot and the Bala-Gi missions. So it's important that the missions are triggered regardless the name of the player!
So here are the questions...

1: Once a mission or a set of missions have been made with MD, is it mandatory that the pilot's name is "Thereshallbewings"?
2: Is there a way to compile the missions created with MD in cat/dat files, as for creating false-patches?
3: can a mission created in one file (ie "GargaMission-1") set values or attributes that can be read in other files (ie "GargaMission-2")

4: If the answer to question 2 is "no", is there a way/program to translate missions created in MD into a script that can be compiled in cat/dat files?
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Wed, 16. Apr 08, 10:51

Buon giorno Garga-Potter
so excuse me if I am posting idiot questions...
There is no such thing, there are only questions.


1. You don't have to "change" your name, but you need to activate the ScriptEditor and that is achieved by typing Thereshallbewings in your pilot name, but if you type it right your previous name will show up again.

2. True is that I never tried that. But just put the files in a 10.cat, refer to director\ and let me know if it worked :D

3. yes

4. Afaik there is a one-way relation between the SE and the MD. No, is my best guess.

ChemODun
Posts: 320
Joined: Mon, 12. Feb 07, 21:58
x3tc

Post by ChemODun » Sun, 20. Apr 08, 22:27

Multiply entropy by absolute zero

Ñâîáîäà ñðåäè çâåçä / Freedom in space

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Fri, 25. Apr 08, 20:33

I have a new question... not idiot ones though :D

- is the subcues tree parsed after the parent cue is completed (all the action part is done) or after it has been triggered?

Let's say the structure is

- cue MAIN
-- cue step0
--- cue step 1
---- cue step 2

Is the cue "step 2" evaluated everytime or only after the parent cues are completed?

And will the "state" of the cues be remembered when the player saves+exits the game?
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Fri, 25. Apr 08, 22:51

Garga-Potter wrote: - cue MAIN
-- cue step0
--- cue step 1
---- cue step 2

Is the cue "step 2" evaluated everytime or only after the parent cues are completed?
You mean

- cues
--cue
---action
---/action
----cues
-----cue

As I understand it, child cues will be handled in order, so only after the parent cue is done or the action in it. If you need multiple cues to be checked at the same time, have them in the same level, like this

-cues
--cue
---action
---/action
--/cue

--cue
---action
and so on

This has worked for me so far.
And will the "state" of the cues be remembered when the player saves+exits the game?
Yes.

MFG

Ketraar
Image

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Sun, 27. Apr 08, 13:36

Thank you... here another thing...

I tried to load a text from an external file, as it is in the examples, but it doesn't work!

I put the text file in the "t" folder, as xml (and in txt, just in case), load it from inside the cue-tree, but what I get is the textidnotfound error...

If I put the file internally inside the "incomming_message" tag I see it and the values in it are correct... I don't understand what is going on...

And I have no director.dmp file neither: what should I activate to have that file?

@ketraar: the tree was "optimized" just to make see how the cues were one inside the other! It was (for me) obvious every cue had to be wellformed, with condition, timing or/and action before the subsequent cues tag...
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Sun, 27. Apr 08, 16:58

Garga-Potter wrote:I tried to load a text from an external file, as it is in the examples, but it doesn't work!

Code: Select all

<load_text fileid="1234"/>
That did work for me.
Note that the language code number is not present.
@ketraar: the tree was "optimized" just to make see how the cues were one inside the other! It was (for me) obvious every cue had to be wellformed, with condition, timing or/and action before the subsequent cues tag...
Not sure what you exactly mean, but just to clarify things.

These cues will be checked simultaneously

Code: Select all

    <cue name="">
      <
    </cue>

    <cue name="">
      <
    </cue>
These will be handled in order

Code: Select all

    <cue name="Parent cue">
      <action>
        <
      </action>
      <cues>
        <cue name="child cue (or sub-cue)" comment="This one will be handled after the above parent cue is delt with">
          <
        </cue>
      </cues>
    </cue>
Hope that was clearer now.

MFG

Ketraar
Image

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Mon, 28. Apr 08, 08:11

Ketraar wrote:

Code: Select all

<load_text fileid="1234"/>
This is what I did too, and as the error has something to do with the textid and not the file I think that the file is loaded...

So, here is what I have...

Code: Select all

<cues>
   <cue name="HumPrepare">
      <condition>...</condition>
      <action>
         <do_all>
            <load_text fileid="3247"/>
            ...
         </do_all>
      </action>
      <cues>
         <cue>
            <condition>...</condition>
            <action>
               <incoming_message author="Grip Whetp" text="{247,1}" popup="1" />
            </action>
            <cues>
               <cue>
                  <condition>...</condition>
                  <action>
                     <incoming_message author="Grip Whetp" text="{247,2}"  />
                  </action>
               </cue>
            </cues>
         </cue>
      </cues>
   </cue>
</cues>
And here is the text (called 3247.xml and in the "t" folder of the game) - I am building the tags by heart, so I'm not sure they are right, but I took the sample file given with the director help files changing only the texts: can it be that the sample file is buggy in some way?

Code: Select all

<language code="39">
   <page id="247">
      <t id="0"> </t>
      <t id="1">Some text part 1</t>
      <t id="2">Some text part 2</t>
   </page>
</language>
By the way... if the language code is not in the name of the file, how can Missions made with MD be multilanguage?
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13087
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Mon, 28. Apr 08, 13:00

Some of your cues do not have names, unless you removed them for the example.

Also, subcues will be triggered as soon as the parent is. If actions in the parent are delayed due to a timeing node, then the subcue will trigger before the parents actions are complete.
To stop this from happening the sub cue must have the <cue_complete/> condition.
Come watch me on Twitch where I occasionally play several of the X games

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Mon, 28. Apr 08, 13:26

Sorry: I thought I said it: if I put the text "hard-coded" in the cues, the text appears normally...

All the cues have names and all subcues conditions start with a "cue_complete" check of the parent cue

Tonight :D I will try the Mission with the embedded texts...

By the way: maybe this is important!: the example with external texts is on a BBS, while my mission is not...

I also copied the text as .txt (changed the extension but not the XML structure), in the "t" folder in the game root directory, but nothing changed...
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 28. Apr 08, 15:06

Xenon_Slayer wrote:Also, subcues will be triggered as soon as the parent is.
Yes, but only if the conditions in the parent cue are met, right?
Or are both parent and sub cues conditions checked simultaneously?

Just to clarify things.

MFG

Ketraar
Image

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 28. Apr 08, 17:44

Garga-Potter wrote: 2: Is there a way to compile the missions created with MD in cat/dat files, as for creating false-patches?

4: If the answer to question 2 is "no", is there a way/program to translate missions created in MD into a script that can be compiled in cat/dat files?
i dont know about MD files, but scripts files dont work corrently if you put them in cat files. You should really put them in the directory rather than in a fake patch.

y would you want to put such files in a fake patch anyways ?

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Mon, 28. Apr 08, 23:05

We are planning a story and whe would like to give it in several languages without having to tell the user "this should go here, that should go there", and so on. I know that zipping all stuff maintains the directory tree when unzipped, but it could overwrite other files as well. Putting all in a false patch could reduce this risk.

I admit I am not an expert of X3 programming at all: this is actually my first approach to the world of scripting-modding-missiondirectoring in X3 so maybe some issues have been discussed before somewhere else...
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

Garga-Potter
Posts: 781
Joined: Fri, 4. Aug 06, 14:50
x3tc

Post by Garga-Potter » Tue, 29. Apr 08, 08:03

I got the external text solution by reading this post thoroughly :roll:

http://forum.egosoft.com/viewtopic.php?p=2346344

and the 2 posts underneath that one

I suppose it would be a good thing to either make a new PDF with the right explanations (eg the example explained in the booklet will NEVER work as it misses the starting load_file tag) or by adjusting the files suplied in the first post!!!

Or maybe both?

Or maybe just writing an addendum in the first post saying how the external text may be linked in the game!

Ah! By the way: it should be also important to say that the dmp file has been disabled (or how one can enable it), as it is another wrong info placed in the PDF! I spend hours in trying to understand how this thing works!!!

So... to make it clear...

* external texts:
- the structure of the example (BM47_XXXT.xml and the accompagnying text) is right BUT: the first bit of the text call MUST be the same as the pageid tag in the text (in the example the leading "3" is missing both in the calling bit AND in the text file) AND the text filename MUST be the same as the one called in load_text PRECEDED by the language code!!!

* director.dmp: it has been disabled due to performance issues

* detailed script (gate race)
- missing the load_text tag (add in the action part of the prepare cue <load_text fileid="1081">)
- missing the text file, but the name for this example to work MUST BE 391081.xml and the structure is anyway very simple:

Code: Select all

<language id="39"><!-- your language code, remember to set the filename to this code + the pageid code -->

    <page id="[b]1081[/b]" desc="whatever you want">
        <t id="0"> </t>
        <t id="1"> bla bla bla </t>
        <t id="2"> hipty dipty doo </t>
        <t id="3">Sim Sal Bim</t>
        <t id="4">Dart Vader</t>
        <t id="5">and so on</t>
    </page>
</language>
Hope this helps...
- Never argue with an idiot: he will first take you to his level and then crash you with his experience!
- If you live in a village and never met his fool... start to worry!
- Good Bye, and thanks for all the fish.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 29. Apr 08, 13:16

Garga-Potter wrote:We are planning a story and whe would like to give it in several languages without having to tell the user "this should go here, that should go there", and so on. I know that zipping all stuff maintains the directory tree when unzipped, but it could overwrite other files as well. Putting all in a false patch could reduce this risk.

I admit I am not an expert of X3 programming at all: this is actually my first approach to the world of scripting-modding-missiondirectoring in X3 so maybe some issues have been discussed before somewhere else...
you could of course jsut use the plugin manager and create your mod in a spk file so its installed automatically for you

ChemODun
Posts: 320
Joined: Mon, 12. Feb 07, 21:58
x3tc

Post by ChemODun » Wed, 7. May 08, 15:42

Previously:
CBJ wrote:
ChemODun wrote:May I post in this thread link to russian translation of Manual and MD files, when I will finish it?
Of course! Positive contributions are always welcome. :)
Now it finished.
ChemODun wrote:Hi All.

Here is Russian Version of XMDGuide manual in pdf.
And same Guide in *.chm format.
As I can see EGOSOFT doesn't need Russian translation. Is it true?
Multiply entropy by absolute zero

Ñâîáîäà ñðåäè çâåçä / Freedom in space

Ilintar
Posts: 122
Joined: Sat, 5. Jul 08, 23:39
x3tc

Post by Ilintar » Wed, 9. Jul 08, 03:37

Hello,

I've just recently started playing X3 and since I like playing around with editors and stuff (and I wanted to add some entertaining BBS quests to the game), I thought I'd get myself acquainted with the Mission Director. I thought I'd modify a sample mission first, so I took the escort mission. Here's the code:

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="Owen Lake" alias="Xenon_Slayer" contact="E-Mail: Owen@Egosoft.com" />
    <content reference="GG01" name="Basic Escort Mission" description="Escort ship to destination station"/>
    <version number="0.2" date="02/01/08" status="Sample"/>
  </documentation>
  <cues>
    <cue name="GG Add Mission">
      <action>
        <add_bbs_quest name="GG01" priority="1000" max="1"/>
      </action>
      <cues>
        <cue name="GG01" instantiate="static">
          <condition>
            <bbs_quest_evaluated quest="GG01"/>
          </condition>
          <action>
            <do_all>
              <find_station name="GG01.Destination Station" dockingallowed="1" race="default">
                <jumps min="1" max="2"/>
              </find_station>
            </do_all>
          </action>
          <cues>
            <cue name="GG01 Mission Offer">
              <condition>
                <check_all>
                  <check_value value="{object.exists@GG01.Destination Station}" exact="1"/>
                </check_all>
              </condition>
              <action>
                <do_all>
                  <set_value name="GG01.Reward" min="({player.traderank.rank}+1) * 10000" max="({player.traderank.rank}+1) * 20000"/>
                  <set_value name="GG01.Offer Race" exact="{player.dockobject.race}"/>
                  <create_actor name="GG01.Offer Actor" character="{random.pilot.{value@GG01.Offer Race}}"/>
                  <offer_bbs_quest quest="GG01" author="{actor.name@GG01.Offer Actor}" text="[center][u]Ship Escort[/u]\n\n [b]{actor.name@GG01.Offer Actor}[/b] will offer [b]{value@GG01.Reward} credits[/b] to anyone who will escort a trading convoy to [b]{object.name@GG01.Destination Station}, {object.sector.name@GG01.Destination Station}[/b]. Be aware that multiple pirate attacks are expected, as the ship is carrying valuable cargo and the pirates have someone caught onto it.[/center] \n\n[center][select value='Accept']Accept[/select][/center]"/>
                </do_all>
              </action>
              <cues>
                <cue name="GG01 Mission Accepted">
                  <condition>
                    <bbs_quest_selected quest="GG01"/>
                  </condition>
                  <action>
                    <do_all>
                      <accept_bbs_quest quest="GG01"/>
                      <set_value name="GG01.Mission End" exact="0" />
                      <set_value name="GG01.Jumps" min="1" max="({player.fightrank.rank}/3)+2" profile="decreasing"/>
                      <do_if value="{object.exists@GG01.Destination Station}" exact="0" comment="Incase the station was destroyed during the BBS offer.">
                        <incoming_message author="{actor.name@GG01.Offer Actor}" popup="1" text="Sorry. Our transports have already left. Thanks for offering anyway."/>
                      </do_if>
                      <incoming_message author="{actor.name@GG01.Offer Actor}" popup="1" text="Ok. The destination is {object.name@GG01.Destination Station}, {object.sector.name@GG01.Destination Station}"/>
                      <do_all>
                        <create_ship leader="1" group="GG01.Escorted Ships" class="ts" highlight="1"
                                     race="{value@GG01.Offer Race}" typename="SS_SH_A_TS" capturable="1" racelogic="0">
                          <position exact="4km" object="{player.dockobject}"/>
                          <equipment loadout="default"/>
                        </create_ship>
                      </do_all>
                      <do_all chance="60">
                        <create_ship group="GG01.Escorted Ships" class="ts" highlight="1"
                                     race="{value@GG01.Offer Race}" typename="SS_SH_A_TS_1" capturable="1" racelogic="0">
                          <position exact="1km" object="{group.leader@GG01.Escorted Ships}"/>
                          <equipment loadout="default"/>
                        </create_ship>
                      </do_all>
                      <do_all chance="60">
                        <create_ship group="GG01.Escorted Ships" class="ts" highlight="1"
                                     race="{value@GG01.Offer Race}" typename="SS_SH_A_TS_2" capturable="1" racelogic="0">
                          <position exact="1km" object="{group.leader@GG01.Escorted Ships}"/>
                          <equipment loadout="default"/>
                        </create_ship>
                      </do_all>
                      <set_group_command group="GG01.Escorted Ships" command="follow" commandobject="{group.leader@GG01.Escorted Ships}"/>
                      <set_command object="{group.leader@GG01.Escorted Ships}" command="dock" commandobject="GG01.Destination Station"/>
                      <set_value name="GG01.Group Size" exact="{group.object.count@GG01.Escorted Ships}"/>
                    </do_all>
                  </action>
                  <cues>
                    <cue name="GG01 Destination Reached">
                      <condition>
                        <check_all>
                          <all_objects_are_docked group="GG01.Escorted Ships" dockobject="GG01.Destination Station"/>
                          <check_value value="{group.object.count@GG01.Escorted Ships}" min="1"/>
                        </check_all>
                      </condition>
                      <timing>
                        <time exact="5s"/>
                      </timing>
                      <action>
                        <do_all>
                          <incoming_message text="Thank you for getting us to our destination. As promised, here are the [b]{value@GG01.Reward} credits[/b]."/>
                          <reward_player>
                            <money exact="{value@GG01.Reward}"/>
                            <traderank min="30" max="50" />
                          </reward_player>
                        </do_all>
                      </action>
                    </cue>

                    <cue name="GG01 Create Pirates">
                      <timing>
                        <count exact="3"/>
                        <time min="1m" max="2m"/>
                        <!--<interval exact="3m"/>-->
                      </timing>
                      <action>
                        <do_all comment="When interval is fixed make this perform multiple times">
                          <set_object name="GG01.Random Ship" value="{group.object.random@GG01.Escorted Ships}"/>
                          <create_ship class="m4" group="GG01.Pirates" covered="0" race="pirate" racelogic="0" typename="SS_SH_M4_P_1">
                            <position object="GG01.Random Ship" max="10km"/>
                            <sector sector="{object.sector@GG01.Random Ship}"/>
                            <equipment loadout="default"/>
                            <command command="attack" commandobject="GG01.Random Ship"/>
                          </create_ship>
                        </do_all>
                      </action>
                    </cue>

                    <cue name="GG01 Create Pirates 2">
                      <timing>
                        <count exact="3"/>
                        <time min="5m" max="6m"/>
                      </timing>
                      <action>
                        <do_all comment="Second group of pirate raiders">
                          <set_object name="GG01.Random Ship2" value="{group.object.random@GG01.Escorted Ships}"/>
                          <create_ship class="m4" group="GG01.Pirates2" covered="0" race="pirate" racelogic="0" typename="SS_SH_M4_P_1">
                            <position object="GG01.Random Ship2" max="10km"/>
                            <sector sector="{object.sector@GG01.Random Ship2}"/>
                            <equipment loadout="default"/>
                            <command command="attack" commandobject="GG01.Random Ship"/>
                          </create_ship>
                        </do_all>
                      </action>                      
                    </cue>

                    <cue name="GG01 Ship Destroyed" instantiate="static">
                      <condition>
                        <any_object_destroyed group="GG01.Escorted Ships"/>
                      </condition>
                      <timing>
                        <time exact="1s"/>
                      </timing>
                      <action>
                        <do_all>
                          <do_choose>
                            <do_when value="{group.object.count@GG01.Escorted Ships}" min="1">
                              <do_choose>
                                <do_when value="{group.leader.exists@GG01.Escorted Ships}" exact="1">
                                  <incoming_message text="A Ship has been Destroyed"/>
                                </do_when>
                                <do_when value="{group.leader.exists@GG01.Escorted Ships}" exact="0">
                                  <set_object name="GG01.Temp Object" value="{group.object.random@GG01.Escorted Ships}"/>
                                  <set_group_leader group="GG01.Escorted Ships" object="GG01.Temp Object"/>
                                  <incoming_message text="{group.leader@GG01.Escorted Ships}"/>
                                  <set_group_command group="GG01.Escorted Ships" command="follow" commandobject="{group.leader@GG01.Escorted Ships}"/>
                                  <set_command object="{group.leader@GG01.Escorted Ships}" command="dock" commandobject="GG01.Destination Station"/>
                                  <set_group_command group="GG01.Pirates" command="attack" commandobject="{group.object.random@GG01.Escorted Ships}"/>
                                  <set_group_command group="GG01.Pirates2" command="attack" commandobject="{group.object.random@GG01.Escorted Ships}"/>
                                  <incoming_message text="The Escort Leader was destroyed!" author="{actor.name@GG01.Offer Actor}"/>
                                </do_when>
                              </do_choose>
                            </do_when>
                            <do_otherwise>
                              <set_group_command group="GG01.Pirates" command="default"/>
                              <set_group_command group="GG01.Pirates2" command="default"/>
                              <cancel_cue cue="GG01"/>
                            </do_otherwise>
                          </do_choose>
                        </do_all>
                      </action>
                    </cue>

                    <cue name="GG01 Ship Captured By Player" instantiate="static" comment="Removing captured ships from mission groups is important">
                      <condition>
                        <any_object_captured group="GG01.Escorted Ships"/>
                      </condition>
                      <action>
                        <remove_object_from_group object="{event.object}" group="GG01.Escorted Ships"/>
                      </action>
                    </cue>

                    <cue name="GG01 Start Cleanup">
                      <condition>
                        <check_any>
                          <object_destroyed object="GG01.Destination Station"/>
                          <object_destroyed_by_player object="GG01.Destination Station"/>
                          <any_object_destroyed_by_player group="GG01.Escorted Ships"/>
                          <any_object_captured group="GG01.Escorted Ships"/>
                        </check_any>
                      </condition>
                      <timing>
                        <time exact="2s"/>
                      </timing>
                      <action>
                        <do_all>
                          <set_value name="GG01.Ship Count" exact="1"/>
                          <do_choose>
                            <do_when value="{group.object.count@GG01.Escorted Ships}" min="1">
                              <do_choose>
                                <do_when value="{object.exists@GG01.Destination Station}" exact="1">
                                  <set_group_command group="GG01.Escorted Ships" command="dock" commandobject="GG01.Destination Station"/>
                                  <set_value name="GG01.Fail Reason" exact="1" comment="Replace with Text ID"/>
                                </do_when>
                                <do_otherwise>
                                  <do_all exact="{group.object.count@GG01.Escorted Ships}">
                                    <find_station class="station" dockingallowed="1" name="GG01.Cleanup Station" nearest="1">
                                      <sector sector="{object.sector@{group.object.{value@GG01.Ship Count}@GG01.Escorted Ships}}"/>
                                      <jumps min="1"/>
                                    </find_station>
                                    <set_command object="{group.object.{value@GG01.Ship Count}@GG01.Escorted Ships}" command="movesector">
                                      <sector sector="{object.sector@GG01.Cleanup Station}"/>
                                    </set_command>
                                    <set_value name="GG01.Fail Reason" exact="2"/>
                                    <set_value name="GG01.Ship Count" exact="{value@GG01.Ship Count}+1"/>
                                  </do_all>
                                </do_otherwise>
                              </do_choose>
                              <cancel_cue cue="GG01 Ship Destroyed"/>
                              <cancel_cue cue="GG01 Destination Reached"/>
                              <cancel_cue cue="GG01 Create Pirates"/>
                              <cancel_cue cue="GG01 Create Pirates 2"/>
                            </do_when>
                            <do_otherwise>
                              <incoming_message text="You have performed a hostile act onto one of our ships. You have failed the mission."/>
                              <cancel_cue cue="GG01"/>
                            </do_otherwise>
                          </do_choose>
                          <do_if value="{value@GG01.Mission End}" exact="0">
                            <do_choose>
                              <do_when value="{value@GG01.Fail Reason}" exact="1" comment="Totally Failed">
                                <incoming_message text="You have performed a hostile act onto one of our ships. You have failed the mission."/>
                              </do_when>
                              <do_when value="{value@GG01.Fail Reason}" exact="2" comment="Limited Reward">
                                <incoming_message text="The destination has been destroyed. We have been given new orders. Your service is no longer required. You have earned {({value@GG01.Reward} / 2)} Credits."/>
                                <reward_player>
                                  <money exact="{value@GG01.Reward} / 5"/>
                                  <traderank min="5" max="10" />
                                </reward_player>
                              </do_when>
                            </do_choose>
                          </do_if>
                          <set_group_command group="GG01.Pirates" command="default"/>
                          <set_group_command group="GG01.Pirates2" command="default"/>
                          <set_group_highlight group="GG01.Escorted Ships" highlight="0"/>
                          <set_value name="GG01.Mission End" exact="1"/>
                        </do_all>
                      </action>
                      <cues>
                        <cue name="GG01 Cleanup" instantiate="static">
                          <condition>
                            <check_any>
                              <any_object_changed_sector group="GG01.Escorted Ships"/>
                              <any_object_docked group="GG01.Escorted Ships"/>
                            </check_any>
                          </condition>
                          <action>
                            <do_all>
                              <destroy_object object="{event.object}"/>
                              <do_if value="{group.object.count@GG01.Escorted Ships}" exact="0">
                                <cancel_cue cue="GG01"/>
                              </do_if>
                            </do_all>
                          </action>
                        </cue>
                      </cues>
                    </cue>

                    
                  </cues>
                </cue>
              </cues>
            </cue>
          </cues>
        </cue>
      </cues>
    </cue>
  </cues>
</director>
Now, I've run into two problems with the mission.

1) It seems that if I code a version of the mission, make it run the instantiated cue, then correct the mission and try to reload, it will not launch again, not even when I reset the Mission Director. It looks like there's a quest ID lingering in the saved file that won't go away with the MD reset and that prevents it from adding a new BBS item. When I change the cue and quest names, however (hence the weird cue names above) and reset the MD, the quest instantly appears.

2) This might be related to the previous one - when I manage to finish the quest (I get my rewards etc.), it does not reappear in the quest list on the BBS. Again, even if I reset the MD, it won't appear again.

Any ideas on what I'm doing wrong or how to remedy this?

Post Reply

Return to “X³: Reunion - Scripts and Modding”