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

jeffwp27577
Posts: 19
Joined: Tue, 30. Dec 03, 05:30
x3tc

Post by jeffwp27577 » Wed, 12. Mar 08, 18:18

Thanks, I just figured somebody out there had already made a list.

Anyway, I downloaded the ship creator and have been using it to look at the ship files to figure out what they are.

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Wed, 26. Mar 08, 23:40

I'm just about to dive in with some simple missions, but could someone sex light some light on a few things please?

1. Can one mission know if a previous has been completed.

2. Can the number of enemies you've killed be a condition to initiate a mission?

3. Can this be checked within a specific time frame? I.e kill 5 pirates in 10 minutes?

4. Once you activate a mission, and it sends an incoming message asking if you want to accept the mission, would it be possible to leave the message and accept at a later time, or is it a must be now thing?

Cheers for any help.
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

XGamer
Posts: 2355
Joined: Sun, 25. Apr 04, 19:09
x4

Post by XGamer » Thu, 27. Mar 08, 01:02

Apollo911 wrote:Can one mission know if a previous has been completed.
IF you know the Cue Name of the Cue which is triggered on Mission Completion of the Mission which should be completed before then YES this is possible with the <cue_is_complete> condition.
Apollo911 wrote:Can the number of enemies you've killed be a condition to initiate a mission?
As far as I can remember there is a condition or variable or so which you can use to archive that.
Apollo911 wrote:Can this be checked within a specific time frame? I.e kill 5 pirates in 10 minutes?
IF the above is true and there is a variable like that then yes! You would need to store the current play time and the enemies killed already. Then in a subcue you set the condition to Previous Stored Playing time + 10m <= {player.age} and stored kill count + 10 <= Current KillCount and you have what you want.

Apollo911 wrote:Once you activate a mission, and it sends an incoming message asking if you want to accept the mission, would it be possible to leave the message and accept at a later time, or is it a must be now thing?
Nope this aint possible. Only if you dont send it as a popup="1" message AND the player does NOT open it up. Once the message is actually displayed there must be pressed a Button to make it go away. Also if a message is shown its transfered to the logbook in where you cant press any buttons. Therefore this is not possible. You would need to resend the message asking the player again which is not quite nice
Apollo911 wrote:Cheers for any help.
np ;)

greetz
XGamer
X:BtF: 7/10 | X2: 8/10 | X3:R/TC/AP: 8/10 | X:R: 3/10 | X4: 0/10 (3 points for split ships and stations, 4.0 -> -50 points).
If you are raising pirate activity, give me meaningful ways to deal with them PERMANENTLY. Better things to do than replacing ships every 10 minutes, or babysitting ships getting harassed.
Stopped playing X4 with 4.0 due to outrageous, needless and pointless nerfs to everything. Don't change what wasn't broken in the first place.

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

Post by Xenon_Slayer » Thu, 27. Mar 08, 01:15

Hi

1. If something happens which you want a future mission/cue to remember, save a value somewhere. Global values are easily accessible for all cues but are not exactly the best place for generic mission values. Save them to the highest parent cue which the future mission will also see, if possible of course. There is also cue_is_complete, but that may not be specific enough if several outcomes could happen in a single cue.

2. You are currently not able to get the number of player kills in the MD, although that does sound quite interesting ;-)
You can use the fight rank as a substitute though. It just is not specific to ship kills or types of ships.

3. The only player kill info which is recorded is the object type and number of kills I think. There may be more such as race as I seem to recall seeing something about that in the statistics.
Specific stuff such as the time of kill are not recorded. Unless you created them in the MD and waited for them to be destroyed but that would make them mission objects and I dont think that is what you were asking for.

4. Incoming questions do not actually disapper I think. As long as the cue which is waiting for the responce is still active, the player can accept when ever but all other incoming messages will be cued behind it until the message is answered.
Come watch me on Twitch where I occasionally play several of the X games

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Thu, 27. Mar 08, 01:42

Thanks guys! The MD seems very flexible, and XML seems like a great way to implement it.

@ Xenon_Slayer - can I ask what you mean by save a value?

