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
memeics
Posts: 978
Joined: Sun, 26. Sep 10, 06:00

Post by memeics » 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)
Image

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

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, 17: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, 10:17

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: 940
Joined: Wed, 4. Feb 04, 18:37

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: 203
Joined: Sat, 24. Dec 11, 12:14

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.
Image

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

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: 203
Joined: Sat, 24. Dec 11, 12:14

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.
Image

Pr0wler
Posts: 133
Joined: Sun, 16. Nov 08, 16:14

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: 27
Joined: Sun, 3. Dec 17, 07:01

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: 3551
Joined: Tue, 31. Oct 06, 13:11

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: 4238
Joined: Fri, 20. Oct 06, 19:02

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

Ok, thanks!

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

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: 3551
Joined: Tue, 31. Oct 06, 13:11

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

I've just died hitting a crate...

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

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

Post Reply

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