[Discussion] Generic X3TC S&M questions III

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

Post Reply
BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Sun, 13. Dec 15, 18:29

ubuntufreakdragon wrote:maps/waretemplates.xml
...
Thank you, this is the information I needed. :)

nekoexmachina
Posts: 58
Joined: Thu, 3. Apr 14, 12:51
x4

Post by nekoexmachina » Mon, 11. Jan 16, 16:33

Can't find info on this one. Is there any way to apply acceleration to the ship in "free" direction? E.g., I have ShipA & ShipB; ShipA explodes, I want to apply a little bit of acceleration on the line of ShipB ---> ShipA, but I can't find how do I do this. I have coordinates for both ships, so I can work with that, but I can't find "free-way" acceleration command.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Mon, 11. Jan 16, 17:58

The commands <RefObj> force position: x=<Var/Number> y=<Var/Number> z=<Var/Number> and <RefObj> set position: x=<Var/Number> y=<Var/Number> z=<Var/Number> allow you to move an object to certain coordinates ('<RefObj> set rotation: alpha=<Var/Number> beta=<Var/Number> gamma=<Var/Number>' (all in General Object Commands) lets you change the rotation). If you make it slow enough (i.e. have a loop which moves every few miliseconds the ship a few meters away), it might be possible to make it look as if it would be pushed away by a shockwave.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

tearing
Posts: 46
Joined: Mon, 26. Oct 15, 03:20

Post by tearing » Tue, 16. Feb 16, 21:05

anyone know how to get a list of installed mods on my addon folder?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Wed, 17. Feb 16, 21:09

There's no ingame way to do that. The official mod installation feature through the mods folder only supports one mod at a time. And by using the Fake patch method the game cannot tell apart files from mods and those from the game installation and patches.

If you use an external program like the Plugin Manager, then there you could see what mods you have installed. Alternatively, if all of your mods would either contain a text file with a specific line or register a script via a certain script menu (like the Community Plugin Configuration) you could find out what is installed, whereby you would have to know what to look for.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

freddie13
Posts: 5
Joined: Mon, 29. Feb 16, 16:16

Post by freddie13 » Wed, 2. Mar 16, 08:37

anyone knows dmg calculation on x3ap oos?

lets say a m3 with 10 ire hitting a m2
will it deal 900 hull dmg and 880 shield dmg per rounds (5 second) and 6 times of it if i am not watching oos battle or there is some more complicated math behind it

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

Post by DrBullwinkle » Wed, 2. Mar 16, 13:55

freddie13 wrote:anyone knows dmg calculation on x3ap oos?

lets say a m3 with 10 ire hitting a m2
will it deal 900 hull dmg and 880 shield dmg per rounds (5 second) and 6 times of it if i am not watching oos battle or there is some more complicated math behind it?
More complicated math and some probability. Not sure that all of it has ever been published.

AP uses separate damage values when OOS. For IRE, the OOS Shield Damage is 88 (per shot) and OOS Hull Damage is 9 (TBullets). IRE fires 400 shots per minute (TLasers) which is 6.67 shots per second. So 587 Shield Damage per second and 60 Hull Damage per second (per IRE).

Usually we only care about RELATIVE damage per second (dps), so the exact number of seconds of fire used does not come up often. I don't recall it ever being mentioned, not even in Gazz's OOS Rebalance or OOS Rebalance v2 threads, which were the predecessors to the OOSR3 balance that is in X3AP. Gazz wrote most of the OOS balance for AP, but he has not been active in the forum recently.

I don't know about the number of seconds of fire. You could test it against an unshielded and weaponless M2 if you want to know for sure.

