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

Diamonddragon
Posts: 1957
Joined: Sat, 7. Feb 04, 20:26
x3tc

Post by Diamonddragon » Sat, 5. Jan 08, 11: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: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Sat, 5. Jan 08, 12: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: 21809
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone » Sat, 5. Jan 08, 13: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: 7168
Joined: Sat, 7. Jan 06, 16:01
x4

Post by eladan » Sat, 5. Jan 08, 13: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: 13093
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer » Sat, 5. Jan 08, 13: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 ;-)
Come watch me on Twitch where I occasionally play several of the X games

eladan
Posts: 7168
Joined: Sat, 7. Jan 06, 16:01
x4

Post by eladan » Sat, 5. Jan 08, 13: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: 21809
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone » Sat, 5. Jan 08, 14: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: 51931
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Sat, 5. Jan 08, 14: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, 21:58
x3tc

Post by ChemODun » Sat, 5. Jan 08, 15: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: 2271
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sat, 5. Jan 08, 22: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

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

Post by Xenon_Slayer » Sun, 6. Jan 08, 01: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'.
Come watch me on Twitch where I occasionally play several of the X games

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

Post by CBJ » Sun, 6. Jan 08, 01: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: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse » Sun, 6. Jan 08, 03: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: 51931
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ » Sun, 6. Jan 08, 03: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: 2271
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sun, 6. Jan 08, 09: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:

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

Post by jlehtone » Sun, 6. Jan 08, 12:03

Any obvious checks I should add before crash testing?

Code: Select all

  <cues>
		<cue name="JL01enterSector">
			<condition>
				<check_all comment="IFF player enters a Xenon sector.">
					<object_changed_sector comment="Player has entered a new sector."/>
					<check_value value="{player.sector.race}" exact="{lookup.race@xenon}"/>
				</check_all>
			</condition>
			<action>
				<find_ship race="Xenon" group="JL01.victims">
					<sector sector="{player.sector.race}"/>
				</find_ship>
			</action>
			<cues>
				<cue name="JL01deadXenon">
					<condition>
						<check_all comment="All initial Xenon have died and player is still in Xenon sector.">
							<any_object_destroyed group="JL01.victims"/>
							<check_value value="{player.sector.race}" exact="{lookup.race@xenon}"/>
							<check_value value="{group.object.count@victims}" exact="0"/>
						</check_all>
					</condition>
					<action>
						<!-- first test: direct retaliation -->
						<do_all count="({player.fightrank.rank}/3)">
							<create_ship class="m6" race="Xenon" group="JL01.avengers">
								<position object="{player.ship}" max="15km"/>
								<sector sector="{player.sector}"/>
								<equipment loadout="maximum"/>
								<command command="killenemies"/>
							</create_ship>
						</do_all>
					</action>
				</cue>
			</cues>
		</cue>
  </cues>
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

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

Post by Xenon_Slayer » Sun, 6. Jan 08, 12:53

The find ship action you have used will only find one ship. Use the multiple attribute and set max to something like 99. Also, the sector node says {player.sector.race} where it should be {player.sector}

<check_value value="{group.object.count@victims}" exact="0"/>
You have forgotten to localise the victims group. It should be {group.object.count@JL01.victims}.

There is no 'count' attibute in do_all. There is counter which increments by one each time. If you want it to perform several times use the exact attribute.
Come watch me on Twitch where I occasionally play several of the X games

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

Post by jlehtone » Sun, 6. Jan 08, 13:05

:oops: never been careful in details.
Xenon_Slayer wrote:The find ship action you have used will only find one ship. Use the multiple attribute and set max to something like 99.
The one and only desired condition ought to be "whenever the player kills the last Xenon of a Xenon sector". But since the any_destroyed requires a group to test the race of killed ship by, and group has to be defined before condition ... or is there a simpler, more fool-proof way?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

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

Post by Xenon_Slayer » Sun, 6. Jan 08, 14:13

To see if a player destroys all ships in a Xenon sector could be difficult. The problem is that the ships are moving. Some are entering a sector, some are leaving. For that you will need to update the group every few seconds.
Actually knowing if it was the player who killed all the Xenon before could be a problem. You can increment a value every time any_object_destroyed_by_player is triggered. That would be the best option.
Also, checking if the sector race is Xenon is not a very solid basis for this mission. I suggest it is done per sector instead of looking at the race. It sounds like you want it per sector anyway. The way I would do it is to either make the mission watch one sector, or use the sector ID in the values you create so that they are different from one an other.
Come watch me on Twitch where I occasionally play several of the X games

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

Post by ChemODun » Tue, 8. Jan 08, 16:50

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. :)
Ok.
Can I use russian analog word episode for naming cue in Manual?
Becouse, from my point of view cue - is a part of Mission, so - it's episode of mission.
Multiply entropy by absolute zero

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

Post Reply

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