Crystal Free SPP's (script) and conflicts with other scripts

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

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

Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Crystal Free SPP's (script) and conflicts with other scripts

Post by Miths123 »

I have just spent the last hour trying out the Crystal Free SPP script that is up for download on xscripting.com (I really would like to be able to afford more than just my first M6 within the next week of in-game time :). I have clocked in around five days so far, and I have only just broken 7 mill. credits - not counting assets).

However, the first thing that puzzled me a bit was that it also apparantly required me to install the "Francium Script Pack" which includes a bunch of other (mainly cheat) scripts, but I assume that it is mostly required for the "libfdn..." files in that pack?

After getting it up and running and my six power plants in various sectors were happily producing energy cells without crystals, I noticed that the script(s) I had just installed interfered in some way with other scripts - XaiCorp Jumpdrive Commands 3.1 and Teladi Auto Trader Mk 2.2, possibly also Patrol 2.0 and XaiCorp AutoMining - although I just thought of the latter ones now, so I may be incorrect here.

For now I have removed Crystal Free SPP's and Francium Script Pack and reverted to an older save game, but can anyone tell me if there is a way to avoid these conflicts, or perhaps another script (in the works) that removes the need for crystals - preferably without requiring me to install a bunch of other scripts I have no interest in? Or perhaps someone could tell me which of the scripts from the Francium Pack are actually needed to get the SPP scripts to work, so I could leave out the rest and see if it still causes trouble?

I really liked not having my power plants constantly flash yellow due to a lack of crystals (and yes, I did read the excellent guid on SPP's on this board, and feel that I chose my sectors wisely) - call me a cheater if you like ;).
kryptyk
Posts: 483
Joined: Fri, 5. Dec 03, 20:19
x4

Post by kryptyk »

The exefdn.*.*.xml are the cheat scripts.The only scripts that Crystal Free SPP calls that I can see are libfdn.CheckPlayingTime, libfdn.EndCurrentInstance, libfdn.GetAllStations and libfdn.CombineArrays. So you can install just those. I don't see how it would mess up any other scripts mainly because it doesn't use the ship command console. Let me know if this helps.
Accushot
Posts: 44
Joined: Tue, 10. Feb 04, 12:12
x3

Post by Accushot »

You could always try doing it yourself...

Code: Select all

Arguments 
1: Station , Var/Station , 'Station' 

001   if $Station ->uses ware Crystals as primary resource 
002   $Station ->remove primary resource from factory:Crystals 
003   $Station ->add second resource to factory:Crystals 
004   end 
005   return null
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

kryptyk wrote:The exefdn.*.*.xml are the cheat scripts.The only scripts that Crystal Free SPP calls that I can see are libfdn.CheckPlayingTime, libfdn.EndCurrentInstance, libfdn.GetAllStations and libfdn.CombineArrays. So you can install just those. I don't see how it would mess up any other scripts mainly because it doesn't use the ship command console. Let me know if this helps.
I did a little testing, and in addition to the files you mention here, it seems that libfdn.ScriptIsAlone.xml (from the same pack) is required to get the Crystal Free script to work.
Unfortunately it also appears that it is exactly this script that causes the XaiCorp and Teladi Trader scripts etc. to have their commands removed from the console menus (I forgot to mention what I ment by "interference" in my original post).

I think I will just get some more factories running and leave it on SETA overnight - I guess I will see the millions start to roll in then :).
If someone has a solution to the problem I am still interested - perhaps a different script, or a way to get it to run without libfdn.ScriptIsAlone.
Scripting is a little over my head, but if needed I guess I can remove or change a few lines of code if I am given specific instructions.
BabyFace
Posts: 140
Joined: Sat, 24. Jan 04, 23:06
x2

Post by BabyFace »

there are easier ways of getting something for nothing, my way was to "monitor" the station/warehouse/HQ and if a product/ware (which is monitored) drops or is sold then it calls a "fill" script to replenish the entire station/warehouse/HQ.

