MD questions

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

Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

Update: Holy crap I did it!!! :D

I would show you the code.. but it would probably bore you to tears :) I got the ship to spawn given my rank and such. Several tweaks later and fixing the mdfiles to include my xml did the trick! Thanks for your help gentlemen :) I will surely ask more of you in the future but I think I am starting to understand this whole mess lol
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

Can anyone tell me what the x/y co-ords for the terran systems are? I'm looking specifically for the mars one. On all the universe maps I've seen 0,0 is legends home, and then the X line kinda goes across with the terran sectors being above them all. Is there a Boolean expression for assigning sectors? Or would mars be something more along the lines of x-1,y15?

EDIT:

Never mind I think I have figured it out. {sector@mars}. Hopefully it works :)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

for completeness sake: these Sectors are displayed above Y=0 but in fact they are squeezed into the empty slots between Family Whi /Shareholders Fortune, a few slots next to Getsu Fune and the 4 Slots between Akeelas Beacon and Tharkas Sun, here a Map representing the real coordinates (it may be a bit tricky to get some of the connections in the Terran Region, thats why many maps resort to place the Terran Sectors above everything)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

oh wow thank you.. that is super :)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

and have to push a small correction here: this map here is right afaik - the one i linked above has a gap between Nyanas Hideout and Omicron which doesnt exist and the position of the Inner Sectors and Jupiter/Saturn Sectors of the Sol System is mixed up.. but it could also be that i missed a change there...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

Oh! Thanks for the update :)

Now I have another question lol. Sooo many questions. I have compiled a handful of XML files now, most of which are library files. Is there a way in-game to actually activate the MD file so I can test its functionality?

EDIT:

I think I have found it, however it only shows 2 of the 12 files I have created. In fact there's probably 50 xml files in the director folder in total (including the native ones) but only like 15 of them show up on the MD screen. 2 of which are mine. Why isn't it showing them all? How do I get them to load?

On that note, half of the ones I created are set for being libraries. Still though. This doesn't explain the complete lack of XML files to choose from. I'm completely confused lol
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

I have figured out that the in-game MD editor only shows *active* files. There's no way to say "load this file" like there is with the script editor. So I've decided to make a trigger file. I'm trying to make it so that when I set my player name to something specific it triggers another mission file. Unfortunately the only way that I can see of so is by using <cue ref="cue name within file">.

This works quite well but unfortunately I have no control over it. I can't put it in <action> or <do_all>. So that means it works like it's an active cue and I have no control over it. I can't say "under this condition then <cue>". Is there any other way of setting the cue in my trigger file so it loads a cue from another file?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

The usual way to control another cue is by using set_value to set a variable (typically 1 for True and 0 for False).

Then, in the cue that you want to trigger, add a condition to check the value.
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

ohhh damn nice nice thanks!
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

not sure about X3 but in XR there is the <signal_cue/> action and the <event_cue_signalled/> condition for this purpose - i am pretty sure they are also available in X3
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

looking at the mission director values file there is not :( There is only ways to cancel a cue. Looks like the rebirth md has more features to work with. IMO the ability to call a cue from another file is a big deal.. since I'm trying to make my mod modular so that I can call different cues from other files into a single file in order to eliminate brutal repetition and making each mission 300 pages long :(
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

hmm.. good to know...

and regarding minimizing repitition: thats what library cues are for: they are not actually executed themselves, they just provide a Template for other cues (the ref-Attribute you mentoined earlier) - you pass them some starting parameters and from those they do all these repetitive things like properly spawning enemies as if it were written in your Script itself ;)

the 0.* Vanilla files provide examples for these, although they are very exhaustive..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

That's exactly what I'm trying to do. When I change my player name, to call up a library cue. ugh... I'm beating my head against a wall here..
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

so it's a simple question because it should be able to be done easily. How do I call for a library file within a cue?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

UniTrader wrote:<signal_cue/> action and the <event_cue_signalled/>
i am pretty sure they are also available in X3
Nope. Sounds handy, though. :)
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

Ok I will post what I have for this problem:

<cues>
<cue name="TriggerDif1">
<condition>
<check_all>
<check_value value="{player.name@difficulty1}"/>
</check_all>
</condition>
<action>
<do_all>
<complete_cue cue="L110M1"/>
</do_all>
</action>
</cue>
</cues>

The library I'm trying to call for is L110M1. this cue is in a separate file. Basically I want the cue to work like this:

When I change my name to difficulty1, the L110M1 library loads. Right now with the code I have the library will not load. The only way I can get the library to load is to make a separate cue called:

<cue ref="L110M1"/>

This seems to work. however, no matter how hard I try I cannot set this cue to be inactive until I set my name. I just loads no matter what. I can't place it in a do_if or anything like that. I can't place it inside a cue where <condition> and <action> are relevant to how it loads. What am I doing wrong here, or how can I fix this, or just straight up how do I load a library and actually have control over it? I won't even bother continuing with this mod until I figure out how to load library files into a cue and have it complete without just loading up as soon as the player enters the game..
dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle »

Code: Select all

<check_value value="{player.name@difficulty1}"/>
I'm fairly sure this is an invalid format...

Code: Select all

<check_value value="{player.name@}" exact="difficulty1"/>
is the correct format.

So...

Code: Select all

  <cues>
    <cue name="TriggerDif1">
      <condition>
        <check_value value="{player.name@}" exact="difficulty1"/>       
      </condition>
      <cues>
        <cue ref="L110M1">
          <params>
            <param name="These are variables passed to your library file"/>
            <param name="Such as Enemy Race"/>
            <param name="Mission Difficulty"/>
            <param name="Sectors Used"/>
            <param name="Etc..."/>
          </params>
        </cue>      
      </cues>
    </cue>
  </cues>
Your Library file L110M1 will need to be set as a library for it to work, otherwise it will get read as a normal cue:

Code: Select all

<cue name="L110M1" library="1">
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

omg it worked :) Thanks dillpickle :) It was my syntax for the player name. I didn't know I had to use {player.name@} I thought I only needed the @ when the tag was inside the variable. Well it worked. I didn't need to set the params since all that stuff was included in the library file itself but it's really good to know about the params since I will likely be using that sort of thing in the future with this mod :) Thanks again!
dillpickle
Posts: 1159
Joined: Mon, 3. Nov 08, 14:25
x3tc

Post by dillpickle »

Actually the {player.name@} is a typo... Should be:

Code: Select all

<check_value value="{player.name}" exact="difficulty1"/>
Aven Valkyr
Posts: 228
Joined: Thu, 13. Mar 14, 23:52
x3ap

Post by Aven Valkyr »

oddly enough {player.name@} worked whereas {player.name} didn't.

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