[Discussion] Generic X3TC S&M questions II

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

Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

Does anyone have, an updated version of MSCI Handbook? I would greatly appreciate it if someone could upload it, since it seems that Xai-Corp is down atm.
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. »

I have the MSCIHandbook by Kurtz Fizner, is that the one you are looking for?

Edit:

Here's a link to the XAI Corp online version through Google cache:

Link

Better to copy it to your hard drive as you never know how long it will be in cache for or if Xai will be back up.

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:
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

Argonaught. wrote:I have the MSCIHandbook by Kurtz Fizner, is that the one you are looking for?

Edit:

Here's a link to the XAI Corp online version through Google cache:

Link

Better to copy it to your hard drive as you never know how long it will be in cache for or if Xai will be back up.

HTH

Argo.
Thank you very much, this is exactly what I need.
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12099
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

dillpickle wrote:I am using MD to create an abandoned TP, and want it to have some Marines in it's cargo. The marines are showing up, except they are all named 'Unknown Object' with their race as 'Neutral'.
Abandoned ships are a PITA.

Try this workaround:

Create the ship race=argon
force the pilot to bail
destroy the pilot
add stuff to the ship, like cargo, equipment, etc..

MFG

Ketraar
Image
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

ScRaT_GER wrote:
17 to another number
No, you can't. Object names are always on page 17 - for the game.

Why this appendix "for the game"? Because you also have the possibilty to define object names on pages 300017 and 350017 (not sure about the last one, you simply have to check what Egosoft did). These pages are read into page 17 by the game.

I don't know why Egosoft created this weird mechanism, since it is absolutely no problem to define new object names directly on page 17.

One other thing to know is, that the objects description is always one ID after the objects name.

Code: Select all

<page id="17">
  <t id="50000">OBJECT NAME</t>
  <t id="50001">OBJECT DESCRIPTION</t>
</page>
Greetings,
ScRaT
Page ids are 4 digits the first 2 are the game the text was added in
30 is for the game engine 3.0 which is x3 reunion
Any page starting with 30 was added in reunion

35 is game engine 3.5 which is terran conflict

If you change something in page 17 it will be overrided by the same I'd in 350017 of it exists
User avatar
Argonaught.
Posts: 1827
Joined: Wed, 6. Nov 02, 20:31
x4

Post by Argonaught. »

Cycrow wrote:
ScRaT_GER wrote:
17 to another number
No, you can't. Object names are always on page 17 - for the game.

Why this appendix "for the game"? Because you also have the possibilty to define object names on pages 300017 and 350017 (not sure about the last one, you simply have to check what Egosoft did). These pages are read into page 17 by the game.

I don't know why Egosoft created this weird mechanism, since it is absolutely no problem to define new object names directly on page 17.

One other thing to know is, that the objects description is always one ID after the objects name.

Code: Select all

<page id="17">
  <t id="50000">OBJECT NAME</t>
  <t id="50001">OBJECT DESCRIPTION</t>
</page>
Greetings,
ScRaT
Page ids are 4 digits the first 2 are the game the text was added in
30 is for the game engine 3.0 which is x3 reunion
Any page starting with 30 was added in reunion

35 is game engine 3.5 which is terran conflict

If you change something in page 17 it will be overrided by the same I'd in 350017 of it exists
So page id's act kinda like cat/dat numbers, better to use the highest version number to make sure it's used? so for object name/descriptions it'll be page id="****17".

Does this mean in TC since it's using 350017 (if it exists) could I use a higher number as long as it ended with 17?

Either way it's good info to have. Thanks Cycrow.

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:
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

No u can't just use any number

Just stick to 35

Then it will always overide the standard text
Deleted User

Post by Deleted User »

I have a question about installing .zip files..

I DL'd IF and unzipped everything into the right folders... now how do I get it to run? I've installed Plugin Manager Lite, and it can't find the mod, I tried to open the script menu, and couldn't find an IF execute line.

What am I missing in the .zip install process?