A Serious cash maker ($80,000,000 in 3 hours) with 5 warehouses and 10 modified dolphins
Check Regularly for new Script/Mods
http://www3.telus.net/public/starnet/default.htm

At the top of each page is a "Back To Main Page" Link

BabyFace
Accushot
Posts: 44
Joined: Tue, 10. Feb 04, 12:12
x3

Post by Accushot »

Miths123:
If someone has a solution to the problem I am still interested - perhaps a different script, or a way to get it to run without libfdn.ScriptIsAlone.
Scripting is a little over my head, but if needed I guess I can remove or change a few lines of code if I am given specific instructions.
OK, specific instructions:

1. If you have activated the script editor, jump to 4

2. Fly into space and type Thereshallbewings (Case-sensitive)

3. Press "S", "C", "S" to get into the script editor.

4. Create a new script, call it what you like.

5. Now select "New Argument", type "Ship" as the name, select "Var/Ship" as the type and type anything you like for the description.

6. Now in the code window enter the following (Most of the functions can be found in the "Trade" library):

Code: Select all

001   if $Station ->uses ware Crystals as primary resource 
002   $Station ->remove primary resource from factory:Crystals 
003   $Station ->add second resource to factory:Crystals 
004   end 
005   return null
7. Now save+exit (Press esc) and you can run the script (With "R").

If you can't get it to work I can e-mail you the script.
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

AccuShot, I thought those were just general guidelines for a script you posted earlier :).

If this is really all it takes, why is the Crystal Free SPP script I downloaded around 25Kb - and takes an additional 5-7 scripts on top of this? Much more complex than it needs to be?

Thanks anyway, I will try it out and report back soon to let you know if it works.

BabyFace, I really like the scripting site you have set up - not that I have anything against xscripting.com ;), but I like the simpler layout of your site, not to mention the fact that I can see the entire readme file from a script. Nice work.

I have taken a look at HQ mod, and I am checking out some of the other scripts as well.
I just do not want to feel that I am "cheating" too much :).
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

Okay, I tried making the script and it appears to be working - I have to manually run it for every SPP of course, but that is hardly a problem :).

A couple of questions though. First, is it a minor slip on your behalf when you say that I should use "ship" and "var/ship" under arguments? I used "station" and "var/station" instead.
Second, the script seemingly need to require me to select the station twice - is this because it needs to know both where to remove prim. resources from and add sec. to?

Also, where I choose the station I also get the option to choose "null" - I assume this is some programmers' term for not returning any data or something similar, but why am I presented with it?

Thanks for helping me anyway - for obvious reasons I like this alot better than the one I originally downloaded, but I also like that I can choose which power plants I want to be "crystal free" - this way I can settle on cheating only in areas where there seem to be a lack of crystals :).

If anyone else is interested here is the how the final script turned out - the simple script/argument names may not sit too well with programmers though ;).

Code: Select all

Look further down the page for an updated script
Last edited by Miths123 on Wed, 25. Feb 04, 22:16, edited 1 time in total.
Accushot
Posts: 44
Joined: Tue, 10. Feb 04, 12:12
x3

Post by Accushot »

Yep, you're right about the station argument, my fault. :headbang:

You don't need to set the first argument, it is only used for scripts that return a value, e.g. You could type return MyCommand at the end of your script and the first station you select receives MyCommand. Basically you just need to select null and then the station.

Glad I could help.
the_conquerer_cgi
Posts: 309
Joined: Fri, 26. Dec 03, 16:12
x3tc

Post by the_conquerer_cgi »

What's the point of re-adding it as a secondary if you aren't going to have the part of the script that adds e-cells for every crystal in stock? I thought that was the point of the crystal-free script, because you can just manually remove them as primary with a simple one-line script. For the player, there is no point in secondary resouces, that's why only NPC stations have them.
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

