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

Post Reply
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 11227
Joined: Sat, 9. Nov 02, 12:45
x4

Post by Xenon_Slayer » Wed, 9. Jan 08, 12:59

The MD groups are not the same as current "Groups". The playership and two wingmen are not considered a group. A sector patrol created by Jobs can be considered a group but it is not the same thing. Those ships have a special group which is accessible through the Script commands I believe.

The MD Group Leader is just a special attribute an object in that group can have. You will be able to use the group leader variables such as {group.leader.name@Example Group}. There is nothing very special about the leader and groups can exist with no leader. It just makes co-ordinating group movement a little easier.

Toastie
Posts: 1223
Joined: Thu, 8. Apr 04, 20:40
x3tc

Post by Toastie » Wed, 9. Jan 08, 15:01

ChemODun wrote:
Toastie wrote:
ChemODun wrote:Word-for-word translation of cue writed in Russian equal with another term - replica, so usage this word-to-word translation is incorrect, from my point of view.
How about ' Намёк ' for 'cue' (literally means hint), this is another theatrical term for cue?
Yes. It's another term for cue, but in Russian it will be look not well.
Sorry for Russian next:
Russian wrote: Например так - условие активации намека, хронометраж намека, блок действий намека.
Или так -
условие активации эпизода, хронометраж эпизода, блок действий эпизода.
Есть еще вариант - нить или поток.
Нить миссии, активация нити, хронометраж и блок действий нити
Another variant - russian analog of word thread, which means mental step. One mind thread may go by one way or another way.
To be honest it may be easier to define the term Cue early on (in case any readers don't know what one is) and then just use 'Cue' or even 'кю'.
The same would go for any set MD terminology which appears regularly in the examples. I know it's not beautiful russian, but it may be more easy to follow the examples that way.

Toastie
Posts: 1223
Joined: Thu, 8. Apr 04, 20:40
x3tc

Post by Toastie » Wed, 9. Jan 08, 18:41

I just noticed that the sample mission file BM47_XXXT has text IDs in instead of text. Here's the version WITH text (excuse the big code-snip, I can't upload in here).

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="BBS_Lottery" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="Toastie" />
    <content name="BBS_Lottery" description="BBS-based lottery quest" reference="BM47_XXXT"/>
    <version date="31 Jul 07" number="1.0" status="Beta Test"/>
  </documentation>
  <cues>
    <cue name="BM47LotteryMainCue" comment="This is the top-level cue, the start point for our quest">      
      <condition>
        <check_age value="{player.age}" min="5s" comment="Conditions to determine when, or where, or under what circumstances your BBS Mission should appear"/>
      </condition>
      <action>
        <do_all>
          <add_bbs_quest name="BM47Lottery" priority="50" max="1" comment="Priority= How often your quest should occur on a scale of 0-100. Max= Max amount of the same quest per station"/>
        </do_all>
      </action>
      <cues>
        <cue name="BM47Lottery Mission Offer" instantiate="static" comment="This will offer the Lottery Mission to the player">
          <condition>
            <bbs_quest_evaluated quest="BM47Lottery" comment="Will evaluate your quest by its given priority and max you set above"/>
          </condition>
          <action>
            <offer_bbs_quest quest="BM47Lottery" author="Spamelot Lottery" text="[center]Would you like to buy a lottery ticket and win more than a guaranteed 1,000,000Cr?\n\nThey cost only 1,000Cr!\n\n[select value='yes']You bet![/select]\n[select value='no']Forget it![/select][/center]"/>
          </action>
          <cues>
            <cue name="BM47 Mission Accepted" comment="If the player accepts your quest">
              <condition>
                <check_all>
                  <bbs_quest_selected quest="BM47Lottery" answer="yes"/>
                </check_all>
              </condition>
              <action>
                <do_all comment="Here we can see how the do_choose works">
                  <do_choose comment="if the player has at least 1000Cr (the cost of a ticket), then the quest is accepted and 1000Cr is debited from the player's account.">
                    <do_when value="{player.money}" min="1000">
                      <accept_bbs_quest quest="BM47Lottery"/>
                      <reward_player>
                        <money min="-1000" comment="this is the 1000Cr being taken from the player"/>
                      </reward_player>
                    </do_when>
                    <do_otherwise comment="do_otherwise is the case if the player doesn't have the 1000Cr for a ticket.">
                      <incoming_message author="Spamelot Lottery" text="You cannot buy a ticket with money you don't have.  Goodbye."/>
                      <cancel_cue cue="lucky dip" comment="here we cancel the next (and subsequent) cue so the draw doesn't take place if no funds are available"/>
                    </do_otherwise>
                  </do_choose>
                </do_all>
              </action>
              <cues>
                <cue name="lucky dip">
                  <condition>
                    <cue_is_complete cue="BM47 Mission Accepted" comment="once all of the actions of the previous cue have been completed this cue will be triggered"/>
                  </condition>
                  <action>
                    <do_all comment="here we are setting some values as local variables to provide 6 'random' lottery numbers. In the lucky dip message, we can see how those variables are used to show the player's lotto numbers.">
                      <set_value min="1" max="7" name="this.rand1"/>
                      <set_value min="8" max="17" name="this.rand2"/>
                      <set_value min="18" max="25" name="this.rand3"/>
                      <set_value min="26" max="33" name="this.rand4"/>
                      <set_value min="34" max="42" name="this.rand5"/>
                      <set_value min="43" max="49" name="this.rand6"/>
                      <incoming_message author="Spamelot Lottery" text="Your lucky dip numbers are:\n\n[center]{value@this.rand1} {value@this.rand2} {value@this.rand3} {value@this.rand4} {value@this.rand5} {value@this.rand6}\n\nGood luck![/center]"/>
                    </do_all>
                  </action>
                  <cues>
                    <cue name="draw" comment="a certain amount of time after ticket purchase">
                      <timing>
                        <!--<time min="20s" max="25s" comment="The 20-25s is just a debug time to shorten testing"/>-->
                        <time min="2h" max="4h"/>
                      </timing>
                      <action>
                        <do_all>
                          <set_value name="this.prize" min="1000000" max="1500000" comment="Prize is somewhere between 1 and 1.5 million Cr"/>
                          <!--<set_value name="this.lotterynum" min="1" max="2" comment="the odds of winning are 50/50 for debug purposes"/>-->
                          <set_value name="this.lotterynum" min="1" max="100000" comment="the odds of winning are 1 in 100000"/>
                          <do_choose comment="another do_choose... useful blighters ;)">
                            <do_when value="{value@this.lotterynum}" max="1" comment="if 'this.lotterynum' is evaluated as being 1 (ie 1 in 100000) then the enclosed actions will be performed.">
                              <incoming_message author="Spamelot Lottery" text="Congratulations! You've won the jackpot!\n\n[b]{value@this.prize} Credits[/b] are being transferred to your account." comment="whichever random number between 1 and 1.5 MCr is evaluated above is inserted here as the prize"/>
                              <reward_player>
                                <money min="{value@this.prize}" comment="and we now add the value of 'this_prize' to the player's account"/>
                              </reward_player>
                            </do_when>
                            <do_otherwise comment="if the value of 'this_lotterynum' is evaluated to a number other than 1 then the message below is sent instead.">
                              <incoming_message author="Spamelot Lottery" text="Sorry, you have not won a prize this time. Please try again soon."/>
                            </do_otherwise>
                          </do_choose>
                        </do_all>
                      </action>
                    </cue>
                  </cues>
                </cue>
              </cues>
            </cue>
            <cue name="BM47 Mission Rejected" comment="If the player declines your quest, ie doesn't want to buy a ticket">
              <condition>
                <bbs_quest_selected quest="BM47Lottery" answer="no" />
              </condition>
              <action>
                <do_all>
                  <incoming_message author="Spamelot Lottery Services" text="Too bad! You look the lucky type." />
                  <accept_bbs_quest quest="BM47Lottery"/>
                </do_all>
              </action>
            </cue>
          </cues>
        </cue>
      </cues>
    </cue>
  </cues>
