Litcube's Universe

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

Post Reply
User avatar
dizzy
Posts: 1019
Joined: Sun, 26. Sep 10, 06:00
x4

Post by dizzy » Fri, 6. Apr 18, 01:04

I could be wrong but I think the state Friend/Foe of an object in X3 (station or ship) is determined upon your relationship with the owning faction at the time of the object's creation, ie those pirate stations will stay as enemy stations until you or someone else destroys them and then when they respawn they will use the new faction relationships. Of course, if you destroy them that'll hurt your relationship with the owning faction.

When I said that X3 is an engine that will eventually become slow I meant that as a game becomes older and older more objects are being tracked by the engine and more scripts run. Some particular causes for slowdowns (rare immortal ship, leaked global scripts) can be found and dealt with but sooner or later X3 will just be slow because there are just too many things happening in the universe, not because of particular bugs. You have a choice in spending time hunting the cause of such slowdowns or doing Export/Import and keep on playing.
X3LU 1.5.2/1.7.0 Youtube series with: IEX 1.5b + LUVi, SIaF r7 (previously also used Phanon Plus 4.02, Revelation Plus 1.04, Diverse Game Starts - LU Edition)
[ external image ]

Sun-Ku
Posts: 7
Joined: Tue, 4. Jul 06, 12:27
x3

Post by Sun-Ku » Fri, 6. Apr 18, 02:47

would the increase of the rep change their hostile status? They changed when i first got in the positive with pirates.

naturecat
Posts: 3
Joined: Mon, 17. Dec 07, 16:24

Post by naturecat » Sat, 7. Apr 18, 10:11

Thanks very much for your mod.This is a perfect mod,I like it.You are very good author。

User avatar
Blue A10
Posts: 41
Joined: Sun, 15. Nov 15, 09:17
x4

Post by Blue A10 » Sat, 7. Apr 18, 10:44

Out of curiosity with the SCH thing I mentioned, would I be right in thinking that you wouldn't decrease the production amount to match the currently provided surplus values, you would instead code the math to increase the required factories to install so that the surplus would match the currently provided production values? Seems like that would be the way to go without having to mess with factory files or production output balance, just an increase in the price, TL cargo space and ore/silicon requirements of certain SCH configs. If there's a consistent ratio between how much is needed and how much is produced in those cases it might be possible to account for it in the math, but it'd suck if it came out to be that a 200x SCH required the equivalent of 200.5x of the product's normal station type.

I'm finally making a little bit of progress on learning scripting and the inner workings of the game and I started thinking about this along with what Joubarbe said about relative value.

EDIT: Okay yeah the fractions thing seems like it'll really be a major PITA. Is it possible to math out 2 sets of factories, like one set will just straight-up be the output factories, so 80 Cahoona Bakery Ls for a 400x SCH, but then calculate all the resources required to run those as a separate set to be added to the list of required factories, including any further Cahoona Bakeries needed, possibly of M size instead for more granularity? Still would have some potentially severe over-coverage, but it wouldn't require anything to be hardcoded, as I understand it, and I'd think it'd be as close as you can get. As close without using some kind of specially-scripted system that's even more abstract compared to the current system based on the stations, which I'm guessing wouldn't align so much with the LU design philosophy not to mention requiring much more work.

BlackArchon
Posts: 1016
Joined: Wed, 4. Feb 04, 17:37
xr

Post by BlackArchon » Sat, 7. Apr 18, 12:43

Please do not create a new patch for LU just now, I'm about to start a new and modified LU 1.7.2 game. Porting all of my changes to a new patch is tedious work, don't make me do that! :D

dreamer2008
Posts: 287
Joined: Sat, 24. Dec 11, 11:14
x4

Post by dreamer2008 » Sat, 7. Apr 18, 17:04

Edit: I managed to find the "problem" and fix it myself, it was my inability to notice a simple setting. The only difficulty I might potentially have is that I can't export/import in the future. I hope I won't need to.

User avatar
Blue A10
Posts: 41
Joined: Sun, 15. Nov 15, 09:17
x4

Post by Blue A10 » Sun, 8. Apr 18, 19:28

Have you downloaded and installed the Export/Import Package? It's a separate download from the rest of LU but IIRC you still see an export option without it, it just wouldn't do anything.

http://litcube.xtimelines.net/wiki/index.php/Download

dreamer2008
Posts: 287
Joined: Sat, 24. Dec 11, 11:14
x4

Post by dreamer2008 » Sun, 8. Apr 18, 20:58

Blue A10 wrote:Have you downloaded and installed the Export/Import Package? It's a separate download from the rest of LU but IIRC you still see an export option without it, it just wouldn't do anything.