the_conquerer_cgi wrote:What's the point of re-adding it as a secondary if you aren't going to have the part of the script that adds e-cells for every crystal in stock? I thought that was the point of the crystal-free script, because you can just manually remove them as primary with a simple one-line script. For the player, there is no point in secondary resouces, that's why only NPC stations have them.
Good point. Since I know absolutely nothing about scripting (well, following AccuShot's instructions I did manage to make this script - and I actually think I understand the reason behind the, albeit simple and few, commands in the code) I had not really considered this.
Guess the script could be redone without the "add sec. resource" command. Anyway, I just started a new game and the script is running flawlessly on my first SPP, so I guess it is just a matter of cosmetics (and sloppy code) really :).

Edit: Okay, cosmetics matter. I just corrected the script to simply remove the need for crystals as well as made another one to correct the factory I had set up.
If any other non-scripters are interested in the very simple script, tell me here and I will post the correct code (which may then provoke an even easier answer from scripters ;)).
User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Post by Storm_Front »

If any other non-scripters are interested in the very simple script, tell me here and I will post the correct code (which may then provoke an even easier answer from scripters ).
I'm interested, and how about uploading to xscripting.com, sounds like it's better, simpler anyways, than the two they have there. :)
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

Okay then.
I assume most of the readers of this forum know their Windows basics, but just in case I will put the instructions in simple terms - sorry if I offend anyone's intelligence ;).

Copy and paste the code below into Notepad or another text editor and save the file as Miths.Crystal.Free.SPP.xml (or change the name in the code and the filename to anything corrosponding - remember the xml on the latter).
Now copy the xml file into the game's script folder and you are good to go.

To actually activate the script you start the script editor (activate with the "Thereshallbewings" method mentioned several other places on this board), highlight the script and hit 'r' to run it.
You will presented with two choices - "null" or "select ship or station". Just select "null" and hit enter on the next page ("argument"). Another page will appear with the same two choices - this time choose "select ship or station" and use the map to select the power plant you wish to remove the crystal requirements for.
You will be returned to the selection page of the script editor and the SPP you chose should now require no resources to run, so cancel any ships you may have sent crystal shopping - and watch the cash roll in quite a bit faster :).

You will need to run the script individually for any power plants you have or wish to make resource free.

As for uploading to xscripting.com - perhaps if more people are interested. It is a very simple script afterall, and I cannot even take credit for it since I was told almost exactly what to do by AccuShot :).

Here is the script (almost similar to the one further up the page) - enjoy:

Code: Select all

<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet href="x2script.xsl" type="text/xsl" ?>
<script>
<name>Miths.Crystal.Free.SPP</name>
<version>1</version>
<engineversion>23</engineversion>
<description>Removes  the  need  for  crystals</description>
<arguments>
<argument index="1" name="Station" type="Var/Station" desc="" />
</arguments>
<sourcetext>
<line linenr="001" indent=""><var>if </var><var>$Station -></var><text> uses ware </text><var>Crystals</var><text> as primary resource</text></line>
<line linenr="002" indent=" "><var>$Station -></var><text> remove primary resource from factory: </text><var>Crystals</var></line>
<line linenr="003" indent=""><text>end</text></line>
<line linenr="004" indent=""><text>return </text><var>null</var></line>
</sourcetext>
<codearray>
<sval type="array" size="10"><sval type="string" val="Miths.Crystal.Free.SPP" /><sval type="int" val="23" /><sval type="string" val="Removes  the  need  for  crystals" /><sval type="int" val="1" /><sval type="int" val="0" /><sval type="array" size="1"><sval type="string" val="Station" /></sval><sval type="array" size="3"><sval type="array" size="6"><sval type="int" val="635" /><sval type="int" val="131074" /><sval type="int" val="0" /><sval type="int" val="-1610612221" /><sval type="int" val="9" /><sval type="int" val="1048577" /></sval><sval type="array" size="5"><sval type="int" val="782" /><sval type="int" val="131074" /><sval type="int" val="0" /><sval type="int" val="9" /><sval type="int" val="1048577" /></sval><sval type="array" size="3"><sval type="int" val="103" /><sval type="int" val="0" /><sval type="int" val="0" /></sval></sval><sval type="array" size="1"><sval type="array" size="2"><sval type="int" val="12" /><sval type="string" val="" /></sval></sval><sval type="array" size="1"><sval type="array" size="2"><sval type="int" val="2" /><sval type="int" val="4" /></sval></sval><sval type="int" val="0" /></sval>
</codearray>
</script>
User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Post by Storm_Front »

