[Video Tutorial] Mission Director Basics

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

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Post by kurush » Tue, 29. May 12, 22:11

Ketraar wrote: Also would like to point out that there not many real situations where this is really useful, given most stuff that can be done via MSCI are available in MD too. The only thing I always thought was missing from MD, was the ability to use menu and retrieve player input from it, that's for me personally the only reason to use MSCI.
That and also running an MD script from a hotkey or a ship command. This is where I had to cross-breed them. I am not sure it should be a part of the tutorial though, just a howto somewhere on the forum should suffice. It is a bit of an advanced topic that you won't need if you are just trying to create missions.

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

Post by apricotslice » Wed, 30. May 12, 02:41

kurush wrote:It is a bit of an advanced topic that you won't need if you are just trying to create missions.
Oh, I dont know.

I can see a plot type MD where a script adds a piece of equipment and the MD is triggered to give the player a mission that uses it.

Also, the one thing I dont like about MD is its lack of orderly flow. You set up ques, but these can be done in any order depending on when the condition activates it or is deactivated.

Scripts on the other hand have ordered logic, so writing a script to control the flow of a mission makes sense, with the MD acting on the conditions setup by the script.

I guess it comes down to whats easier to do. So seeing both ways of doing it presented would help someone choose which is best for them.

Edit : Once you get to that point, ask one of the scripters to colaborate. Someone like LV, Gazz or Logain-Abler.

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Wed, 30. May 12, 07:15

apricotslice wrote:
kurush wrote:It is a bit of an advanced topic that you won't need if you are just trying to create missions.
Oh, I dont know.

I can see a plot type MD where a script adds a piece of equipment and the MD is triggered to give the player a mission that uses it.
In which case you simply use:

Code: Select all

<condition>
  <object_has_equipment object="{player.ship}">
    <ware typename="SS_WARE_TYPENAME" min="1"/>
  </object_has_equipment>
</condition>
apricotslice wrote:Also, the one thing I dont like about MD is its lack of orderly flow. You set up ques, but these can be done in any order depending on when the condition activates it or is deactivated.

Scripts on the other hand have ordered logic, so writing a script to control the flow of a mission makes sense, with the MD acting on the conditions setup by the script.
Of course it has orderly flow, that is why you use sub cues - Once the parent cue has been triggered it will only then start checking conditions for the sub cues, and so on for their sub cues etc...

They are two different tools for two different purposes, and never designed to have much interactivity. Trying to force them to work together will just lead to unnecessary frustration, and as I've yet to see a plot (or any other mission) that required a script to handle the mission flow it seems to me fairly pointless...

These videos are after all aimed at the beginner....

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

Post by apricotslice » Wed, 30. May 12, 10:20

I dont disagree.

Its the way that MD is structured that offends my "old school" programming constructs. :D

I dont doubt it works, but my way of programming is more akin to the SE, so having the MD be an adjunct of a script strikes me as a good way of doing it. Essentially the MD becomes a series of black boxes each of which is player communication based, but the script controls the logic flow.

Anyway, just conjecture at this point. Personally I'm waiting for them all to be completed, at which point I'll do the lot as a course, then see which way strikes me as being the way that suits me best.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Thu, 31. May 12, 16:05

Well I used to go to companies and give training to people about new ways to do the things people were doing for ages, in some cases decades. The more people are set in their ways the harder it was to convince them to adopt new techniques. This seams to be a general bug in humans as they grow older, so my advise to everyone is to approach any learning process as a child, you don't know anything, that will make learning so much easier. Just a suggestion, as usually everyone is entitled to what the heck they like. :-)

OK so preparing next video, I think I'm going to address library, should be a shorter one. I want to do some coding of my own too so this will have to do for this week.

Maybe, and that's just a maybe, I'll do a live recording of a small MD script I wanted to do for a while but never got around to actually do it. This would be one with less explaining as the last ones otherwise it would take for ever, but may be interesting for some to see how to build a script from start to end (I could add comments later in editing where needed). Obviously this would be a larger endeavour.

So let me know if it would be worth doing.

MFG

Ketraar
Image

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 31. May 12, 17:40

Ketraar wrote:maybe, I'll do a live recording of a small MD script ...

So let me know if it would be worth doing.
I think that a recording of a real development session would be great, although it would probably be best to edit that one after you record it. We do not need to see all of your pauses for thought, lookups, and re-works... although one of each, with comments, would be good.

Also, when it fits into your series, a tutorial on tracing and debugging would be outstanding. It is one of the most-important-yet-most-avoided topics on the forum.

User avatar
Juggernaut93
Posts: 2897
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Thu, 31. May 12, 20:30

DrBullwinkle wrote:
Ketraar wrote:maybe, I'll do a live recording of a small MD script ...

So let me know if it would be worth doing.
I think that a recording of a real development session would be great, although it would probably be best to edit that one after you record it. We do not need to see all of your pauses for thought, lookups, and re-works... although one of each, with comments, would be good.

Also, when it fits into your series, a tutorial on tracing and debugging would be outstanding. It is one of the most-important-yet-most-avoided topics on the forum.
I totally quote, even though I think that also "lookups and re-works" may be important, as they can show, for example, corrections to common errors, enhancements to the code and so on... :)

User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. » Thu, 31. May 12, 21:33

A live development would be cool to see.

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

XBTF>XT>X2TT>X3R>X3TC>X3AP>X4F

I lurk alot for the most part now
:thumb_up:

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Fri, 1. Jun 12, 12:21

