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

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

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

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

Post by Cycrow » Mon, 2. Oct 06, 12:16

they will jump between stations if there is enough energy cells, and they have enough room to store the energy cells after they pick up the wares.

the main problem with using makos is thier limited cargo space

Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 » Wed, 4. Oct 06, 15:38

Cycrow I have been trying to work out whats going on which isn't easy when you know nothing about scripting :o . Anyway I checked the debug screen in the script editor and the ship seems to be stuck here :-
026 [THIS] -> set local variable: name='plugin.tdn.status' value='dock'
027
028 $homebase = [THIS] -> get homebase
029 if [THIS] -> get amount of ware Jumpdrive in cargo bay
030 @ = [THIS] -> call script 'lib.cycrow.jumptomax' : Station or sector=$homebase
031 else
032 [THIS] -> set destination to $homebase
033 [THIS] -> set command: COMMAND_DOCKAT
034 while not [THIS] -> is docked
035 @ = [THIS] -> call script '!move.movetostation' : station=$homebase
036 @ = wait 100 ms
037 end
Line 034 - 036 in an endless Loop.
Thats from plugin.tdn.returnhome. The code in !move.movetostation that the debug shows is:-
001 skip if $targetstation -> exists
002 return null
I haven't worked out why yet but thats not suprising as I have only read a couple of newbie guides.
I'm sure you will have more luck.
Cheers

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

Post by Cycrow » Wed, 4. Oct 06, 16:13

well, a simple check to c if the homebase exists should work, althou it should exist anyways

but it might be worth a try

Code: Select all

while not [THIS] -> is docked
... (move to station
....(wait)
skip if [THIS] -> exists
  break
ship if $homebase -> exists
  break
end
ill add it in the next version, but u can add it the to current version and c if it fixes it.

also, is the return home script actually running in the global scripts ?

Diesel309
Posts: 704
Joined: Sun, 11. Apr 04, 14:37
x3

Post by Diesel309 » Wed, 4. Oct 06, 17:46

Right gave it a try returnhome now reads:
034 while not [THIS] -> is docked
035 @ = [THIS] -> call script '!move.movetostation' : station=$homebase
036 @ = wait 100 ms
037 skip if [THIS] -> exists
038 break
039 skip if $homebase -> exists
040 break
041 end
But still getting the same result

The return home script is running multiple times in global scripts, at least a few pages full, this may have something to do with it.

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

Post by Cycrow » Wed, 4. Oct 06, 18:05

yeah that sounds like a problem, they should be running on the ships themselves, not as globals, i will look into it

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

New Update 1.01

Post by Cycrow » Wed, 4. Oct 06, 18:21

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 » Wed, 4. Oct 06, 19:30

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 » Wed, 4. Oct 06, 20:45

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: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 4. Oct 06, 20:57

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 » Wed, 4. Oct 06, 21:43

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: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 4. Oct 06, 22:00

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 » Wed, 4. Oct 06, 23:19

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 » Thu, 5. Oct 06, 00:06

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: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 5. Oct 06, 00:42

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 » Thu, 5. Oct 06, 01:08

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: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 5. Oct 06, 03:10

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 » Thu, 5. Oct 06, 04:08

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 » Thu, 5. Oct 06, 04:15

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 » Thu, 5. Oct 06, 04:28

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 » Thu, 5. Oct 06, 09:32

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.

Post Reply

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