[Discussion] Generic X3TC S&M questions I

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

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Quick Question

How big is the new galaxy? (How big is the maximum rather)
i.e. What are the max dimensions the universe can have?
(eg. X3 had like 24x16 sectors or something)
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

its still the same in TC
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Are you sure?


*Link to the X3 universe map, may contain spoliers*
http://80.237.211.54/viewtopic.php?t=217926
But the Terran sectors are floating on top of the old X3 Universe?
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

That map isn't accurate. Kingdom end is still 0,0. The map maker just put the sectors above for easier reading.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

s9ilent wrote:Are you sure?


*Link to the X3 universe map, may contain spoliers*
http://80.237.211.54/viewtopic.php?t=217926
But the Terran sectors are floating on top of the old X3 Universe?
if you open the map file you will see that it doesn't look the same as the map from that post.

that was is obviously designed based on how it appears in the game, not how it looks internally

there is a 3d scene file that determines how the sectors are displayed ingame. This can make sectors appear in different positions than they actually are
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Holy cow.... You have no idea how awesome a revelation this is!
I can include my entire universe now!! (spanning only 128 sectors, but spread out over a theoretical 50x80 grid), It'll be awesome!
It'll require me to remake my universe as well but awesome none the less

:D:D
User avatar
LV
Sith Lord
Posts: 8255
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by LV »

Code: Select all

$ship = THIS
write to logbook = $ship
returns null

No matter how i try this meaning either i've gone mad or the way i call a ship do do something in a script no longer works without using $ship as an argument?????

Doing my ed in :evil:
LV's TC Scripts
Readme's For All My Scripts


I felt a great disturbance in the forum, Like millions of voices cried out in terror, then were silenced

si tacuisses, philosophus mansisses
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

When you actually run the script in the script editor, the first argument it asks you is what object are you running the script from.
Usually due to lazyness, Null is the default option and you press it with out thinking twice. Could it be that your pressing enter when running running it, making This = Null?
User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster »

LV wrote:

Code: Select all

$ship = THIS
write to logbook = $ship
returns null

No matter how i try this meaning either i've gone mad or the way i call a ship do do something in a script no longer works without using $ship as an argument?
Well, you know more than me, but the first question off the top of my head is are you running this from inside the script editor? If so, it doesn't have a reference ship for [THIS]. Also, as Cycrow mentioned to an earlier question of mine, [THIS] can't be used in global scripts either. If [THIS] is, for example, in a script that's called from a ship's command console, then that ship is considered [THIS]. Think of how you're trying to use it/apply it, and where you're calling it from and I think you'll see that the Editor doesn't have any reference for what [THIS] is. Sorry if that doesn't help.

-Grax
User avatar
clevider
Posts: 349
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider »

I'm still having trouble reading in text from a file. I've used Cycrow's "Scripting Help" here to get started and looked at his SEWN setup script to figure out my bug, but I'm still stuck after about 4 hours. When using my text file, the code seems to be getting the text of the "read text" line of code rather than the text in the file.

I named my text file "7042-L044.xml" and it's in "D:\X3 Terran Conflict\t".

I'm loading, reading, and displaying the file text with:

Code: Select all

load text: id=7042
$message =  read text: page=7042 id=11
display subtitle text: text=$message duration=3000 ms
But what I get on the screen is, "ReadText7042-11". If I use 9601 and 1, then I get the "Satellite Early Warning Network" text from Cycrow's file so it seems like it must be a problem with my text file rather than my code, but I've not a clue what it might be. Do I have to register the text file in the game beyond using the "load text" command somehow? Scripts can be run without packaging them, right? This is my first script so I'm probably missing something really basic and would appreciate any help.

7042-L044.xml:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<language id="44">
<page id="7042">
  <t id="10">Object is not in range</t>
  <t id='11">Invalid object</t>
  <t id="20">Not an asteroid</t>
  <t id="21">Mineral Scanner not installed</t>
  <t id="22">Asteroid Scan Results:</t>
  <t id="23">  Type=</t>
  <t id="24">  Yield=</t>
  <t id="30">Freight Scanner not installed</t>
  <t id="31">Illegal wares detected!</t>
  <t id="32">All detected wares are legal</t>
</page>
</language>
//-- ...Signature line decrypting: 1%... --\\
ianrobo75
Posts: 309
Joined: Mon, 13. Aug 07, 11:47
x4

Post by ianrobo75 »

Is it possible to mod the player property window or create your own version with scripts?
I've posted on DevNet about having a 'sort by name' option in the property window but I'm not holding my breath. Its such a must for me I'm willing to learn the scripting language.
User avatar
clevider
Posts: 349
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider »

