Post Mission Director Code Here!

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

User avatar
LV
Sith Lord
Posts: 6361
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post Mission Director Code Here!

Post by LV » Wed, 10. Jun 09, 20:56

This may sink like lead but i've seen a few short md scripts over the last few days/weeks and it's work trying to have dedicated thread for short md code

I've created this thread so smaller md code can be posted so users can not only use it but also ask questions around what certain commands do.


Let's keep the idle chit chat down please ;)

to use this code people, copy and paste it into notepad and save it as a .xml file in the newly created director folder



first you need to open your x3 directory where your exe and other folders like scripts and t are and create a new folder called director
Image

Any code posted in these forums like below can be put here even if you didn't write it as long as your post shows who did.

--------------------------------------------
I'll start with the...
Max Trade/Fight rank code by JMCorp

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="tradefightcheat" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="JMCorp" alias="JMCorp" contact="none" />
    <content reference="JMCCheat" name="trade fight cheat" description="add trade and fight ranks for no reason" />
    <version number="0.1" date="2/1/08" status="cheat" />
  </documentation>
  <cues>
    <cue name="JMCCHEAT001">
      <action>
        <do_all>
          <reward_player>
            <fightrank max="1000000"/>
          </reward_player>
          <reward_player>
            <traderank max="1000000"/>
          </reward_player>
          <reset_cue cue="JMCCHEAT001"/>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Last edited by LV on Wed, 10. Jun 09, 21:04, edited 1 time in total.
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses

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

Post by jlehtone » Wed, 10. Jun 09, 21:03

Defying OP's idle chit warn I must note that the [url=http://forum.egosoft.com/viewtopic.php?t=216690]TC Download Library[/url] has a link pointing to this thread. ;)

Nephtys
Posts: 1164
Joined: Tue, 26. Jun 07, 14:55

Raising OFF Rang to highest

Post by Nephtys » Sat, 1. Aug 09, 11:52

You want to skip most of the Final Fury Plot?

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="FF Cheat" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <documentation>
    <author name="username" alias="username" contact="contact details" />
    <content reference="FFCheat" name="FF Cheat" description="Cheat to skip FF" />
    <version number="1.0" date="today" status="sample" />
  </documentation>
  <cues>
    <cue name="Final Fury Cheat"> 
      <timing> 
        <time exact="20s"/> 
      </timing> 
      <action> 
        <set_mission_rank name="L2OFF" exact="notop8"/> 
      </action> 
    </cue> 
  </cues>
</director>
This MD Code is good to understand the very basical usage of the MD. The Script is waiting 20s after loading and then setting your FF rank to Major.

Major is enough for triggering the last 2 Missions of Final Fury (starting with the great Khaak Invasion in M148).
As far as tests showed you have to do the first 3 Missions also. And dont use the MD script while you are doing a mission. If you are Ensign 65% and using the MD Script while you are doing the 3rd mission (just because i remember this part the most^^) you get Major status 20s after loading BUT after ending the mission you get Ensign 85%.
Use the Script (Using=Setting the file in the director directory (^^)) while you are waiting for the next mission. Then you just jump to Mission 15 (just before the final Mission)
Image
Fear the drones!

User avatar
apricotslice
Posts: 13734
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Sat, 1. Aug 09, 14:52

Great idea ! :D

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

Post by Stu Austin » Mon, 19. Oct 09, 23:58

Hello LV. I like the idea of this thread.
My question is in your code:

Code: Select all

<reset_cue cue="JMCCHEAT001"/> 
wouldn't that reset it continuosly? Is it suppose to be

Code: Select all

<cancel_cue cue="JMCCHEAT001"/> 
whereas you want the code to be canceled after the cue does its action?
Transcend Mod Team - AP, TC, Reunion

User avatar
Malakie
Posts: 848
Joined: Tue, 13. Apr 04, 23:08
x4

newbie and lost...

Post by Malakie » Tue, 19. Jan 10, 05:20

Hi all,

I have slowly been learning the script editor and how to use it hopefully with the goal of creating some scripts I have been wanting to see done in X3TC.

With that, I have also moved toward using th MD as well but I am comepletely stuck on what to do and where to start in X3TC.

I HAVE downloaded the X3R MD archive so I do have access to the manual however there are quite a few differences between X3R and X3TC MD coding and usage. For a newbie like me it is a bit confusing since there is no clear cut 'programmers handbook' for script and MD creation.

Is there or does anyone have a manual or pdf of all the X3TC information like the one that was done for X3R? Second, any luck in there also perhaps being a nice follow along tutorial for creating your first MD script from scratch?

What would be really nice and I think would actually boost the use of the MD for X3 enhancements, is a nice walk along tutorial for newbs that step by step helps you create MD packages..... Perhaps two that could then open a lot of avenues for creative ideas..

