[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

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

[Video Tutorial] Mission Director Basics

Post by Ketraar » Sun, 20. May 12, 19:36

Hello everyone

This is the Topic for a new video tutorial series I'm starting for the MD aka Missions Director. Given a lot of people complaining there is no real info on it and the info there is, usually is so overwhelming that puts people off, mostly due to frustration.

So I decided that maybe the best way to explain AND show how you code MD (for most part) is best done in a video and given its today rather simple to do using Youtube, I thought I'd just go ahead and do it.

Still I'm quite new to this video making thingy, so bear with me as I get around to figure it out right, so might not be perfect at start.

Also I would need you guys to post here topics you want covered so I can address them specifically. The fist one I made (uploading at time of writing) is for the very basics. Its for me to see how to do it and hopfully informative to those really at the beginning.

OK then, Ill be updating this topic with links as we go, first one is oploading as we "speak" once its up I'll post the link.

MFG

Ketraar

Empty Template code

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<?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="" alias="" contact=""/>
    <content reference="" name="" description="" />
    <version number="" date="" status=""/>
  </documentation>
  <cues>
    
  </cues>
</director>
Image

Links
Last edited by Ketraar on Wed, 13. Jun 12, 12:17, edited 8 times in total.
Image

User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon » Sun, 20. May 12, 19:46

This could be brilliant.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

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

Post by dillpickle » Sun, 20. May 12, 20:46

Is it possible to have a download-able file as an alternative to youtube? Personally my Internet connection isn't good enough to stream youtube without it stopping to buffer every few seconds (I'm sure I'm not the only one). Tutorials you need to be able to pause and jump back and forth to refresh the memory.

Cheers...

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

Post by Argonaught. » Sun, 20. May 12, 21:09

Fantastic idea Ketraar :D

Look forward to learning more about the stuff after the basics but will watch them all anyway and give feedback....will also probably bombard you with questions but atm I'm tired and can't think of anythng lol :S

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
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Sun, 20. May 12, 21:19

sounds great Ketraar
dillpickle wrote:Is it possible to have a download-able file as an alternative to youtube?
There are a couple of youtube download tools (and websites) that can do that, just saying. I use those for all youtube video tutorials i need - a seperate download link would be handy though.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

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

Post by Ketraar » Sun, 20. May 12, 23:35

dillpickle wrote:Is it possible to have a download-able file as an alternative to youtube?
Like Killjaeden said if you google it you'll find ways to get youtube files downloaded. Thus I'll save me the trouble of uploading stuff twice, specially since I don't have any place to do so anyway. Hope that solves it for you though, mind my connection is probably as crappy as yours (lots of disconnects here, so I feel your pain mate).

OK then first one up, finally. Should have figured it out now how to do, still mind I'm not native English speaker, so cut me some slack. Still hope its understandable, I'll try yo get better with practice, I'm not really a speech person.

Anyway, let me know what I can do better and what topics you want covered. Next one up will be about Object and variable naming conventions.

MFG

Ketraar
Image

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

Post by apricotslice » Mon, 21. May 12, 02:58

I've never understood the whole variable handling.

I'm from a programming background. A variable gets described, it gets a value put in it to start with and then it gets used.

What I cant see in the MD code is how the variable is created and the initial value is put in it. Create variable. Move zero to variable. That sort of thing.

Also, I've wondered about calling other files. I HATE the way egosoft codes its MD's. Code 20 levels deep is imo, a very stupid coding practice making debugging a nightmare. So the way I'd prefer to do it is have a master MD that never goes more than 3 levels deep, that calls other MD's to black box functions. eg. the top level has the flow of the missions, but each mission is in its own file called from it.

Alternatively, how do you do sub-routines ? I was taught sub-routine style of coding. You had a single flow of code that defined the logic structure, but everything was actually done in called sub-routines. I cant see how that can even be done in MD, but if there is a way, please outline.

How do you do an if-then-else structure ? Behind the MD has to be logic, and thats often based on if-then-else. How do you turn that logic into MD code ?

Also yes to downloadable files. You-tube is something I generally avoid, simply because my bandwidth is so terrible that most of them are either a slideshow or resemble something controlled by a monkey with attention deficit problems. Also, I dont have the bandwidth limit to keep watching them as you-tubes. I need to download them once, and then watch as many times as needed. So for me, the whole series as a single zip download would be great. And as you do them, downloadable zips for each.

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

Post by DrBullwinkle » Mon, 21. May 12, 07:09

Bravo, Ketraar. This is excellent!

For downloading from YouTube, I really like DownloadHelper extension for Firefox. It is reliable, can integrate with Flashget, and can download directly into common video formats.

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

Post by Argonaught. » Mon, 21. May 12, 08:17

Well done, can be pretty hard to try explain stuff when there's only yourself doing the talking.

You laid it out pretty clear :)

Note for downloading, I use firefox with either flashget, unplug or downthemall plugins...one of them usually gets the job done if i want to dl a vid for later watching.

HTH

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
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 21. May 12, 11:39

apricotslice wrote:Alternatively, how do you do sub-routines ? I was taught sub-routine style of coding.
Say what? :?

I'm no programmer, so please speak English :-P
Can you put that in X terms so I know what you mean?
How do you do an if-then-else structure ? Behind the MD has to be logic, and thats often based on if-then-else. How do you turn that logic into MD code ?
Do-if and do-when are very powerful tools and also rather simple to use in MD, I'll explain those soon, maybe not in the next one due its rather complex nature, trying to build up complexity as I go (mind I said 'try' :-))

