Mission Director Basics and Installation

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

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

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

Post by Diamonddragon » Sat, 5. Jan 08, 12:20

Got it working, at least till it shows up on the BBS.
A problem with your reset_cue: you reset the top level cue, meaning it will add the quest again etc. but thats unnecessary. Cancel the cue thats triggered when the bbs quest is evaluated is enough for the cues to be

Oh and about the multiple typenames: The MD will choose ONE of the ones you provided, so if it chooses SS_FAC_F219 but there is only a destillery with the typename SS_FAC_F219_1 in the system, it wont find it. You could first search for the first typename and then with a do_if look if there was an object found. If not, the search for the station with the other typename and if that didnt work, cancel the cue.

About the director.dmp: it has been deactivated in the released 2.5 version because of performance problems.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="BBSTemplate" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="name" alias="username" contact="contact details" />
    <content reference="DS01" name="Distillery Raid" description="Raid a Space Fuel Distillery" />
    <version number="0.1" date="today" status="sample" />
  </documentation>
  <cues>
    <cue name="DS01 Start">
      <condition>
        <check_all>
          <check_age value="{player.age}" min="10s" />
          <!--<object_changed_sector/>-->
        </check_all>
      </condition>
      <action>
        <do_all>
          <add_bbs_quest name="DS01" priority="1000" max="1"/>
        </do_all>
      </action>
      <cues>
        <cue name="DS01 Find Station" instantiate="static">
          <condition>
            <check_all>
              <bbs_quest_evaluated quest="DS01"/>
              <check_value value="{player.sector.race}" exact="{lookup.race@argon}"/>
              <check_any>
                <match_object class="fighter"/>
                <match_object class="m6"/>
                <match_object class="m7"/>
              </check_any>
            </check_all>
          </condition>
          <action>
            <do_all>
              <find_station typename="{random.type@SS_FAC_F219|SS_FAC_F219_1}" nearest="1" name="this.Distillery" max="1" comment="Find the nearest Space Fuel Distillery"/>
              <set_sector name="this.SFDSector" value="{object.sector@this.Distillery}"/>
              <find_station typename="SS_DOCK_A_TRADE" max="1" nearest="1" race="argon" name="this.Paddybase" comment="Find the nearest trading station"/>
              <!--<set_sector name="DS01.DockSector"/>-->
            </do_all>
          </action>
          <cues>
            <cue name="DS01 reset" comment="checks if the dock and distillery are valid and in sector">
              <condition>
                <check_all>
                  <cue_completed cue="DS01 Find Station"/>
                  <check_any>
                  <object_exists negate="1" object="parent.Distillery"/>
                  <object_exists negate="1" object="parent.Paddybase"/>                    
                  <check_value value="{object.race@parent.Distillery}" exact="{object.race@{player.ship}}" comment="Player owned?"/>
                  <check_value negate="1" value="{sector@DS01 Find Station.SFDSector}" exact="{player.sector}"/>
                  <!--<check_value negate="1" value="DS01.DockSector" exact="{player.sector}"/>-->
                </check_any>
                </check_all>
              </condition>
              <timing>
                <time min="1s"/>
              </timing>
              <action>
                <do_all>
                  <cancel_cue cue="DS01 Find Station"/>
                </do_all>
              </action>
            </cue>
            <cue name="DS01 Mission Offer" instantiate="static" comment="This will offer the BBS Mission to the player">
              <condition>
                <check_all>
                  <cue_completed cue="DS01 Find Station"/>
                  <cue_activated negate="1" cue="DS01 reset"/>
                </check_all>
              </condition>
              <action>
                <do_all>
                  <create_actor race="argon" name="Copper" character="{random.pilot.argon}"/>
                  <set_value name="this.DS01Reward" min="101" max="250" profile="decreasing"/>
                  <offer_bbs_quest quest="DS01" author="Copper" text="Raid the Space Fuel Distillery?\n\n[center][select value='yes']You bet![/select][/center]\n" />
                </do_all>
              </action>
              <cues>
                <cue name="DS01 Accept" comment="If the player accepts your quest">
                  <condition>
                    <bbs_quest_selected quest="DS01" answer="yes"/>
                  </condition>
                  <timing>
                    <time min="1s" max="2s"/>
                  </timing>
                  <action comment="start quest, create transport">
                    <do_all>
                      <accept_bbs_quest quest="DS01" />
                      <incoming_message author="Copper" text="Let's go!" />
                      <create_ship group="DS01Paddygroup" leader="1" class="tp" race="argon" highlight="1" typename="{random.type@SS_SH_A_TP_1|SS_SH_A_TP}" capturable="0" name="DS01Paddywagon" dockobject="DS01 Find Station.Paddybase" racelogic="0">
                        <equipment loadout="default">
                        </equipment>
                        <cargo>
                          <ware typename="SS_WARE_MPERSONNEL" min="40" max="60"/>
                          <ware typename="SS_WARE_HWEAPONS" min="40" max="60"/>
                        </cargo>
                        <command command="dock" commandobject="DS01 Find Station.Distillery">
                          <position/>
                        </command>
                        <relations>
                          <relation relation="friend"/>
                          <relation relationobject="DS01 Find Station.Distillery" relation="friend"/>
                        </relations>
                        <pilot shipname="Argon Police Transport" name="{random.pilot.argon}" race="argon" />
                      </create_ship>
                    </do_all>
                  </action>
                  <cues>
                    <cue name="DS01 Paddykilled" comment="Checks if the Paddywagon is dead">
                      <condition>
                        <object_destroyed object="DS01Paddywagon"/>
                      </condition>
                      <timing>
                        <time min="1s"/>
                      </timing>
                      <action>
                        <do_all>
                          <incoming_message author="Copper" text="Mission failed: The transport was destroyed!"/>
                          <cancel_cue cue="DS01 Find Station"/>
                        </do_all>
                      </action>
                    </cue>
                    <cue name="DS01 Distillerykilled" comment="Checks if the distillery has been destroyed">
                      <condition>
                        <object_destroyed object="DS01 Find Station.Distillery"/>
                      </condition>
                      <timing>
                        <time min="1s"/>
                      </timing>
                      <action>
                        <do_all>
                          <incoming_message author="Copper" text="Mission failed: The distillery was destroyed! Excessive force is not appreciated."/>
                          <cancel_cue cue="DS01 Find Station"/>
                        </do_all>
                      </action>
                    </cue>
                    <cue name="DS01 Paddydocked">
                      <condition>
                        <all_objects_are_docked dockobject="DS01 Find Station.Distillery" group="DS01Paddygroup"/>
                      </condition>
                      <timing>
                        <time min="2s" max="3s"/>
                      </timing>
                      <action>
                        <incoming_message author="Copper" text="Great job! We're boarding now, stand by."/>
                      </action>
                      <cues>
                        <cue name="DS01 GJ">
                          <condition>
                            <cue_completed cue="DS01 Paddydocked"/>
                          </condition>
                          <timing>
                            <time min="10s" max="20s"/>
                          </timing>
                          <action>
                            <do_all>
                              <incoming_message author="Copper" text="That's another gang rounded up. Here is your {value@DS01 Mission Offer.DS01Reward},000 credits. You have my thanks, that could have been pretty hairy!"/>
                              <reward_player>
                                <money exact="(DS01 Mission Offer.DS01Reward)*1000"/>
                                <notoriety>
                                  <relation race="argon" exact="10"/>
                                </notoriety>
                              </reward_player>
                              <destroy_object object="DS01Paddywagon" explosion="0"/>
                              <cancel_cue cue="DS01 Find Station"/>
                            </do_all>
                          </action>
                        </cue>
                      </cues>
                    </cue>
                  </cues>
                </cue>
              </cues>
            </cue>
          </cues>
        </cue>
      </cues>
    </cue>
  </cues>
