Need help with script text output

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Need help with script text output

Post by Shara »

I have written a small script that adds a new command to the Trading Software MK2. It is a variation of the BestBuy command, and uses COMMAND_TYPE_TRADE_26 as my command.

It works great, but there is one small detail I would like to iron out.

When you view your ships in the Player Property menu of ships you own you see your ships, what sector they are in, and the right-most column shows you the command your ship is executing, and what good it is buying. So, when you are using the BestBuy command, it looks like:

Buying ware at best price...[Energy Cells]

My command uses the text "Buy resource at best price..." In the Player Property menu for ships that is all that shows up as the command the ship is executing. The product that is being bought does not show up in the Player Property meny right-most column. Only the command that is being executed shows up.

So my ships all show a command of:

Buy resource at best price...

And no product shows up.

I want to know how to get the product to show up in the Player Property ship menu right-most column, just as how the Bestbuy command does.

If I can get that to work, my script will be perfect, and will solve a ton of problems...
Last edited by Shara on Fri, 30. Apr 04, 18:05, edited 1 time in total.
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

It doesn't seem to work properly for the spare command slots, or if it does there's a special way to set it up that Egosoft aren't telling.

you can do this though

Code: Select all

005   * Set Command shown
006   [THIS] -> set command: COMMAND_GET_WARE  target=$buy.ware target2=null par1=null par2=null
007   set script command: COMMAND_XAI_XTC2_BEST_BUY
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

I don't understand.. what's that suppose to do?
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

set the command to one of the default commands that accept the type of target you want. In your case one of the default commands for wares Get Ware for example. Then set the command target to the ware you want.

After that use the set script command to the command you're actually using

you would use

Code: Select all

[THIS] -> set command: COMMAND_GET_WARE  target=Energy Cells target2=null par1=null par2=null 
set script command: COMMAND_TYPE_TRADE_26
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

Ahhh..... gotcha. Gotta use a GetWare command already being used. Well, since GetWare is pretty much useless (does anyone use it?) then that will have to do.

Has anyone tested all 32 COMMAND_TYPE_TRADE commands to see if any of them operate like a GetWare command? It would be nice if a few of them did.

Appreciate the help BTW - thanks!
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

You don't actually replace the getware command. You just use it to set the command target then you overwrite the command name.

This is a bodge job to force the correct display. There's no guarantee it will continue to work after the next patch.
Shara
Posts: 244
Joined: Tue, 24. Feb 04, 19:37
x2

Post by Shara »

So, let me get this straight:

My command (called BuyResourcesBest) will still show up as a separate command in the Trade Command window, right? There are four commands by default: Buy, BuyBest, Sell, SellBest. My command will still show up as #5, BuyResourceBest, but by using GetWare command it forces the display to show up correctly in the Player Resources ship list.

Does this affect the Buy... command at all?
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

shouldn't do. The commands just affect the text displayed not what's actually bound to that command object.

Return to “X²: The Threat - Scripts and Modding”