[Discussion] Generic X3TC S&M questions I
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 422
- Joined: Thu, 24. Aug 06, 13:45
Trade Commands;
the Find station commands on the trade menu, in particular the ones which go like
<retvar/if> = (<refobj> ->) find station: Product <ware> ...
will they find trade docks/eq docks/other kinds of docks, which will buy that ware? or do i need to script that eventuality in (for tech wares, e.g. weapons, shields etc)?
note: to Cycrow.
the command i queried about before return the amount that is needed to fuel jumps within the jumprange set, taking into account ecells in the hold already. Not exactly what i needed, so i wrote i library to do what i wanted... thanks for your (as always) quick response though
the Find station commands on the trade menu, in particular the ones which go like
<retvar/if> = (<refobj> ->) find station: Product <ware> ...
will they find trade docks/eq docks/other kinds of docks, which will buy that ware? or do i need to script that eventuality in (for tech wares, e.g. weapons, shields etc)?
note: to Cycrow.
the command i queried about before return the amount that is needed to fuel jumps within the jumprange set, taking into account ecells in the hold already. Not exactly what i needed, so i wrote i library to do what i wanted... thanks for your (as always) quick response though

-
- Posts: 422
- Joined: Thu, 24. Aug 06, 13:45
-
- Posts: 1132
- Joined: Sun, 19. Oct 08, 18:46
Anyone know if you can override the stock command->script mappings? I'm trying to override a stock command to link to my own script instead of the one in the !init.ship.globalsciptmap scripts, but when I run it on a ship it still runs the old version. I've tried adding a wait of 1ms at the top of my setup script in the hopes it will re-register it after registering in the !init scripts, but to no avail...
-
- Posts: 422
- Joined: Thu, 24. Aug 06, 13:45
the global script make: set: ...
command should overwrite the previous one (you probably need to set the script command upgrade too as normal)
init scripts run before setup files, so that should not be a problem (please correct me if im wrong)
you can also do it on a ship to ship basis if you want to change only some ships.
command should overwrite the previous one (you probably need to set the script command upgrade too as normal)
init scripts run before setup files, so that should not be a problem (please correct me if im wrong)
you can also do it on a ship to ship basis if you want to change only some ships.
-
- Posts: 1132
- Joined: Sun, 19. Oct 08, 18:46
Yeah tried all sorts of combinations can't seem to override the default mapping.
Even tried just removing the command altogether (global script map: remove), and still no difference - the command is still available and whatsmore still runs the stock script. Tried running my setup script manually. Tried different ship classes... there must be some trick to doing this, I'm sure it's been mentioned before.
EDIT: tried 'global script map: ignore' and that worked to remove the command. But then, wierdly, when I add a 'global script map: set' after the 'ignore' and pass it my own script, the command reappears - but still uses the stock script!!!
Even tried just removing the command altogether (global script map: remove), and still no difference - the command is still available and whatsmore still runs the stock script. Tried running my setup script manually. Tried different ship classes... there must be some trick to doing this, I'm sure it's been mentioned before.
EDIT: tried 'global script map: ignore' and that worked to remove the command. But then, wierdly, when I add a 'global script map: set' after the 'ignore' and pass it my own script, the command reappears - but still uses the stock script!!!
-
- Posts: 1132
- Joined: Sun, 19. Oct 08, 18:46
preloads are used to display the menu.
these are run before the actual script command, so when u tested it, u most likly only saw the preloaded menu, before getting to your script change
what would have happened is, when u selected the menu, then ur command would start and u will see the changes, if u want to change the input, u'll need to also change the preload.
when u said u overright the preload, did u use the same script for both ?
coz its not advised to do that
these are run before the actual script command, so when u tested it, u most likly only saw the preloaded menu, before getting to your script change