</director>
Hope that helps.

User avatar
Sandalpocalypse
Posts: 4195
Joined: Tue, 2. Dec 03, 23:28
x4

Post by Sandalpocalypse » Thu, 10. Jan 08, 00:21

The sample mission in the book uses textIDs too xD but it tells you what they say, so, heh.

Apollo911
Posts: 523
Joined: Sun, 2. Nov 03, 22:10
x3tc

Post by Apollo911 » Thu, 10. Jan 08, 16:11

uoes anyone know if Using the MD is it possible to initiate BBS like missions via contact with a ship?

i.e you a comm a ship and are offered a mission?

Cheers!
Image
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

User avatar
al_main
Posts: 1379
Joined: Wed, 6. Oct 04, 10:26
x3

Post by al_main » Thu, 10. Jan 08, 16:15

You could easily have a ship comm the player using an incoming question when the player got to a certain distance, etc. But having the player comm the ship would need some kind of workaround, eg some kind of user defined hotkey in scripts, which creates or does something that the MD can detect and know the player is trying to use the comms on their target.

Apollo911
Posts: 523
Joined: Sun, 2. Nov 03, 22:10
x3tc

Post by Apollo911 » Thu, 10. Jan 08, 16:41

al_main wrote:You could easily have a ship comm the player using an incoming question when the player got to a certain distance, etc. But having the player comm the ship would need some kind of workaround, eg some kind of user defined hotkey in scripts, which creates or does something that the MD can detect and know the player is trying to use the comms on their target.
Cheers! So I'd have to specify a hotkey first? And then when the ship is targeted and that hotkey was pressed it would send an incoming message to the player?
Image
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

