Page 2 of 3

Re: Escort Contracts added imagery & F4 screen

Posted: Sun Mar 03, 2013 10:08 pm
by cim
Keeper wrote:
or at least make them behave like the "View Chart" but without the "press F6 to return"
Since you're already using 1.77-only things, you could use backgroundSpecial: "SHORT_RANGE_CHART" here
Image

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 2:21 am
by Keeper
Oh, that's cool... I can't seem to figure out how to get it to go back to the contract offer screen after viewing the chart yet, though.

Edit 1: Ooh wait, now I'm getting somewhere...!

Edit 2: OK, now it would be nice if I could find how to put the government type symbols in text. I've seen it done somewhere but I can't recall where.

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 5:53 am
by Keeper
OK, I worked on this all day (and now all night -- over 12 hours!) and it's much nicer now. And nicer still in a later post...

I've made it so you can leave the noticeboard without the contract offers going away (though they do go on a timer and eventually will disappear, usually after a few hours). Therefore I've removed the initial mission screen altogether as it became unnecessary extra step. The Interfaces screen menu entry now tells you how many offers are available.

So now, the offers you get are the only offers you're going to get for as long as you remain docked. (Unfortunately the ability to generate new offers when the timer expires is something I couldn't get to work right, but it took a lot of buying/selling ship upgrades before the offers actually expired, so it's not a big deal.) No longer can you select, deselect, re-select to get more offers to show up.

The "View Short Range Chart" option (renamed "Toggle chart") now simply displays an overlay of the chart (thanks for the heads-up, cim!), with the options to accept, leave or view other offers still visible, and with the key details of the offer shown at the top of the screen. This is a big improvement, as now you don't have to memorize what the details were.

All the menu selection positions are maintained. For example, when you view the next contract, the menu option will stay on "View next contract". Also the "Agree" option is never pre-selected, so you can't accept a contract by mistake. (When you go to view another contract, it always will show the full-detail page even when you've previously toggled the chart on -- I suppose I could, if the demand is there, work out the extra code needed to keep the chart-on toggle active between contract views.)

Because removing the unnecessary initial screen meant one of ZygoUgo's new background images would be unused, I changed things around so that that image now appears when you accept a contract. It looks good.

The NewReadMe is updated to reflect this new version, also.

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 7:47 am
by cim
Keeper wrote:
Edit 2: OK, now it would be nice if I could find how to put the government type symbols in text. I've seen it done somewhere but I can't recall where.
The built-in transport contracts do it. The government symbols are characters 0..7 in the Oolite font, so you can do String.fromCharCode(govNumber) to add them to a string.

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 8:07 am
by Keeper
cim wrote:
The government symbols are characters 0..7 in the Oolite font, so you can do String.fromCharCode(govNumber) to add them to a string.
What of the economy symbols, then? I thought it might be nice to put what the destination (maybe current too) planet's government/economy (and tech level?) is when on the chart screen, since the "i" button doesn't work when using backgroundSpecial. That way you can factor what you might be hauling yourself into your decision of which contract to accept.

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 8:46 am
by cim
Keeper wrote:
What of the economy symbols, then?
Also available at positions 16..23 (see Textures/oolite-font.png)

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 10:13 am
by Diziet Sma
Keeper wrote:
Diziet Sma wrote:
It will make a nice change in my Ooniverse to run across some GPBs that aren't being flown by pirates! :lol:
They're out there. There are four types of GPB by default -- one for each set of four decals. The first set's role is strictly as a pirate. The next two are trader or pirate, and the fourth is trader only.
Yes, I am aware of that.. :wink:
I just seem to run into an awful lot more of the pirates than the traders.. might just be something to do with my chosen profession of bounty-hunter, though.. :lol: Escorting is just a sideline business for me whilst hunting down RH marks.

Re: Escort Contracts added imagery & F4 screen

Posted: Mon Mar 04, 2013 1:30 pm
by ZygoUgo
Impressive... :D
Never mind the art work, you do whatever improves the functionality and I'll do new backgrounds wherever it needs it, so I'll wait till you're happy first. I'll replace that image for your new screen interacting with the HUD better :)
What I might do is try and add a random factor to select from different backgrounds for variation, so the screen you have there could re-appear elsewhere me thinks.

