[SCRIPT] Trading Distribution Network V1.01 : Update 04/10/2006

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

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

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

New Update 1.01

Post by Cycrow »

Just a small update to change the return hom.

Diesel, i would suggest totally reseting the network and using the new version, kill all the global scripts to with plugin.tdn.*

then remove all ships and stations from the network.

then try it again and c if it works any better
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

Done as you said and it has stopped the global script problem but the other problem
The Caimen sat around doing nothing .
So i stuck 1 unit of space fuel in the LoH station to see if that made a difference, nope Caimen stationary.
So I jumped him to AP Station to see if that would kick start him. Now he is sat in the AP station going between Idle and None and strangely his E-cells are increasing even though the Stations don't stock them.
is still there, I even added another station to see if it would make a difference but no luck.

Could be another script interfering I guess.
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

Been looking at the Logic, returnhome etc scripts to see if I could sort it out and I have noticed that lib.cycrow.jumptomax does not exist in my scripts folder this could be why the ships won't move.
What do you reckon Bud :D
Don't suppose you have it kicking about do you :)
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

doh, i forgot to add it :oops:

that would certinaly explain y its working for me and not for u
try downloading it again and it should have the file in this time
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

Cheers it seems to be working now :D
Except they don't want to use their jumpdrives :(
Oh well you can't have everything :lol:
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

well, as long as the logic itself is working, getting them to use the jumpdrive is an easy fix.

althou, if theres alot of stock, the ship might fill its cargo hold with the stock and have no room for energy cells, so they cant jump, i havn't put a side some resevere space for energy cells yet.
User avatar
Lucike
Posts: 12969
Joined: Sun, 9. May 04, 21:26
x4

Post by Lucike »

Code: Select all

037 skip if [THIS] -> exists 
038 break
That is cool. :D

Run on object:

Code: Select all

034 while [ENVIRONMENT] != [HOMEBASE]
035 @ = [THIS] -> call script '!move.movetostation' : station=[HOMEBASE]
036 @ = wait 100 ms 
037 skip if [HOMEBASE] -> exists 
038 break 
039 end
or ...

Code: Select all

    while [THIS] -> is docked
     [THIS] -> set command: COMMAND_MOVE_SECTOR  target=null target2=null par1=null par2=null
  @  = [THIS] -> fly to sector [SECTOR]
  @  = wait randomly from 200 to 400 ms
    end

    $ShipTarget == [HOMEBASE] (or another Target)
    if $ShipTarget -> is docking possible of [THIS]
     if [THIS] -> is docking allowed at $ShipTarget
      while [ENVIRONMENT] != $ShipTarget
       if $ShipTarget == [HOMEBASE]
         [THIS] -> set command: COMMAND_RETURN_HOME  target=$ShipTarget target2=null par1=null par2=null
 @      = [THIS] -> fly to home base
       else
         [THIS] -> set command: COMMAND_DOCKAT  target=$ShipTarget target2=null par1=null par2=null
 @      = [THIS] -> fly to station $ShipTarget
       end
 @     = wait randomly from 200 to 400 ms
       skip if $ShipTarget -> exists 
        break 
      end
     end
    end
Image
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

LOL I actually understood most of that Lucike I've only been reading bits of scripts for a day or so.

Cycrow, the Logic is working ok apart from one little thing, I dumped some ecells, 1MJ sheilds and SpaceFuel into one Dock and let it do it's thing.
It called the ship ok split the products ok and sent it back to the other Dock :) (Although no jumping). When it got there however it only dropped the Ecells and Spacefuel and left the Sheilds in the cargo bay? (there was already 1 Sheild in there though and nothing else, so that may have messed something up)

I shouldn't have a problem with space for Ecells for Jumping I'm using a Caimen SF, so hopefully getting the jumping going shouldn't be hard.

I would test a bit more but it takes ages for the Caimen to get from AP to LoH. :wink:
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

well it should work fine with shields as well, as it keeps a record of everything it picks up and where to deliever them too, ill have to test that
User avatar
Lucike
Posts: 12969
Joined: Sun, 9. May 04, 21:26
x4

Post by Lucike »

I look into the script.

CLS pilots can also deliver any products to playerowned docks. What is the difference? The network?

When the dock is open for the races the CAG can sell all products.

OK, it's another way. ;)

Greets
Lucike
Image
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

well, the main difference is that it keeps all stock in the network belanced between all the stations, so it will try to keep the same number of wares in each station in the network.

it also means you can use 1 ship to supply all the wares in the whole network
russbo
Posts: 862
Joined: Sat, 12. Nov 05, 21:53
x4