(If your M2 has weapons, then the test won't last long. ;) )

The amount of damage done per turn is the same whether you are watching the battle or not. The turn lasts longer if you are not watching, but the damage per turn is the same.

Hope that helps.
Last edited by DrBullwinkle on Wed, 2. Mar 16, 15:05, edited 1 time in total.

freddie13
Posts: 5
Joined: Mon, 29. Feb 16, 16:16

Post by freddie13 » Wed, 2. Mar 16, 16:09

so x3ap now use damage per second instead of damage per shots

thanks a lot for those information

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Post by JSDD » Mon, 9. May 16, 21:31

i have a question about the model files, i want zu figure out how / where the mesh size is specified
if you look for example at the decompiled (.bod using doubleshadows tool) argon discoverer mesh and compare it to the mesh from boron thresher, the argon discoverer is twice the size !! obviously that cant be correct, so there must be anywhere a scale factor ror the mesh, and my question is: where ?

example: argon_M5.bob converted to .bod

Code: Select all

// material has nothing to do with scale
MATERIAL6: 0; 0x2000000; 1; argon.fx; 68; diffcompression;SPTYPE_BOOL;0; b .......

// beginning of bodies (4)
// beginning of body 1
4001; 
that value seems quite promising to be such a scale factor, but i've triied to use that ... without success :-|

// beginning of points (5154)
6519; -18361; -53531; // 0
... these are the vertices of the mesh i want to resize

// ----- part 1 (10096 faces) -----
0; 0; 2; 1; -25; 2; 0.717072; 0.048264; 0.719437; 0.026810; 0.761368; 0.048203;
... first number = used material, second/third/fourth number = face point indices
-25 = no clue, but the thresher file has also -25
2 = no clue
the next 6 floating points are texture coordinates

... and at the end of that part:
/! COLLISION_BOX: 0.000000; 0.000000; 0.000000; 1.009842; 1.000000; 0.491196; 0.973785; !/
-99; 00000000000000000001; // part 1 end
-99; 0000000001000000; // body 1 end
... seems to specify the collision box, i guess ^^
i've taken also a look at TShips / scene files, but i havent got a clue where i can get the correct scaling factor .... :| :?:
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

tearing
Posts: 46
Joined: Mon, 26. Oct 15, 03:20

Post by tearing » Tue, 31. May 16, 13:28

can i add a new drone?
i tried couple of things but fail miserably

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Tue, 31. May 16, 16:56

You can add the ship, but I don't think you can get the "ware turns into ship"-mechanism to work.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

tearing
Posts: 46
Joined: Mon, 26. Oct 15, 03:20

Post by tearing » Sat, 4. Jun 16, 09:37

the only thing i can do are just changing existing drone eh.
and how the game decide ai ship's loadout?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sat, 4. Jun 16, 20:12

tearing wrote:the only thing i can do are just changing existing drone eh.
Or you write a script, activated via a command slot or a hotkey, which creates a drone close to the playership and removes the respective "drone ware" from its cargo hold.
tearing wrote:and how the game decide ai ship's loadout?
Depends on the situation: For job ships there's the weapons and equipment tab in the Job editor allowing you to set allowed/forbidden values and define to which percentage values the ships should be equipped. You can also create and specify a config script in the general tab, which you could use to equip a ship. The wares list id will specific, which wares a trading ship will trade.
In some cases the loadout is hardcoded, and works after certain formulas: pick the strongest shields and a certain amount of certain weapons, or the like.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

tearing
Posts: 46
Joined: Mon, 26. Oct 15, 03:20

Post by tearing » Wed, 8. Jun 16, 17:54

today i made a new weapon.
after a cup of coffe its work.

now the problem is, i cant see any AI ship using that weapon.
i cant find a way how to make AI ship carry that weapon on job file.

Leonardo Myst
Posts: 20
Joined: Fri, 8. Jul 16, 23:26
x3ap

Post by Leonardo Myst » Sat, 9. Jul 16, 01:40

I was looking at [RESOURCE/TUTORIAL] X3:TC Music Library + Changing the soundtrack as I'm planning to replace all the music files with ship/cockpit noises (engine hum, beeps, clicks, etc.) and I have a question.

I got X3TC&AP on Steam but haven't installed the game yet, as we're in the process of getting a new computer.
Will the above info on changing the music tracks work on a Steam installed version of the game?
Are the music tracks in the same format/directory setting?

And another question... is there a limit to length of each track?
I assume the tracks loop.
But I started with a 40 minute track of an engine hum and added beeps and computer noises.
Should I chop it down into smaller pieces?
Or can I leave it as is?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sat, 9. Jul 16, 11:30

Yes to the first two questions. I'm not aware of a file length limit, but to be honest I never tried it out with something longer than the usual 3 to 5 minutes.

When modding the Steam version it is a good idea to create a second installation, which is independent from the Steam installation though. That way you won't run into any problems with Steam trying to update or replace any modified files with their originals. To create one, simply copy the whole X3 Terran Conflict Steam folder (which includes the X3AP "addon" directory) to a different place and download and extract the NoSteam.exe files to that location. The one for X3AP can be downloaded here, and while there is no specific one for X3TC, you can simply download the latest non-Steam patch and use the exe file from that one to start the game without Steam.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Leonardo Myst
Posts: 20
Joined: Fri, 8. Jul 16, 23:26
x3ap

Post by Leonardo Myst » Sat, 9. Jul 16, 19:45

Thanks, X2-Illuminatus!
I'll do just that.

Avatar of darkness
Posts: 83
Joined: Tue, 3. Aug 04, 16:28
xr

Post by Avatar of darkness » Fri, 7. Oct 16, 23:59

I ran into a problem with ",910 ,842" and find solution by darkangel666:

http://www.x2thethreat.com/x2/forum/vie ... p?t=380876

Edit t file content


<page id="117">
<t id="2000">{117,910} {117,911}</t>
<t id="2001">{117,910} {117,842}</t>
<t id="2002">{117,957} {117,125}</t>
<t id="2003">{117,957} {117,126}</t>
<t id="2005">{117,841} {117,845}</t>
</page>

<page id="118">
<t id="2000">{118,910} {118,911}</t>
<t id="2001">{118,910} {118,842}</t>
<t id="2002">{118,957} {118,125}</t>
<t id="2003">{118,957} {118,126}</t>
<t id="2005">{118,841} {118,845}</t>
</page>

<page id="119">
<t id="2000">{119,910} {119,911}</t>
<t id="2001">{119,910} {119,842}</t>
<t id="2002">{119,957} {119,125}</t>
<t id="2003">{119,957} {119,126}</t>
<t id="2005">{119,841} {119,845}</t>
</page>



But what files I must change?
A long time ago in a galaxy far, far away...

RobCubed
Posts: 24
Joined: Thu, 21. May 09, 13:17
x4

Post by RobCubed » Tue, 6. Dec 16, 22:36

Question -

How do I save data in the player's save game file?

Example - if I have a script that loads a t file, picks a random entry from a page in it, and then uses it - I want that player's save game to NEVER use that entry again.

Are there any example scripts or guides on how to store data in the player's save game?

Edit: Are global variables saved in the player's save game?

Edit #2: They do. That works. Simple enough.

Edit #2: New question - is there any efficient way to randomly resort a large array?

Edit #2: I'll just try Fisher-Yates, if I only have to run it once on setup it shouldn't be bad at all

More editing, Fisher-Yates worked great. 2500 string list (pulling from a page, leaving room for up to 10k if you want to edit the page file) goes very quickly - no noticeable delay when initializing. Only run on setup obviously, and only once unless you reinit globals.

Code: Select all

$Key.ShipNames = 'rc.ShipNames'
$ShipNames = get global variable: name=$Key.ShipNames
if not $ShipNames
    $ShipNames = read text: page id=8847, from 1 to 10000 to array, include empty=[FALSE]
    $ShipNames.currentIndex = size of array $ShipNames
    $randomizedShipArray = array alloc: size=$ShipNames.currentIndex
    while 0 != $ShipNames.currentIndex
        $randomIndex = random value between 0 and $ShipNames.currentIndex
        dec $ShipNames.currentIndex
        $temporaryShipValue = $ShipNames[$ShipNames.currentIndex]
        $temporaryRandomValue = $ShipNames[$randomIndex]
        $ShipNames[$randomIndex] = $temporaryShipValue
        $ShipNames[$ShipNames.currentIndex] = $temporaryRandomValue
    end
    set global variable: name=$Key.ShipNames value=$ShipNames
end
I know I'm answering my own questions but thought it might help if somebody else has the same one. I hate seeing posts online "Hey how do I do this Edit: Nevermind fixed it" with no solution posted.

hqz
Posts: 37
Joined: Sun, 10. Jul 16, 11:28
x3ap

Post by hqz » Sat, 25. Mar 17, 04:46

I'm trying to set the turret command for a ship through a script but I can't get it to work.

So far I thought this would work (but it doesn't):

Code: Select all

$ship -> call script !turret.command.alpha : turret id=2
What am I doing wrong?
Last edited by hqz on Sat, 25. Mar 17, 16:10, edited 1 time in total.

Post Reply

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