[SCR] Station Financial Manager Mk2

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
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Tue, 17. Jan 12, 23:12

There isn't really anything I can do to prevent the overflow with funds, its just how the game works :S. The only thing I can recommend is if you use other scripts/mods to "bank" the credits in your account so it doesn't overflow.

billw
Posts: 53
Joined: Wed, 1. Oct 08, 19:19
xr

Post by billw » Tue, 17. Jan 12, 23:56

Sorry I didn't explain well. I have nowhere NEAR 2bil in cash before this bug occurs. I had around 20 mil, and the station min max set to 900,000 and 1,000,000. I tried a couple more times to get it to work okay: first didn't change anything and reloaded my older save before the overflowing occured, left it on sata 10x for an hour or so and it happened again this time on 2 out of 4 stations. Next I disabled the min max using the global settings and left it on SATA again for an hour and it STILL happened. I have uninstalled the script for now, gonna have a look at the code maybe but I don't really know the X scripting system.

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Wed, 18. Jan 12, 00:27

The code on the auto transfer is really simple and is unlikely to be the source of the problem. (It was the very first "feature" of this script and has no complaints/bugs to date)

Can you explain it to me again in a bit more detail?

From what you've said so far what I can gather is:


You have some credits on your person (how much?), and some in the station (900k-1 mil).
You let the station run for a while.

When you come back, you have 2 billion credits and it's decreasing by 30 million a second. (When you say "you" do you mean your personal account or your stations account, also where is the money going/coming from?)



Do you only use the auto transfer, or do you use both the traders and the auto transfer (in which case, what does your station actually buy, sell and buy & sell).


Also it'll help if you can send me your save game (email address is in my profile)

billw
Posts: 53
Joined: Wed, 1. Oct 08, 19:19
xr

Post by billw » Wed, 18. Jan 12, 00:37

Okay, I will run for a while with your stuff uninstalled again first to see if I still get the problem, if I do obviously your script isn't at fault.
I dug into your code and yes the credit transfer stuff in global.loop.actual.sta looks totally fine and even checks to make sure it won't allow an overflow of player credits.
My save game won't be much use to you unless you have XTC installed I don't think!
Regarding what the symptoms:
I had about 50 mil in my player account. Four stations with the SFM applied using the global apply (actually the first I set manually, then I found the apply to all command). Also I set the (standard, not SFM) transfer money to player account before I found your script, but replaced it in the command list with SFM. Also had a single trading ship on each station with its homebase set to the station, which I also applied SFM to.
Then I left my stations running on SATA 200% for half a day or so (while at work) and when I got back to them my player account was rapidly decreasing from 2bil to 0 then rolling over to 2 bil again and one of the station accounts was rapidly increasing to 2 bil then rolling over to 0. They just kept going.
The stations themselves are custom ones that come with XTC (shield fabs where you can set the specific shield to build, and weapons fabs the same), so they could be the source of the problem or a conflict.
Like I say I will get back with more info later after trying without your script, and also with it on a standard station.

billw
Posts: 53
Joined: Wed, 1. Oct 08, 19:19
xr

Post by billw » Wed, 18. Jan 12, 19:29

So without the SFM I have had no problems (except my retarded CAGs dying all the time!), left my factories running all day and all night on SATA 200% with no problems. All I changed was removing SFM completely (uninstalled).
If you want I can try and make a save game showing the problem, but will need to reinstall the script and leave my PC running it for a while, plus you will need XTC installed to test it, so I'm not going to do it unless you say you definitely want it. Otherwise I will muddle through with CAGs.
Thanks for the response so far!

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Wed, 18. Jan 12, 21:54

:S I can't really do much with out a save game. I've already read through all the money related scripts and I can not figure out why anything like that would be happening. (I only directly alter credits in 3 scripts, the transfer script, and 2 other which only deduct credits (repair and commission))

Snus
Posts: 209
Joined: Wed, 27. Sep 06, 22:52
x3tc

Problems with energy selling

Post by Snus » Thu, 5. Apr 12, 02:58

HI again!

I have a pretty big complex built as an energy loop, IE food+minor food, silicon, crystal fabs and SPP's.

Now this problem im having is quite similar to what i explained on page 28 (this thread) Except that i have no ship selling at all they all sits and rest, and rests... :shock:
At first it worked great, the first 22 million or so, but then all my traders just gave up :/ 7-8 Mistral SF's.

And this seem to only occur when i set them to only sell energy cells, which was the whole point of that complex, if i dont chose any prohibited wares they do like to sell off my crystals, and so far only the crystals..

The complex is full of ES, dunno if that can have something to do with it, since it worked fine in the beginning.

Ill send you a save game in case you should need it, as ill be going away over the easter.

/snus

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Thu, 12. Apr 12, 23:30

Ok I've figured out the problem (I honestly never though this would happen :S)

Numeric overflow! (Wow that is a lot of stations :O, 125 SPP in a self sufficient chain?!)

You have ~4 million energy cells, and my function for working out the priority of a ware is..:
7 * (4mil) * 1000 = 28 billion (> 2 billion)



It may take me a while to fix this (as I use this formula in a few places)

---

Side note, found another bug where it was adding nulls to an array used to calculate things. Doesn't cause any problems but should be removed as well. (self note ware.fut.list and ware.fut.amt)

Snus
Posts: 209
Joined: Wed, 27. Sep 06, 22:52
x3tc

Post by Snus » Sun, 15. Apr 12, 05:14

Hello

Think there is 12.5 SPP XL in that complex :) But maybe that is 125 in M size hehe, however ive used your script before on such big complexes and only had the problem ive reported here before (page twenty eight, lol cant write 8 :P ) and after the "fix" it worked great again.

And btw, theres no rush in fixing it as i started to use the CAG (just been too lazy not learning it before :roll: ) Its a bit more fuzz getting it started though but have some other features thats quite handy.

Best regards

/snus

Wee_Mee
Posts: 28
Joined: Sat, 26. Nov 05, 04:33
x3

Post by Wee_Mee » Sun, 20. Jan 13, 10:27

This just isn't working for me. I installed with the SPK file, its sets up ok just when I add ships to the station they just sit ideal and do nothing.

Using most up to date patch, steam version AP.
"enuff said now its your turn"

Post Reply

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