Post by russbo »

Cycrow, another issue, which you helped me with (overspawning of ships) has introduced me to the Global Script area of the game. I had to kill over a hundred plugin.m7.spawnship tasks, from an XTM 5c mod installation.

But, during this very tedious process, I had to wade through maybe a few hundred tdn.returnhome tasks.

Now, I tried the tradiing network script back when it first came out, and I removed it, all related ships and stations, back when I first noticed "slow down" issues (eventually discovered to be from old XTM install). But, I still have a little game stutter, and now I'm wondering if the few hundred or so of these "tdn" global tasks are slowing my game down. Deleting them one by one is going to be impossible; it will take days.

What do you suggest? These tasks are locked into my saved games. Any script I can run to end all of these tasks that this script started?

Thanks!

PS: Please keep the xplanation simple. I have no where near the game mechanics understanding that the rest of you guys have.
Last edited by russbo on Thu, 5. Oct 06, 04:22, edited 1 time in total.
Saint-Ashley
Posts: 1267
Joined: Sat, 3. Dec 05, 03:40
x4

Post by Saint-Ashley »

Im afraid the only thing you can do is KILL them the old fasioned way that you alerdy know how...

All those scripts are cached into your save games alerdy, AFAIK their is no way just to end them easily.
russbo
Posts: 862
Joined: Sat, 12. Nov 05, 21:53
x4

Post by russbo »

Yea, that's what I was afraid of. But, I figured if Cycrow knew how to write scripts that added global tasks, maybe he'd know how to kill them?

My girlffriend is not going to understand my sitting in front of the computer all day again, LOL.

Oh, and while we're playing in the Global Scripts, anyone know why I have about fifty plugin.advthrust.keepstock. and plugin.advjump.keepstock tasks going? Do I need fifty or so of each, or does just one of each suffice? If you haven't figured this out yet, my Global Scripts area is pretty big.
russbo
Posts: 862
Joined: Sat, 12. Nov 05, 21:53
x4

Post by russbo »

I'm going to have to suggest that this script might be referenced as a beta, until the global task issue is officially taken care of. It has caused me a lot of unnecessary headaches, and a tremendous waste of hours over the past two days. Not typical for the usual Cycrow wizardry.

Initially, I thought my game slowdown was due to older XTM mod scripts causing spawning issues in my game. After going through two days of dealing with that, I now discover that that was not the issue. The slowdown has been due to the Trading Networks' initial plugins. I literally have HUNDREDS of plugin.tdn.returnhome tasks running in my global scripts I have spent hours killing these, (my mouse is maneuvering better), but I still have quite a while to go before all of these tasks are gone.

An excellent concept, as usual by Cycrow. I hope the future issues of this do not cause this problem. I can't tell you how aggravating it is to kill hundreds of tasks in the global script area, using a mouse that jitters across the screen.

EDIT: I'm done. I think, quite literally, there were well over five to seven hundred of these tasks running. Got them all; killed quite a few other nonrelated tasks in the process. Not sure what's going to happen to my game, but, I am amazed at how smooth the mouse moves now. Those tasks must have used a lot of processor power.

Looking forward to a version that doesn't do this.
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

Cycrow has already sorted it in V1.01 russbo, no more global tdn.returnhome :wink:
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

i anwsered the question about the keepstock script in the advanced jumpdrive thread, but they rn't needed, you can remove them and make sure you have the latest versions of the scripts, download them again if your unsure.

as for removing them from global task, its easy to put them on, but unfortually impossible to remove by scripts.

but make sure u have 1.01 of the script, it should have fixed the returnhome problem
jlehtone
Posts: 22550
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

Interesting approach. Not the "push where the demand is", nor "push in one direction anyway".

Other scripts could do the input and output, but co-operation of distributors and salesmen could be smart. And smart buyers. Normal ship can only buy 2 gPPC, because a station can only hold to. Forge may have at least 8. And the network can hold that many (if it has at least four Docks).

How does it compute the average when a whopping 2 gPPC drops into the basket of five stations? :wink:
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

in that casse, it'll move 1 uni to another station that doesn't have any

so u'll have 2 stations with 1 unit each in
Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 »

Still trying to work out why the ships don't jump, the only time they use the jumpdrive is when you add a ship.
I guess this narrows it down to the lib.jumptomax because everything else uses it except the add ship script.
I did notice you used !move.jumptosector instead of !move.jumptostation but I guess thats because it makes the rest easier. For some reason mine misses the jumpto statement and uses moveto instead?

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