[Discussion] Generic X3TC S&M questions I

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

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

Post by Cycrow » Sun, 10. Jan 10, 21:35

theres been some additional script commands added, but afaik, the only change to the existing commands is a fix for the putting attacking marines on ship command

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

Post by s9ilent » Wed, 13. Jan 10, 21:30

New Question:
I'm investigating mobile mining to make my own script and I'm noticing some .. undesirable behavior.

#1) All collectible asteroids have the same yield as the original rock. So If I wanted to zap some into my cargo bay... how much am I suppose to bring in? (How much does the game bring in? U~(0, 1? 2? yield? k/relval?)

#2) The game keeps creating some Maintype 28, Subtype 0 "invisible" asteroids (which are not collectible, but have a yield, so presumably your suppose to break them some more and then get the asteroids, thou from my experiments, invisible asteroids never give any smaller asteroids)

#3) To clear up space junk a bit, I want to destroy all rocks, even if they don't have any yield. However, I can't seem to find a way to get the S.E to lock onto yield less mini rocks. The find debris instruction keeps bringing up null. I can manually target them and they seem to always have a maintype 0 subtype 0.
Is there any way to target these with the S.E alone?

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

Post by Cycrow » Wed, 13. Jan 10, 21:35

for 2) some of the invisible ones are actually asteroid fields, and the invisible ones is just the center of that field

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

Post by s9ilent » Sat, 16. Jan 10, 13:37

Context: Want to make a script to replace the current mining system

Question 1:
I don't suppose anyone has information on mobile minnings resource outcome (per yield? or other?)? As I tried to run an experiment on my game... and 3 yield of nividium resulted in something like 1454 nividium... But a 20 yield seemed to yield 0??

Question 2:
Debris, how does it work?
I had always assumed that 1 debris would be 1 rock. But... I suspect it might actually be a field of rocks. If such is the case, how would I go about removing the actual individual rocks, from a debris field via the s.e?
I've tried destruct show explosion true/false and similarly with the killer flag set to [playership] but all that happens is the actual mini rocks remain, but they just loose their underlying mineral properties (i.e. They go from nividium 3, to just "asteroid" will no info

Question 2a:
How do I destroy a debris field/rock?



Question 3: Bah! -resloved-
I'm having issues getting one of my scripts to function properly and I was hoping a fresh set of eyes could help.

Basically, I'm doing a readtext, number id etc.
Now I made this file in C#, and then edited it in note pad first (fail) then wordpad (still failing)

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<LANGUAGE ID="44">
<PAGE ID="7743" title="Voice Control" descr="">
<t id="0">20</t>
</PAGE>
</LANGUAGE>
Every time I Read in t id0, it keeps returning read text errors instead of 20? The script doesn't do anything fancy when it reads it in and I have reloaded the text file
-Resolved Q3- Have to user lower case in thingy

pelomar
Posts: 7
Joined: Tue, 4. Mar 08, 09:39

Post by pelomar » Wed, 20. Jan 10, 18:12

Hey guys, I've got 2 questions :

- I can't find any mods to add cockpits in TC. I'm pretty sure it does exist, but still i can't find it (them). Any ideas ?

- What is the purpose of the librairies ? I know there are needed in order to install some scripts, but what are they ?

Thanks,

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

Post by Cycrow » Wed, 20. Jan 10, 18:18

which librarys do you mean ?

in general library scripts are a collection of scripts or common functions that scripters create to so they dont have to repeat these functions in all thier scripts.

it also means that when updating these functions you only have to update the library script instead of all of them.

if a script needs a certain library, it usually says on the thread

idgar
Posts: 17
Joined: Thu, 15. Jun 06, 14:56
x4

Post by idgar » Fri, 22. Jan 10, 02:17

I have a question related to my last post (and edit) of this thread:
http://forum.egosoft.com/viewtopic.php?t=269280

I asked for help/advice in that thread and didn't ask here sooner since I didn't want to cross post, but now an issue has surfaced and I don't want to keep spamming that thread. ;)

I packaged the bug fix as an .spk, thinking it would make a backup of the original file when installed. It appears that's not the case though, so the package can't be properly uninstalled which kind of defeats the purpose of installing it through the plugin manager in the first place.