If anyone was looking at the problem I reported two posts up, you can stop. I finally realized that I had an apostrophe instead of a quotation mark in the text file on the line for "Invalid object". :doh:

On the other hand, I still don't know how to trigger sound events in X3TC. I presume "play sample" is the command I want, but how do I find out what argument to send? If someone get point me in a direction for that, I'd be mighty grateful.
//-- ...Signature line decrypting: 1%... --\\
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

what sounds are you planning on player, sound effect, voices, etc ?

what type depends on what commands you need to use and what arguments you need
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Sounds, are in the s folder, and are typicalled given different numbers (eg 1.wav, 1000.wav etc)
And you play the number. So if you wanted to add your own, make a mod file, put the sound in the s folder in the cat/dat


HOWEVER, as of X3R, when one sound file stops playing, they all stop playing. (It doesn't matter which one you played first, when the one stops they all stop). So you can play as many as you want to over lap, but they will all stop playing at exactly the same time
User avatar
clevider
Posts: 349
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider »

I was just planning to play the "scan" sound effect, but maybe it isn't worth it if will kill any other ambient effects at the end. On the other hand, it seems like the game can handle multiple effects well sometimes (space battles?). Honestly, the only audio cut-offs I've noticed are with voiceovers when second one starts.

Anyway, I found a couple hundred .wav files in 01.cat. Is there a list somewhere or do we just try them all?
//-- ...Signature line decrypting: 1%... --\\
Teladidrone
Posts: 644
Joined: Tue, 24. Aug 04, 11:41
x3tc

Post by Teladidrone »

I need a table/list of the numeric values for the player fight ranking... where is this information stored?

/edit:
Next problem:
I am trying to create a shipyard that sells some rare ships.
Everything is working fine except that new bought ships do not show up in the list of currently docked ships.
But they already exist in game and are in my property list (r); using that menu I can access their command console and order them to undock.
What did I forget to make them show up in the docked list?
random50
Posts: 283
Joined: Fri, 23. Dec 05, 14:43
x3

Post by random50 »

Where is the Mission Director located (is that even a sensible question to ask? Is it an actual *thing* or just a reference to the way missions are now built?)

Also, is it possible to inspect the stock missions already in game?

And one more...is it possible to mod the notoriety required for each rank?(I want to slow the game progression down somewhat)
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I was just planning to play the "scan" sound effect, but maybe it isn't worth it if will kill any other ambient effects at the end. On the other hand, it seems like the game can handle multiple effects well sometimes (space battles?). Honestly, the only audio cut-offs I've noticed are with voiceovers when second one starts.

Anyway, I found a couple hundred .wav files in 01.cat. Is there a list somewhere or do we just try them all?
It doesn't kill other ambient affects, it only kills sounds played with the play sound file #####, via the script editor (I have no idea about the MD). Sound fx, music and other general sfx in general are not affected by it

There is a list in the Appendix A2 of the MSCI book, but its not that informative, honestly just put them all in a play list and play. It should only take a few minutes and you might find something else that you want.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22410
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

random50 wrote:Where is the Mission Director located (is that even a sensible question to ask? Is it an actual *thing* or just a reference to the way missions are now built?)
the mission director is part of the game, to use it, you simply need to create the director scripts and put them in the director folder for them to be loaded
random50 wrote: Also, is it possible to inspect the stock missions already in game?
all the MD missions are in the cat files, so you can simply extract them all to view them
random50 wrote: And one more...is it possible to mod the notoriety required for each rank?(I want to slow the game progression down somewhat)
notority is hardcoded, no way to change the rankings
User avatar
clevider
Posts: 349
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider »

s9ilent, thank you very much! I'd noticed the list in the MSCI Handbook when I read through it prior to starting this exercise, but I'd disregarded it thinking that there was no way Egosoft would have kept the same codes through two more games. Apparently they did for the most part, though. Sample 966 is still the scanner sound. Neat!

I guess my script is basically done except for one rather frustrating problem. The "get player tracking aim" function returns null when rocks smaller than than full fledged asteroids (i.e., ones that don't show on the map) are targeted until they've been hit by something (like weapons fire). After that, "get player tracking aim" will return a pointer to them. Is there any way around this? That is to say, is there any way of getting a pointer to a targeted object besides "get player tracking aim"? I've tried "get command target 1/2" and "get attack target" with, as expected, even less success.
//-- ...Signature line decrypting: 1%... --\\

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