[SCR] [v1.7.3] [04/27/2012] MK3 Improvement Reloaded

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

gnasirator wrote:
Does anyone have a copy of the hotfix script? The site the hotfix is hosted on (freewebspace4all.de) is closed permanently.
hu? the url is:
http://www.madxhawk.com/msci/downloads. ... tail&id=44

works fine for me
Oops, the "alternate download" was broken .. the primary download still works :oops:
*** modified ***

[ external image ]
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

good to read that.

any news on the ghost ships? do they still respawn? cause i'm pretty sure i fixed them ... give me some more input pls!
xIRageIx
Posts: 26
Joined: Wed, 7. Mar 07, 23:36
x3

Post by xIRageIx »

Woke up with 350mil...but lost 6 of my UTers, did I install it wrong?
why are u asking? this script is no invulnerability cheat. just some improvements to the routine.
so the traders can still be some bad guy's vicitims ...[/quote]

<--- newb :oops: I extracted the T folder to the T folder in the egosoft X3 folder, and the scripts into the scripts folder, and enabled script editor. think thats right... :oops:
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

I haven't noticed any new ghost spawns, but I've mostly been playing a new start anyway (for unrelated reasons).

One thing that did occur to me though - I was looking through the X2 MCSI manual (nothing like a little light reading!) and I gather the running script cache wouldn't have been cleared out even on a game restart. I did do a manual restart of my UTs after I ran the hotfix since most of them appeared to be stuck, may have been what cleared out the old version. Do the autotrade scripts do a version check?

Or it may not work that way in X3 at all and/or I could be talking complete gibberish :p.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

<--- newb Embarassed I extracted the T folder to the T folder in the egosoft X3 folder, and the scripts into the scripts folder, and enabled script editor. think thats right... Embarassed
ah okay got it. so its running now?
haven't noticed any new ghost spawns, but I've mostly been playing a new start anyway (for unrelated reasons).

One thing that did occur to me though - I was looking through the X2 MCSI manual (nothing like a little light reading!) and I gather the running script cache wouldn't have been cleared out even on a game restart. I did do a manual restart of my UTs after I ran the hotfix since most of them appeared to be stuck, may have been what cleared out the old version. Do the autotrade scripts do a version check?
hmm i don't get it. had you installed the new version and then begun a new game?
or did you just update the script? because it shouldn't be a problem at all. in doubt, stop all the uts, go into SE, run "reinit script caches" and restart the uts.


im ... confused!
User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious »

Roughly:
1. Had lots of ghost ships (on old version)
2. Installed new version, and restarted X
3. Manually deleted the ghost spawns in MP using a cheat script
4. Ghost ships respawned.

5. Ran the hotfix script to delete all the spawns
6. Restarted all my UTs
7. No more ghost ships.


As I understand it (which may well be wrong!) the UTs would still have been running the old version of the script until I restarted them, unless the script does a version check and restarts itself. I think...

But, it all seems to work now so kind of academic.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

aaah yes, that can be.

i only changed some lines in the delivery scripts and didn't update their version number. therefore autotrade.galaxy, which contains the update-check routines doesn't notice the changes and won't restart the traders.
although even changing the delivery-scripts version wouldn't fix that because autotrade.galaxy only checks its own version.

and yes, restarting the game does not reinit the script caches. currently running scripts are saved in the savegames, so they keep on running like before when you've loaded the game.


so restarting the uts is the only way to get it all running as intended. OR go to the SE and reinit the script caches. should work, too.
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

bug report:

autotrade never releases SIGNAL_ATTACKED.

SIGNAL_ATTACKED is always connected to plugin.autotrade.signal.attacked" even when autotrade has stopped.

This makes sense, if you halt any of the autotrade scripts (galaxy or sector) then there is no way to connect SIGNAL_ATTACKED to the default action (your script is already ended).

... ugh, I just looked at ways to store the old value of SIGNAL_ATTACKED - you can't. :(
*** modified ***

[ external image ]
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

hm yes, i think i can follow.

but what would be a usable alternative without a possibility to store the old value?

p.s.: isn't my fault, i didn't change the signal behaviour at all ;)


but if anyone has a suggestion, i'll try it out!
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

I'm not sure how to handle it yet, I have some ideas but need time to test them :wink:
*** modified ***

[ external image ]
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

feel free to do so,

and report your results here. pls ;)

edit: would there be any use in changing that?

do you need the default behaviour of deactivated mk3 traders? e.g. for a script you're working on?
Kakurate
Posts: 65
Joined: Sun, 26. Sep 04, 03:45
x4

Post by Kakurate »

I would like to make a suggestion:

Currently it seems that none of the traders do a good check as to what they currently have and compare it to what they want to keep and what they want to sell. There have been many times when I notice my UT's on standby because they have a hold full of something like ore or silicon and they either dont realize its there or dont care. Maybe you could add in something before looking for ware to buy where they check their hold against what they normally carry vs what they have and try to sell of what they have first.
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

gnasirator wrote:feel free to do so,

and report your results here. pls ;)

edit: would there be any use in changing that?