Should I just leave it as an .spk anyway or provide the .pck file directly and instruct people to make a backup of the original script?
(in case it turns out my fix somehow broke something worse)

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

Post by Cycrow » Fri, 22. Jan 10, 02:55

it should create a backup, what plugin manager did you use to install it ?

idgar
Posts: 17
Joined: Thu, 15. Jun 06, 14:56
x4

Post by idgar » Fri, 22. Jan 10, 03:41

Plugin Manager Lite v1.00.

And it looks like I was wrong. Or at least it works now after I restored the file through steam and installed/uninstalled the package again. :)

I guess I was tired when I installed the package the first time and forgot I already had the modified file in the dir or something...

NewEonOrchestra
Posts: 106
Joined: Sat, 26. Dec 09, 23:42
x3tc

Post by NewEonOrchestra » Sat, 23. Jan 10, 03:31

I've been looking around but without any luck...

How do I simply reset my notoriety with a race to be 0? I engaged in a frustrating skirmish with the Teladi where my dang lasertowers shot every Teladi on sight, and now my race relations are completely screwed up.

I assume you can do this in a single line, as this should be a very easy variable to change... can anyone explain how changing my rep works, or point me to a tutorial that will explain it?

Snowship
Posts: 1350
Joined: Wed, 4. Jan 06, 03:28
x3tc

Post by Snowship » Sun, 24. Jan 10, 12:59

Are Job ID No's used elsewhere or can I just add another without issues:

In the jobs file:
Say there's job id's;
554
555
556
819
820
821
....

Can I create another job using the next 500 number (in this case 557) without problems or is the ID No. used in another file?
(Basically are ID No.s file specific or common throughout the game files)
[ external image ]
Vanilla Malt Gamestarts
"The only time you have too much fuel is when you're on fire"

Rodion Karimov
Posts: 55
Joined: Fri, 6. Mar 09, 12:35
x3tc

Post by Rodion Karimov » Thu, 28. Jan 10, 13:43

Hello, Gazz!
Sorry for not answering so long.
Gazz wrote:Sure.
The easiest way is to take an off-the-shelf AL Plugin template and have the script check all your notorieties every few minutes.
If the gain during that time is faster than whatever you defined, then the notoriety is reduced to your intended max gain.
It is too difficult for me - and I think - it is better - to edit formula - than to check constantly, even if not all gainings are accounted.
Maybe someone know which files there is need to edit and what part of them?

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

Post by ScRaT_GER » Sun, 7. Feb 10, 00:16

Does anyone happen to know if SIGNAL_SELWARE works differently with stations of type Shipyard than with other stations?
The reason I'm asking is, that I added a secondary signal to all stations of type Fabric, which also includes Shipyards apparently (is there an overview of the type hierarchies?). I used the following code:

Code: Select all

global secondary signal map: add signal={SIGNAL_SELWARE} race=null class={Fabric} script='signal.sellship' prio=0 name='signal.sellship'
As you might guess by the name, the script "signal.sellship" is used, when ships are sold by the factory or, looking from the other side, bought by the player.
Strangly though, the signal does not fire, when a station of type Shipyard sells a ship (I buy it), but when it buys one (I sell it).
So I went ahead and added some debug information to the "signal.sellship" script, which results in the following output (values are scripts arguments):

Code: Select all

signal.sellship :: Shiptype: Medusa - Buyer: Ihr Buster - Amount: -1 - Price: 2349873

So it sold the amount of -1 ships, which is somehow right, since it actually bought the ship. :)
I hope someone can explain this behaviour, because I really don't understand it.

Greetings,
ScRaT

Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs » Thu, 11. Feb 10, 04:34

Sounds to me you got the boolean TRUE in return. As in the transaction went through, rather than reporting the amount.
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.

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

Post by ScRaT_GER » Thu, 11. Feb 10, 13:09

A boolean TRUE value would be 1 and not -1.
And still, this does not explain, why the signal fires when a ship is bought by the shipyard, although it only should fire, when the shipyard sells a ship.

Greetings,
ScRaT

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

Post by Cycrow » Thu, 11. Feb 10, 13:15

i think its the way shipyard handles sales, i remember it being different from normal factorys, but it was a while ago since i used them

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Thu, 11. Feb 10, 20:08

