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
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?

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

Post by Litcube » Tue, 17. Apr 18, 17:28

Why not load them on a carrier?

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

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

Because no carrier can support 4 Aegirs docked, and moreover, involving carrier is what I call "tedious". So the question is, how can I either mod ships to include working jumpdrive, or mod shipyards to have jumpdrive.

Thanks for your response anyway. LU is a masterpiece, I just try to turn it into a game I can play nearly forever.

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

Post by BlackArchon » Tue, 17. Apr 18, 17:56

sdfgwrtetyryr wrote:...
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?
You want to add Jumpdrives as a product to a Military Base or Equipment Dock in the same sector as the Shipyard, not to the Shipyard itself.

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

Post by Litcube » Tue, 17. Apr 18, 17:58

This is not thread for generic X3 modding.

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

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

Thanks BlackArchon, I've tried it already, but it did not work either, jumpdrive appears as equipment, yet jumps do not occur. I'll try to solve it myself somehow.

BTW, I tried it on a LU-free install as a test and it works just to edit a ware category for a ship, so I am sure it's just due to LU have something modified about it. And taking into account this, and that forum branch is called "Scripts and Modding" it seems like a proper place to ask, but whatever...

Post Reply

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