what would have happened is, when u selected the menu, then ur command would start and u will see the changes, if u want to change the input, u'll need to also change the preload.
when u said u overright the preload, did u use the same script for both ?
coz its not advised to do that
-
- Posts: 1132
- Joined: Sun, 19. Oct 08, 18:46
I wrote my own preload script and overwrote it with that.Cycrow wrote:preloads are used to display the menu.
these are run before the actual script command, so when u tested it, u most likly only saw the preloaded menu, before getting to your script change
what would have happened is, when u selected the menu, then ur command would start and u will see the changes, if u want to change the input, u'll need to also change the preload.
when u said u overright the preload, did u use the same script for both ?
coz its not advised to do that
As I say, the weird thing is that if I only overwrite the command script and the leave the preload script alone, then it doesn't do anything, I *have* to overwrite the preload script as well. Unfortunately there is no 'remove command preload' script command, so the only method is to write a (very small in this case) replacement preload script.
Makes sense in a way to block replacing of command script whilst the preload script remains the same - stop the (potentially) wrong input going to the new command script.
well as i said, the preload script is run first.
so when you start the command, what happens, is the preload script is run.
this script then returns an array of arguments. If those arguments match the command script, then the command will start.
otherwise, the command will not begin at all.
preloads basically allow you to create a menu system for the command without starting the command straight away.
if u put a menu in the command script itself, then the existing command will stop to display this menu, so if u then quit out the menu to cancel the command, u will lose any existing commands running as well.
with a preload it allows the existing commands to continue running until u've finished and accepted the menu selection
so when you start the command, what happens, is the preload script is run.
this script then returns an array of arguments. If those arguments match the command script, then the command will start.
otherwise, the command will not begin at all.
preloads basically allow you to create a menu system for the command without starting the command straight away.
if u put a menu in the command script itself, then the existing command will stop to display this menu, so if u then quit out the menu to cancel the command, u will lose any existing commands running as well.
with a preload it allows the existing commands to continue running until u've finished and accepted the menu selection
-
- Posts: 1132
- Joined: Sun, 19. Oct 08, 18:46
yeah if ur using a preload, jsut make sure ur returning an array of arguments, even if the command script only has 1 argument.
the idea of preloads is to basically allow you to create a script to select what arguments are being passed to the command, instead of the game simply getting input for each argument.
if you use one argument as a Var/Ship, then when u run the command u will get the standard ship selection menu then the command will run using that ship.
if u use a preload, u can make a custom menu for a different ship selection, then simply return that ship as an array.
u cant do this
u need to make it into an array
then each element of that array is passed to the command script arguments
if u dont return an array, then the command terminates, ie, if u want to quit out the menu coz u no longer want to run the command, then u can just return null and the command will then never be run
the idea of preloads is to basically allow you to create a script to select what arguments are being passed to the command, instead of the game simply getting input for each argument.
if you use one argument as a Var/Ship, then when u run the command u will get the standard ship selection menu then the command will run using that ship.
if u use a preload, u can make a custom menu for a different ship selection, then simply return that ship as an array.
u cant do this
Code: Select all
return $ship
Code: Select all
$arr = create array with arguments = $ship, null, null, null, null
return $arr
if u dont return an array, then the command terminates, ie, if u want to quit out the menu coz u no longer want to run the command, then u can just return null and the command will then never be run
- ScytheBlade1
- Posts: 42
- Joined: Fri, 26. Oct 07, 04:38
.cat/.dat format?
I've searched high and low, and while it is entirely possible that the answer is right in front of me, I can't find it..
For various reasons, I'm looking to write a .cat/.dat parser. Everywhere I look simply says "don't do this, just use one of these tools: X Y or Z" or it just says "don't do this."
Which doesn't help me much.
Seeing as this is the generic S&M thread, I figured it'd be worth it to ask and see if anyone (a) knows the formats in question well enough to describe it and (b) would be willing to do so.
For various reasons, I'm looking to write a .cat/.dat parser. Everywhere I look simply says "don't do this, just use one of these tools: X Y or Z" or it just says "don't do this."

Which doesn't help me much.
Seeing as this is the generic S&M thread, I figured it'd be worth it to ask and see if anyone (a) knows the formats in question well enough to describe it and (b) would be willing to do so.
