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

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: 13088
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?

Stu Austin
Posts: 2262
Joined: Tue, 23. Dec 03, 22:32
x4

Post by Stu Austin » Wed, 9. Jul 08, 20:19

Hello Ilintar. When I first started making the BBS missions, I came to the conclusion that it was broken. I spent days trying to get them to work on the bbs with no success. So I decided to try a different approach.
Instead of having them show up on bbs, I decided to have an incoming message asking if I wanted to do a mission. So far the way I do it now has been working great. I've modified the missions a lot but here is a simple one which it can be changed around to suit your needs. Enable script editor, fly to the wall and 45 seconds later you will get an incoming message. You are more than welcome to change the file around anyway you would like. Hope this helps.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="Stu Austin" alias="Stu Austin" contact="contact info" />
    <content reference="Escort Mission" name="Escort Template" description="escort mission with rewards." />
    <version number="0.1" date="4-5-2008" status="beta" />
  </documentation>
  <cues>
    <cue name="question" game="all" map="all">
      <condition>
        <check_all>
          <object_changed_sector comment="Check first"/>
          <object_sector exact="0">
            <sector x="2" y="3" comment="The Wall"/>
          </object_sector>
          <match_object object="{player.ship}" class="fighter"/>
        </check_all>
      </condition>
      <timing>
        <time exact="45s" />
      </timing>
      <action>
        <ask_question name="q" author="Space Truckers Inc." text="Hello Commander. We desparately need an escort for one of our transports. There will be an reward plus a bonus if mission is completed successfully. Will you provide us as an escort?\n\n[center][select value='yes']Yes[/select][/center]\n[center][select value='no']No[/select][/center]" />
      </action>
      <cues>
        <cue name="ES01" game="all" map="all" instantiate="instance">
          <action>
            <do_all>
              <find_station name="ES01.Destination Station" dockingallowed="1" race="default">
                <jumps min="1" max="2"/>
              </find_station>
            </do_all>
          </action>
          <cues>
        <cue name="answer yes" game="all" map="all">
          <condition>
            <question_answered question="q" answer="yes" />
          </condition>
          <action>
            <do_all>
              <set_value name="ES01.Mission End" exact="0"/>
              <set_value name="ES01.Jumps" min="1" max="({player.fightrank.rank}/3)+2" profile="decreasing"/>
              <find_station name="ES01.Destination Station" dockingallowed="1" race="default">
                <jumps min="1" max="1"/>
              </find_station>
              <incoming_message author="Space Truckers Inc." popup="1" text="Thankyou Commander. The destination is {object.name@ES01.Destination Station}, {object.sector.name@ES01.Destination Station}"/>
              <do_all>
                <create_ship leader="1" group="ES01.Escorted Ships" class="ts" highlight="1"
                             race="argon" typename="SS_SH_A_TS" capturable="1" racelogic="0">
                  <position exact="1km" object="{player.ship}"/>
                  <equipment loadout="default"/>
                  <pilot shipname="Space Truckers Inc."/>
                </create_ship>
              </do_all>
              <set_command object="{group.leader@ES01.Escorted Ships}" command="dock" commandobject="ES01.Destination Station"/>
              <set_value name="ES01.Group Size" exact="{group.object.count@ES01.Escorted Ships}"/>
            </do_all>
          </action>
              <cues>
            <cue name="ES01 Mission Offer" game="all" map="all">
              <condition>
                <check_all>
                  <check_value value="{object.exists@ES01.Destination Station}" exact="1"/>
                </check_all>
              </condition>
              <action>
                <do_all>
                  <create_actor name="ES01.Offer Actor" character="{random.pilot.{value@ES01.Offer Race}}"/>
                </do_all>
              </action>
              <cues>
                <cue name="ES01 Mission Accepted" game="all" map="all">
                  <cues>
                    <cue name="ES01 Destination Reached" game="all" map="all">
                      <condition>
                        <check_all>
                          <all_objects_are_docked group="ES01.Escorted Ships" dockobject="ES01.Destination Station"/>
                          <check_value value="{group.object.count@ES01.Escorted Ships}" min="1"/>
                        </check_all>
                      </condition>
                      <timing>
                        <time exact="5s"/>
                      </timing>
                      <action>
                        <do_all>
                          <reward_player>
                            <money exact="1500000"/>
                            <traderank exact="10000"/>
                            <fightrank exact="10000"/>
                          </reward_player>
                          <incoming_message author="Space Truckers Inc" text="Mission Completed. We have awarded 1,500,000 credits to your account and 10,000 points each towards your trade and fight rank increase."/>
                          <cancel_cue cue="ES01 Destination Reached"/>
                        </do_all>
                      </action>
    </cue>
  </cues>
                </cue>
              </cues>
            </cue>
          </cues>
        </cue>
      </cues>
    </cue>
  </cues>
    </cue>
  </cues>
</director>

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

Post by Ilintar » Wed, 16. Jul 08, 03:02

Yeah, but the problem is the tradeoff between scripting and playing. If one were able to add the missions to the BBS, one could actually enjoy the game and have his custom-made missions pop once in a while. With preprogrammed missions, you have to actually remember to trigger them, disable them when you need them so that they don't appear suddenly etc.

So, I'm looking for a way to make the BBS missions work, I'll try to look into it myself if I find some more time.

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

Post by Ketraar » Wed, 16. Jul 08, 10:55

Ilintar wrote:and have his custom-made missions pop once in a while.
I advise you read Stu's post again, but slower.
Instead of having them show up on bbs, I decided to have an incoming message asking if I wanted to do a mission.
So there is not really a big difference, to the BBS missions. You get them, you read them and you accept them or not.

I think its an acceptable compromise.

MFG

Ketraar
Image

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

Post by Ilintar » Wed, 16. Jul 08, 15:55

So there is not really a big difference, to the BBS missions. You get them, you read them and you accept them or not.
I think I quite explicitly noted where I see the difference, but once again:
1) With BBS missions, you can play your game normally and not worry about _specific_ conditions that have to be met for your mission to appear.
2) With custom-made missions triggered on entry to some sector, you can actually have it interrupt your game (say, you're travelling a lot through The Wall doing some trading), so you have to turn them on and off continuously.

I'm not saying his solution is bad, I'm just saying I'm still hoping there's a way to integrate the missions from MD into the game in a way that will make it transparent for the typical player.

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

Post by Ketraar » Wed, 16. Jul 08, 16:28

Ok then lets see if I can say this:
BBS inclusion is NOT working, as Stu and others came to know after trying for a very long time.

Having said that:
Ilintar wrote:1) With BBS missions, you can play your game normally and not worry about _specific_ conditions that have to be met for your mission to appear.
How you set the conditions its up to you so I don't see a difference, since it would be the same for BBS (yes those also need conditions).
2) With custom-made missions triggered on entry to some sector, you can actually have it interrupt your game (say, you're travelling a lot through The Wall doing some trading), so you have to turn them on and off continuously.
Make the incoming message pop up only when the player is docked. Also its up to you to decide how often the same mission will appear and if random or not.

I think you are missing the point that using incoming message does not imply that a mission must be static. Its just the "delivery" of the mission that differs, everything else its just about the same.

MFG

Ketraar
Image

Post Reply

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