</director>
Es ist nicht das Schicksal, was die Zukunft bestimmt.
Script- und Modliste

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

Post by Sandalpocalypse » Sat, 5. Jan 08, 13:43

Cheers Diamonddragon,

All good things to know, and good point about the factories.

I fiddled with your fixed version a bit and think I found a pretty straightforward way to account for that.

Thanks tons for the help. :)

jlehtone
Posts: 17740
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone » Sat, 5. Jan 08, 14:29

Sorry if asking obvious ...

1.

Code: Select all

<condition>
  <any_object_targeted group="ships_running_trade_mk3"/>
</condition>
...
Would that be a feasible "early warning system", or simply waste of CPU?


2. Events galore, but is any of them of type "player accepted/completed hardcoded BBS mission"? For example to modífy reward if player completes a mission in particular way?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

eladan
Posts: 5341
Joined: Sat, 7. Jan 06, 17:01
x4

Post by eladan » Sat, 5. Jan 08, 14:43

jlehtone wrote:Would that be a feasible "early warning system", or simply waste of CPU?
It's one of the first things I noticed, and I plan to test it out. :)

OOS problems would undoubtedly remain though.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 11351
Joined: Sat, 9. Nov 02, 12:45
x4

Post by Xenon_Slayer » Sat, 5. Jan 08, 14:43

