[LIST] Streamlining X3 with ease of use modifications
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 456
- Joined: Tue, 21. Aug 07, 06:59
-
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
ARRGH Exsripter hates me right now the line produces an error because -
the weidest thing is that this is an Egosoft script which makes NPC's attack your ships in OOS in war sectors and it makes no errors normally.
@DrBullwinkle - link removed beacuse of bad kudos
Code: Select all
do if $enemy->exists
Code: Select all
Error on line 37 - Unrecognised symbol in expression: do
@DrBullwinkle - link removed beacuse of bad kudos

Last edited by jack775544 on Thu, 12. Apr 12, 04:36, edited 1 time in total.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Great suggestion, Llama. (Do your friends call you "Dali"?)Llama wrote:Add the nemeia auto-scan freight/asteroids to this list. Sooooo handy.
The files are not so easy to find due to dead links and stale threads, so here you go:
Memia Scan Asteroids thread
Direct link to files:
Memia Scan Asteroids, Freight, and Sector
Last edited by DrBullwinkle on Thu, 12. Apr 12, 04:39, edited 2 times in total.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
Move your curser to the top of your file, and then make sure the writing caret is on the first linejack775544 wrote:ARRGH Exsripter hates me right now the lineproduces an error because -Code: Select all
do if $enemy->exists
the weidest thing is that this is an Egosoft script which makes NPC's attack your ships in OOS in war sectors and it makes no errors normally.Code: Select all
Error on line 37 - Unrecognised symbol in expression: do
Hit Ctrl+F, and then in the box "Find What" enter
"do if"
in the box "Replace With" enter:
"skip if not"
Then press "Replace All"
Exscripter is not currently capable of compiling the commands rename.
Last edited by Jack08 on Fri, 11. May 12, 13:27, edited 1 time in total.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Good tip, Jack.Jack08 wrote:Exscripter is not currently capable of compiling the commands rename.
If you want to fix this permeation then extract the 0001 file from the 01.cat/dat and replace the "do if" string in the script command table to "skip if not", then repack it into 01.cat/dat
Is it even good form to use skip or do if? They seem sloppy to me, and create a maintenance hassle if you (or another developer) ever want to add another line. It seems too easy to create a bug, to me. (I realize it cannot be avoided in this example of a vanilla script.)
jack775544 wrote:link removed
Thank you.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 292
- Joined: Sat, 31. Mar 12, 06:39
While your modified UFJD script does indeed include the khaak, you are missing a vital part from the TC script.jack775544 wrote:{link removed beacuse of bad kudos}
and
My modified UFJD file
When (if) installing the UFJD just place it in the director file and delete the words in capitals. The names are pretty self explanitary for what they do. For the DC scripts I pulled all of the relavent files out of the XTC scripts directory (sorry if I missed any)
Code: Select all
<!--Kha'ak Generation-->
<do_when value="{value@this.Enemy}" exact="{lookup.race@khaak}">
<set_value name="this.Nividium Chance" min="{value@this.Nividium Chance}" max="{value@this.Nividium Chance}*2" profile="decreasing"/>
<set_value name="this.OBS Instances" min="3" max="7" profile="bell"/>
<do_any>
<do_all chance="15" comment="Healthy Hive">
<set_value name="this.OBS Instances" min="3" max="13" profile="bell"/>
<set_value name="this.Nividium Chance" min="{value@this.Nividium Chance}" max="{value@this.Nividium Chance}*2" profile="bell"/>
<create_station name="this.Position" typename="SS_DOCK_K" race="khaak">
<position min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
<equipment loadout="default"/>
</create_station>
<do_if value="{value@this.Enemy Level}" max="{lookup.level@veryhard}">
<set_value name="this.Enemy Level" operation="add"/>
</do_if>
</do_all>
<do_all chance="15" comment="Dying Hive">
<set_value name="this.OBS Instances" min="0" max="7" profile="decreasing"/>
<set_value name="this.Nividium Chance" min="{value@this.Nividium Chance}/3" max="{value@this.Nividium Chance}/2" profile="decreasing"/>
<do_if value="{value@this.Enemy Level}" min="{lookup.level@veryeasy}">
<set_value name="this.Enemy Level" operation="subtract"/>
</do_if>
<do_any min="5" max="15">
<create_object chance="5" typename="{random.type@SS_SPECIAL_KD1|SS_SPECIAL_KD2}">
<position min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
</create_object>
<create_object chance="3" typename="{random.type@SS_SPECIAL_DEBRIS1|SS_SPECIAL_DEBRIS2}">
<position min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
</create_object>
</do_any>
</do_all>
<set_value name="this.temp" exact="1"/>
</do_any>
<do_all max="{value@this.OBS Instances}*2">
<create_ship typename="{random.type@SS_SH_K_M3|SS_SH_K_M4|SS_SH_K_M5}" race="khaak">
<position object="this.Position" min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
<equipment loadout="maximum"/>
<command command="killenemies"/>
</create_ship>
</do_all>
<do_all max="{value@this.OBS Instances}">
<do_any>
<create_ship typename="{random.type@SS_SH_THINKER|SS_SH_THINKER6}" race="khaak" chance="3">
<position object="this.Position" min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
<equipment loadout="maximum"/>
<command command="killenemies"/>
</create_ship>
<create_ship typename="{random.type@SS_SH_THINKER14|SS_SH_THINKER27}" race="khaak" chance="1">
<position object="this.Position" min="{value@this.MinRange}km" max="{value@this.MaxRange}km"/>
<sector sector="UFJD Sector"/>
<equipment loadout="maximum"/>
<command command="killenemies"/>
</create_ship>
</do_any>
</do_all>
</do_when>
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
Adding another line is easy, in both the MSCI or Exscriptor, i use it for things like this; 'good form' in a language like MSCI is not really anything to worry about, if it works it works - its not like we have OO issues to worry aboutDrBullwinkle wrote: Is it even good form to use skip or do if? They seem sloppy to me, and create a maintenance hassle if you (or another developer) ever want to add another line. It seems too easy to create a bug, to me. (I realize it cannot be avoided in this example of a vanilla script.)

