Sign in to follow this  
Daemonjax

MOD:Better Stealth Toggle

Recommended Posts

Better Stealth Toggle


An autohotkey script that makes stealth much less of a chore to use.

 

 

I always hated having to manually dismiss the popup when entering stealth mode and AGAIN when disabling solo mode.

 

This fixes that.

 

 

How it works:

 

You define a single key that when pressed will either:

 

1. put the currently controlled character into stealth mode; or

2. disables solo mode (which also takes you out of stealth mode).

 

In both cases the popup is dismissed when you release the key.

 

So... You just need to set up the script to use your preferred key and also tell it what keys are bound ingame to your solo mode and stealth mode... and have the script running while running the game, of course.

 

You can edit the script using notepad or whatever. I made notes next to the parts that need to be changed

 

NOTES:

 

1) I made three notes within the script where you'll need to make changes to make this work for you (keybinds).

2) The script may need some customized tweaking because it taps a pixel at screen location X=53, Y=1000 in order to detect if the currently controlled character is in stealth mode or not. I'm running the game at 1920x1080, so if your resolution is different, this won't work "out of the box".

3) Let me know if it doesn't work and I'll work with you to fix it.

4) Also, I can only play the game in windowed mode and I don't think it'll work in fullscreen... so I won't be able to help if it doesn't work in fullscreen mode for you.

 

You can download autohotkey here: http://www.autohotkey.com/


 

Share this post


Link to post
Share on other sites

After getting annoyed at the pixel thingy, I decided to rework the script a bit. Instead of trying to find a pixel of that stealth icon pressing the button will just toggle a variable and make it do different things. This change also provides something of a benefit over the original if I'm reading it correctly: if you're ever in solo mode but not stealth mode, the script will always try to disable solo mode first so your allies will come to assist if you press it after you ambush an enemy or get discovered.

Just overwrite everything in the downloaded file with this:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen,
#SingleInstance Force   ; Personal preference

#IfWinActive, Star Wars: Knights of the Old Republic


G:: ;This is the hotkey button, but it should be set to use the same binding as Stealth Mode
{	
	inStealth = 0
	
	
	if (inStealth == 0) ;Activates stealth mode
	{
		Send, {G} ;G is the default Stealth Mode key, if you rebound it change this to match
		inStealth := !inStealth
	}
	if (inStealth == 1) ;Deactivates stealth and solo mode
	{
		Send, {V} ;V is the default Solo Mode key, if you rebound it change this to match
		inStealth := !inStealth
	}

	Return	
}

G UP:: ;Same as the hotkey button, releasing it will close the pop-up
{
	Send, {ENTER}
}

The reason I suggest using the Stealth Mode key as the hotkey binding is because it'll work better if you're alone. By binding it to something separate, you'll require 2 keypresses to enable or disable stealth since the Solo Mode button doesn't exist. If you really want to bind it to something else, however, you could disable this script while you don't have a party.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this