Utility Script: Ship Predictor

« Back to Developers

2524 days, 5 hours, 42 minutes ago
View lord helmet's profile
lord helmet
Utility Script: Ship PredictorWrite Reply

This userscript shows the change in ship state (cargo, fuel, damage, crew etc) for the next turn according to its mission, waypoint, friendlycode, special abilities and so on.

Note that no prediction concerning enemy (or allied!) ships are included, like transfers (including btm, btf, btt, bum etc), rob fuel, etc.

features included (in host order)
* build fighters
* lady royale
* borg repair
* FC bdm
* planet FC bum
* gather missions
* alchemy
* refinery (Neutronic Refinery Ship, Aries)
* lay mines
* scoop mines
* starbase fix ship
* repair with supplies
* mkt
* movement (disabled for bugfix)
* ramscoop (cobol) (disabled for bug fix)
* radiation (stellar cartography)
* glory device (own ships only)
* another repair with supplies (after glory device)

2do:
* jettison
* starbase unload all freighters
* starbase load torps
* prediction of other ships when they influence each other (like with gather missions)
* prediction of tow break

Changes are displayed as small numbers next to the real value.
Since I was altering the shipscreen already, I added a display of towing ships. The tower gets a border with a solid line, the towee has a dashed line in the same color.
The functions can be disabled in the settings section of the dashboard.

This is a prediction only, certain special circumstances might change the outcome, so don't rely on it too much - especially the fuel prediction (currently disabled)

http://userscripts.org/scripts/show/146137

As always I'd be glad about feedback, bugreports, missing features and so on.
2524 days, 1 hours, 2 minutes ago
View mycroft's profile
mycroft
RE: Utility Script: Ship PredictorWrite Reply
Just a quick peek so far, but its looking really helpful!
2523 days, 17 hours, 23 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
Nice! And fits nicely into the interface. I like how the fuel usage factors in weight changes from beam up missions. A couple things I noticed, both fuel related:
- the change in fuel doesn't seem to reflect burning fuel to cloak, if the ship isn't moving. Seems ok if it is.
- in one instance, the change in fuel from the script was 1 more than the "Fuel Needed" on the interface. The ship is using "mkt" this turn. I don't know which is right, it may very well be the script, but thought I'd mention it. I can get you more details if you need.