Code: Select all
$ShipTypes = [THIS]->call script 'xtl.lib.ship.choose' : class={M7 2027} ship.race=$Race return.array=[TRUE] enable.m7m=[FALSE] GetXTLClassOverride=null FilterXTLClass=null
$ShipNumber = 3
skip if not $LowCPU
$ShipNumber = 2
gosub AddShips
Code: Select all
skip if $Client
$Client = [THIS]
Code: Select all
skip if not $Debug
[THIS]->set name to 'CarrierManagerBegin'
Lines that are not likely to need a second statement

[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
That is consistent with my observation of a few scripts that I have seen.Jack08 wrote:'good form' in a language like MSCI is not really anything to worry about

What are OO issues?if it works it works - its not like we have OO issues to worry about
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
My modified UFJD file
What does this do:
Depending on the mode this
v1 Initial Release
v1.1: Added Pirate and Kha'ak generation for all versions
v1.2: Added wares to the Pirate station
Installation:
Edit [1st Dec 2015]: replaced outdated x1tp with working xdownloads link. X2-Illuminatus
What does this do:
Depending on the mode this
- adds Kha'ak/Pirates to UFJD sectors.
- stops Equipment damage from occuring when jumping.
v1 Initial Release
v1.1: Added Pirate and Kha'ak generation for all versions
v1.2: Added wares to the Pirate station
Installation:
- Choose a version from the zip file
- Only put ONE version in the director file.
- Delete the words in capital letters from the title of the selected version so the name is "3.08 Sector Management" (No quotes)
- Unfocussed Jump
- Profit
Edit [1st Dec 2015]: replaced outdated x1tp with working xdownloads link. X2-Illuminatus
Last edited by jack775544 on Wed, 1. Aug 12, 07:44, edited 10 times in total.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
What i mean is the 'good form' is only really majorly considered in OO languages; most others, if it works - it works. (most, but not all)DrBullwinkle wrote:What are OO issues?
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Oh, Object Oriented. I think that good form is considered important in many languages, if not most of them. But, whatever... I understand your comment.Jack08 wrote: 'good form' is only really considered in OO languages.
I thought you were making some kind of joke that I did not grok. I tried to think of humorous possible meanings for "OO".
Then it occurred to me that the Australians here do not write with an accent. Nobody says, "crikey!" or, "mate". It is slightly disappointing.

Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
Bahahaha.... Crikey... i don't think i ever talk like that mate!DrBullwinkle wrote: Then it occurred to me that the Australians here do not write with an accent. Nobody says, "crikey!" or, "mate". It is slightly disappointing.
errr... *cough* Ahem... Sorry what?


QFT.jack775544 wrote:I am Australian and can I just say that Steve Irwin was the only person to say "Crikey".DrBullwinkle wrote: Nobody says, "crikey!" or, "mate". It is slightly disappointing.

Last edited by Jack08 on Thu, 12. Apr 12, 05:51, edited 1 time in total.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
I am Australian and can I just say that Steve Irwin was the only person to say "Crikey".DrBullwinkle wrote: Nobody says, "crikey!" or, "mate". It is slightly disappointing.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
-
- Posts: 292
- Joined: Sat, 31. Mar 12, 06:39
It was me who pointed out the missing kha'ak codejack775544 wrote:I THINK it should work now. Thanks to Jack08 for the pointer.
My modified UFJD file
Changes:
Added Pirate and Kha'ak generation for all versions
Only put ONE version in the director file. I had all 3 in there before and it crashed the game. Can someone confirm if this is a global issue or if it just me (Computer has been playing up lately).

I'm led to believe the director will execute anything XML in its folder, as I have not seen a specific include file yet, so in your case, they were probably overwriting the same variables and creating funky scenarios in your game.
-
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
I have a single synapse twitching something about there being an MD load list, but it is unnecessary for unpacked files in the director folder. Maybe.Teleth wrote:I'm led to believe the director will execute anything XML in its folder, as I have not seen a specific include file yet, so in your case, they were probably overwriting the same variables and creating funky scenarios in your game.
OK, I believe you.Jacks[1]&[2] wrote:Steve Irwin was the only person to say "Crikey".
It is still slightly disappointing.

Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
Yep, mdfiles.txtDrBullwinkle wrote: I have a single synapse twitching something about there being an MD load list, but it is unnecessary for unpacked files in the director folder. Maybe.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
-
- Posts: 292
- Joined: Sat, 31. Mar 12, 06:39
I actually decided to test it and it does seem to execute anything in the folder. I successfully renamed my UFJD xml and executed the new code it had.DrBullwinkle wrote:I have a single synapse twitching something about there being an MD load list, but it is unnecessary for unpacked files in the director folder. Maybe.Teleth wrote:I'm led to believe the director will execute anything XML in its folder, as I have not seen a specific include file yet, so in your case, they were probably overwriting the same variables and creating funky scenarios in your game.
OK, I believe you.Jacks[1]&[2] wrote:Steve Irwin was the only person to say "Crikey".
It is still slightly disappointing.
-
- Posts: 2993
- Joined: Sun, 25. Dec 05, 10:42
Yes, it will... The load list (mdfiles.txt) is only for md files that reside within the cat/datsTeleth wrote: I actually decided to test it and it does seem to execute anything in the folder. I successfully renamed my UFJD xml and executed the new code it had.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire