Course lock

Catch-all for all development not having a specific forum.
j_k
Posts: 29
Joined: Wed Sep 21, 2005 7:00 am

Post by j_k »

Back in the helpline forum, I posted this:

QUOTE Is there a (legit) way I can change this? Back in Tachyon you'd "lock course" as long as the key was pressed, and return to normal when you released it.

Can I configure Alleg to work this way?[/quote]

The answer is currently "no," but Raveen suggested that I mention it here, so here it is.

Would the Alleg engine handle it?

--j_k
ingame as j_k or j_k_redtail
Raveen
Posts: 9104
Joined: Wed Mar 16, 2005 8:00 am
Location: Birmingham, UK
Contact:

Post by Raveen »

I see no reason why this couldn't be added as an option. In fact if you have a dead clever keyboard I suspect you could set this up as a macro or some such.

Any dev feel like coding it?
ImageImage
Spidey: Can't think of a reason I'd need to know anything
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

i considered posting about how you could use an AHK script to do it, and give some lines of code that could be added to my hotkey mod,

but then, every time you pressed l (lock course button) when typing, it would put an l in, and every time you released it, it would put another l in

so typing "lol" would give "lloll" in chat.

i thought you could have say ctrl+l to input a single l for typing, but then that may get annoying.

then you may get the problem of if lock course got activated for some reason without the button pressed, then you would have to hold the button to turn it off, but then again, if you had the ctrl+l to send a single l then you could turn it off, so this doesnt matter too much.

if you could live with having to press ctrl+l (or any other combo really) when ever you wanted to type an l then i could give you some AHK code you could use, etehr by putting it at the end of my hotkey mod, or in a seperate script by its self.

the reason for the double l thing is because this is what the script will do

when you press l , it sends a l input, activating course lock.
when you take your finger off l, it sends another l, turning course lock off

so tapping the key makes the key go down - sends an l - then key moves up - sends a second l
finn_bryant
Posts: 31
Joined: Mon Feb 20, 2006 8:00 am
Location: Stansted, UK

Post by finn_bryant »

Sorry for resurrecting this thread, but i came up with a fix, basically, if you tap the L key (press it for less than 500ms) it produces one L but if you hold it down, it produces one at the beginning and another at the end of the key press.

Code: Select all

#IfWinActive Allegiance ahk_class MS_ZLib_Window
$l::
   Sendinput l
   Keywait l
   If (A_TimeSinceThisHotkey > 500)
      Sendinput l
Return
add that to the end of an ahk script.

EDIT: added madp's suggestion
Last edited by finn_bryant on Sun Dec 10, 2006 6:13 pm, edited 1 time in total.
[sig]This post may contain nuts![/sig]
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

that's some nice solution there /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

if you find it is a little slow responding, change the "Send" s to "SendInput" s

but it should be fine like that since you only really notice the speed difference when sending strings of letters
Last edited by madpeople on Sun Dec 10, 2006 4:48 pm, edited 1 time in total.
finn_bryant
Posts: 31
Joined: Mon Feb 20, 2006 8:00 am
Location: Stansted, UK

Post by finn_bryant »

thanks mad, that makes a difference when the fps drops a lot.
[sig]This post may contain nuts![/sig]
Adaven
Posts: 1959
Joined: Sat Oct 25, 2003 7:00 am
Location: Greater Ozarks

Post by Adaven »

I think that this is a really good idea, I too sometimes get to missing tachyon's course lock, especially how it didn't drop your speed at all if you turned or cut boosters. I know this would affect game play if you made it universal but as a core addable flag/item it'd be neat to enable something like that.
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

finn_bryant wrote:QUOTE (finn_bryant @ Dec 10 2006, 04:17 PM) if you tap the L key (press it for less than 500ms) it produces one L but if you hold it down, it produces one at the beginning and another at the end of the key press.
Adaven wrote:QUOTE (Adaven @ Dec 10 2006, 07:40 PM) I think that this is a really good idea, I too sometimes get to missing tachyon's course lock, especially how it didn't drop your speed at all if you turned or cut boosters. I know this would affect game play if you made it universal but as a core addable flag/item it'd be neat to enable something like that.

you can do that if you want, just install my
hotkey mod and add
finn_bryant wrote:QUOTE (finn_bryant @ Dec 10 2006, 04:17 PM)

Code: Select all

#IfWinActive Allegiance ahk_class MS_ZLib_Window
$l::
   Sendinput l
   Keywait l
   If (A_TimeSinceThisHotkey > 500)
      Sendinput l
Return
to the end of it

what it does is basically
finn_bryant wrote:QUOTE (finn_bryant @ Dec 10 2006, 04:17 PM) if you tap the L key (press it for less than 500ms) it produces one L but if you hold it down, it produces one at the beginning and another at the end of the key press.
so you can type normally, use courselock like you do now by tapping l, or you can hold l to turn courselock on, then release it, and have courselock deactivate

you could just make your own ahk script, but if your installing AHK, you may as well install my script due to its feature-fullness (read awesomeness)

hmm, may have to make this an official part of the hotkey mod.. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
finn_bryant wrote:QUOTE (finn_bryant @ Dec 10 2006, 06:14 PM) thanks mad, that makes a difference when the fps drops a lot.
really?

that's interesting, i may have to change other parts of my hotkey mod which use "Send" instead of "SendInput"
Last edited by madpeople on Sun Dec 10, 2006 7:54 pm, edited 1 time in total.
Adaven
Posts: 1959
Joined: Sat Oct 25, 2003 7:00 am
Location: Greater Ozarks

Post by Adaven »

I'm sorry I think I didn't explain myself clearly. I understand and am very glad you guys made a hotkey mod to enable the course lock key presses to work that way. I'm probably going to look into installing it this afternoon.

Since you've already found a solution to that part, I'm adding that it would be interesting to change the way course lock fundamentally works in the game. Currently it just locks your direction, similar to auto-pilot, and your velocity depends on the standard capabilities of your engines and side thrust ratio's, i.e. turning slows you down (unless you are an int/belts).

I hate to keep comparing alleg to other games, but in tachyon, you could boost, hit L and let off boost, and your boosted velocity was still maintained, regardless of your orientation. In essence it allowed you to turn a Newtonian flight model on and off at will. In Allegiance if you try the same trick, after you hit course lock your speed will decay normally back to your normal cruise speed. That's why I was saying a change would require alterations to both the code and the core system. We already have enough problems w/ ints being able to get across the map too quickly, but on a special ship/faction it could be a lot of fun. Like I mentioned earlier, it enables the advantages of Newtonian physics without the disadvantages by letting you switch between drag and no drag environments. Fixing the way the keys work is great, but I still miss the whole package.
Last edited by Adaven on Sun Dec 10, 2006 8:09 pm, edited 1 time in total.
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

hmm, not sure i like that.

besides, boosters are giant fixed rocket engines on the back of your ship, they cant thrust sideways
Post Reply