http://litcube.xtimelines.net/wiki/index.php/Download
Its been so long since I installed so I don't remember, I even forgot it exists. That must be it, thank you, I think I skipped installing it since I thought I wouldn't need it :) . Its good to know I'm safe in case something is wrong.

Pr0wler
Posts: 134
Joined: Sun, 16. Nov 08, 15:14
x4

Post by Pr0wler » Sun, 8. Apr 18, 21:10

I'm currently RP'ing kinda shady character that can't get any new ships from shipyards (I can only buy used ones, capture or produce them myself). I managed to get a HQ and, as a next step, thought about starting some mining operations with re-engineered ships, but I can't seem to find any second hand miner variants or blueprints for them. Several in-game days and no luck so far.

So, the questions is- are all ships variants available to buy as used ships and blueprints or is my only option is trying to capture one?

Lone Machete
Posts: 29
Joined: Sun, 3. Dec 17, 06:01
x3ap

Post by Lone Machete » Mon, 9. Apr 18, 04:37

Hey Litcube

Could you add a "attack station" like command for the MLCC, so we dont have to use broadcast commands to attack a station? Because of MLCC all Missile fire probabilities on the ships settings are set to zero to use MROE, which means they don't fire missiles when issued a broadcast attack command. I managed to surpass this issue by setting the last order of ships to "protect me: attack same target" but it doesent work for the fighters of a carrier

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Mon, 9. Apr 18, 15:13

@Litcube

For your TODO list, in Cmd.ShipTemplateOutfit.Dock:

Code: Select all

$LoadAmount = $WareQuantity - $ShipHas
do if $LoadAmount > 0
    = $Ship-> load $LoadAmount units of $WareCurrent

$TestMainType = get maintype of ware {1 GJ Shield}
$ThisMainType = get maintype of ware $WareCurrent
if $TestMainType == $ThisMainType
    $NegativeLoadAmount = 0 - $LoadAmount
    = $Ship-> install $NegativeLoadAmount units of $WareCurrent
    = $Ship-> install $LoadAmount units of $WareCurrent
end
... will install shields by default, even if HOMEBASE has none.

Should be something like:

Code: Select all

$LoadAmount = $WareQuantity - $ShipHas
if $LoadAmount > 0
    $maintype = $WareCurrent -> get maintype of ware
    if $maintype == [SSTYPE_SHIELD]
        $loaded = $Ship-> load $LoadAmount units of $WareCurrent
        $neg = $loaded * -1
        = $Ship-> install $neg units of $WareCurrent
        = $Ship-> install $loaded units of $WareCurrent
    else
        = $Ship-> load $LoadAmount units of $WareCurrent
    end
end

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Mon, 9. Apr 18, 16:55

Ok, thanks!

User avatar
Blue A10
Posts: 41
Joined: Sun, 15. Nov 15, 09:17
x4

Post by Blue A10 » Mon, 16. Apr 18, 07:53

Ever since realizing that a portion of my SCHs have been magically conjuring additional products without the factories to produce them I've been unable to sleep at night due to a constant barrage of self-doubt on my own abilities as Space Emperor of the universe's largest and most financially powerful trade empire.

What if those SCHs hadn't been handing me free products? Would I even be where I am today?
What if this unknown and seemingly higher power had not granted me such a boon on resources, a boon inaccessible to the great many other merchants and peoples in this universe?
What if this force exacts a payment for my good fortune so far, like some kind of divine retribution or devilish deal of souls?
How will the people I employ under my company react once they know that their money comes from some inexplicable and seemingly magical phenomenon with unknown consequences?
How will my peers and competitors, or perhaps more frighteningly, the governments and regulatory bodies react?
It is these questions and more that provide the overwhelming sense of guilt and dread that have plagued my nights and robbed me of tranquility.

I set about on my own journey of knowledge and discovery, in an attempt to find the reasoning and the mechanics behind this peculiar advantage bestowed upon me. If possible, I would see this blessing removed, so that I might compete with others on fair ground in a true test of ingenuity. After hours of studying sacred texts, meticulous labor, and meddling in the supernatural, I think I have finally come to a conclusion on the subject of correcting this disorder and source of stress in my career.


Scripting is hard and I suck at it.

Thought maybe I could make a band-aid fix myself by adding the final product output to the consumption of said ware in the surplus array and it sort of worked for everything but minerals. Those just errored a bunch and the calculator gave me a blank list of stations. Even on everything else that worked, there was around 30% over-coverage of the main product in most cases even though it seemed like fewer stations could've been used without going below 100%. I didn't really understand why that is or what to look at. I wish there was a LU Scripting 101 class I could take, with an accompanying prereq of X3 Scripting 101.

