KB/M on PS3 with Metal Gear Solid 4

Titan One general support. Questions, firmware update, feature request.

KB/M on PS3 with Metal Gear Solid 4

Postby atarumoroboshi18 » Sun Aug 31, 2014 10:10 pm

I've just purchased the Titan One(not yet shipped) and I was going to try some of the non-FPS/Racing games with a Keyboard/Mouse setup. Specifically MGS4: Guns of the Patriots. I don't know why, but I have this feeling that using a KB/M would be a near perfect setup for the game. Simply have the mouse be used for aiming and firing and configure the keyboard for all the other actions. Has anyone tried to create a gamepack for MGS4?
User avatar
atarumoroboshi18
Master Sergeant
Master Sergeant
 
Posts: 26
Joined: Sun Aug 31, 2014 9:55 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby J2Kbr » Mon Sep 01, 2014 11:35 am

Not yet. We have a topic only to request GamePacks. Please post your suggestion there. We use this post to prioritize the GamePacks we release.

viewtopic.php?f=5&t=122

Thanks
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby atarumoroboshi18 » Mon Sep 01, 2014 8:09 pm

Oh, I was just asking if there was one. More than likely I will create my own and post it when I receive the Titan One. Going to see how well it controls. I'll have more questions when I've received the Titan and set it up.
User avatar
atarumoroboshi18
Master Sergeant
Master Sergeant
 
Posts: 26
Joined: Sun Aug 31, 2014 9:55 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby atarumoroboshi18 » Sat Sep 06, 2014 4:27 pm

Alright, just received the Titan One and have begun setting up MGS4. I have a question about analog stick movement in game.

Is it possible to utilize the Shift key to shift between running and walking? Since it's an analog stick, why not let shift go from maximum analog movement to a slower, lesser analog push? And also, are we able to double click the shift key to allow it to stay in one state or the other as well?


Edit: After a lot of trial and error, I've got the shift key working perfectly as a Walk/Run modifier for MGS4. No wonder they didn't bring this game to PC, it's incredibly easy with the mouse and KB. Here's my script, still trying to figure out how to double click Shift and have it stay in that state. Here's my script if you're interested:

Code: Select all
int LX = 0;
int LY = 0;

main {

    if(get_val(PS3_ACCZ)){
        LX = get_val(PS3_LX);
        LY = get_val(PS3_LY);
       
   
        if (LX > 0)
            set_val(PS3_LX, LX/2);
        if (LX < 0)
            set_val(PS3_LX, LX/2);
        if (LY > 0)
            set_val(PS3_LY, LY/2);
        if (LY < 0)
            set_val(PS3_LY, LY/2);
        }


}


Also, I'm still trying to fine-tune the Mouse controls to get them to be 1 to 1. Can anyone give me some help on that front? They're working good, but I want finer Mouse movements.
User avatar
atarumoroboshi18
Master Sergeant
Master Sergeant
 
Posts: 26
Joined: Sun Aug 31, 2014 9:55 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby J2Kbr » Sun Sep 07, 2014 11:57 am

Very nice you got it work!! :smile0517:

atarumoroboshi18 wrote:still trying to figure out how to double click Shift and have it stay in that state.

Here the peace of code I use to detect double clicks. I commented each "section", you should have no problem to understand it. But, if you do, let me know. :wink:
Code: Select all
define DOUBLECLICK_BUTTON = PS4_TRIANGLE;

int doubleclick_flag = 0;