User avatar
Sandalpocalypse
Posts: 4195
Joined: Tue, 2. Dec 03, 23:28
x4

Post by Sandalpocalypse » Thu, 10. Jan 08, 16:53

TBH, the nonstandard comms systems are a pain in the butt to use. :|
The ship asking you within a certain range is much more convenient for the player and to script. Like in the Lost in Space script.

User avatar
Observe
Posts: 2815
Joined: Fri, 30. Dec 05, 18:47
xr

Post by Observe » Thu, 10. Jan 08, 21:37

Please forgive me if this is already covered: Can I load/call a Mission from a "standard" script written in the script editor?

User avatar
SymTec ltd.
Posts: 4389
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Thu, 10. Jan 08, 22:03

This is not intended for the MD, and should not be done.

I'm going to tell you a way:

1. write a MD-plugin that starts once the player-ship-name is changed to a certain string
2. change the player-ship-name to the certain string.

:roll: - and remember you are not supposed to do this. :D

User avatar
Observe
Posts: 2815
Joined: Fri, 30. Dec 05, 18:47
xr

Post by Observe » Thu, 10. Jan 08, 22:12

Thank you SymTec ltd.! I'll keep in mind what I'm "not supposed" to do. :wink:

One more thing: Am I correct in assuming Global Variables defined in "regular" scripts are accessible for Missions scripts?

User avatar
SymTec ltd.
Posts: 4389
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Thu, 10. Jan 08, 22:16

no, if you mean MD-plugins by "Mission scripts".

Diamonddragon
Posts: 942
Joined: Sat, 7. Feb 04, 21:26
x3tc

Post by Diamonddragon » Thu, 10. Jan 08, 22:17

The MD can only start a script. It has no way to know anything SE related.
Es ist nicht das Schicksal, was die Zukunft bestimmt.
Script- und Modliste

CBJ
EGOSOFT
EGOSOFT
Posts: 37620
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Thu, 10. Jan 08, 22:21

Just to clarify something, Observe, you are perhaps thinking of the MD as if it were a programming language. It isn't. You cannot "call" anything in the MD, either from inside it or outside it. Every action within the MD is performed in response to a set of conditions being met. The only way to make something happen in the MD is to satisfy a set of conditions that the MD understands - SymTec's suggestion is an example of this, but he's not joking when he says you shouldn't do it as it would be highly inefficient as well as pretty annoying for the player.

Regarding the relationship between scripts and the MD, the only think you can do is start a script from the MD. There is no access to anything else relating to scripts from within the MD environment.

User avatar
Observe
Posts: 2815
Joined: Fri, 30. Dec 05, 18:47
xr

Post by Observe » Thu, 10. Jan 08, 22:30

Thanks for clarification CBJ! Oh, and SymTec ltd, re the offer you made in post which promptly "disappeared", I'm content to work with what MD currently supports. :)

Post Reply

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