I apologize if this isn't where this question should go, but the X3R: MD thread is over a year old, and I hate digging something that old up. I didn't see anything in the tutorials for X3TC SM thread either.

Is there an updated PDF and mission director files available that include all the changes to the MD since 2.5 TC? I'm looking through the old X3:R one, and I hear that there are tons more options available.

Many Thanks!

TheEarl
Posts: 352
Joined: Fri, 3. Aug 07, 17:27
x3ap

Post by TheEarl » Fri, 12. Feb 10, 10:15

hi !
i tried to clear a marines training center (hope thats the english name) of its marines to spawn new troopers.
i tried it with:

Code: Select all

Script aaaa.test
Version: 0
for Script Engine Version: 44

Description
Description
Arguments
1: station1 , Var/Ship/Station , 'station'
Source Text

001   $marines = $station1 -> get marines array
002   $marines.size =  size of array $marines
003   
004   while not $marines.size == 0
005   |$marine = $marines[0]
006   |= $marine -> destroy passenger
007   |remove element from array $marines at index 0
008   |$marines.size =  size of array $marines
009   end
010   
011   display subtitle text: text='alle tot' duration=500 ms
012   return null 
as result i have 71 "unknown objects" in the station instead of 71 marines.
i tried

Code: Select all

destruct: show no explosion
with the same result.
then i moved them into a spawned TP and destroyed it, same result.
i wondered why the "unknown objects" are in the station and discovered another feature:
if you move marines with

Code: Select all

= $marine -> move passenger to ship $ship: set passenger as pilot=[FALSE]
you see them in the inventory of the TP and in the station (same names) and there still 71 left in the station. then i destroyed the TP manually in space and after this the named marines, that was in station and in TP are now "unknown objects" inside the station.
and not to forget, the destroy commands work well on marines, if i buy them manually into an TP (or other ship) and destroy them inside one of my ships. they dont convert to an "unknonwn object".
now the 2 questions:

1) can i clearly remove them from game when they are in training center ?
2) is there a way to move (or buy) them by script from a station into a ship ? (for another reason i need some of them alive :) )

thx for help !

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

Post by ScRaT_GER » Fri, 12. Feb 10, 13:25

Cycrow wrote: i think its the way shipyard handles sales, i remember it being different from normal factorys, but it was a while ago since i used them
Thanks for the insight, Cycrow! I guess I'll just remove the secondary signal from shipyards.
Is there an updated PDF and mission director files available that include all the changes to the MD since 2.5 TC? I'm looking through the old X3:R one, and I hear that there are tons more options available.
Just look for the newest "director" directory in the .cat files (using the X3 Editor 2 for example). You need the following files:
  • director.css
  • director.htm
  • director.xsd
  • director.xsl
  • dirobjdb.xsd
  • dirschema.xsl
If you extract them with the X3 Editor 2, pay special attention to the file endings, since they are not extracted correctly (at least they weren't, when I did it a while ago).
The director.htm lists all commands available.

Greetings,
ScRaT

User avatar
eldyranx3
Posts: 2178
Joined: Sat, 14. Jan 06, 21:29
xr

Post by eldyranx3 » Sat, 13. Feb 10, 22:55

ScRaT_GER wrote:Just look for the newest "director" directory in the .cat files (using the X3 Editor 2 for example). You need the following files:
  • director.css
  • director.htm
  • director.xsd
  • director.xsl
  • dirobjdb.xsd
  • dirschema.xsl
If you extract them with the X3 Editor 2, pay special attention to the file endings, since they are not extracted correctly (at least they weren't, when I did it a while ago).
The director.htm lists all commands available.

Greetings, ScRaT
Thanks! I'll look into them when I figure my little gate problem. Im trying to link two of the Terran unknown sectors out past Oort Cloud with two jump gates, but Im having some issues.

Code: Select all

$TUSX7Y5EG = create gate type=4 add to:[Sector X7,Y5] gateid=8 dstx=8 dsty=5 dstgateid=7 x=[x] y=[y] z=[z] 
$TUSX8Y5EG = create gate type=3 add to:[Sector X8,Y5] gateid=7 dstx=7 dsty=5 dstgateid=8 x=[x] y=[y] z=[z]
When the gate in US X7 Y5 gets created, its broken. Is it because the gate in X8Y5 hasnt been created yet? How to I work this out?

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