I have an infinite loop sell ware script that basically looks like this:
while 1
wait for 10000 ms
log #1, 'calling standard'
call script ship.cmd.sellware.std
log #1, 'finished standard'
end
This works 99.9% of the time, but occasionally the game hangs. I know it's this script since if I deassign all of my ships from it, the game never hangs.
When I look in the log, I see 'calling standard' and 'finished standard' lots of times (as expected - shows the script is working). But the last line in the log is always 'calling standard' (showing that the standard script is the last thing to be called before the hang).
It's difficult to tell exactly when the standard script crashes, but it appears to be when the supply station has 0 quantity (not often - maybe at the end of the factory cycle?).
Any suggestions? Is this a known bug?
Standard sell ware script crashes
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 1075
- Joined: Wed, 6. Nov 02, 20:31
for bug info/reporting, try the tech-support forum - except of course that scripting is unsupported
um... why do you need to have an infinite sell script anyway? and won't the constant re-calling of this script be interrupting your ship's trading runs? you're pausing 10 seconds between calls, last time I watched a ship i'd changed/reassigned a sellware command to, it took it 5 seconds just to get it's bearings and decide where to try and dock next! I'm assuming you're trying to always get the absolute top price for your wares, well if you keep making your ships stop en-route, then you're more likely to lose sales I'd have thought...
um... why do you need to have an infinite sell script anyway? and won't the constant re-calling of this script be interrupting your ship's trading runs? you're pausing 10 seconds between calls, last time I watched a ship i'd changed/reassigned a sellware command to, it took it 5 seconds just to get it's bearings and decide where to try and dock next! I'm assuming you're trying to always get the absolute top price for your wares, well if you keep making your ships stop en-route, then you're more likely to lose sales I'd have thought...
-
- Posts: 31
- Joined: Sat, 13. Mar 04, 16:24
I did originally post this to the tech support forum, and now it says moved even though it's in the tech support forum... Strange.
Anyway, the reason I wrote this script was to try to sell to a trading station for max price (rather than let the trading station ships buy for max price). It didn't work, but in the meantime I noticed the buggy behaviour and figured I'd report it.
Anyway, the reason I wrote this script was to try to sell to a trading station for max price (rather than let the trading station ships buy for max price). It didn't work, but in the meantime I noticed the buggy behaviour and figured I'd report it.
-
- Posts: 1075
- Joined: Wed, 6. Nov 02, 20:31
-
- Posts: 31
- Joined: Sat, 13. Mar 04, 16:24
The custom scripts may be unsupported, but the scripts provided by Egosoft (like the standard sell ware script) should be supported, even when a bug is found by the user scripting engine.
In fact, the custom scripting engine is probably a great place to stress test a standard script by doing pretty much exactly what I did.
In fact, the custom scripting engine is probably a great place to stress test a standard script by doing pretty much exactly what I did.
-
- Posts: 1075
- Joined: Wed, 6. Nov 02, 20:31
-
- Posts: 31
- Joined: Sat, 13. Mar 04, 16:24
But it isn't really a non-standard use - it's just called lots of times with 10 seconds between calls. It would be the same if I did it manually, but much less boring
The situation that causes the standard script to lock up obviously doesn't happen very often because it took multiple ships running the script for a medium term period of time for the lockup to occur. But that implies that in rare cases the standard script does crash, and it would probably crash if it was run from a script or manually.

The situation that causes the standard script to lock up obviously doesn't happen very often because it took multiple ships running the script for a medium term period of time for the lockup to occur. But that implies that in rare cases the standard script does crash, and it would probably crash if it was run from a script or manually.
-
- Posts: 2997
- Joined: Sat, 20. Mar 04, 20:50
Re: Standard sell ware script crashes
Since you have a hunch as to what causes the crash:demner wrote:It's difficult to tell exactly when the standard script crashes, but it appears to be when the supply station has 0 quantity (not often - maybe at the end of the factory cycle?).
Any suggestions? Is this a known bug?
Code: Select all
while 1
label: check
wait for 10000 ms
$check = $station -> getvolume of ware $ware
if check == 0
goto check
end
log #1, 'calling standard'
call script ship.cmd.sellware.std
log #1, 'finished standard'
end
-
- Posts: 31
- Joined: Sat, 13. Mar 04, 16:24
Actually, I didn't have much luck tracking down the source of the problem. The script I posted was a snippet of the actual script that seemed to best show that the standard sell ware script crashed (which I figured out would be useful for tech support). The actual script was quite a bit more involved and did much of the type of checking that you suggested. But the script still crashed.
Bottom line is, the script didn't do what I hoped it would do, so I didn't need it, and removed it. But I figured I'd post it in the tech support forum to let them know there was a bug in their script. But they moved it to this forum so obviously don't care
Bottom line is, the script didn't do what I hoped it would do, so I didn't need it, and removed it. But I figured I'd post it in the tech support forum to let them know there was a bug in their script. But they moved it to this forum so obviously don't care
