[Video Tutorial] Mission Director Basics

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

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

Post Reply
kurush
Posts: 3955
Joined: Mon, 7. Nov 05, 00: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: 13737
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: 1154
Joined: Mon, 3. Nov 08, 15: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: 13737
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
Moderator (DevNet)
Moderator (DevNet)
Posts: 8983
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: 5704
Joined: Sat, 17. Dec 11, 02: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: 2727
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: 1618
Joined: Wed, 6. Nov 02, 21:31
x3ap

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

I lurk alot for the most part now
:thumb_up:

User avatar
eldyranx3
Posts: 2146
Joined: Sat, 14. Jan 06, 22:29
x3tc

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: 3955
Joined: Mon, 7. Nov 05, 00: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: 2146
Joined: Sat, 14. Jan 06, 22:29
x3tc

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: 2727
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
Moderator (DevNet)
Moderator (DevNet)
Posts: 8983
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: 2727
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: 1154
Joined: Mon, 3. Nov 08, 15: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...

Post Reply

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