{duplicate post tidied - Carlo}
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Question

Post by Logain Abler »

Optimisation questions.

I have a couple of queries about what is the most efficient approach to a situation and about the capacity of the game engine.

First off the game engine:

Is there a limit to the number of task an object can run. Obviously less equals better as far as CPU load goes but nothing would happen in-game. Is there a known tipping point.

Which approach is better as far as game performance:

Option 1:
Storing values as local variables on an object and updating/referring to the variable for check.

Example would be Variable Prefix + object ID + Offset will give a unique ref for a local variable stored on the object. This unique ref is then called as needed either to check the value or update.

I current use this option in FDN, SSDN & PM.

(Do game objects have a limit to the number of local variables it will hold)

Option 2:
Storing related values in an array on the object and then using that array to queried values, or updated as needed.

An example would be a configuration string made-up of Integer and Array values stored as a local variable or even within another Array and the values pulled from, referred to and updated from there.

From my limited knowledge there is always going to be a processing overhead when working with Arrays especially nested Arrays. Hence I have used option 1 quite a lot over option 2, rather than work a lot in nested Arrays, although I work with nested arrays for global variable to create dynamic menus.

Maybe I've taken the wrong approach, or both of the above are wrong.

Thanks in advance.

LA
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Is there a limit to the number of task an object can run.
There is no real limit, at least no one, you'll ever reach.
Option 1:
Storing values as local variables on an object and updating/referring to the variable for check.Option 2:
Storing related values in an array on the object and then using that array to queried values, or updated as needed.
I don't think there is a big difference, but the array version is probably a little faster.
From the programming point of view, a local variable maps a string to a value. A string is a quite "big" object.
An array is simply a sequence of values and if it is implemented ideally, all values lie directly behind each other in memory and can thus be easily referenced.
So using local variables might need more space and they are likely to be a little slower.

It all depends on implementation however, so I guess only Cycrow might have a definitve answer.

Greetings,
ScRaT
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

As long as you keep using an object/array, the array pointer remains valid so you don't need to re-fetch the array or local array.

Single-value local vars are "real" variables. You read their value and lose contact.
If you fetch a local array, all changes to it are instantly visible to all scripts currently using it. That can be useful.

Depending on the frequency of the checks and who or what accesses the data, each way can be better so it's impossible to tell without knowing what you're up to.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

ScRaT_GER & Gazz,

As always your comments have cleared a few points for me.

My thanks.

LA
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

I been trying to replace an existing sector with out restarting, but I've gotten stuck. Any help is greatly welcomed.
Here's my thinking:
1. I need to replace a Khaak 841
2. I create a map with just that sector, at the same coordinates as a vanilla version.
3. Named that map file fix.xml
4. Placed it in my X3TC /maps directory.
5. Used the code below to load it, if the player changes his name to "fix"

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="MapFix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="Loadmap_fix" comment="">
      <condition>
        <check_all>
          <check_value value="{player.name}" exact="fix" comment=""/>
        </check_all>
      </condition>
      <timing>
        <time exact="2s"/>
      </timing>
      <action>
        <do_all>
          <load_map file="fix" comment="map name WITHOUT file extension"/>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Result: Nothing happens :(
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12099
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

Note that load_map ONLY ADDS stuff. Also note that your game needs to be modified when loading MD files (just making sure).

The location for the code posted here is the \director folder, not maps. (sounds like a stupid thing to say, just making sure.)

Should this still not solve your issue please post both files (not the code) in here and I'll have a look if you like.

MFG

Ketraar
Image
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

Ketraar wrote:Note that load_map ONLY ADDS stuff.
I think that explains it, thank you Ketraar. Basically what I been trying to do is replace a broken Khaak 841, which has 2 extra planets. So if I use load_map it won't replace the sector completely, I just tried it my adding a gate in one test (worked) and then my removing a station in another (didn't work). Thank you for clarifying this for me.
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12099
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

np

