[SCR] Station Financial Manager Mk2

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Sun, 18. Jan 09, 03:06

Ok I worked out "why" the ship is bouncing around different stations.

It is finding the closest station BUTTT, I make it recheck when docked, and when its docked, it has no co-ordinates (position null). So the nearest is just the nearest to 0-0-0, but if i make the ref obj the station, then it doesn't count it in the search.

So... *sigh* dodgy work around required...

Bah wait.. ... i set the ref object.. but i forgot to make the search use the refobj var..

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

Post by s9ilent » Sun, 18. Jan 09, 03:16

Ok I worked out "why" the ship is bouncing around different stations.

It is finding the closest station BUTTT, I make it recheck when docked, and when its docked, it has no co-ordinates (position null). So the nearest is just the nearest to 0-0-0, but if i make the ref obj the station, then it doesn't count it in the search.

So... *sigh* dodgy work around required...

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 03:23

Something is hapening.
Becouse I increased the prices in station Crystal Fab 1 game-ships just poping up and fill the station with wares not my EST.
So I used the Cycrow cheat script and creat new Crystal Fab 2 to speed the proces.Then I stoped the command on my Tester 1 ship,set his homebase to Crystal Fab 2, start the fin recording and start station manager ageen.Then my ship Tester 1 start to fly to Light Weapons Complex in Elena's Fortune.The ship goes to the station but not docking and then moved to second target Photon Pulse Canon Forge :? :? :? :?
I restart the proces several times and it is same thing.
Last edited by Idea on Sun, 18. Jan 09, 03:33, edited 1 time in total.
Image

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

Post by s9ilent » Sun, 18. Jan 09, 03:28

Yeh that's a bug in the find station command at the moment, I'm trying to find a work around at the moments... Well not a bug.. but an undesirable feature...

For the moment I'm going to stop using the find nearest and post on dev net. about it, and then Ill try it again.

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 03:57

I must pull my statement back
I accidentally increased the price for buying wares in station and my EST fill it up.That probably trigger the ship to go back.I will reduce it ageen Embarassed
The reason is because the ship is returning to homebase irrelevant to the stations supplyes.I check.The ship is going back to homebase in moments after the ship enter the sector.It do not buy just enter the sector and turn back to homebase.That is in the case when target is station which have goods which are needed to the homebase.
One issue:Is script allows more than one station manager for a one station?
Second issue:The ship target Solar Power Plant in Bala Gi's Joy to buy energy cells for 12 credits even when in homesector(Argone Prime) i have my one Solar Power Plant with energy cells at price 12.Only difference is the one in Bala Gi's Joy has more energy cells.Is that how suposed to be.
Edit'Ageen ship turn back to his homebase immediately when enter the sector Bala Gi's Joy and didn't buy anything ageen.
That is all from me tonight.I am going to sleep.
Image

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

Post by s9ilent » Sun, 18. Jan 09, 04:29

No the script doesn't.

A ship can only monitor one station at a time. It could probably be changed to do several but... it will burn up cpu power (LOTS of cpu power) so I'd rather not.

That and I don't want to replace the commercial agent (CAGS). (not yet.. any way..)



Ok re uploaded (here is the link)


Various fixes listed in the above posts. Most notably, it will no longer uses the THIS find station, it just uses find station. It will stop it doing that
Land at alpha, land at beta, land at alpha, beta a bababababab.
But at the cost, it may not find the nearest in the sector.

Ok im' more or less happy with this version now
I've made another upgrade (not uploaded yet)
the min priority is higher for invididual stations then complexes, prevents the ship going off to buy like... 5 wares energy cells. Now its at about 5+% complex 25+% for singles. And I made it prioritizes sell goods at 7, and buying goods at 5.
Time to add the front end, and remove debuggers now
Last edited by s9ilent on Sun, 18. Jan 09, 13:18, edited 1 time in total.

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

Post by s9ilent » Sun, 18. Jan 09, 07:37

A thought occurred to me...


How exactly do I prevent an energy stall? (Whilst unlikely to occur mid way through its life time... new stations will almost always face this problem)

As a ship will only jump if it has fuel, and if there is no spare fuel....