The first tutorial I think would be great is one walking through the creation of making a mission that the user can receive from stations or other ships. Say something simply like creating a small mission to retrieve a crate from some location in a sector. Using this script future MD creative from that template would allow newbs to not only learn step by step how to create an MD mission template but using that same new template they could now create more and more missions to play, enhancing and expanding the depth and capability as they now continue to learn more and more about design in the MD.

The second great template tutorial might be in how to create a ship, equip it, assign it to a faction and give it a mission in game... Then for some advanced learning, how to expand on that by creating a carrier ship and adding fighters to it that are equipped and ready to fly.

I am sitting here looking at my screen having downloaded the X3R MD stuff but not finding anything really useful for X3TC so far on the forums. Basically I am staring at my screen wanting to create something in the MD but at a completely loss on where to even start this moment.

In my director dir there are a few files and I have tried looking at those to see if I could figure anything out... The problem is some seem to be in pck file format which I am not sure how to open properly for this nor how to even create them for X3.

Anyhow, if someone had something like this available for newbs, I bet you might see a lot more stuff for X3 being created by many others who otherwise like me are not as well versed in coding in X3..

BTW, the other reason I want to learn this is because of another idea I have...... If I can learn the in's and out's of using the X3 script and MD editors, I plan on creating an external tool that can help newbs create simple MD scripts for their use by allowing them to have a point and click GUI without having to dig into files manually for editting.. Not an end all create all tool.. but something simplistic allowing for easy creation of certain script types.. maybe a ship generator or something along that lines.

So any help here on any of this learning stuff?
Take it light.....

Malakie

----------------------------------------------------

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

Post by Stu Austin » Tue, 19. Jan 10, 07:24

Hello Malakie.
I agree. If we md coders can go ahead and start posting our work, it will help others to start using md.
At the following link on our forum, I have posted a file called director.rar which has all the director files in it. Download and extract them to your director directory in TC.

http://www.x3dmod.com/forum/viewtopic.php?f=2&t=563

Hopefully you have Visual Web Developer 2008 Express Edition from Microsoft (a free program) installed.
Here is a code for a super Nova I created. It has extra engine and rudder tunings.

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="http://www.x3dmod.com" />
    <content reference="Nova" name="N1" description="Simple 'Nova' template" />
    <version number="0.1" date="4-8-2008" status="testing" />
  </documentation>
  <cues>
    <cue name="nova_1">
      <condition>
        <check_all>
          <check_age value="{player.age}" min="20s"/>
        </check_all>
      </condition>
      <action>
        <do_all exact="1" comment="Number of times for the Nova to spawn in at the same time.">
          <find_sector x="1" y="3" comment="Finds Argon Prime and assigns a name which can be used later" />
          <create_ship name="Argon Nova" class="m3" typename="SS_SH_A_M3_1"
              race="player" capturable="1" highlight="1" racelogic="1">
              <position x="1km" y="1km" z="1km" comment="position of the ship in the spawned sector" />
              <sector x="1" y="3" comment="argon prime"/>
              <equipment loadout="none">
                <ware typename="SS_WARE_TECH213" exact="-30" comment="engine tunning"/>
                <ware typename="SS_WARE_TECH213" exact="30" comment="engine tunning"/>
                <ware typename="SS_WARE_TECH246" exact="-30" comment="rudder tunning"/>
                <ware typename="SS_WARE_TECH246" exact="30" comment="rudder tunning"/>
                <ware typename="SS_WARE_TECH251" exact="-216" comment="cargo bay"/>
                <ware typename="SS_WARE_TECH251" exact="216" comment="cargo bay"/>
                <ware typename="SS_WARE_SW_FIGHT_1" exact="1"/>
                <ware typename="SS_WARE_SW_FIGHT_2" exact="1"/>
                <ware typename="SS_WARE_SW_SPECIAL_1" exact="1" comment="special command software"/>
                <ware typename="SS_WARE_WARPING" exact="1" comment="jumpdrive"/>

                <ware typename="SS_WARE_SCANNER2" exact="1" comment="duplex scanner"/>
                <ware typename="SS_WARE_SW_NAV_1" exact="1"/>
                <ware typename="SS_WARE_SW_TRADE_1" exact="1"/>
                <ware typename="SS_WARE_SW_TRADE_2" exact="1"/>
                <ware typename="SS_WARE_BEAMING" exact="1" comment="transporter device"/>
                <ware typename="SS_WARE_TECH226" exact="1" comment="boost extension"/>
                <ware typename="SS_WARE_TECH231" exact="1" comment="SETA"/>
                <ware typename="SS_WARE_TECH277" exact="1" comment="trading system extension"/>
                <ware typename="SS_WARE_TECH241" exact="1" comment="docking computer"/>
                <ware typename="SS_WARE_TECH275" exact="1" comment="mineral scanner" />
                <ware typename="SS_WARE_TECH209" exact="200" comment="salvage insurance"/>
                <ware typename="SS_LASER_PRG" exact="9" comment="phase repeater gun"/>
                <ware typename="SS_SHIELD_C" exact="2" comment="2 25mj shields"/>
                <ware typename="SS_MISSILE_HTSK" exact="5" comment="5 thunderbolt missiles"/>
              </equipment>
              <command command="none"/>
          </create_ship>
          <incoming_message author="{TerraCorp}" popup="1" text="Here is an Super M3 Nova from TerraCorp. It can be found in Argon Prime. "/>
                  <cancel_cue cue="nova_1"/>
                </do_all>
              </action>
            </cue>
          </cues>