You could use the find_planet to reference the planet you want to remove and then apply destroy_object to it to remove. Trigger load_map with the changes after you removed the objects that need to be replaced.

Note that you also can directly add_planets to sector or changing backgrounds directly with MD, but you still need to remove the existing ones first.

MFG

Ketraar
Image
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

Would something like this work?

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="MapFix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="khaak_fix" comment="its imperative that you use a custom name">
      <condition>
        <check_all>
          <check_value value="{player.name}" exact="fix" comment=""/>
        </check_all>
      </condition>
      <timing>
        <time exact="2s"/>
      </timing>
      <action>
        <do_all>
          <find_planet name="this.broken1" typename="planet">
              <sector x="14" y="12"/>
          </find_planet>
          <destroy_object object="this.broken1">
          </destroy_object>
          <find_planet name="this.broken2" typename="planet">
            <sector x="14" y="12"/>
          </find_planet>
          <destroy_object object="this.broken2">
          </destroy_object>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
Or would it be like this?

Code: Select all

<do_all>
  <find_planet name="this.broken1" typename="7">
    <sector x="14" y="12"/>
  </find_planet>
  <destroy_object object="this.broken1">
  </destroy_object>
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12099
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="director.xsl" type="text/xsl" ?>
<director name="MapFix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="director.xsd">
  <cues>
    <cue name="khaak_fix" comment="its imperative that you use a custom name">
      <condition>
        <check_all>
          <check_value value="{player.name}" exact="fix" comment=""/>
        </check_all>
      </condition>
      <timing>
        <time exact="2s"/>
      </timing>
      <action>
        <do_all>
          <find_object group="this.broken1" category="planet" typename="SS_PL1">
            <sector x="14" y="12"/>
          </find_object>
          <find_object group="this.broken1" category="planet" typename="SS_PL100">
            <sector x="14" y="12"/>
          </find_object>
          <destroy_group group="this.broken1" explosion="0"/>
        </do_all>
      </action>
    </cue>
  </cues>
</director>
I posted find_planet, but that does not exist, sorry. one hast to use find_object with category="planet".
Also note that I've set the referencing to group instead of name. Every planet found should get added to that group and therefore destroyed by the destroy_group action.

Also note that you need to put the typename as in SS_PL_* for the planet, you may need to look it up in map file first.

MFG

Ketraar
Image
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

Thank you Ketraar, but there seems to be something missing I tried destroying planets in Kingdon End (which are with are type 4 and subtype 56, 68, and 126 in my game) with

Code: Select all

<do_all>
          <find_object group="this.broken1" category="planet" typename="SS_PL_56">
            <sector x="0" y="0"/>
          </find_object>
          <find_object group="this.broken1" category="planet" typename="SS_PL_68">
            <sector x="0" y="0"/>
          </find_object>
          <find_object group="this.broken1" category="planet" typename="SS_PL_126">
            <sector x="0" y="0"/>
          </find_object>
          <destroy_group group="this.broken1" explosion="0"/>
        </do_all>
and with this

Code: Select all

<do_all>
          <find_object group="this.broken1" category="planet" typename="SS_PL56">
            <sector x="0" y="0"/>
          </find_object>
          <find_object group="this.broken1" category="planet" typename="SS_PL68">
            <sector x="0" y="0"/>
          </find_object>
          <find_object group="this.broken1" category="planet" typename="SS_PL126">
            <sector x="0" y="0"/>
          </find_object>
          <destroy_group group="this.broken1" explosion="0"/>
        </do_all>
Nothing happens :(
Fantasy is the impossible made probable. Science fiction is the improbable made possible.
Igor.tverd
Posts: 266
Joined: Sun, 5. Oct 08, 10:06
x3ap

Post by Igor.tverd »

I just discovered something.

In 07.cat/types/Tplanets earth is designated as subtype 140, while is doubleshadows galaxy editor it has designation of 139, a lot of the planets seem to be one number off. Maybe this is the root of the problem?
Fantasy is the impossible made probable. Science fiction is the improbable made possible.

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