main {
    // Detect the first click for the button defined in 'DOUBLECLICK_BUTTON'
    if(doubleclick_flag == 0) {
        // The first click should be less than 250ms
        if(event_release(DOUBLECLICK_BUTTON) && get_ptime(DOUBLECLICK_BUTTON) < 250) {
            // The time to the second click should be less than 125ms
            doubleclick_flag = 125;
        }
    }
    // Detect the second click with in the limit time set in 'doubleclick_flag'
    else if(doubleclick_flag > 0) {
        // Ok, second click detected
        if(event_press(DOUBLECLICK_BUTTON)) {
            // Set the flag to -1, meaning double click happened
            doubleclick_flag = -1;
        }
        // Decrement the timeout to the second click,
        // If reach 0, go back detect the first click above
        else {
            doubleclick_flag = doubleclick_flag - get_rtime();
            if(doubleclick_flag < 0) doubleclick_flag = 0;
        }
    }
    // Ok, double click detect
    else if(doubleclick_flag == -1) {

        //
        // TODO: Your code here.
        //

        // Go back detect the first click
        doubleclick_flag = 0;
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby atarumoroboshi18 » Sun Sep 07, 2014 9:16 pm

Wonderful! Used your code fully and also made some other changes to it as well to make it a generic function that can take any Identifier and tell if it's been doubleclicked by using the wasDCed(ident) function. I also added to the code the ability when you are already in the WALK state and you hold Shift, that it puts you into normal mode and vice versa. Give this code a shot and I'll also put up the Layout that I'm using too.

Here is the code:
Code: Select all
int LX = 0;
int LY = 0;
define WALKBUTTON = PS3_ACCZ;
int doubleclick_flag = 0;
int WALK = FALSE;

main {


moveSlow();



}


function moveSlow(){
    //X and Y Axis for the Left Analog stick for the PS3.
    LX = get_val(PS3_LX);
    LY = get_val(PS3_LY);
   
    //Was the walk button pressed, PS3_ACCZ pressed twice in succession? Call this function
    wasDCed(WALKBUTTON);

    //If both of these are true you move normally, i.e. full speed
    if(get_val(PS3_ACCZ) && (WALK))
    {
        //When both variables above are true, if one of these are being used
        //then set them back to their normal state.
        if ((LX != 0) || (LY != 0))
        {
            set_val(PS3_LX, LX);
            set_val(PS3_LY, LY);
        }
    }
    //If either of these are true, you move slowly
    else if(get_val(PS3_ACCZ) || (WALK))
    {
        //When either of the variables above are true, if one of these are being used
        //then set them back to the slower state.
        if ((LX != 0) || (LY != 0))
        {
            set_val(PS3_LX, LX/2);
            set_val(PS3_LY, LY/2);
        }
   
    }
       
}


function wasDCed(IDENT){

   if(doubleclick_flag == 0) {
        // The first click should be less than 250ms
        if(event_release(IDENT) && get_ptime(IDENT) < 250) {
            // The time to the second click should be less than 125ms
            doubleclick_flag = 125;
        }
    }
    // Detect the second click with in the limit time set in 'doubleclick_flag'
    else if(doubleclick_flag > 0) {
        // Ok, second click detected
        if(event_press(IDENT)) {
            // Set the flag to -1, meaning double click happened
            doubleclick_flag = -1;
        }
        // Decrement the timeout to the second click,
        // If reach 0, go back detect the first click above
        else {
            doubleclick_flag = doubleclick_flag - get_rtime();
            if(doubleclick_flag < 0) doubleclick_flag = 0;
        }
    }
    // Ok, double click detect
    else if(doubleclick_flag == -1) {
       
        changeState(IDENT);
       
        // Go back detect the first click
        doubleclick_flag = 0;
    }

}


//Generic function for what to do when the state has been changed, usually used for
//double-clicked buttons.
function changeState(IDENT){

    //What was the Identifier used that was double-clicked? Perform an action such
    //setting values, change variables, etc. depending on the button.
    if (IDENT == PS3_ACCZ){
        if(!WALK)
            WALK = TRUE;
        else if(WALK)
            WALK = FALSE;
    }
   

}


Here is my layout, posted as an attachment. Gotta say, once the Mouse Settings are perfected, MGS4 will never be the same!

Edit: Oh yeah, would it be possible for someone to actually set up the Mouse Settings to be 1 to 1? That would be incredible, it's a game where you definitely need very fine mouse controls.
Attachments
Metal Gear Solid 4.glf
Give it a shot, needs to be used in conjunction with the script above and you'll be playing MGS4 like never before!
(7.5 KiB) Downloaded 259 times
User avatar
atarumoroboshi18
Master Sergeant
Master Sergeant
 
Posts: 26
Joined: Sun Aug 31, 2014 9:55 pm

Re: KB/M on PS3 with Metal Gear Solid 4

Postby J2Kbr » Mon Sep 08, 2014 12:28 pm

Awesome job on the script! Very clever the way you mixed the double-click code with functions! :joia:

I still don't have MGS4. As soon as I get my copy surely I gonna use your MaxAim layout. :wink:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to Titan One Device

Who is online

Users browsing this forum: No registered users and 143 guests