MarkShot Posted November 27, 2009 Share Posted November 27, 2009 (edited) Here is a hot tip for everyone who wanted to use the mouse wheel in the map screen to zoom in and out. Yes, ESim it is almost 2010 and all G*d's children have mouse wheels these days.Download this free utility:http://www.autohotkey.com/Create the following script file "MouseZoom.ahk":; Make the mouse wheel zoom in and out in Steel Beast Pro PE;; Mark Kratzer - 11/26/09 (revised 11/26/09)#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.SendMode Input ; Recommended for new scripts due to its superior speed and reliability.SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.SetTitleMatchMode 3#IfWinActive, Steel Beasts Pro PE WheelDown:: Send - Return WheelUp:: Send {+} ReturnMy formatting will probably be lost above, but it does not really matter.Now, before playing launch the script by double clicking on the file. (You can create a shortcut to the file if you like.)This will have no impact on any other programs as it only activates when you are SBPPE. When you are not playing, you can shot down the utility from the System Tray. It will be the green icon with an "H".Have fun! Edited November 27, 2009 by MarkShot 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted November 27, 2009 Author Share Posted November 27, 2009 My next upgrade to mouse support will be to make the map scroll by pushing the cursor to the edge of the screen.This will push my scripting with this utility to the next level.OTW! 0 Quote Link to comment Share on other sites More sharing options...
Piotre Posted November 27, 2009 Share Posted November 27, 2009 That's just what the doctor ordered! Works like a charm, thank you :luxhello:. Now, since people are never happy and you expressed interest in pushing your scripting with this utility to the next level :biggrin:, how about letting us drag the map by pressing the central mouse button? 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted November 27, 2009 Author Share Posted November 27, 2009 Sorry to not take your request, but I am coding for ME!However, if just got the basic code structure working to scroll the map when you push the mouse to the screen edge.I have to go out, but I will finish it up later today and post after some more testing.The only issue I see is for people with a single processor and poor performance. This might eat into their FPS. I have four processors and I am running SBPPE and AutoHotKey on different processors.Later. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted November 27, 2009 Author Share Posted November 27, 2009 ZOOM + SCROLL !!!!!Okay, working and tested. Very enhanced mouse support in the map.Note1: You'll have to modify your script to correspond to your playing resolution. Yes, I know there must be a function to check the screen resolution, but I am doing this for myself and just making it available to others as a courtesy.Note2: The code is not the most elegant. Clearly, I should have used an additional subroutine. But I am only started learning this utility/language yesterday.; Enhance mouse map handling in Steel Beasts Pro PE; Make the mouse wheel zoom in and out.; Added map scrolling by moving the mouse to edge of map.;; Mark Kratzer - 11/27/09 (revised 11/27/09)#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.SendMode Input ; Recommended for new scripts due to its superior speed and reliability.SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.ScreenWidth = 1600ScreenHeight = 1200EdgeTopY = 0EdgeRightX := ScreenWidth - 1EdgeBottomY := ScreenHeight - 1EdgeLeftX = 0HoldInterval = 200TimerInterval = 200SetTitleMatchMode 3SetTimer, WatchCursor, %TimerInterval%returnWatchCursor: IfWinActive, Steel Beasts Pro PE { MouseGetPos, XPos, YPos If (YPos = EdgeTopY) { Send {UP down} Sleep HoldInterval Send {UP up} } If (YPos = EdgeBottomY) { Send {DOWN down} Sleep HoldInterval Send {DOWN up} } If (XPos = EdgeLeftX) { Send {LEFT down} Sleep HoldInterval Send {LEFT up} } If (XPos = EdgeRightX) { Send {RIGHT down} Sleep HoldInterval Send {RIGHT up} } }return#IfWinActive, Steel Beasts Pro PE WheelDown:: Send - Return WheelUp:: Send {+} Return 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted November 27, 2009 Author Share Posted November 27, 2009 I have taken it to yet another level.I now have a version that:(1) Does all the above.(2) Dynamically responds to whatever resolution is used. You change the resolution in the middle of running SBPPE.(3) The code is compiled. Just run a 200K EXE and you have mouse support in the map.I plan to release to the site downloads after I get some people to test it. 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted November 29, 2009 Share Posted November 29, 2009 You've got my attention. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted November 29, 2009 Author Share Posted November 29, 2009 There are some unintended consequences of using this due to the way it functions which are handy, in fact. (see my comments in the code)After using, I decided to create mouse landing zones at the top and bottom of the screen. This prevents quickly stabbing for the menu at the top or units at the bottom while playing from triggering scrolling.However, after making the above change. It makes it difficult to deliver a dynamic resolution version that is compiled and needs no tweaking by the player. Perhaps, I can simply disable the landing zones if the resolution is below a certain minimum. If it is above the required minimum, then I simply split the width and make the mouse landing zones the top right and the bottom left for scrolling.What do you think? (I'll include my non-dynamic version below for my personal use so that you can see what I mean.)There is also the issue of MP use. This allows the player to crank the turret much more conveniently by pushing the mouse to the edge than by stabbing the keyboard. Some might consider that a cheat. I am hesitant to be the source of "a cheat utility", since I know how MP communities are.; Enhance mouse map handling in Steel Beasts Pro PE;; Make the mouse wheel zoom in and out.; Added map scrolling by moving the mouse to edge of map.;; Further tuning for 1600x1200 to avoid scrolling problems in games 3D; at top edge and bottom edge. Basically, to scroll you must hit the; top right half or the bottom left half.;; Unintended but useful consequences:; - Can scroll the F8 (external view) more smoothly left and right.; - Can use the scroll to manually crank the turrent instead of the arrow keys.;; Mark Kratzer - 11/27/09 (revised 11/28/09)#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.SendMode Input ; Recommended for new scripts due to its superior speed and reliability.SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.ScreenWidth = 1600ScreenHeight = 1200TopMenuLoc = 800BottomDialogueLoc = 800EdgeTopY = 0EdgeRightX := ScreenWidth - 1EdgeBottomY := ScreenHeight - 1EdgeLeftX = 0HoldInterval = 100TimerInterval = 100SetTitleMatchMode 3SetTimer, WatchCursor, %TimerInterval%returnWatchCursor: IfWinActive, Steel Beasts Pro PE { MouseGetPos, XPos, YPos If (YPos = EdgeTopY) { If (XPos > TopMenuLoc) { Send {UP down} Sleep HoldInterval Send {UP up} } } If (YPos = EdgeBottomY) { If (XPos < BottomDialogueLoc) { Send {DOWN down} Sleep HoldInterval Send {DOWN up} } } If (XPos = EdgeLeftX) { Send {LEFT down} Sleep HoldInterval Send {LEFT up} } If (XPos = EdgeRightX) { Send {RIGHT down} Sleep HoldInterval Send {RIGHT up} } }return#IfWinActive, Steel Beasts Pro PE WheelDown:: Send - Return WheelUp:: Send {+} Return 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 Did anyone try this with the script I made available above?Interest seems pretty underwhelming.If no one is interested, then I think I will skip the trouble of releasing an EXE only version with map zoom+scroll which dynamically handles any resolution and provides 1/2 screen landing zones on the top and bottom to avoid interference with other elements (menu/units) if the horizontal resolution is 1024 or better.Please advise if you are interested. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
GH_Lieste Posted December 3, 2009 Share Posted December 3, 2009 I would be interested, but my mouse scroll wheel is INOP. The axle has sheared off and I only have the 'middle button click' functionality on it. So cannot test the zoom.I might get around to trying to glue the bits of axle back together, but as the rest of the mouse is fine I doubt I'll be replacing it very soon if that doesn't work. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted December 3, 2009 Members Share Posted December 3, 2009 I'm highly interested, but currently traveling. :redface: 0 Quote Link to comment Share on other sites More sharing options...
Mogwa Posted December 3, 2009 Share Posted December 3, 2009 It would appear we can scratch one item off "the list". Perhaps after the release of your .exe, you can put out a playable T-72 or something...Mog 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 Nils,In honor of your interest I have added "mouse landing zones". This should be the final version.(see email for where to download for testing) 0 Quote Link to comment Share on other sites More sharing options...
Piotre Posted December 3, 2009 Share Posted December 3, 2009 Mark, the wheel zoom works nicely as I had previously reported . However, the scroll feature only works up and to the left on my system, i.e. works when the mouse reaches the top of the screen or the left side of the screen, but it doesn't seem to work right and down. This happens both in map view and in observer view (F8). I'm running the sim full screen at 1680x1050 under Vista X64, using the script version of your post #8. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 PM me an email address. You can try the latest compiled version and see if you have any better luck. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 My initial guess would be that there is something different about how Vista 64 is reporting the screen resolution and/or the mouse position.Top and left are both being tested against zero. Bottom and right are being tested against 1049 and 1679 respectively.You can display a variable while running the script by adding the following line:Msgbox %VariableName%Perhaps this might help you to figure out why the screen bounds testing is not working. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 Forget it. I see your problem. (script in post #8)If you didn't edit your resolution from my script, it was hard coded to work for me at 1600x1200.PM me and you'll get the dynamic resolution EXE. Much more adaptible; you can even change res in the middle of playing and it continues to work. 0 Quote Link to comment Share on other sites More sharing options...
Piotre Posted December 3, 2009 Share Posted December 3, 2009 My bad, I hadn't noticed the resolution part.I've manually changed it in your script and now works nicely left and right, down 90% of the time and top is a hit and miss affair, sometimes needing 4/5 tries to make it budge. PM sent and I'll report back. 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 3, 2009 Author Share Posted December 3, 2009 Well, see your email. I added the autocad support for your own private custom version. That's enough of this for today. Take care. 0 Quote Link to comment Share on other sites More sharing options...
Piotre Posted December 4, 2009 Share Posted December 4, 2009 Mark, I was finally able to test both the EXE and the scripted, custom made version . They both seem to work fine. I haven't been able to test your utility in the heat of the battle as I'm currently going through the tutorials, but I've experienced no adverse collateral effects so far. The erratic behavior I was reporting was due to the safety dead zones you have setup to guard against accidental activation of the scroll feature while accessing the game menus. This only became clear after you sent the readme in the mail. Well done with your scripting, this is a nifty little utility and I'll be definitely be using it. 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted December 6, 2009 Share Posted December 6, 2009 Thanks MS, works great.Would it be at all possible to use the cursor location as the "zoom in point". Instead of having to center the screen where you want to zoom in? It would be useful to have the screen zoom in where ever the mouse cursor happens to be on the map screen. I don't think there's a key command to do that, but you'll see an option in a drop down menu when you right-click on the map with the mouse to "Center View". 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 6, 2009 Author Share Posted December 6, 2009 Tacbat,Nice concept, but you have to remember that this is a utility that stands alongside SBPPE and not a change to SBPPE itself.So, I am able to know from the window name that the mouse actions are happening within SBPPE. However, I am unable to know whether SBPPE is displaying the map or something else. Thus, any coding I do for the map is active throughout the entire game. Sending right clicks blindly into the game is going to cause all types off problems.This would have been doable if there was a keystroke combination which centers the map and was not overload with any other functionality in the game.Sorry.---Glad you like it. Most likely you have the final build. I am waiting for a little more feedback and then I guess I will upload it the site.Thanks again for your help. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted December 6, 2009 Members Share Posted December 6, 2009 ...so, if there was an option to set a hotkey to center the map at the current mouse position, you could do it? 0 Quote Link to comment Share on other sites More sharing options...
MarkShot Posted December 6, 2009 Author Share Posted December 6, 2009 Yep. Assuming it was ALT-C. Then instead of sending only "+" to the window, I would send "ALT-C" + "+". This would cause the map to center and zoom in.In fact, it would make it possible for the user to just rock the mouse wheel back and forth, if they only wanted to center the map.So, Nils, did you get to try the EXE yet?I've already written a number of AutoHotKey (www.autohotkey.com) scripts for various games. A most excellent free utility. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted December 7, 2009 Members Share Posted December 7, 2009 So, Nils, did you get to try the EXE yet?Actually, no. I will have to install Windows 7 on my computer to get rid of the release candidate, and since there is no upgrade path to it I need to backup my data first, so I'll be kept busy for the next days... :-| 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.