</director>
The next code is for same ship but it does not have extra ware but equipment loadout is "maximum".

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="http://www.x3dmod.com" />
    <content reference="Nova" name="N1" description="Simple 'Nova' template" />
    <version number="0.1" date="4-8-2008" status="testing" />
  </documentation>
  <cues>
    <cue name="nova_2" comment="use unique cue names so as not to have double cues">
      <condition>
        <check_all>
          <check_age value="{player.age}" min="20s"/>
        </check_all>
      </condition>
      <action>
        <do_all exact="1" comment="Number of times for the Nova to spawn in at the same time.">
          <find_sector x="1" y="3" comment="Finds Argon Prime and assigns a name which can be used later" />
          <create_ship name="Argon Nova" class="m3" typename="SS_SH_A_M3_1"
              race="player" capturable="1" highlight="1" racelogic="1">
              <position x="1km" y="1km" z="1km" comment="position of the ship in the spawned sector" />
              <sector x="1" y="3" comment="argon prime"/>
              <equipment loadout="maximum"/>
              <command command="none" comment="this sets the ship to do different things"/>
          </create_ship>
          <incoming_message author="{TerraCorp}" popup="1" text="Here is an Nova from TerraCorp. It can be found in Argon Prime. "/>
                  <cancel_cue cue="nova_2"/>
                </do_all>
              </action>
            </cue>
          </cues>
</director>


To try these, select new game, custom, x3universe.
Transcend Mod Team - AP, TC, Reunion

User avatar
Ketraar
Moderator (DevNet)
Moderator (DevNet)
Posts: 8887
Joined: Fri, 21. May 04, 17:15
x4

Re: newbie and lost...

Post by Ketraar » Tue, 19. Jan 10, 13:22

Malakie wrote:I HAVE downloaded the X3R MD archive so I do have access to the manual however there are quite a few differences between X3R and X3TC MD coding and usage. For a newbie like me it is a bit confusing since there is no clear cut 'programmers handbook' for script and MD creation.
Using the X3R Manual is a good way to start, look up there how MD works and the logic behind it. All the steps are 1:1 for X3TC. Once you understand the logic of MD you can start building your own stuff, here I recomend to have a look at others files and the vanilla files, so you can have an idea on how to aply the commands.
Second, any luck in there also perhaps being a nice follow along tutorial for creating your first MD script from scratch?
There is one/several in the X3R manual, as said above, the steps are the same for both.
What would be really nice and I think would actually boost the use of the MD for X3 enhancements, is a nice walk along tutorial for newbs that step by step helps you create MD packages..... Perhaps two that could then open a lot of avenues for creative ideas..
Again as for the tutorial use the existing manual.
A tutorial for creative thinking will be rather hard to achieve IMO, think that MD has a HUGE amount of ways to be (mis)used, no way a tutorial would cover anything near to all possibilities, plus I doubt anybody would want to spend that much time in it, as its better used in coding.
I still think the best method is the try&error&peeking&asking method is the best way to go.
I am sitting here looking at my screen having downloaded the X3R MD stuff but not finding anything really useful for X3TC so far on the forums.
There are several Missions/mods that use MD just look in here, download them and have a peek. You also can extract the Vanilla files and have a look there too. So there is plenty from where you can get "inspiration".

As I suggest in the German forums if you have doubts post them here somebody will sure help/explain.

MFG

Ketraar
Image

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

Post by Stu Austin » Tue, 19. Jan 10, 23:51

I have made a small pdf tutorial which can be found here:
http://www.x3dmod.com/forum/viewtopic.php?f=2&t=563
Its called Stu_md_tutorial

It is by no means complete but will get you going if you want to attempt using md. I will be adding more content to it if anyone is interested.
stu
Transcend Mod Team - AP, TC, Reunion

User avatar
Ketraar
Moderator (DevNet)
Moderator (DevNet)
Posts: 8887
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 1. Feb 10, 18:40