Hmm.... I may have to write an overwatch script on the station to monitor all fuel... (Either that, or I just say stuff it, let the player worry about it, just send them a message)





Just a quick interface question. When you add a ship, should you.. stay on the say screen (add ship screen), go back to the main menu, or close all menu's (on a sucesfull add)?


Quick stat rep
Its almost alive!!! UI (add) is in, now I've just got a few things to flesh out

Broken jumpers
ui (ship stat rep)
ship.add add error checkers Exclude ware list
add save to station local VaR

station make an overwatch Include ship list
self array cleaning on menu load

Energy stall

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 11:08

Just a quick interface question. When you add a ship, should you.. stay on the say screen (add ship screen), go back to the main menu, or close all menu's (on a sucesfull add)?
Go back to main menu.
How exactly do I prevent an energy stall? (Whilst unlikely to occur mid way through its life time... new stations will almost always face this problem)As a ship will only jump if it has fuel, and if there is no spare fuel....
Hmm.... I may have to write an overwatch script on the station to monitor all fuel... (Either that, or I just say stuff it, let the player worry about it, just send them a message)
Well to leave that to player to worry aboute it would nor be fair.I meen the word Automated Station Manager says more than enough to your dilemma.
As for fuel would you consider instead of use of energy cells for ship jump,use credits like in Graxster free jump with some changes like insted of 12 credits for energy cell it would be 16(average price).That would solved the fuel problem, but is this proposal
acceptable for you?
I will download the new version to see what did you change.
I will feedback if any kind of problem happen.
Image

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

Post by s9ilent » Sun, 18. Jan 09, 11:22

Ok ill make it pop to the main menu


As for the fuel thing. I don't really want to spawn energy cells as I'm hoping that if this scripts work, I'll submit it for bonus packing. But I don't really want to put it into the main loop, as it will require substantial re-writing.

So to be honest, I really just want a quick soln. to the problem so, here it is:
if the homebase's energy < 100, (which it should be as soon as you land, as the auto refuel is in the !signal.docked, and there is a wait at the top of the loop, so no issues with that either)
Go buy fuel, search pattern, find nearest first, within standard constraints (sect dist, price etc etc etc). Will not re-prioritise, will not divert (even if price rises > min, restrict qty to 500 if that happens). It will check for a station that nothing is docking at thou (to prevent 20 ships all going to the nearest SPP). Will jump if able.
Its crude, but effective. I'll put that in a separate script and smack that near the top of the loop (right under the checks)


Whilst yes, this is EXTREMELY crude... the goal is to get the station to have enough energy, so ships can trade across the entire universe. And ideally, if you did add a jump capable ship (which is the only ship that's affected by the stall), it would've already come with Ecells, so the price thing shouldn't be an issue (as it would zap to the spp and arive in <30 seconds)
Hrm..

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 11:54

I have a problem.The ship now target correct station in my case only Solar Power Plants and Silicon Mines but when the ship enter the sector where station is located the ship retarget to next station.I just swich betwen Silicon Mines and Solar Power Plants over and over ageen.
The ship do not dock so it could not buy any goods.
The message log are look like this:
ARRAY(Silicon Wafers,Silicon Mine M beta(Duke's Vision) 1,764 Silicon Mine M beta(Duke's Vision))

Silicon Mine M beta(Duke's Vision)

premove this is new

flyin to sect

can jump
and this log reload every time when he target next station except it change
ARRAY to station that he target it.
Image

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

Post by s9ilent » Sun, 18. Jan 09, 11:57

Another question (about preferences)


Right now, the script is using move.movetosector, which governs flying between sectors and automatically uses the jump drive.
BUTTT, if the ship is being escorted by at least 1 non jump-capable ship, it wont jump. It will travel slowly with the escort ship.

Should I
1) continue using the current script. (stay with escorts, with out jumping)
2) force it to jump any way (I can't say where the escorts will end up, and they may stray through xenon sectors when trying to get back to the ship)

(And no I can't really let you choose, as jump-ability pops up in about 4 different places in the script.. so it'd be a huge HUGE hassel to change it. eg. Ware prioritisation depends on jumping, fly 1 sector at a time/all sectors etc. )

W.r.t Premove, I'm just putting logbook commands all over the shop at the momment. I've taken most of them out (In my version I've left one somewhere.. having issues finding it thou... I'll take it out later)
It just means, that the script reached before the move command. (so it passed the... findware command + checks)



I think I'll do one simply because I have coded it this way to begin with. And if you did order things to escort it, I'm sure you did it for a reason.
Last edited by s9ilent on Sun, 18. Jan 09, 12:10, edited 1 time in total.

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 12:09

Right now, the script is using move.movetosector, which governs flying between sectors and automatically uses the jump drive.
BUTTT, if the ship is being escorted by at least 1 non jump-capable ship, it wont jump. It will travel slowly with the escort ship.

Should I
1) continue using the current script. (stay with escorts, with out jumping)
2) force it to jump any way (I can't say where the escorts will end up, and they may stray through xenon sectors when trying to get back to the ship)
2 option is better.Way?Becouse if ship always jump when it buy goods the escort ship is not needed.Ship jump,dock,buy,undock,jump ageen,dock,unload,undock,jump..........
The time the ship spend in space would be reduced to minimum.It would allwayes jump ther,jump here, nobody will have the time to attack the ship :)
Image

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 12:22