do you need the default behaviour of deactivated mk3 traders? e.g. for a script you're working on?
Sometimes I stop my UT's and use them at stations (buy ore, etc..). It's really odd when they respond with the UT "I've been attacked" code, especially when I've moved the pilot to a new ship.

Usually when I start a new game I'll capture a bunch of random freighters (dolphins, demeters, anything really..) and turn them into UT's as soon as possible. After a while I move the pilots to faster ships and retire the old ships to other jobs (ore or silicon freight).

Basically I see the signal handling as a bug because it causes problems for me in the mid game. I guess the original author didn't intend for people ever to stop the universe trader ;)
Kakurate wrote:I would like to make a suggestion:

Currently it seems that none of the traders do a good check as to what they currently have and compare it to what they want to keep and what they want to sell. There have been many times when I notice my UT's on standby because they have a hold full of something like ore or silicon and they either dont realize its there or dont care. Maybe you could add in something before looking for ware to buy where they check their hold against what they normally carry vs what they have and try to sell of what they have first.
That's harder than you'd think - what if you give them something to carry that you want them to keep? Say 50 mosquito missiles for missile defense.
*** modified ***

[ external image ]
Kakurate
Posts: 65
Joined: Sun, 26. Sep 04, 03:45
x4

Post by Kakurate »

Add another command: - Maintain current supplies - if they drop below what it was set at, they'll attempt to replenish it. I've not really had the chance to look at the language, but as a programmer myself, this seems very simple to do. I would attempt it myself but I wouldnt know where to start.
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

Kakurate wrote:Add another command: - Maintain current supplies - if they drop below what it was set at, they'll attempt to replenish it. I've not really had the chance to look at the language, but as a programmer myself, this seems very simple to do. I would attempt it myself but I wouldnt know where to start.
That's a good idea, I'm not sure if you can distinguish between wares in the cargo hold and wares that are installed into hardpoints on the ship though (ie: if you say "maintain current supplies" then switch a couple of guns or shields around you might end up flying off to pickup replacements for those things, and selling your currently installed items.
*** modified ***

[ external image ]
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

halo112358 wrote:
Kakurate wrote:Add another command: - Maintain current supplies - if they drop below what it was set at, they'll attempt to replenish it. I've not really had the chance to look at the language, but as a programmer myself, this seems very simple to do. I would attempt it myself but I wouldnt know where to start.
That's a good idea, I'm not sure if you can distinguish between wares in the cargo hold and wares that are installed into hardpoints on the ship though (ie: if you say "maintain current supplies" then switch a couple of guns or shields around you might end up flying off to pickup replacements for those things, and selling your currently installed items.
well .... that is already implemented - but in a more basic way.

first of all the rest ware selling. I implemented two routines to do check if the traders have rest wares on board and to look for a place to sell them. think that's what you're aiming at, hm?

it was quite a pain to get it running but now it works.

and via the command get true amount of ware on board you can get the amount of e.g. 25MW shields on board which are NOT used by the ship itself.

and for energy cells I've already constructed a method to keep a certain amount of the ware on board.
but it's all hard coded. wouldn't be very easy to change that to a general way of handling wares according to your rules.

and to be honest, I'm not really in the mood to keep on working at that script. takes too much time and I'm glad that it runs smooth now.

if anyone else wants to experiment, do so. I don't mind ;)

and @ signal handling:
I see what you're aiming at. I'll work on that. promised. but don't know yet, when.

greetings!
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

gnasirator wrote: and @ signal handling:
I see what you're aiming at. I'll work on that. promised. but don't know yet, when.

greetings!
I read what was suggested in the german thread - modifying plugin.autotrade.signal.attacked is less complicated than my method :)
Last edited by halo112358 on Mon, 16. Apr 07, 06:28, edited 1 time in total.
*** modified ***

[ external image ]
jlehtone
Posts: 22505
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

halo112358 wrote:bug report:
autotrade never releases SIGNAL_ATTACKED.
Some have exploited that. Start ST to set that signal handler and then revert the ship to Trade Mk1 freighter. The ship will escape like UT. Better chance to survive than with stock handler.

IIRC, you can have only one bound signal handler. Thus, if you want just to add a tiny bit, you have to make a copy of stock handler and modify that.

Since stopping a script cannot reset the handler (unless another script is used to do the stopping), each script should set the handler when they start. Thus, the most obvious "fix" is to modify the stock Trade/Fight/Navigate commands to revert the handlers. However, XaiCorp Group Management now sets the handler for the leader ship, so its death will result proper adjustments in formation -- the stock SIGNAL_KILLED does rearrange formation, but not properly for GMS group. Now if Navigation commands would always reset that handler, it would ruin the GMS, or GMS should constantly reset the handler in order to stay in control.

IIRC, you can have only one handler for signal, and cannot even chain them.

The attacked-handler can of course check if the ship runs the ST/UT script and behave like ST/UT only in that case?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

Better to modify the handler I think than the stock scripts.

A very easy test at the start:

Code: Select all

is the autotrader running on task 0?

yes
  handle signal
no
  bind signal_attacked to default handler
  call default handler with prio XXX

exit
*** modified ***

[ external image ]
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

but the mk3 script cant do that.

if the script checks if it's running it always gets "yes" as a result ... ;)

Return to “X³: Reunion - Scripts and Modding”