Results 1 to 9 of 9

Thread: GlovePIE Script: Zoom with your mousewheel

  1. #1

    GlovePIE Script: Zoom with your mousewheel

    Today I wrote a GlovePIE script to zoom with the mouse wheel.
    I hate it to zoom with FreeTrack so I decided to write a script to change that

    Requirements:

    Tutorial to install PPJoy on Windows Vista / 7 64 Bit:

    You have to activate the test mode to install the unsigned driver from PPJoy. Easiest way to do that is to use the Driver Signatur Enforcement Overrider.

    I included the line to fix the Throttle axis. If you don't want to use it, you don't have to. For more information see this thread by TheHarvesteR.

    Code:
    // Script by Cyborg11
    // @ 05.11.2010
    // v1.1
    // Joystick Fix (Full Throttle) by TheHarvesteR (First line)
    //   http://forums.bistudio.com/showthread.php?t=108410
    // Description:
    // With this script you can zoom with your mouse wheel
    // - Press Ctrl + Alt + Space to change the toggle mode
    // - Toggle mode means that you have to press the activate (default: Shift + B)
    //   only once to zoom everytime with your mousewheel.
    // - Non-Toggle mode means that you have to hold the activate key to zoom
    // - Shift + B + Spacebar is the Reset button
    
    // In the block below you can change the keys, the default toggle value
    // (default: false -> Non-Toggle mode) and the sensitive of the zoom levels
    // 120 means 2 zoom levels (2x zoom in / 2x zoom out)
    // 240 means 4 zoom levels (4x zoom in / 4x zoom out)
    // 360 means 6 zoom levels (6x zoom in / 6x zoom out)
    // 480 means 8 zoom levels (8x zoom in / 8x zoom out)
    
    // Changelog
    // v1.1
    // - Fixed: Toggle Zoom
    // - Added: Zooming is disabled when chatting (because Backspace is running every
    //          10ms to prevent the menu from showing every time you zoom)
    // - Added: Now you can aim while holding the right mouse button.
    //          That means that you have to hold the right mousebutton to look through
    //          the ironsight/scope. To use it you have to remove the 'Right Mousebutton'
    //          from the optics in the controls and set the
    //          variable 'var.aimwhileholding' to true. Uses the 0 button on the numpad
    //          for the optics (default for optics in arma).
    //          (Requested by: ])rStrangelove => http://forums.bistudio.com/showpost.php?p=1780768&postcount=5)
    // v1.0
    // - Release
    Download: http://cyborg11.cy.funpic.de/ArmA2/Downloads/ArmA2.PIE

    Usage:
    • Open the script ArmA2.pie with GlovePIE, change the keys and click on the Run button
    • Start ArmA 2 and go to your Controls
    • Scroll down to the entries "Zoom in (continuous)" and "Zoom out (continuous)"
    • "Zoom in (continuous)" should be "PPJoy Virtual Stick X- Rotate" (mousewheel up - scroll fast so ArmA 2 can recognize the axis)
    • "Zoom out (continuous)" should be "PPJoy Virtual Stick X+ Rotate" (mousewheel down - scroll fast so ArmA 2 can recognize the axis)
    • Stop the script
    • Set the variable 'var.firstSetup' to false
    • Restart the script and have fun


    If you can't set the axis ingame don't worry. Open your YourName.ArmA2OAProfile file in your Documents \ ArmA 2 folder, scroll down to "keyZoomContIn" and change it to this:
    Code:
    keyZoomContIn[]={524299,198147};
    keyZoomContOut[]={524293,198155};

  2. #2
    Hehe, I was about to reply to your question about this on my thread, but I see you've got it down already

    I wondered how you planned to use the mousewheel for zoom without disturbing the default setting... Nice job with the modes there!

    Isn't GlovePIE awesome?

    Cheers
    Remember : You don't need to outrun the bear... you just need to outrun your buddy

  3. #3
    One idea that springs to mind would be to do mousewheel or mouse x axis movement + modifier key (eg ctrl) to do lean settings, ala raven shield's lean system; I know incremental lean is doable via freetrack axis but don't know whether it could be defined as a joystick axis instead

  4. #4
    Staff Sergeant Cyborg11's Avatar
    Join Date
    Jun 7 2009
    Location
    Germany
    Posts
    310
    Author of the Thread
    Quote Originally Posted by TheHarvesteR View Post
    Isn't GlovePIE awesome?
    Yes GlovePIE is awesome.

    @DaveP: It should be possible too to control the lean with the mouse x axis But first I have to find a way to disable the aiming when you press the Toggle button.

  5. #5
    Sergeant Major ])rStrangelove's Avatar
    Join Date
    Jan 24 2002
    Location
    Rainy, foggy, begins with G
    Posts
    1,760
    Are you trying to get an aim-while-holding functionality? That would rock. I hate toggle-aim.

    Spoiler:

  6. #6
    Staff Sergeant Cyborg11's Avatar
    Join Date
    Jun 7 2009
    Location
    Germany
    Posts
    310
    Author of the Thread
    Quote Originally Posted by ])rStrangelove View Post
    Are you trying to get an aim-while-holding functionality? That would rock. I hate toggle-aim.
    How should it work? Should the script presses the optics button after a certain time?
    In my opinion it's useless. But maybe I missunderstood you

  7. #7
    Sergeant Major ])rStrangelove's Avatar
    Join Date
    Jan 24 2002
    Location
    Rainy, foggy, begins with G
    Posts
    1,760
    I dont want to click right mouse button to aim/ironsights and then click again to switch back, i want to hold right mouse button, then release it to switch back.

    It works in most other games but not here i think. Would be great if GlovePIE could do this.

  8. #8
    Quote Originally Posted by ])rStrangelove View Post
    I dont want to click right mouse button to aim/ironsights and then click again to switch back, i want to hold right mouse button, then release it to switch back.

    It works in most other games but not here i think. Would be great if GlovePIE could do this.
    It probably could, or Autohotkey could.

    EDIT:
    Spoiler:
    Last edited by JojoTheSlayer; Nov 4 2010 at 13:42.
    Want to be as fast as the AI to give AI orders in ArmA 1-3 or IF44?
    Try my VAC v305! voice command profile.
    More than 700+ voice commands! Learn more on YouTube.

  9. #9
    Staff Sergeant Cyborg11's Avatar
    Join Date
    Jun 7 2009
    Location
    Germany
    Posts
    310
    Author of the Thread
    Quote Originally Posted by ])rStrangelove View Post
    I dont want to click right mouse button to aim/ironsights and then click again to switch back, i want to hold right mouse button, then release it to switch back.

    It works in most other games but not here i think. Would be great if GlovePIE could do this.
    Now I understand what you mean

    Here is the GlovePIE Script for that:
    Code:
    if (not var.init) {
       var.init = true
       var.righthold = false
    }
    
    If (Mouse.RightButton) {
       var.rightcount++
    } else {
       var.rightcount = 0
    }
    
    if (var.rightcount > 0) {
       Press (Key.Numpad0)
       var.righthold = true
    }
    
    if (var.rightcount == 0 and var.righthold) {
       var.righthold = false
       Release (Key.Numpad0)
       Press (Key.Numpad0)
       Wait 100ms
       Release (Key.Numpad0)
    }
    debug = Key.NUMPAD0 + " " + var.rightcount + " " + var.righthold;
    To use:
    - Remove the "Right mouse button" from the optics
    - 0 (NUM) should be a default key for the optics so you don't have to do anything more

    I added this piece of code into version 1.1


    I updated the script to 1.1:
    Code:
    // Changelog
    // v1.1
    // - Fixed: Toggle Zoom
    // - Added: Zooming is disabled when chatting (because Backspace is running every
    //          10ms to prevent the menu from showing every time you zoom)
    // - Added: Now you can aim while holding the right mouse button.
    //          That means that you have to hold the right mousebutton to look through
    //          the ironsight/scope. To use it you have to remove the 'Right Mousebutton'
    //          from the optics in the controls and set the
    //          variable 'var.aimwhileholding' to true. Uses the 0 button on the numpad
    //          for the optics (default for optics in arma).
    //          (Requested by: ])rStrangelove => http://forums.bistudio.com/showpost....68&postcount=5)
    // v1.0
    // - Release
    Have fun with 1.1
    Downloadlink in the first post.
    Last edited by Cyborg11; Nov 4 2010 at 22:49.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •