[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

WBKingpin1
Posts: 9
Joined: Tue, 3. Jan 06, 09:38
x3tc

Post by WBKingpin1 »

gnasirator wrote:
erm yes just looked into it.

as far as I can tell EVERY ship having at least one 25MJ, fight software mk1 & 2 and is not the playership is able to do sector and universe trading.


Yes that is true

However the commands for ST and UT will not show up in trade menu for M6 and other non vanilla classes of ST and UT ships ect.
Unless the script "setup.plugin.autotrade" is changed to have them setup as set classes of UT or ST ship so it appears in their respective trade menu

Unless this has already been changed with the updates that gnasirator has kindly done to make this script better


Edit: Ok thanks seen it has been sorted. :)
Last edited by WBKingpin1 on Wed, 6. Sep 06, 12:25, edited 1 time in total.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

@apricotslice: yepp those were my thoughts, too.

but all those big ships can't dock at factories. and trading from equipment dock to equipment dock is forbidden in mk3 as it's no use (no profit!).

And TS ships un-/loading the big ships automatically are way too complex for my taste. ain't no use anyway because after the first ship bought ware from factory the sell price increases .....

@WBKingpin1:

yep I've just found what you mean. Changed it so that all ships up to m6 can use mk3. okay m4/m5 cannot UT as they don't get enough shield strength.
jlehtone
Posts: 22506
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

[OT]Hmmm, a person able to 'optimize' a part of the "standard" game, and yet interact with the end-users ... Design decisions, balance, NDA, ... [/OT]


Fighters are not likely to ever have enough fuel onboard, so they will end up flying the hard way. Teladi Falcon Hauler can haul any weapon, and every one of them in amounts sellable to EQdocks. But will run short on fuel sooner or later. So they may work as UT's somewhat, but the risks are higher. That seems balanced.

M6. Faster. Stronger. Moderate cargo bay and XL capasity. They can now dock everywhere, and their other use is limited (the darn Elephant). So they seem obvious UT ships. That seems balanced too.
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

totally agreed.

but the cargo space really is not that huge .... I'll stay with my ''Split Kaiman" :)

edit:
can someone explain to me how to use 2d arrays best? mine just spits out crap².

would be really nice if someone could look into my stats script and tell me what's wrong in there ...

the first half of it runs fine but from line 45 on it's bugged. Some of the commands used are wrong, I know. But I already tried all other possibilities I could think of.
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

first thing I noticed is the way you check an array is empty. X3's going to be throwing exceptions left right and center the way you're doing it.
If the size of the array = 0 then it's empty.

secondly, you could improve the efficiency of the script by rolling the first two while loops into one,( O(n²) -> O(n) )

lastly, I'm guessing your 2d arrays aren't working because you haven't defined them as arrays yet. ($stats.new = array alloc: size=<Var/Number>)
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

good guess, but wrong guess :)

hm I should have sent out the first version I wrote. This one is not good because I already tried to get that running like crazy.

and I also tried some more inconventional ways .... ;)

okay, about the size:
everytime I've seen a new array with only 'null' inside the size check said '1' ... think because there was one field inside of the array which contained 'null'. so I checked that, too.

about the array:
I tried array alloc - but that command only allocates a 1d array. So I tried to fill this arrays' slots each with another array (of size 2) -> manually constructing a 2d array. didn't work.

then I tried to build a 2d array in any other way but they all finally weren't what I've been looking for -> Array = new Array[x][y]; ;)

about the first two while loops:
I'll try that as soon as that script gives out a correct value for gained.total!


The problems are:
1: that at the calculation label the stats.new array always contains the same data in every slot.
2: I'm trying to save the ship id and the ship's gained together in one slot of the stats.new array (think x3 has no problems with 2 different data types in one array). and as soon as I put that into the array the gained value goes up like crazy ( e.g. 788090020022 ) which is WAY too much for one trader - before putting the value into the stats.new array the gained value was correct.

but now .... *yaw* .... time to sleep. gute nacht!
jlehtone
Posts: 22506
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

gnasirator wrote:(think x3 has no problems with 2 different data types in one array)
In that case 1D array and calculation of indexes would work. But 'insert' and 'remove' would be more difficult too. Well, the change of the 'fixed' dimension would be a pain. The other dimension should be "easy".
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

gnasirator wrote: okay, about the size:
everytime I've seen a new array with only 'null' inside the size check said '1' ... think because there was one field inside of the array which contained 'null'. so I checked that, too.
OK, so that array isn't actually empty. It contains 1 element whose value happens to be null. What you're actually checking is whether the first element is null, not whether the array is empty. that's completely different.
about the array:
I tried array alloc - but that command only allocates a 1d array. So I tried to fill this arrays' slots each with another array (of size 2) -> manually constructing a 2d array. didn't work.

then I tried to build a 2d array in any other way but they all finally weren't what I've been looking for -> Array = new Array[x][y]; ;)
to use any arrays you need to define them first. A "2D" array is simply an array with 2 element both of which are arrays themselves.

for example

Code: Select all

001   $array =  array alloc: size=2
002   $array1 =  array alloc: size=2
003   $array2 =  array alloc: size=2
004   $array[0] = $array1
005   $array[1] = $array2

008   $array[0][0] = [ENVIRONMENT]
this code leaves us with the following:

Code: Select all

$array1 = [Environment], null
$array2 = null, null

I had a bit of a play with your script. my changes can be downloaded here.
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13485
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid »

Since the script testing tread is locked I post this here:



Oddity A:

My UT (lvl 25) jumped into Bala Gi's Joy to sell wares to the QT fab there. He was attacked, released drones and commenced trading.

#1 he should not have jumped there because Pirates is set to foes and BGJ is a Pirate sector.

#2 Although I've received an acoustic warning from Betty, not message was sent to the log.

#3 (related to #2) The UT should have done the emergency jump.


Oddity B:

I have a new ST running and he doesn't seem to level up. Sent him to various sectors. Finally I've sent him to HoL after placing an SPP and a Cattle Ranch there. I've placed 500 ecells and 100 xtals in his cargo bay.
He's still carrying all xtals although my SPP buys them for a good price. Moreover he keeps 60 ecells in his cargo bay although he's apprentice and sells load of ecells.

#1 He should not keep the ecells

#2 he should sell the xtals

3# He made at least 500K turnover but still is level 0

#4 When starting the ST no message is send to the log



Cheers Euclid
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

okay first of all:

thank you very much, moggy, I'll check that out.

I tried it first the way you described it. But it just didn't work properly so I slowly got away from the regular way of programming trying more exotic ways ... ;)

and yes, by that time I thought empty arrays would always contain 'null'. now I know better.

@euclid:
Phew ... well ... the situation is that I'm kind of desperate atm because now I've reached a point where I've changed and added so much to the script that I'm having headache all day. I'm sitting hier the whole day trying to get this thing running absolute correctly but the more I change the more crazy it goes.

So atm I'm not surprised that this happens ALTHOUGH I thought the last release was running correctly.

Well to make it short:
I think I'll totally rewrite most of the ut giving it a different structure with a lot more subroutines. I love subroutines because they come closest to methods used in java & co. and they give a very much better overview.

The problem is the rest ware selling. By adding that feature I've added some new loops I have to control and that is DAMN confusing.
But I want it. Let's see I won't start today, maybe not tomorrow but the weekend should work.


mmh I hate being a perfectionist ... :roll:
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13485
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid »

gnasirator wrote: ..........The problem is the rest ware selling. By adding that feature I've added some new loops I have to control and that is DAMN confusing.
But I want it. Let's see I won't start today, maybe not tomorrow but the weekend should work.......
You effort is much appreciated.

If you code it new some suggestions (pseudo code) concerning the enemy check:

#1 get array of sectors in range r (depends on the level) of UT

#2 if a sector is enemy to UT then delete sector from array

#3 if a sector contains ships which are enemy to UT then delete sector from array

#4 check array for best trade.....


Cheers Euclid
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

great idea.

I'll try to implement it that way!

-> Hotfix sector trader !!
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

push
-> just released all the small fixes and changes I made over the last weeks in order to tidy it all up

here's version 1.29.1

enjoy :)

btw: I've been convinced not to totally recode this stuff. too much work, would take too long.

so for now I only have to get the stats running properly and that would be it.
Graphil
Moderator (DevNet)
Moderator (DevNet)
Posts: 3931
Joined: Sun, 6. Jun 04, 11:59
x3tc

Post by Graphil »

A further suggestion for this script which it seems the community is crying out for. Have a setting to turn trading on and off with your HQ.
Graphil

There are two secrets to life: 1) Don't tell everything you know...
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator »

A further suggestion for this script which it seems the community is crying out for. Have a setting to turn trading on and off with your HQ.
-> done

have fun! 8)
MutantDwarf
Posts: 716
Joined: Tue, 20. Jun 06, 02:29
x4

Post by MutantDwarf »

Think you could make a version that allows large ships (TLs, etc.) to use the Transporter for purchasing/selling so as to allow them to become viable sector/universe traders of their own? I think it's about time they got some love;)
User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 »

Anyone interested in an spk for this?

One thing tho, since spks delete files upon uninstall, the only way to restore/uninstall is to install a "restore spk". That means releasing Egosoft material (the original pcks), which I believe isn't allowed?
User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 »

Would like to confirm tho, am I right to say that this improvement adds the following:

.: Adds plugin.autotrade.delivery.run.pck
.: Adds plugin.autotrade.restart.pck
.: Adds plugin.autotrade.signal.attacked.pck
.: Adds setup.plugin.autotrade.pck
.: Changes UT scripts to use 440003.xml (new) and 490003.xml (new)

Correct?
BlackRazor
Posts: 4708
Joined: Tue, 20. Apr 04, 17:39
x4

Post by BlackRazor »

arcana75 wrote:Anyone interested in an spk for this?

One thing tho, since spks delete files upon uninstall, the only way to restore/uninstall is to install a "restore spk". That means releasing Egosoft material (the original pcks), which I believe isn't allowed?
AFAIK if the installer detects that you overwriting an existing file it backups the original and restores it when uninstalling the spk, anyway check the last pages of the official Script Installer thread, it should be better explained there.
"For the love of the Fish-Queen!"
Neofit
Posts: 121
Joined: Sat, 14. Feb 04, 00:00
x4

Post by Neofit »

Hi,

There was talk in this thread about this script being able to generate statistics for the UTs. I was thinking about something like what was programmed into the Commercial Agents, the 0,0,0 command. I've checked the scripts this package comes with and there is no script with "stat" in the name. Installed, didn't find any command to generate stats. Spent 2 hours on SETA and did not see any logs generated either.

So, apparently it did not make it into this script? And if so, is there another script that could generate stats for the ST/UTs? I've tried searching but no matter what strings I use I am getting hundreds of pages, impossible to go through them all.

Thanks.

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