Executing commands in script

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
the6ftmidget
Posts: 1
Joined: Tue, 8. Dec 15, 21:00

Executing commands in script

Post by the6ftmidget » Wed, 9. Dec 15, 13:27

Hi everyone,

I have a (most likely trivial) question regarding scripting in X3. I would like to know how I can call the command 'Start commercial representation'([Comm.Agent]) on a ship from a script. I would assume that any menu command is linked to a script, but I have no idea how to find the linked script.
I have skimmed through the MCSI handbook but didn't manage to find what I am looking for.

Does anyone have any suggestions?

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

Post by X2-Illuminatus » Wed, 9. Dec 15, 13:36

Check the setup script for the Commercial agent script. The command will be registered there.

Apart from that, an explanation of the call script command can be found here.
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!

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Thu, 10. Dec 15, 09:38

Just to extend on the previous answer a little bit, any script that starts with the name 'setup.' will be run when the game is either created or loaded from a save file but after the universe has been generated. So these are the places where commands are usually initialised.

For CAG the script that you are looking for will be 'setup.plugin.com.agent' and the command that binds a menu action to a script will be

Code: Select all

set script command upgrade: command=<Object Command/Signal> upgrade=<Var/Ware>
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

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

Post by JSDD » Thu, 10. Dec 15, 13:24

... regarding the commercial agent command, i think that you cannot simply start / call it an then "forget", because it has a preload script
... that is every time you start the command the preload script executes, which in this case opens up a menu
... in this preload menu you must manually click on "start the command" button

to start the commsAgent on a ship that has previously run that command (and has all the necessary settings/pilot/software/etc), you have to look into the preload script and find out what script commands / lines are executed when you click on that "start commercial agent" button
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

User avatar
ubuntufreakdragon
Posts: 5198
Joined: Thu, 23. Jun 11, 14:57
x4

Post by ubuntufreakdragon » Thu, 10. Dec 15, 16:07

there isn't much more to do than checking for pilotes, I had already done this for Lucikes Scripts for this Script of mine: http://www.nexusmods.com/x3terranconflict/mods/4/?
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist

Post Reply

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