Escort Contracts added imagery & F4 screen

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Escort Contracts added imagery & F4 screen

Post 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
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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.
Last edited by Keeper on Wed Mar 06, 2013 7:01 am, edited 1 time in total.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Escort Contracts added imagery & F4 screen

Post 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.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Escort Contracts added imagery & F4 screen

Post by cim »

Keeper wrote:
What of the economy symbols, then?
Also available at positions 16..23 (see Textures/oolite-font.png)
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Escort Contracts added imagery & F4 screen

Post 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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
ZygoUgo
---- E L I T E ----
---- E L I T E ----
Posts: 406
Joined: Mon Nov 17, 2008 4:15 pm
Location: Blighty

Re: Escort Contracts added imagery & F4 screen

Post 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.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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?
Last edited by Keeper on Wed Mar 06, 2013 7:02 am, edited 2 times in total.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Escort Contracts added imagery & F4 screen

Post 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)
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Escort Contracts added imagery & F4 screen

Post by Wildeblood »

Keeper wrote:
My guess is that "infoForSystem" does not support "techLevel".
Look closely:
http://wiki.alioth.net/index.php/Planet ... Tech_Level
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Escort Contracts added imagery & F4 screen

Post 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
User avatar
Ranthe
---- E L I T E ----
---- E L I T E ----
Posts: 330
Joined: Sat Oct 13, 2012 7:35 pm
Location: Paraparaumu, New Zealand (TL 8, Rich Agricultural, Multi-Government)

Re: Escort Contracts added imagery & F4 screen

Post by Ranthe »

Keeper wrote:
Here is how the chart view looks now, on the second available contract:
Image
Oooh, nice!

<downloads immediately>
Commander Ranthe: Flying the Anaconda-class transport Atomic Annie through Galaxy 2.
Combat Ranking: Dangerous
"Big ships take more booty on your interstellar flights..."
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Re: Escort Contracts added imagery & F4 screen

Post by pagroove »

Downloaded 8)
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
Post Reply