@jlehtone

Event triggers are not checked as much as value checks. That would wait for a target to be set by the player and then check if the target is in that group. It will not be a CPU hog unless the player repeatedly toggles between targets, even then the object audio description would probably more CPU intesive. That in itself would not be a good early warning system as the player is obviously aware of the target. <find_ships/> will be the best thing if you wanted to create a group which matched some parameters.

Not entirely sure what your second questions about sorry. There are several BBS actions and conditions yes. Be aware that this never seemed to work reliably. Try using other ways to offer missions. <ask_question/> nudge nudge.

Rewards can be what ever you want, even if it is not what the offering mission said. It can be changed anytime in the mission. Have you guys noticed all the different stuff besides money that can be rewarded ;-)

eladan
Posts: 5341
Joined: Sat, 7. Jan 06, 17:01
x4

Post by eladan » Sat, 5. Jan 08, 14:51

Wait - you're saying that only the player target is checked for? There's no way to specify whether something is targeted by any other ship?

So much for that idea.

jlehtone
Posts: 17740
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone » Sat, 5. Jan 08, 15:39

That was not clear from:

Code: Select all

<player_target_set>             player target being set
<object_destroyed_by_player>    specified object being destroyed by the player
<object_destroyed>              specified object being destroyed by anything other than the player
<object_attacked_by_player>     specified object being attacked by the player 
<object_attacked>               specified object being attacked by anything other than the player
<object_targeted>               specified object being targeted 
<any_object_attacked_by_player> any object in the specified group being attacked by the player
<any_object_attacked>           any object in the specified group being attacked by anything other than the player
<any_object_targeted>           any object in the specified group being targeted 
Intuition expects <any_object_targeted> be like <any_object_attacked> rather than like <any_object_attacked_by_player>.


As for the second, I was referring to hardcoded missions. One can always create a personal mission, but I was thinking for example cutting the reward of stock Xenon Invasion mission if player completes it within 15 minutes. (So quick? Not a real invasion then, and our rates for stopping mere probe attacks is 30% of the real thing.) IIRC, there is no way to prevent the stock missions from getting generated, so one cannot ensure only the MD-based missions to populate the BBS?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

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

Post by CBJ » Sat, 5. Jan 08, 15:47

The game does not have a concept of "targeting" from ships other than the player ship, so the events relating to that couldn't be triggered in other cases.

The MD also knows nothing at all about the hard-coded missions, so it cannot respond to anything relating to them.

As Xenon_Slayer already suggested, you might be better off looking at different ways of triggering MD missions rather than using the BBS as there are some limitations to the MD integration with the BBS.

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

Post by ChemODun » Sat, 5. Jan 08, 16:56

CBJ wrote: If you don't want to use the MD in X3 then no-one is forcing you to. Feel free to step away from this thread any time you like and let people get on with it, as they already have been in the German forum. I'm looking forward to seeing what they come up with.
I want use MD. But when I first read about MD, I think - it will be fully functionality thing. I am upset about only preview status.

Sorry, if injury you.


May I post in this thread link to russian translation of Manual and MD files, when I will finish it?
Multiply entropy by absolute zero

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

User avatar
Stevio
Posts: 1983
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sat, 5. Jan 08, 23:31

having some issues with a lottery bbs
to my eyes this should work
but when you choose any of the buttons on the bbs nothing happens

i've been through the code about 3 times now and i cant see why

heres the accepted and rejected code:
Full code Here

