Binding keys to new commands

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

Moderators: winston, another_commander

Post Reply
bjasspa
Average
Average
Posts: 8
Joined: Wed Dec 29, 2010 2:06 pm

Binding keys to new commands

Post by bjasspa »

Apologies in advance, I'm new to Oolite and I'm hoping the problem is my ignorance!

I'm trying to create a 'fast forward' button which makes time go ten times faster; I want this because at the start fighting is not wise and trading is quite slow waiting for other ships to get out of the way so that I can use 'j' (or am I missing something?). So hunting around I've found the timeAccelerationFactor which is just what I need, I have written the following script to test it:

this.compassTargetChanged = function(whom, mode)
{
if(mode == "COMPASS_MODE_PLANET") timeAccelerationFactor = 1.0;
if(mode == "COMPASS_MODE_BEACONS") timeAccelerationFactor = 10.0;
}

This makes time go 10x faster when I change the compass mode to a beacon and it slows down again when changed to the planet. But this messes around with the compass which I don't want (and I haven't got an advanced compass at the start :-).

What I really want is to create a new key binding which toggles the state, i.e. bound to the key 'o' say. Can this be done? I can't find anything in the docs on how to create a new 'key_<my_command>' which can them be used in the keyconfig.plist file. Is it me being dumb?

Thanks for a great game - really brought be memories which I had long thought lost and I hope many new ones to come!
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Binding keys to new commands

Post by Eric Walch »

bjasspa wrote:
What I really want is to create a new key binding which toggles the state, i.e. bound to the key 'o' say. Can this be done? I can't find anything in the docs on how to create a new 'key_<my_command>' which can them be used in the keyconfig.plist file. Is it me being dumb?
Not dumb, just a way ahead of the rest of us. Wait until 1.75 gets released. Than this will be possible. I assume that a lot of oxps will start using this feature, so you really must decide which one to add or you will drown in all that new equipment.

For now a warm welcome at this side of the galaxy and fly at a slow pace until the next Oolite will see daylight.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

Hi and welcome to the friendliest board this side of Riedquat.
There may be a few problems doing what you are doing, partly because there are several types of Beacon. There is one at the witchpoint, one at the station and often one at a Rock hermit as well. Also, many OXPs have unique beacons, so it's not that straightforward. Otherwise it seems like it might be useful.
Edit:- sort of Ninja'd by Eric!
There are other ways of getting to the planet quickly, the best being to angle up away from the planet as you exit witchspace, fly under Torus Drive for a few seconds then angle back to the planet. This way you will avoid the spacelanes (and other ships) and you will get to the planet in seconds.
Also, invest in Fuel Injectors which will (fuel permitting) allow you to blast past other ships at high speed.
One other point...most of the fun in Oolite comes during the run into the planet and many of us string it out as long as possible. Get the right eye-candy and a nice leisurely run into the planet becomes a joy.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Hi, bjasspa, and another friendly welcome! :D

You could also simply use the time acceleration factor in it's in-built vanilla flavour, which is already bound to a key. Hit 'P' for pause, then hit 'Left Arrow' for making the game slower or 'Right Arrow' for making the game faster. This works in increments between 1/16 and 16 times.

If you display the frame rate (toggle with 'F') you will also see the current value of the TAF.
bjasspa
Average
Average
Posts: 8
Joined: Wed Dec 29, 2010 2:06 pm

Post by bjasspa »

This game is fantastic and thanks for the replies & tips (fuel injectors are great!)

But am I really the only impatient old timer? Sitting back and watching the world go by (quite literally) is fine for a while but there's so much more to do in the game!

The tip to use the pause and then arrows works but not simple enough (for me :-). For now I've created a new 'Cranky FastForward' equipment (costing 0.1 Cr so I can buy it right at the beginning) which unfortunately has to award and interfere with the advanced compass - but the 'fast forward' feature is great and the ease of implementation shows the strength of Oolite's kernel. I even have it auto switching off when player's condition changes to red - neat.

I would like to get this working independently and like the 'j' jumpdrive key so if any one has any ideas of how to better hook this in I would be grateful. When in 1.75 coming out?

P.S. I discovered the advantage of having a fast forward while playing the Atari ST Elite on a PC using the Steem emulator which has a fast forward built in - this was good but Oolite is a lot better!
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Re: Binding keys to new commands

Post by TGHC »

bjasspa wrote:
Thanks for a great game - really brought be memories which I had long thought lost and I hope many new ones to come!
Hi bjasspa

Welcome to the Oolite universe, if you haven't already, install both the Famous Planets, and Griffs Shipset_all_in_one OXP,s they'll blow your mind!
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
bjasspa
Average
Average
Posts: 8
Joined: Wed Dec 29, 2010 2:06 pm

Re: Binding keys to new commands

Post by bjasspa »

TGHC - thanks for the suggested OXPs but alas my machine can't handle them :-( Being a programmer I went for CPU & memory rather than graphics so it just can't handle the shader effects.

While I'm on that subject is there any way to control the nebular effects? Its with some sadness that I make this request because the effects are fantastic but some systems have such a high number of nebular effects (multiple layers) that it brings my machine down to a stuttering wreck (there's one near Zaria in Galaxy 2 whcih I ended up going to frequently while doing the Ionics mission - excellent missing, thanks Galileo!)

I've trawled the visible and hidden settings but can't find one that effects this - any help appreciated.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Binding keys to new commands

Post by Cody »

If you're using Oolite's own skies (no systems OXP installed), then you can adjust the star and nebulae multipliers here:
~\Oolite\oolite.app\Resources\Config\planetinfo.plist... in the Universal section. That might help.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
bjasspa
Average
Average
Posts: 8
Joined: Wed Dec 29, 2010 2:06 pm

Re: Binding keys to new commands

Post by bjasspa »

Thanks El Viejo for the steer - have found and tweaked the settings (found the documentation too! why did I fail to find them first time round? :shock:)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Binding keys to new commands

Post by Commander McLane »

Good that you found the documentation as well. Just in case you every lose it again, here's a link:

http://wiki.alioth.net/index.php/Planetinfo.plist

Everything else you need to modify Oolite is listed in the scripting category:

http://wiki.alioth.net/index.php/Catego ... _scripting
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Binding keys to new commands

Post by Smivs »

Sorry for such a shameless plug, but my Smivs'Shipset has a low-resolution edition specifically for computers with limited graphics abilities. The textures are the same size as those that come as standard, and might be suitable for you. :)
Smivs.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
CheeseRedux
---- E L I T E ----
---- E L I T E ----
Posts: 827
Joined: Fri Oct 02, 2009 6:50 pm

Re: Binding keys to new commands

Post by CheeseRedux »

Smivs wrote:
Sorry for such a shameless plug
How can you be sorry if it's shameless? :wink:
"Actually this is a common misconception... I do *not* in fact have a lot of time on my hands at all! I just have a very very very very bad sense of priorities."
--Dean C Engelhardt
Post Reply