The ship do not jump.Messege log:
ARRAY(Energy Cells,Crystals,Silicon Wafers,Measteak Cahoonas)

ARRAY(100,0,185,-1)

ARRAY(Silicon Wafers,Silicon Mine M alpha(Pontifex's Realm) 1,764

Silicon Mine M alpha(Pontifex's Realm))

Silicon Mine M alpha(Pontifex's Realm)

premove this is new

flyin to sect

premove

can jump

The station have about 6000 energy cells
Image

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

Post by s9ilent » Sun, 18. Jan 09, 13:17

That is a good point on option two. (Grr and I just finished coding option1)


As for the problem with your ships being funky... I think its something I did in that version... Ill upload another. (has anti e-stall in it as well now :))

Hopefully that Problem should be gone now
(But be aware, I took out like 99% of the log messages now, so your going to have to add them back in around the place)
I recommend putting back in the logprinting of...
the return from findware, the warelist, and the priority

i.e.
ARRAY(Energy Cells,Crystals,Silicon Wafers,Measteak Cahoonas)
ARRAY(100,0,185,-1)
ARRAY(Silicon Wafers,Silicon Mine M alpha(Pontifex's Realm) 1,764

those ones



Oh but wait, I don't know if I mentioned this yet, but you can start the command on ships, from the station now. (in the menu, add ship, select ship, etc, and all the add ship options do work) Remember that if a ship is set to jump, but is not jump capable, it will just return to the home base.
And the default, is the station default, who's default is the global default, whos default is yes, jump capable.
Last edited by s9ilent on Sun, 18. Jan 09, 14:22, edited 1 time in total.

User avatar
Idea
Posts: 516
Joined: Fri, 24. Oct 08, 12:14
x3tc

Post by Idea » Sun, 18. Jan 09, 13:52

The first time the ship dock on to his target and buy silicon and come back to the station.
What did I do is I supply my Crystal Fab 2 with Energy cells and Measteak Cahoonas to the max.Only supply of Silicon Wafers was on 0.
Then I command my ship to jump to homesector and start the script ageen.It target Silicon Mine M alpha in Pontifex's Realm but it didn't jump instead it took the longer road sector by sector.Then I when he came back he dock stayed dock.So I dock anoter ship took all supply of Measteak Cahoonas expected that the Tester 2 will go to buy that good but nothing it stay docked.I try restarting the script severel time but nothing.The ship would allways dock and do nothing.Message log:
Crystall Fab 2 (Argon Prime)
premove
mve alrdy in dest
post move
transacting
1
we are at home.
This log show every 1 minute.

So to test my opinion that fin.stat.manager work good only when there is one good that he must buy I created Solar Power Plant becouse it need only one resource crystal,start the fin.recording set homebase for my ship Tester 3, and start the script.And it is working well.Only my ship buy crystal in small size.The ship buy 60-150 units of crystal(it has place in cargo hull 14000,money is no problem) even when my Solar Power Plant have room for 6600 units of crystal.Also the station that ship target have 300-400 units of crystal.

I downloadin new version now.
Image

Post Reply

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