and there is no way i can add a sector in the current save game?
Since this was rased rather often in the last few days here the code on how to load custom map files.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="Loadmap_*******" comment="its imperative that you use a custom name">
      <condition>
        <check_all>
          <check_value value="{player.name}" exact="loadmeamap" comment="change condition to anything that fits your purposes"/>
        </check_all>
      </condition>
      <timing>
        <time exact="2s"/>
      </timing>
      <action>
        <do_all>
          <load_map file="mymap" comment="map name WITHOUT file extension"/>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Note: Just create the things you want to ADD, save your map as you feel like (just not as x3universe ;-))

MFG

Ketraar
Image

User avatar
enenra
Posts: 6174
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Tue, 9. Feb 10, 16:08

Two simple snippets which might be of interest to some. :)

Code: Select all

<set_owner object="enemyship" race="neutral"/>
<set_relation object="enemyship">
 <relation object="{player.ship}" relation="enemy" mutual="1"/>
</set_relation>
You can use that to have a ship fight the player without summoning the race's wrath upon the player in the process (using the original race) or having every ship in the sector attack it (using enemy race).
Thanks to Ketraar for the tip. :)

Code: Select all

<reward_player>
 <notoriety>
  <relation race="split" exact="{reward.notoriety.split@average}" operation="subtract"/>
 </notoriety>
</reward_player>
This is one way you can punish the player.

Code: Select all

<reward_player>
 <notoriety>
  <relation race="split" exact="{penalty.notoriety.split@average}"/>
 </notoriety>
</reward_player>
But it's also possible to do it like this.

Just two things I learned today. :)

User avatar
Argonaught.
Posts: 1618
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by Argonaught. » Tue, 16. Feb 10, 19:05

This one below is similair to Stu's but it creates a Terran M1 in Kingdom End with extra speed, cargo and rudder.

However it's not friendly and will kill stuff, It is also not affiliated with any of the known races so it will kill them too afaik.

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="Argonaught" alias="Argonaught" contact="argonaught@iol.ie" />
    <content name="Rogue Terran Warship" description="creates an enemy ship" />
    <version number="0.1" date="15.2.2010" status="Testing"/>
  </documentation>
  <cues>
    <cue name="Rogue Terran Warship">
      <condition>
        <check_all>
          <check_age value="{player.age}" min="1m"/>
        </check_all>
      </condition>
      <timing>
        <time exact="1m"/>
      </timing>
      <action>
        <do_all exact="1">
          <create_ship capturable="1" class="m1" typename="SS_SH_USC_M1" race="enemy" racelogic="1">
            <position x="50km" y="50km" z="1km"/>
            <sector sector="Kingdom End"/>
            <equipment loadout="maximum"/>
            <cargo>
              <ware typename="SS_WARE_TECH213" exact="30"/>
              <ware typename="SS_WARE_TECH246" exact="30"/>
              <ware typename="SS_WARE_TECH251" exact="30"/>
            </cargo>
            <command command="killenemies"/>
            <pilot name="Terry the Terrible" race="other1" shipname="Rogue Terran Warship"/>
          </create_ship>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
You can create your own race with the race="other1" setting and make use of imported ships to setup another race in the game.
Afaik you can create upto 3 extra races using the race="other1" , race="other2" , race="other3" settings, but don't quote me, I may be totally wrong.

Still learning but I created this using the original MD guide and have dl'd Stu's guide for later reading.

Argo.
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP

I lurk alot for the most part now
:thumb_up:

Rednoahl
Posts: 900
Joined: Sat, 3. Jan 09, 16:48
x4

Post by Rednoahl » Thu, 25. Mar 10, 22:07

Not full code, but it took me a long while to find out what "discipline" meant.

Code: Select all

<cue>
  <action>
    <do_all>
      <create_offer discipline="XXXXP" comment="Plot"/>
      <create_offer discipline="TXXX" comment="Trade"/>
      <create_offer discipline="XFXX" comment="Fight"/>
      <create_offer discipline="XXBX" comment="Build"/>
      <create_offer discipline="XXXT" comment="Think"/>
    </do_all>
  </action>
</cue>

User avatar
EmperorJon
Posts: 7178
Joined: Mon, 29. Dec 08, 21:58
x3tc

Post by EmperorJon » Thu, 25. Mar 10, 22:39

What does that do?

I get the Plot, TradeFightBuildThink, but does it just add more missions or what?
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

User avatar
Argonaught.
Posts: 1618
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by Argonaught. » Fri, 26. Mar 10, 02:06

I think that code is in relation to the type of mission icons in/on stations etc
Not sure though tbh.

Argo.
[MOD]X3TC No Fog / [MOD]X3AP No Fog / [MD]X3TC Menagerie Shipyard / [MD]X3AP Menagerie Shipyard
<==<<Argonaught>>==>

XBTF>XT>X2TT>X3R>X3TC>X3AP

I lurk alot for the most part now
:thumb_up:

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”