I did at least come out with a greater respect for the modders of this game and the Litcube Team.

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Mon, 16. Apr 18, 14:17

I've just died hitting a crate...

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Mon, 16. Apr 18, 15:18

Blue A10 wrote:Scripting is hard and I suck at it.
Don`t feel bad. The SCH scripts are, by a wide margin, the most complicated in LU. They are the most complicated I have seen. They could be the most complicated made for X3, period (Bounce, script version, was pretty complicated).

I will commit to fixing it. If I have my brain wrapped around it right, the issue is only with energy cells, in that the generation of support stations is only compensating for resource requirements, and not product requirements. What is likely to happen is energy hubs will end up requiring much more support stations once the number crunching is done.

Joubarbe wrote:I've just died hitting a crate...
LOL

Sirrobert
Posts: 1213
Joined: Wed, 21. Aug 13, 13:55
x3ap

Post by Sirrobert » Mon, 16. Apr 18, 17:36

BlackArchon wrote:Please do not create a new patch for LU just now, I'm about to start a new and modified LU 1.7.2 game. Porting all of my changes to a new patch is tedious work, don't make me do that! :D
You could just... not update.
9 out of 10 voices in my head say I'm crazy. The 10th is singing the music from Tetris

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Mon, 16. Apr 18, 18:15

I recommend a delay of 7 years between each patch.

User avatar
Blue A10
Posts: 41
Joined: Sun, 15. Nov 15, 09:17
x4

Post by Blue A10 » Tue, 17. Apr 18, 13:49

Litcube wrote: Don`t feel bad. The SCH scripts are, by a wide margin, the most complicated in LU. They are the most complicated I have seen. They could be the most complicated made for X3, period (Bounce, script version, was pretty complicated).
Your words mean a lot, thanks. It took me a lot of time to get as far as I did, and although I never expected to be able to fix the core issue myself, I did at least learn from it a bit. Plus now I've finally got the basics of scripting down, with a better but still incomplete idea of just what all exactly can be done. It was fun and insightful not to mention a good way to pass the time.
Litcube wrote:I will commit to fixing it. If I have my brain wrapped around it right, the issue is only with energy cells, in that the generation of support stations is only compensating for resource requirements, and not product requirements. What is likely to happen is energy hubs will end up requiring much more support stations once the number crunching is done.
What you said is what I'm seeing, but I think it applies to every configuration where the main product ware is also a resource for a support station, not just energy cells specifically. Off the top of my head Rastar Oil, Crystals, and Silicon Wafers are some of the more noticeable ones since they're HQ resources along with Energy Cells. All race foods should be affected too, but that's probably much less common of a main product for an SCH.

A problem I see though is that in those cases even if the product requirements are compensated for, in the end you'll have an SCH that only outputs say 400 of the main product because of how RelVal and station sizes work, but the stations that make it up would actually make 410 if they were in a traditional complex. So on the SCH, that extra 10 just gets clipped off. You'd have to either just take that loss or make something like the Minimum Energy Surplus / Lib.Cmd.SaturnComplexHub.Surplus script that periodically adds the difference back in.

I'm going to do a fresh install and check what the calculator gives me just to double check everything. I can make a screenshot album of the results if you'd like.

Freenan
Posts: 110
Joined: Tue, 5. Aug 08, 18:46
x4

Post by Freenan » Tue, 17. Apr 18, 13:57

Joubarbe wrote:I recommend a delay of 7 years between each patch.
i´m REALLY sory, you are nuts! :P :wink:

sdfgwrtetyryr
Posts: 6
Joined: Tue, 31. Mar 15, 10:24
xr

Post by sdfgwrtetyryr » Tue, 17. Apr 18, 17:15

Hi Folks, can someone help me a bit here. I am really newb to modding, so I need some help.
I have quite an annoying issue, with ships bought in Terran/ATF sectors; there are no Jumpdrives on shipyards there as you may know, which results in a tedious procedure before you can move them to your MLCC.
I tried to modify TWares list via X3 editor2 and modify a ware category, adding SS_WARE_WARPING, which will just install Jumpdrive on each ship as a built-in component (after modding TShips ofc).

It worked, Jumpdrive was installed, however ships just refuse to jump with it. If you buy a Jumpdrive it works, but built-in doesn't.

I decided to try another way, and tried to add Jumpdrive as an equipment to Shipyards, but ultimately failed to figure out which file is responsible for editing what equipment is sold on shipyads.

So is there any way to solve the issue of either adding jumpdrives to shipyads, or setting it is as default equipment?

Post Reply

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