Code: Select all

        <cue name="steviobbslottery Misson Accepted" comment="what to do if mission is accepted">
          <condition>
            <check_all>
              <bbs_quest_selected quest="steviobbslottery" answer="yes" />
            </check_all>
          </condition>
          <action>
            <do_all>
              <do_choose>
                <do_when value="{player.money}" min="1001">
                  <accept_bbs_quest quest="steviobbslottery" />
                  <reward_player>
                    <money exact="-1000"/>
                  </reward_player>
                </do_when>
                <do_otherwise>
                  <incoming_message author="Steviocorp Lottery!" text="You cannot buy a ticket with money you don't have. Goodbye." />
                  <cancel_cue cue="lucky dip" />
                </do_otherwise>
              </do_choose>
            </do_all>
          </action>
          <cues>
            <cue name="lucky dip">
              <condition>
                <cue_is_complete cue="parent" />
              </condition>
              <action>
                <do_all>
                  <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="Steviocorp Lottery!" text="Your lucky dip numbers are: {value@this.rand1} {value@this.rand2} {value@this.rand3} {value@this.rand4} {value@this.rand5} {value@this.rand6}\n\nGood luck!"/>
                </do_all>
              </action>
              <cues>
                <cue name="draw" comment="a certain amount of time after ticket purchase">
                  <timing>
                    <time min="20s" max="25s" />
                  </timing>
                  <action>
                    <do_all>
                      <set_value name="this.prize" min="1000000" max="1500000"/>
                      <set_value name="this.lotterynum" min="1" max="100000"/>
                      <do_choose>
                        <do_when value="{value@this.lotterynum}" max="1">
                          <incoming_message author="Steviocorp Lottery!" text="Congratulations! You've won the jackpot!\n\n{value@this.prize} Credits are being transferred to your account."/>
                          <reward_player>
                            <money exact="{value@this.prize}" />
                          </reward_player>
                        </do_when>
                        <do_otherwise>
                          <incoming_message author="Steviocorp 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="steviobbslottery Mission Rejected" comment="if the player declines the quest">
          <condition>
            <bbs_quest_selected answer="no "/>
          </condition>
          <action>
            <do_all>
              <incoming_message author="Steviocorp Lottery!" text="Too bad! You look the lucky type." />
            </do_all>
          </action>
        </cue>

Cheers
Stevio
My Scripts
Image
So say we all!

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 11351
Joined: Sat, 9. Nov 02, 12:45
x4

Post by Xenon_Slayer » Sun, 6. Jan 08, 02:45

The checking conditions for any BBS mission offer or question must be in a subcue of the offer.
The reason that the cue does not trigger is because the action that offers the mission is on the same level as the condition that checks it. 'steviobbslottery Misson Accepted' must become a subcue of 'steviobbslottery Mission Offer'.

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

Post by CBJ » Sun, 6. Jan 08, 02:54

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. :)

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

Post by Sandalpocalypse » Sun, 6. Jan 08, 04:23

Bleh! Had to stick iin my own debugging messages before I figured out some error in my target selection was causing my mission to reset and thats why the BBS wasn't workin'. :)

I was trying to use Set Value to change an objects name, I don't think that's working. Am I using Set Object properly here? Not at my X3 comp unfortunately, can't test it. I want this.DistilleryM to be renamed to this.Distillery, or at least have this.Distillery refer to the same object as this.DistilleryM.

Code: Select all

              <find_station typename="SS_FAC_F219" nearest="1" name="this.DistilleryM" max="1" comment="Find the nearest Distillery M" race="default"/>
              <set_sector name="this.SFDSector" value="{object.sector@this.DistilleryM}"/>
              <set_object name="this.DistilleryM" value="{object@this.Distillery}"/>

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

Post by CBJ » Sun, 6. Jan 08, 04:58

What you have there should make this.Distillery and this.DistilleryM refer to the same object. However I think you've got them the wrong way around in the <set_object> action. I think what you meant was:

Code: Select all

<set_object name="this.Distillery" value="{object@this.DistilleryM}"/>

User avatar
Stevio
Posts: 1983
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sun, 6. Jan 08, 10:40

Xenon_Slayer wrote:The checking conditions for any BBS mission offer or question must be in a subcue of the offer.
:oops: oops my bad i thought i did that but obviously not :lol:

Cheers XS :thumb_up:
My Scripts
Image
So say we all!

Post Reply

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