Overall very cool though, and haven't even had occasion to see most of the features in action. Oh one more thing I just noticed. The "Total Mass" field doesn't show any changes, but I'm not sure what anyone uses that for anyways.
2522 days, 19 hours, 19 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Thanks for the feedback. I added the cloaking fuel and some valid fuel prediction. Unfortunately there was a little bug in the last changes, but I'm too tired to find it, so I deactivated the fuel change display.
The total mass is relevant for towing ships. It should change to the mass of the ship (and its towee if there is one) with the correct mass for movement. (I say it should, because I didn't test it.)
I also added actions of allied ships if the information sharing script is enabled - might be relevant for some things, mine laying for instance.

2521 days, 2 hours, 22 minutes ago
View tom n's profile
tom n
RE: Utility Script: Ship PredictorWrite Reply
Thanks, but have a question. I'm using Google Chrome and have added about 10 useful add-on's with no problem, but now I'm getting an error message stating that the script can only be added from the "Chrome Web Store". Any way around Chrome's 'control'?
2521 days, 2 hours, 11 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
This was a change in chrome, perhaps you've updated your chrome version since adding the other scripts?

Regardless, it's still possible to install userscripts that are not from the web store, but you have to do a little more work. This link has a few ways to do it:

http://userscripts.org/topics/113176?page=1#posts-455149
2515 days, 8 hours, 21 minutes ago
View vepr's profile
vepr
RE: Utility Script: Ship PredictorWrite Reply
Hey Beefer.

love the script overall, just one question.  some of the ships end up with no ability to change anything about it, like mission, fcode, etc..  and those ships have a solid border around it.  any idea what's going on?
2515 days, 8 hours, 0 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Ships with a solid border around it are towing ships (unless it's a red border which means there's a towing conflict).
What do you mean by "no ability to change"? Are the buttons gone (that would mean there's a bug in the script) or is there just no reaction to a click on a button? The latter sounds like the script, that locks the screen when the ready check box is hit:
http://planets.nu/discussion/utility-script-lock-ships-when-marked-ready


2514 days, 20 hours, 45 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Just uploaded a new version that has the i-dots and t-crosses for fuel calculation and next turn location.
I included the chunnelling for the Cyborg campaign ships, but I didn't test it yet, so report any problems.
2514 days, 19 hours, 0 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
Awesome script. To be honest, didn't think I would find it as useful as I have. Seeing how much fuel I'm going to use including things I'm beaming up has saved me a couple of mistakes already. Seeing the results of "mkt" also good. I know several times in the past I've picked up supplies instead of cash to make torps, and this would help me spot that for sure.

One thing I noticed. When I move cargo between a ship and planet (and maybe do other things, didn't really try), I noticed a green spot show up on the map, I think to represent the next turn location? But it doesn't seem to be there when I first load a ship, should it be? Also, I kind of prefer the yellow next location circle personally, so if there could be an option to use that instead...
2514 days, 15 hours, 19 minutes ago
View spiper's profile
spiper
RE: Utility Script: Ship PredictorWrite Reply
Works for new borg ships.  btw, you can chunnel to a B200 that has hyperJumped.

Stephen

2514 days, 6 hours, 9 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Thanks for the B200 info, I will add this soon; for now the Probe has to be stationary, as any other Chunnel Target.
2514 days, 3 hours, 23 minutes ago
View vepr's profile
vepr
RE: Utility Script: Ship PredictorWrite Reply
hey lord helmet.

To clarify the issue.  The towing ship gets a solid border but looses all ability to change anything about the ship.  those buttons are simply not there.  The towed ship can still be changed, i.e. mission changes, fcodes, transfers, etc.  This issue is only with towing ships. i can still tell them to go somewhere but i can not change their warp speed for examply.  the button is simply not there.  i also can not release the tow lock.

i am not running the scrip that locks ships when the check box is clicked.

any idea what could be causing this?
2514 days, 1 hours, 22 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Okay, that helped identifying the issue. The problem lies inside the script (unless you've got other scripts active that interferes with this one).
There's definitely something wrong with the mass calculation when towing ships, this is one possible cause..
I couldn't reproduce your error, so I might need additional info (screenshot would be helpful):
Are there enemy ships at the same position (maybe the towed ship)?
Can you see the "Cargo" bar of the towing ship?
Do hotkeys work? (like 'm' for mission or 'f' for friendly code)


@Beefer:
you're right, the green circle is the next turn position. It turns red when running out of fuel or when trying to move without actually moving. I had it there for testing first, but it stayed in. In most cases it will be at the same position as the one of your movement indicator, so they are drawn on top of one another. That's why you can see it sometimes and sometimes not. Also, because it is a fragment, there are multiple circles sometimes...

Edit: uploaded Version 0.8 that fixed some towing problems (I hope ;)) keep those bug reports coming.
2509 days, 23 hours, 58 minutes ago
View mycroft's profile
mycroft
RE: Utility Script: Ship PredictorWrite Reply
I think I've hit a possible bug? But it could also be a script clash.

Upon disabling this script I was able to stop the bug from occuring. The bug being, that upon opening any ship display. Only the ship picture down to Armaments/Crew/Damage is viewable. Everything else shows as blank.

I can still order the ship as normal but everything else is white screen. So I cannot view cargo, speed, fuel usage, mission, FC, PE, Jettison, and any other function in that general area of the screen. I can still transfer planet to ship as normal and use that to view and manage payloads/cargo. And all other aspects of the game function normally (Planets/Starbases).

I am currently using 0.2 version of this script.

I have active:

Planets.nu ally information sharing 0.9
Planets.nu cloning preview 0.1
Planets.nu extended shiplist 0.10
Planets.nu Game Data Alliance Addon 0.6
Planets.nu improved hover text 0.11
Planets.nu improved movement indicators 0.5
Planets.nu map drawing 0.11
Planets.nu message links add-on 0.5
Planets.nu minefield preview enhancement 0.6
Planets.nu ship predictor 0.2 (Disabled due to stated issue)
Planets.nu show mine hits 0.2
Planets.nu show player slot for PE 0.1
Planets.nu super filter 0.1
Planets.nu Tax Assistant 0.5

~Edit~

I would also like to note, that it is only effecting one of my games. Not the others. Which is kind of weird. After the turn passes I will enable the script again and see if solar winds are effecting my command quarters.
2509 days, 22 hours, 59 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
This script is on version 0.8, so I'd update and see if it works, I know he's made quite a few fixes. Also, on a side note, you can disable the show player slot for PE script. It's including in the .nu code now.
2509 days, 22 hours, 25 minutes ago
View mycroft's profile
mycroft
RE: Utility Script: Ship PredictorWrite Reply
I updated to version 0.8 and the problem is now consistent with all games (When enabled).

I have gone through all other scripts I use and have updated them to their latest versions. I could I guess go through one by one and begin the process of elimination as to what script is messing with what script.
2509 days, 22 hours, 8 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Okay, I had hoped updating to 0.8 would fix your issue. But looks like I'll have to dive into that more deeply. Which is hard, because it seems to be working just fine for me...
2509 days, 22 hours, 2 minutes ago
View mycroft's profile
mycroft
RE: Utility Script: Ship PredictorWrite Reply
I'm pretty sure it's a script clash. Give me a couple days to weed out which script it is and I'll upload some pics to show examples also.
2509 days, 19 hours, 46 minutes ago
View red megaman's profile
red megaman
RE: Utility Script: Ship PredictorWrite Reply
I got the same behaviour as Mycroft, only it started with version 0.8 and only affects towing ships.  The previous version worked just fine for me.

RM
2509 days, 19 hours, 20 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Oh yes, version 0.8 tried to be very smart and fix the very rare occasion that two ships tow one another. It did that very good, but would crash the screen in all other cases. Sorry for the inconvenience...

By the way, I found out that beefer's "improved movement indicators" overwrites a function needed for this script. So the ship predictor needs to be loaded after that (at least in greasemonkey the order of execution can be changed).
2509 days, 0 hours, 30 minutes ago
View red megaman's profile
red megaman
RE: Utility Script: Ship PredictorWrite Reply
Great!  I have reinstalled it and have no problems with towing ships.

I noticed a minor detail.  An NRS making fuel doesn't show any change in the fuel tank, but minerals and supplies show the expected change.

RM
2507 days, 18 hours, 37 minutes ago
View mycroft's profile
mycroft
RE: Utility Script: Ship PredictorWrite Reply
I run chrome so all extensions are ran differently I think. Do you have any suggestions on how I can rearrange load order?
2507 days, 18 hours, 10 minutes ago
View spiper's profile
spiper
RE: Utility Script: Ship PredictorWrite Reply
You can put all the extensions in a folder.  Then add a manifest file which lists the extensions in order.  Then in chrome Settings:Extensions turn on developer mode.  Then load unpacked extension which will be the folder containing the extensions and manifest.  Then reload planets.nu page.

sample manifest file:

manifest.json
2409 days, 11 hours, 26 minutes ago
View darth balls's profile
darth balls
RE: Utility Script: Ship PredictorWrite Reply
I would have a hard time playing this game without this script-- it makes things so much easier.  First time I've played in awhile as the Privateers, but is there any way that it can predict "Next turn" location for ships with gravitonic accelerators?  For these ships it still states next turn location as if they only moved the regular distance.

Thanks,
DB



2409 days, 10 hours, 14 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
Good point, I totally forgot about gravitronics! I'll fit it in as soon as I get to it.
And what I'm missing in my Fed game is Super Refit, but let's see how that can be displayed correctly.
By the way, some things have been added to the standard gui on play.planets.nu, like beaming up and down, mkt, lfm, alchemy/refinery and so on. http://planets.nu/documentation/release-notes
More suggestions are welcome.
2394 days, 18 hours, 53 minutes ago
View eeon's profile
eeon
RE: Utility Script: Ship PredictorWrite Reply
Lord helmet thx for this script, ill be definately using it. thanks again.
2271 days, 22 hours, 12 minutes ago
View tom n's profile
tom n
RE: Utility Script: Ship PredictorWrite Reply
Hi Lord Helmet, I love the script, but as of today it's unusable for some reason. I use Chrome on Windows 7. I'm playing on the old site (until the new one gets better) and had to disable the Mod or when I select a ship from the dashboard list i now longer get centered on that ship. Furthermore, the ship's mission and cargo are missing. 
2175 days, 1 hours, 40 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
Helmet, any chance of getting the who-is-towing-who indicators rolled into a script for the new version? I know most of the code here was already put into the main .nu code, but this is a feature that apparently wasn't, and it's too useful to play without. I tried switching to the new version recently, but when I got to a big fleet where everybody was towing something or another... I just gave up trying to figure it out and went back to the old version so this script would tell me.
2175 days, 1 hours, 1 minutes ago
Profile Image
furey
RE: Utility Script: Ship PredictorWrite Reply
OK wierd. I was trying to reply to @Ryder Cross regarding his question re:

http://planets.nu/discussion/utility-script-planetary-management-plugin

But it firstly linked to the wrong place, and secondly, posted it in this thread?? Odd.
2174 days, 10 hours, 35 minutes ago
View lord helmet's profile
lord helmet
RE: Utility Script: Ship PredictorWrite Reply
@Big+Beefer I already looked into it, but it looks difficult. I'd prefer not to overwrite all of the "official" code. I also want to included fuel calculation and next turn position, but this needs to be injected somwhere in the middle of the current code.
But I'm on it. Nice to hear someone is using it, keeps motivation high ;)

(end content)

@Joshua Something seems to be corrupted with this thread.
2174 days, 10 hours, 31 minutes ago
View darth balls's profile
darth balls
RE: Utility Script: Ship PredictorWrite Reply
Now that Draw is up-to-date, I will switch to the new client as soon as Ship Predictor is complete. :) Keep up the great development, guys! I wish I could be more helpful.

DB
2174 days, 3 hours, 6 minutes ago
View big beefer's profile
big beefer
RE: Utility Script: Ship PredictorWrite Reply
I actually have a little script that at least does the who's towing tow part I'm planning to put out today. Interestingly, Joshua has an almost working version in the code, but doesn't actually use it (search for showFleetTowing).

Also, one note on fuel use and towing that I noticed. Sometimes your fuel use estimate would be one less than the .nu UI estimate, when towing another ship. I started putting notes on my ships to check which was "right" and I think it is .nu. I believe your code is based on donovan's, where the towee's mass is trunc'd before being added to the towers, but I don't think. nu does it that way. Another of the small differences from old vgap.