(I'm a complete noob to any form of coding! :P )
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

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

Post by Xenon_Slayer » Thu, 27. Mar 08, 02:19

You have a few actions in the MD which will save some kind of value.
<set_value/>: The generic numerical saving action. e.g.

Code: Select all

<set_value name="MyNumber" min="1" max="10"/>
This would save a global value named 'MyNumber' as a random number between 1 and 10. You can save many things as values.

Code: Select all

<set_value name="MyShipID" exact="{player.ship}"/>
This is using a 'variable' to set a value named MyShipID. But in the case of objects and sectors, they have their own actions which are made just for them.
<set_object/> and <set_sector/>

To access the values, use the variables such as {value@MyNumber}, {object@MyShipID} and {sector@MySector}

Variables
These are simple ways for you to get information. Easy ones are player related ones such as {player.ship} which will return the players current ship. More complex ones need you to feed additional information such as: {object.race@object}.
In the above example, {object.race@object} needs an objectid or an MD object name. Best use the player ship to explain this again.

Code: Select all

<set_object name="MyShip" value="{player.ship}"/>
Here we use the set_object action to set an object named 'MyShip' to my current ship. The object name 'MyShip' can now be used in variables and conditions. Even if the player ship changes, the object name 'MyShip' will still point to that ship unless it is destoryed.
Actions and conditions can use variables within them as well as value/object/sector names which you saved. Such as:
<object_changed_sector object="{player.target}"/>

You can also nest variables within variables. Look at the second example here.
The following will return the same values:
{object.race.name@MyShip}
{object.race.name@{player.ship}}
{player.ship.race.name}

Local Values
As I mentioned in the previous post, there are global variables which are accessable to the whole Mission Director. This will run into problems if there are two missions using the same named variables such as:
Mission 1:
<set_value name="Difficulty" min="1" max="10"/>
Mission 2:
<set_value name="Difficulty" min="1" max="1000"/>

One mission will save the value named 'Difficulty'. As soon as the other mission runs it will also save a value named 'Difficulty' but it will overwrite the previous value, which could spell trouble for the other mission if it expects a value between 1 and 10 but it gets 768 for example.

You can save values to cues, so only that cue and its child cues can see that value. For example

Code: Select all

<cue name="Mission1">
  <action>
    <set_value name="Mission1.Difficulty" min="1" max="10"/>
  </action>
</cue>
<cue name="Mission2">
  <action>
    <set_value name="Mission2.Difficulty" min="1" max="1000"/>
  </action>
</cue>
Here, the cue named 'Mission1' will set a value named 'Difficulty' to the cue 'Mission1'. Likewise, the cue named 'Mission2' will set the value named 'Difficulty' to the cue named 'Mission2'.
Even though these values have the same name, they are saved in different places. The subcues can have access to them by using the variables such as: {value@Mission1.Difficulty} and {value@Mission2.Difficulty}.
Remember though, the values can only be read if it is saved in above the cue or inside the cue using it.
Likewise, they can only be saved in the current cue or a parent cue.
Come watch me on Twitch where I occasionally play several of the X games

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Thu, 27. Mar 08, 10:39

Thanks Xenon Slayer, that will be a great help!

I have 2 more questions if you don't mind?

Can the MD display text on screen, not an incoming message, just say text along the top of the screen? (If not, can it play a sound file without pausing the game?)

Can it change the playership? (If not, can it activate the transporter and move them to another ship?)

Ok, maybe that was 4.

Thanks again!
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

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

Post by Xenon_Slayer » Thu, 27. Mar 08, 10:50

The MD can display things in the subtitle bar. As for sound, you can not play a sound file like a wav you added. I think there is a way to MOD the cat/dat files so you can add new sounds. If you can do that I see no reason why you can't play them.
Have a look at all the 'play_' actions such as play_subtitle.

Changing the playership, sorry. The MD does not have control over that, in any form, incuding the transporter.
Come watch me on Twitch where I occasionally play several of the X games

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Thu, 27. Mar 08, 12:48

Thanks XS. That's great about the subtitle bar and the sounds, I'll try editing the cat files and sounds.txt. I guess I'll just make the kind of ship as a condition rather than attempting to change it during the mission.

Cheers, Apollo
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Thu, 10. Apr 08, 15:40

FYI: It appears at least some cue events will not occur specifically in Khaak owned sectors for some strange reason. Change sector owner to other than Khaak and everything works fine.

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

Post by Xenon_Slayer » Thu, 10. Apr 08, 16:29

What kind of cue events? The only special thing about Kha'ak sectors is that there are no gates so find actions will not find anything other than stuff in that sector.
Come watch me on Twitch where I occasionally play several of the X games

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Fri, 11. Apr 08, 16:29

Xenon_Slayer wrote:What kind of cue events? The only special thing about Kha'ak sectors is that there are no gates so find actions will not find anything other than stuff in that sector.
Conditions are I must be flying specific ship, it is attacked, and shields are less the 95%

This code:

Code: Select all

<condition>
   <check_all>
      <object_attacked object="{object@customship}" />
      <match_object object="{player.ship}" tyepename="{SS_SH_OSR_SECRET}"/>
      <check_value value="{player.ship.shields}" max="95"/>
   </check_all>
</condition>
   .....action, do all, etc....
      <incoming_message author="system" text="any old text" popup="1"/>
   .....do all, action, etc
Code works perfect in any non-Khaak sector. However, if I enter Khaak sector (first I tried 14,11), nothing happens. The funny thing is as soon as I return to some non-Khaaks sector, I get the incoming message popup along with other events not listed in above code fragment which should have been triggered in the Khaak sector.

At first I thought something was wrong with my map. Finally after beating my head for several hours, I changed owner of some Argon sector to Khaak owned (race 7) and the code stopped working. Code worked again once changed back to Argon owned.

Conclusion: This code at least does not work in Khaak-owned sectors.

Footnote: I also made simple code with condition <object_changed_sector> followed by action incoming message (after 5s delay). Result: no incoming message when change to Khaak sector, but then when change to some other race sector I got 2 messages (Khaak sector message and second sector message).

Hope that helps.

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

Post by jlehtone » Fri, 11. Apr 08, 18:38

Observe wrote:Code works perfect in any non-Khaak sector. However, if I enter Khaak sector (first I tried 14,11), nothing happens. The funny thing is as soon as I return to some non-Khaaks sector, I get the incoming message popup along with other events not listed in above code fragment which should have been triggered in the Khaak sector.
That occurs even in vanilla game. No incoming message popups. They all queue until you return to normal space. Note though that direct writes to logbook do work. Sounds like Kha'ak specific "feature". My initial guess was that lack of gates does that, but if ownership affects it then it indeed is bound to race.

A "short" raid "out there" and then all this spam:
[ external image ]

So not a MD problem. :wink:
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Fri, 11. Apr 08, 18:46

jlehtone wrote:Sounds like Kha'ak specific "feature". My initial guess was that lack of gates does that, but if ownership affects it then it indeed is bound to race.
Presense or lack of gates makes no difference. For example, if I make a normal gated Argon sector Khaak owned, the problem occurs. Revert back to Argon owned, and the problem goes away. In other words, no imcoming messges (popup) are possible in Khaak sectors.

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

Post by Xenon_Slayer » Fri, 11. Apr 08, 22:52

Very interesting. I've never noticed this behaviour. It must be to make the player feel isolated, but no. Not MD specific. Also, the {} tags around the typename are not needed.
Come watch me on Twitch where I occasionally play several of the X games

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Sat, 12. Apr 08, 01:01

Thanks for verifying and clarification. I do hope this "feature" is changed for next release (TC). Having message backlog appear when returning from Khaak sector is not good. Certainly there are cases where popup's may be useful in Khaak sectors as well as others. I suppose messages could be supressed in such sectors, but that seems a bit unreasonable. :)

Apollo911
Posts: 1492
Joined: Sun, 2. Nov 03, 21:10
x3tc

Post by Apollo911 » Sat, 12. Apr 08, 13:22

Hi guys - I'm back with another question...

I suppose this could be non-MD specific. Can the player dock at an M1 that isn't theirs? Like docking at a station? I fear the answer to this is no...If so, can anyone suggest a workaround using the MD? In a ship not capable of jumping, I would hope it would dock with the capship, and then the capship would jump automatically.

The solution could be - briefly change the ownership of the capship to the player, then once the player docks, use the warp command, then the player undocks and ownership is returned to normal?

Thanks.
[ external image ]
From the darkness you must fall
Starting to mod? Watch my ship importing tutorial here here!

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

Post by Xenon_Slayer » Sat, 12. Apr 08, 17:21

Unfortunately, that is not possible. I'm quite sure that temporarily setting a ship to the player race will open up a heap of exploits too. You could just warp the player and put some fiction behind it, perhaps make it cost money and energy cells.
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 » Wed, 16. Apr 08, 10:33

I am a brand new newbee... so excuse me if I am posting idiot questions...
I tried the "Hello World" script and nothing happened until I changed the name of the player in Thereshallbewings...
I want to make a "distributable plot" that should take place before, during or after the normal plot and the Bala-Gi missions. So it's important that the missions are triggered regardless the name of the player!
So here are the questions...

1: Once a mission or a set of missions have been made with MD, is it mandatory that the pilot's name is "Thereshallbewings"?
2: Is there a way to compile the missions created with MD in cat/dat files, as for creating false-patches?
3: can a mission created in one file (ie "GargaMission-1") set values or attributes that can be read in other files (ie "GargaMission-2")

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?
- 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 » Wed, 16. Apr 08, 10:51

Buon giorno Garga-Potter
so excuse me if I am posting idiot questions...
There is no such thing, there are only questions.


1. You don't have to "change" your name, but you need to activate the ScriptEditor and that is achieved by typing Thereshallbewings in your pilot name, but if you type it right your previous name will show up again.

2. True is that I never tried that. But just put the files in a 10.cat, refer to director\ and let me know if it worked :D

3. yes

4. Afaik there is a one-way relation between the SE and the MD. No, is my best guess.

Post Reply

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