Thank you for this wonderful resource. Hopefully this inspires new content from the community!

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Post by kurush » Sat, 2. Jun 12, 06:42

One thing I am really curious about that might make sense to include in the tutorial is applying changes to an MD mission that is already in the game. How does game engine react on an removed or updated MD file. I think this is something you would need to do when testing a mission.
Last edited by kurush on Sat, 2. Jun 12, 07:52, edited 1 time in total.

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Sat, 2. Jun 12, 07:00

To expound on kurush's suggestion, when do <patch> portions of a cue run, do they run retroactively on already completed cues, what happens when <patch> is used in a cue reset loop, and when does the Gameplay -> Mission Director Options (Refresh Conversations ect) help in testing?

User avatar
Juggernaut93
Posts: 2897
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Sat, 2. Jun 12, 10:24

I've just finished to watch the latest video. I'm not sure to have understood well the differences between <cancel_cue> and <destroy_cue>. :gruebel:

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Sat, 2. Jun 12, 15:34

MD code patching and version updates are things that should be addressed in the testing/debugging video. Mostly cause I will need to get some info myself on how to explain it. While version updates are quite simple the patching node is yet a mystery to me on how it works, all I know is it does work.

Resetting the Mission Director via the debug option is very useful for testing because you can force a code reset without having to reload or use a reset_cue manually. You also can alt+tab out of the game, make a change to the code, alt+tab back in to the game and use the MD reset and immediately see the effects of your changes. Very good for testing portions of code as you code it.

@Juggernaut93
The difference is that when you cancel a cue, it still exists but is "dormant" and can be reactivated if reset. Also all objects, variables, etc are still available up to when the cue (and sub-cues) was canceled. Destroy cue will delete the cue and all references in it and cant be reactivated, they are gone until you reload them again, usually means new start or load save where its still there. A very finite solution to clean up. Hope that was a bit more clarifying.

Next video is in the making, should be up today, like I said a few posts back, its about libraries and should shed some light on how they work and can be useful.

Thanks everyone for the feedback and suggestions. :-)

MFG

Ketraar
Image

User avatar
Juggernaut93
Posts: 2897
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Sat, 2. Jun 12, 16:02

Ketraar wrote:@Juggernaut93
The difference is that when you cancel a cue, it still exists but is "dormant" and can be reactivated if reset. Also all objects, variables, etc are still available up to when the cue (and sub-cues) was canceled. Destroy cue will delete the cue and all references in it and cant be reactivated, they are gone until you reload them again, usually means new start or load save where its still there. A very finite solution to clean up. Hope that was a bit more clarifying.
Ok, all clear! :thumb_up: Waiting for next video :)

dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle » Sun, 3. Jun 12, 07:25

A couple of points from your last video on conversations and actors:

Actor location on 'Big Ships' (those that have a captain and crew) - If you set the actor location as pilot, then the mission icon will show up on the ship, but the Pilot (Captain) won't offer your mission conversation. You have to use 'Crew' as the location for the conversation to work.
TM's are impossible to use for mission offers, as they are classified as big ships (docking ability) the Pilot won't offer the mission conversation, however they don't have a crew like the other big ships, so the actor can't be placed there...

Your clean up cue 'MDT_END' - will only run if the player selects 'No' from the question. - If they select 'Yes' the station will remain invincible, with the actor still on it...

User avatar
Tohron
Posts: 331
Joined: Mon, 24. Oct 11, 06:38
x3tc

Post by Tohron » Mon, 22. Apr 13, 16:56

Simple question on the first video - you mention extracting files from a catalog file in the X3 Editor 2, but don't say where the catalog file is or how to extract it. Can anyone offer a little guidance? Thanks!

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 22. Apr 13, 18:11

Yes sorry, its always assumed you know these things, bad habit too actually.

Anyway, the files you have to extract are in the cats, depending on which game you use (TC or AP) they will be located in different locations, TC main installation folder for TC and \addon for AP.

The best would be to extract all cats into a working folder starting with the lower numbers and working your way up, overwriting as you go. This makes sure you have the latest version.

For single files its the other way around, open the highest cat and extract the needed files, and work your way down if the higher cat does not contain all the files you need. In this case never overwrite any files.

This method is true to any modding activity.

MFG

Ketraar
Image

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 22. Apr 13, 18:25

Rather than hunting for files, it is more reliable (and quicker) to find the file in VFS (Virtual File System).

You can Open from VFS from the file menu or:
  • Pull down Plugins menu.
  • Choose Cat Manager.
The Cat Manager gives you a "view" into VFS. Any file that you open from the Cat Manager will automatically be the most-current version of the file (the same version that the game uses).

VFS automatically manages the Addon folder if you set the Game Profile correctly (Options/Configuration). So just look in the Director folder for the files that you want.

Two ways to export a file:
  • Drag and drop from VFS to Windows Explorer.
  • Pull down the Files menu and choose Extract Files.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 22. Apr 13, 18:34

Not sure if its my settings but I dont trust VFS for AP, it mixes the files up, specially MD I noticed it.

Anyway, having a full extracted working copy of the games is IMO the simplest way to mod, specially if you like to mod multiple parts of the game.

MFG

Ketraar
Image

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 22. Apr 13, 18:40

Ketraar wrote:Anyway, having a full extracted working copy of the games is IMO the simplest way to mod
Agreed.

I have never seen VFS make a mistake. If you move or modify a file outside of X3 Editor, then you may have to close and reopen X3 Editor to re-read the files.
  • (It *should* be sufficient to "Reload game data" but that sometimes does not do the entire job.)

Post Reply

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