Linked 2 more vids about naming conventions and variable handling. Also added small description to what is talked in those as the title does not always say it all, hopefully this will help people identify the things they are looking for without having to go through those they dont really need/care.
Well done, can be pretty hard to try explain stuff when there's only yourself doing the talking.
Thanks, yeah its not easy to talk to yourself either. :-D

Its also not easy to make sure its explained the way people with no clue understand it, some things just work the way the do and explaining in a way that makes sense is not always easy.

MFG

Ketraar
Image

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

Post by apricotslice » Mon, 21. May 12, 11:56

Ketraar wrote:
apricotslice wrote:Alternatively, how do you do sub-routines ? I was taught sub-routine style of coding.
Say what? :?

I'm no programmer, so please speak English :-P
Can you put that in X terms so I know what you mean?
X scripting has a call subroutine command in the flow control section. I forget off hand what it is. You define a title, and then call the title, within the same script. So a sub routine written script looks like this.

blah
blah
blah
If blah
..call subroutine blah1
else
..call subroutine blah2
endif
blah
blah
end of script.

title Blah1
more blah
etc.
end title

title Blah2
new blah
if not blah
..call subroutine blah3
end if
more blah
etc.
end title

title Blah3
more blah
etc.
end title

Eg. If you want to create the exact same task force, but from many different places or situations, you write a sub routine for the actual creation commands, and call it from where ever you want that task force created in the logic flow. That way, you only ever code it once, even though the criteria of creating it may be very different. Any variables, are passed to the sub-routine to use and anything resulting is passed back by more variables.

This is done now in the way egosoft write their mission scripts, but not explained very well.
Its also not easy to make sure its explained the way people with no clue understand it, some things just work the way the do and explaining in a way that makes sense is not always easy.
Some things just have to told, not explained. In most programming languages, there are things that just are. Why they are, is not relevant, its just the way they designed it. Understanding why isnt necessary to coding and trying to explain it is too difficult to bother doing, especially since a lot of the time, it wont make sense anyway.

The trick is sorting out what needs to be "told" and what needs to be explained.

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Mon, 21. May 12, 12:06

Great work so far Ketraar. Do you write out your instructions then read from them as you go, like a script? Or do you just discuss what you are doing at the time?
Still life in the old dog yet...

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

Post by Ketraar » Mon, 21. May 12, 12:10

apricotslice wrote:Eg. If you want to create the exact same task force, but from many different places or situations, you write a sub routine for the actual creation commands, and call it from where ever you want that task force created in the logic flow. That way, you only ever code it once, even though the criteria of creating it may be very different. Any variables, are passed to the sub-routine to use and anything resulting is passed back by more variables.
Ah I think you mean, libraries.
I mentioned those in the first video just "passing by" I'll do one for Library use, they do come handy, but tbh they are not as effective as in SE. It will be very useful for simple create ships for generic missions, but not so effective if your mission/plot has specific stuff a lot. I also will try to mention some existing Libraries, like OBS and SRST, those are two Libraries that spawn enemies based on rank criteria, all one has to do is usem them as they are there already. :-)
The trick is sorting out what needs to be "told" and what needs to be explained.
I'll keep this is mind. :-)

@all who care
Also just realised that one can have subtitles added to the videos, so if you have the skills and time and think your language should be covered, feel free to translate those and send me the subtitles I'll add them to the vids.

MFG

Ketraar
Image

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

Post by apricotslice » Mon, 21. May 12, 12:21

The existing library structure is certainly something that needs to be covered in detail, especially how to call what library to do what, all the variables involved and any restrictions they have.

The existing structure is worth a video on its own.

Another one is how to go about creating your own from scratch. eg. How to put together a simple plot with a sub-plot, where the sub-plot is coded as a library file instead of nesting it.

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

Post by Ketraar » Mon, 21. May 12, 12:27

Vayde wrote:Great work so far Ketraar. Do you write out your instructions then read from them as you go, like a script? Or do you just discuss what you are doing at the time?
Thanks mate, missed your post there :-)

I write down some generic notes (not much really) then do as I go. I know making a script would be best, but I don't have the skills for that stuff really. I'll try to keep stuff on topic as much as I can but for most part I guess it will be me just thinking out loud for now. Hope that works.

MFG

Ketraar
Image

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 21. May 12, 12:28

Very good idea Ketraar, and very nice of you to take the time to do it. Should be a good refresher for me when I come back to AP modding with out me having to nag you every 5mins :D
Image

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30367
Joined: Fri, 16. Apr 04, 19:21
x4

Post by Alan Phipps » Mon, 21. May 12, 12:32

Thank you also, MD coding was always a complete mystery to me before. I think this thread already deserves a big mention in the Tutorials and Resources listings and even a place as a forum Sticky.
A dog has a master; a cat has domestic staff.

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

Post by Ketraar » Mon, 21. May 12, 17:52

Thanks for the feedback :-)

@Alan
You mean you want to hide this topic by making it a sticky? :o
:-D

But yeah, it should be listed in Tutorials, I'll poke a S&M Mod next time I'll catch one.

Ok so next vid will be about cue structure. As in use of parent/child cue (aka sub-cue), their priority, maybe how to cancel and rest cue, respectively what happens when you do. Might be some stuff on the side as usual :-)

MFG

Ketraar
Image

User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon » Mon, 21. May 12, 18:06

To clarify on apricotslice's part; subroutines = functions, procedures, code reusability, parameter passing, etc.

Anyway, very nice tutorials!
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

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

Post by kurush » Mon, 21. May 12, 19:32

Very nice! I noticed that you use some cheat sheet with {player.name} and other variables that are available in MD. Is it something you can give us a link for?

Post Reply

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