Miths123: I couldn't get your script (the 1 above) to work, I kept getting ctd's. So I removed it, loaded a save and tried scripting one myself. It took me over an hour, but I got it and tested it out on my SPP, works great. Then I compared it to yours: The word station is missing from the argumentsand there are a couple of "&"and "#" missing. Here's my first script, of course I was copying yours as best I could :D
<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet href="x2script.xsl" type="text/xsl" ?>
<script>
<name>Crystall.free.SPP</name>
<version>0</version>
<engineversion>23</engineversion>
<description>Description</description>
<arguments>
<argument index="1" name="station" type="Var/Station" desc="station" />
</arguments>
<sourcetext>
<line linenr="001" indent=""><var>if </var><var>$station -></var><text> uses ware </text><var>Crystals</var><text> as primary resource</text></line>
<line linenr="002" indent=" "><var>$station -></var><text> remove primary resource from factory: </text><var>Crystals</var></line>
<line linenr="003" indent=""><text>end</text></line>
<line linenr="004" indent=""><text>return </text><var>null</var></line>
</sourcetext>
<codearray>
<sval type="array" size="10"><sval type="string" val="Crystall.free.SPP" /><sval type="int" val="23" /><sval type="string" val="Description" /><sval type="int" val="0" /><sval type="int" val="0" /><sval type="array" size="1"><sval type="string" val="station" /></sval><sval type="array" size="3"><sval type="array" size="6"><sval type="int" val="635" /><sval type="int" val="131074" /><sval type="int" val="0" /><sval type="int" val="-1610612221" /><sval type="int" val="9" /><sval type="int" val="1048577" /></sval><sval type="array" size="5"><sval type="int" val="782" /><sval type="int" val="131074" /><sval type="int" val="0" /><sval type="int" val="9" /><sval type="int" val="1048577" /></sval><sval type="array" size="3"><sval type="int" val="103" /><sval type="int" val="0" /><sval type="int" val="0" /></sval></sval><sval type="array" size="1"><sval type="array" size="2"><sval type="int" val="12" /><sval type="string" val="station" /></sval></sval><sval type="array" size="1"><sval type="array" size="2"><sval type="int" val="2" /><sval type="int" val="4" /></sval></sval><sval type="int" val="0" /></sval>
</codearray>
</script>
Accushot
Posts: 44
Joined: Tue, 10. Feb 04, 12:12
x3

Post by Accushot »

so I guess it is just a matter of cosmetics (and sloppy code) really
:rant: WHAT THE...SLOPPY CODING?!?!?!...oh wait it was, never mind.
Miths123
Posts: 34
Joined: Wed, 11. Feb 04, 17:38
x2

Post by Miths123 »

AccuShot wrote:
so I guess it is just a matter of cosmetics (and sloppy code) really
:rant: WHAT THE...SLOPPY CODING?!?!?!...oh wait it was, never mind.
Well, in your defense I did ask how to make crystals a secondary resource (albeit a working one I think), not how to remove them completely ;).
EliteJal
Posts: 115
Joined: Wed, 31. Dec 03, 00:29
x4

Post by EliteJal »

Hi, could you please send me this script to Andl90@hotmail.com?
Thank you. :)
Accushot
Posts: 44
Joined: Tue, 10. Feb 04, 12:12
x3

Post by Accushot »

On it's way...put the script in your X2/scripts folder.
Joule
Posts: 54
Joined: Sun, 26. Apr 09, 11:06

Post by Joule »

Hi, I´m not so good in english - I´m not sure if I understand instructions for making this script well, so can you just send me it to martin.loula@seznam.cz please?

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