[LIST] Streamlining X3 with ease of use modifications

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

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Thu, 12. Apr 12, 04:55

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)
While your modified UFJD script does indeed include the khaak, you are missing a vital part from the TC script.

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>
				
Without this part, the khaak will never have much meat to 'em!

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Apr 12, 04:55

DrBullwinkle 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.)
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 about :D

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'
etc
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

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

Post by jack775544 » Thu, 12. Apr 12, 05:04

@Teleth lol thanks
Last edited by jack775544 on Thu, 12. Apr 12, 06:18, 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.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 12. Apr 12, 05:16

Jack08 wrote:'good form' in a language like MSCI is not really anything to worry about
That is consistent with my observation of a few scripts that I have seen. ;)
if it works it works - its not like we have OO issues to worry about :D
What are OO issues?

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

Post by jack775544 » Thu, 12. Apr 12, 05:40

My modified UFJD file
What does this do:
Depending on the mode this
  • adds Kha'ak/Pirates to UFJD sectors.
  • stops Equipment damage from occuring when jumping.
Changes:
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.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Apr 12, 05:41

DrBullwinkle wrote:What are OO issues?
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)
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 12. Apr 12, 05:47

Jack08 wrote: 'good form' is only really considered in OO languages.
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.

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. :(

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Apr 12, 05:49

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. :(
Bahahaha.... Crikey... i don't think i ever talk like that mate!

errr... *cough* Ahem... Sorry what? :D - in all seriousness i dont even use these words when talking aloud :D

jack775544 wrote:
DrBullwinkle wrote: Nobody says, "crikey!" or, "mate". It is slightly disappointing. :(
I am Australian and can I just say that Steve Irwin was the only person to say "Crikey".
QFT. :D
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

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

Post by jack775544 » Thu, 12. Apr 12, 05:51

DrBullwinkle wrote: Nobody says, "crikey!" or, "mate". It is slightly disappointing. :(
I am Australian and can I just say that Steve Irwin was the only person to say "Crikey".
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Thu, 12. Apr 12, 05:51

jack775544 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).
It was me who pointed out the missing kha'ak code :P

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.

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

Post by jack775544 » Thu, 12. Apr 12, 05:56

Teleth wrote: It was me who pointed out the missing kha'ak code :P
Crikey! :D WHOOPS. I have changed my post but thanks for pointing that out.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 12. Apr 12, 05:59

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.
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.
Jacks[1]&[2] wrote:Steve Irwin was the only person to say "Crikey".
OK, I believe you.

It is still slightly disappointing. ;)

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Apr 12, 06:01

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.
Yep, mdfiles.txt
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Teleth
Posts: 292
Joined: Sat, 31. Mar 12, 06:39

Post by Teleth » Thu, 12. Apr 12, 06:12

DrBullwinkle wrote:
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.
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.
Jacks[1]&[2] wrote:Steve Irwin was the only person to say "Crikey".
OK, I believe you.

It is still slightly disappointing. ;)
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.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Apr 12, 06:15

Teleth 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.
Yes, it will... The load list (mdfiles.txt) is only for md files that reside within the cat/dats
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Post Reply

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