[Discussion] Generic X3TC S&M questions III

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

Szynszyl
Posts: 289
Joined: Fri, 2. Jan 09, 20:23
x4

Post by Szynszyl »

Hello
I want to edit an.xsp ship file, to use them in AP. I want modyfi copatible lasers and rockets, but in xsp converter i have only numbers from 1 to 32 on tabs. Where i can check what weapon is under which number?
FriedTrix
Posts: 63
Joined: Fri, 13. Jan 06, 03:12
x4

Post by FriedTrix »

X2-Illuminatus wrote:1. You can change the colors of the sector name's directly in the text file by using color tags, e.g.

Code: Select all

\033RArgon Prime\033X
...

2. No, that's not possible.

...

Maybe these do already what you want or at least help by creating your own script/mod.
@X2-Illuminatus

Hello and thanks.

I've seen universe map(sector's name) with some other colors than than those that I can use with the "/33*" command. That's my reason for asking. I've seen brownish/golden for paranid, a lighter blue for argon, etc....

http://www.il2sturm.webd.pl/X3/x3screen00128.jpg

and on the second question,

is it possible to find out which key is used by the current player profile to open the sector map and simply add a HK with that same key to launch a script ?

I currently use quizzie mods and even tho they are awesome they do not satisfy to all my requirements. I'm checking out how he/did it and wanna see if I could improve them to add more colors, use a more dynamic approach and if I can manage to add the same color code to the ships/stations icons on the left side of the sector map panel.

Any thoughts on that idea? (is possible/not possible, ways to do this..)

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

Post by X2-Illuminatus »

FriedTrix wrote:That's my reason for asking. I've seen brownish/golden for paranid, a lighter blue for argon, etc....

http://www.il2sturm.webd.pl/X3/x3screen00128.jpg
If I'm not mistaken that screenshot shows the HUD from Litcube's Universe mod. I doubt that it's an easy change to make, but rather a consequence of a specific hardcode change. Whereby that is really just guesswork from my side. But you can always ask in the mod thread, if it's possible to make that change in your game or not.
FriedTrix wrote:is it possible to find out which key is used by the current player profile to open the sector map and simply add a HK with that same key to launch a script ?
No, that's not possible. You can neither find out what button is mapped to a certain function nor can you create a hotkey and map a button to it via a script. Of course, you can create a hotkey and tell the player to bind the same button as for opening the sector map to that hotkey. But even then, there are different cases when the sector or universe map opens and the player didn't press the hotkey before. For example this will be the case when commands ask for sector / sector position / sector object input or when the player opens the map from the sidebar. In these cases, your script wouldn't be triggered.
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!
FriedTrix
Posts: 63
Joined: Fri, 13. Jan 06, 03:12
x4

Post by FriedTrix »

@X2-Illuminatus

Well it's bad news for me then!
But thanks for the info.

And moreover, thanks for your time.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

Szynszyl wrote:Hello
I want to edit an.xsp ship file, to use them in AP. I want modyfi copatible lasers and rockets, but in xsp converter i have only numbers from 1 to 32 on tabs. Where i can check what weapon is under which number?
You can use the Creator to open and edit xsp files.
you will need to add the game directories so it can load the text files for each game.

with the text files loaded, it'll replace the numbers with the actual weapon names
User avatar
ScytheBlade1
Posts: 42
Joined: Fri, 26. Oct 07, 04:38
x3tc

Post by ScytheBlade1 »

(X3AP)

I've been trying to script in some additional PHQs to my sector for a while now. After some searching around, it appears that there are additional scripts that are attached to the PHQ that enable, for example, it to actually build ships.

How would I be able to script in a TL that contains a PHQ to place?
Alternatively, how would I be able to attach the appropriate scripts to my PHQ after being scripted in?

For reference, I've been scripting in my PHQs like this, so far. And no, I have no idea if I'm doing it properly :)

Code: Select all

  $a = create station: type=Headquarters owner=Player addto=Blue Horizon x=-1680 y=1510 z=-49000
  = $a -> install 15 units of 2 GJ Shield
  $a ->set current shield strength to 30000
  $a ->set name to 'Headquarters'
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12187
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

Build bit is Hardcoded only one HQ will ever build ships, the last one placed (not scripted).
Mind also that any build plans will not be transferred, but can be added though.

Adding a HQ to a TL is done like adding a ware, Cycrows cheat pack (or any similar cheat script) will have that ability.

MFG

Ketraar
User avatar
ScytheBlade1
Posts: 42
Joined: Fri, 26. Oct 07, 04:38
x3tc

Post by ScytheBlade1 »

Well, that's depressing, but good to know. In that case, I guess placing them via TL won't help much...

Thanks!
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

I am wanting to adjust the behavior of the game in how it spawns NPC ships from shipyards and sends them to guard military bases. Pirate bases also seem to do the same thing.

Looking for someone to point me in the right direction on this. What script or file do I need to look at, or is there a way to disable it? I am assuming these NPCs are used for defending the base against attackers, but the NPCs in question do not have a job id attached and run no script on task 0 once they are docked.

Alternatively I could just take control of the ships and order them to all patrol the sector or some such but in at least one base I am looking at these ships have clogged up all available docking ports... I'm thinking maybe if i undock them they'll just keep spawning more and more.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

zanzal wrote:I am wanting to adjust the behavior of the game in how it spawns NPC ships from shipyards and sends them to guard military bases. Pirate bases also seem to do the same thing.

Looking for someone to point me in the right direction on this. What script or file do I need to look at, or is there a way to disable it?
usually that would be the jobs.txt, but:
zanzal wrote:I am assuming these NPCs are used for defending the base against attackers, but the NPCs in question do not have a job id attached and run no script on task 0 once they are docked.
this sounds to me like these Ships are definied in the Map, like in X², which is not used at all in vanilla X³ - to apply changes if done this way you have to start a new Game since the map is in the Savegame, too, but..
zanzal wrote:Alternatively I could just take control of the ships and order them to all patrol the sector or some such but in at least one base I am looking at these ships have clogged up all available docking ports... I'm thinking maybe if i undock them they'll just keep spawning more and more.
there is a script command <RefObj> disable ship rebuild which may deactivate them when applied before destruction. no restart required when using this method.
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 ;)
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

The miltary base ships are spawned by jobs, but controlled by scripts from the military base.

Its the base that issues the orders, rather than the ships following individual scripts
User avatar
ubuntufreakdragon
Posts: 5226
Joined: Thu, 23. Jun 11, 14:57
x4

Post by ubuntufreakdragon »

does anyone know a free of charge decompiler to transform the deassembled sourcecode (hardcore) into something more readable than assembler?
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist
Redrazors
Posts: 12
Joined: Fri, 5. Sep 14, 16:49
x3ap

Post by Redrazors »

I'm new to scripting in x3, and the script editor is driving me mad. When I edit a script and save it the edits stay as long as I have the game running. When I exit and reload the game the edits have disappeared and I am back to the original version of the script.

Anyone know what I'm doing wrong? I have litcube's universe running but no other mods/scripts, if that information is relevant.

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

Post by X2-Illuminatus »

If I had to guess, I would say your edits include selecting or referencing specific objects (e.g. ships or stations) in your game. These references are not saved outside your current game instance and therefore will be gone, when you exit and restart or save/reload your game. This is to prevent the script from running into problems finding an object, which is only there in your savegame.
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!
Redrazors
Posts: 12
Joined: Fri, 5. Sep 14, 16:49
x3ap

Post by Redrazors »

X2-Illuminatus wrote:If I had to guess, I would say your edits include selecting or referencing specific objects (e.g. ships or stations) in your game. These references are not saved outside your current game instance and therefore will be gone, when you exit and restart or save/reload your game. This is to prevent the script from running into problems finding an object, which is only there in your savegame.
That was a very good guess. I was referencing red wing in the get wing array command, and for some foolish reason kept on using that line when trying to work out why it wasn't saving. It saves with some simple test code.

Thanks for your help.
Redrazors
Posts: 12
Joined: Fri, 5. Sep 14, 16:49
x3ap

Post by Redrazors »

New Question:

I'm trying to add a new piece of equipment to Duke's Haven. I have successfully added a new ware to it using Cycrow's Package Creator, and calling it with the plugin manager scripts, but this adds a tradable ware rather than a ship upgrade. Can anyone point me to how to add a new ship upgrade?

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

Post by Cycrow »

Ship Upgrdaes are hard coded, so scripts/mod cant actually create any more of them.

the only way to have a custom upgrade is to use one thats already been defined in the game.

There are some usable ones available (althou alot of these have been used by the bonus scripts)
Redrazors
Posts: 12
Joined: Fri, 5. Sep 14, 16:49
x3ap

Post by Redrazors »

Ah ok thanks.

So it is possible to fudge it all? I was hoping for a ship upgrade that could add a new special menu command for the ship it was installed on. Could that still happen with a normal ware, just by the ship having it in freight?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

you can use the custom wares with commands.

they main difference between the 2, is that they will appear in a different section of the trade/ware menus and that the custom ones can have a quantity. (so you need to make sure stations have available quantity)

The plugin manager ware manager scripts take care of the issue of availability in the stations, so they can be set to be always available, like normal upgrades
Redrazors
Posts: 12
Joined: Fri, 5. Sep 14, 16:49
x3ap

Post by Redrazors »

Thanks for the help, Cycrow. Much appreciated.

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