Re: Escort Contracts added imagery & F4 screen

Posted: Tue Mar 05, 2013 8:44 am
by Keeper
I've got it now correctly displaying the symbol for the current and destination systems' government and economy on the chart screen, but for the life of me I can't get it to display the destination system's tech level, even using exactly the same procedure as used to display the government and economy.

For example, the lines of code used (cutting out bits unrelated to these two functions and condensing to fewer lines for the board's sake):

Problem has been solved now so the code snippets have been removed for the sake of post size.

Writing it out long like that instead of just trying to display the value+1 (to account for zero) outright is because it didn't work that way, so I tried it in a "tried and true" way (economy had to be written long like that because the numerical value and text value go in opposite directions, so you can't just print the value+16, unfortunately). But even the "tried and true" method didn't work for the techLevel. The plist entry is valid because I can set missionVariables.ec_targettech=11 explicitly and it will display 11.

I'm stumped. I'm no programmer, as I said, so I must be missing something... usually I can figure it out but I don't know what else to try now. My guess is that "infoForSystem" does not support "techLevel". But is there another way to print the tech level of a planet besides the one you're in?

Re: Escort Contracts added imagery & F4 screen

Posted: Tue Mar 05, 2013 8:52 am
by cim
Keeper wrote:
System.infoForSystem(thisGalaxy, this.ec_targetsystems[counter]).techLevel
Try .techlevel for this, and then just +1 for display will work fine. SystemInfo properties are named exactly after the corresponding planetinfo.plist property, and the plist properties are all lower-case.
Keeper wrote:
(economy had to be written long like that because the numerical value and text value go in opposite directions, so you can't just print the value+16, unfortunately).
Try String.fromCharCode(23-economy)

Re: Escort Contracts added imagery & F4 screen

Posted: Tue Mar 05, 2013 9:01 am
by Wildeblood
Keeper wrote:
My guess is that "infoForSystem" does not support "techLevel".
Look closely:
http://wiki.alioth.net/index.php/Planet ... Tech_Level

Re: Escort Contracts added imagery & F4 screen

Posted: Tue Mar 05, 2013 9:05 am
by Keeper
cim wrote:
Try .techlevel for this, and then just +1 for display will work fine. SystemInfo properties are named exactly after the corresponding planetinfo.plist property, and the plist properties are all lower-case.
Ah hah! And here I was being all careful to match the upper/lower case with what I see on the Oolite Javascript wiki...! Yes, it works now.
Try String.fromCharCode(23-economy)
But that's... but that's... but that's... ... ... I hate math.

All right, I'll clean it up and lean it out tomorrow. Then upload an update. (Or maybe I will try that persistent-chart-toggle first...) I'm an hour late for bed tonight.

Thanks! I was tearing my hair out with that one.

Re: Escort Contracts added imagery & F4 screen

Posted: Wed Mar 06, 2013 7:11 am
by Keeper
Finished! Pretty darn sure about it, as I've done everything I wanted to do and more.

http://www.keeper1st.com/pics/oolite/Es ... 1.5.6e.zip

Since the last update:
  • Added the economy, government and tech level to the current and destination systems on the chart view.
    Made the "chart toggle" persistent, so you can keep it in chart view as you look through different contracts.
    Created three different Success screens, so it won't mention getting a bonus if you made no kills, and will use the singular of "kill" if you made just one kill.
    Some text changes, e.g. the top title text now mentions the trader name and the contract offer number (when there's more than one), and as this meant the word "Noticeboard" was no longer in use, the exit option on the menu has changed to "Decline contract" or "Decline all contracts".
Here is how the chart view looks now, on the second available contract:
Image

Re: Escort Contracts added imagery & F4 screen

Posted: Wed Mar 06, 2013 8:44 am
by Ranthe
Keeper wrote:
Here is how the chart view looks now, on the second available contract:
Image
Oooh, nice!

<downloads immediately>

Re: Escort Contracts added imagery & F4 screen

Posted: Wed Mar 06, 2013 9:10 pm
by pagroove
Downloaded 8)