KB + XIM + Titan2 - Fortnite Combos

GPC2 script programming for Titan Two. Code examples, questions, requests.

KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Sat Feb 03, 2018 7:44 pm

Inspired by antithesis post (viewtopic.php?f=20&t=6965) about the possibility of using a seperate KB connected to a Titan 2 when using a XIM to create a lot of extra keys for macros/combos, I've done a basic one for Fortnite.

The main functionality of this script is to bring the advantages PC players have to console - namely the ability to build with 1 button press rather than the usual console method of enter building mode, scroll to building piece, confirm. On PC you can also do the same for weapons too, but I don't think this is possible or if it is it's well beyond my coding expertise. The difference between weapons and building, is with the latter, all building formats are always available and in the same slot, whereas with weapons not all slots are always filled, so 'scrolling 4 places to the right would bring up a different weapon depending on how many slots you have filled. So you would need to track what slots are actually filled with a weapon at point in time to know how many slots to sroll to the left/right to get to slot x etc, if that makes sense.

So below I have the usual KB mappings together with floor, wall and stairs mapped to individual KB button presses, much like a PC player would have them mapped.

Finally, I also have a combo specifically for doing the double pump SG trick - I've mapped this to LEFT ARROW, which is mapped via XIM to middle mouse button. I've played around with turning on/off, tapping fire button instead of holding but I find these get in the way of doing other tasks quickly and it more efficient to have a seperate button specifically just for this.

Obviously, this only works with the combat pro controller layout.

Code: Select all
#pragma METAINFO("<Mark>", 1, 0, "FORTNITE KEYBOARD COMBO") 
#include <keyboard.gph>
 
init {
 
//------------------------------------------------------------------------------
// KEYBOARD BINDINGS
 
    // Load Keyboard Mapping
    const uint8 map[] = {
        KEY_W,                STICK_2_Y | KEYMAP_NEGATIVE,
        KEY_A,                STICK_2_X | KEYMAP_NEGATIVE,
        KEY_S,                STICK_2_Y,
        KEY_D,               STICK_2_X,
        KEY_ESCAPE,       BUTTON_1, // XBOX
        KEY_M,                  BUTTON_2, // VIEW
//                         BUTTON_3, // MENU
//                            BUTTON_4, // RB
//                            BUTTON_5, // RT
//                            BUTTON_6, // RS
//                            BUTTON_7, // LB
//                              BUTTON_8, // LT
        KEY_LEFTSHIFT,        BUTTON_9, // LS
        KEY_I,                BUTTON_10, // UP
//                              BUTTON_11, // DOWN
//                              BUTTON_12, // LEFT
//                              BUTTON_13, // RIGHT
//                            BUTTON_14, // Y
//                            BUTTON_15, // B
        KEY_SPACEBAR,         BUTTON_16, // A
//                              BUTTON_17, // X
    };
 
    keymapping(map);
 
}   
 
main {
 
    if (event_release(BUTTON_12)){
        combo_run (DoublePumpShotguns);
        set_val(BUTTON_12, 0.0);
    }
 
//------------------------------------------------------------------------------
// KEYCODE
 
    // Output the key code of pressed keys
    output_keycode();   
 
//------------------------------------------------------------------------------
// LOAD-OUTS
 
    // Use && key_status(KEY_LEFTSHIFT) etc as modifiers to increase available toggles
        if(key_status(KEY_Q))        { combo_run (BuildWall); }
        if(key_status(KEY_F))        { combo_run (BuildFloor); }
        if(key_status(KEY_E))        { combo_run (BuildStair); }
 
} // main
 
combo BuildWall {
    wait(20);
    set_val(BUTTON_15, 100.0);
    wait(100);
    set_val(BUTTON_15, 0.0);
    wait(350);
    set_val(BUTTON_5, 100.0);
    wait(140);
    set_val(BUTTON_5, 0.0);
    wait(80);
    set_val(BUTTON_15, 100.0);
    wait(80);
    set_val(BUTTON_15, 0.0);
    wait(20);
}
 
combo BuildFloor {
    wait(20);
    set_val(BUTTON_15, 100.0);
    wait(110);
    set_val(BUTTON_15, 0.0);
    wait(200);
    set_val(BUTTON_4, 100.0);
    wait(110);
    set_val(BUTTON_4, 0.0);
    wait(140);
    set_val(BUTTON_5, 100.0);
    wait(120);
    set_val(BUTTON_5, 0.0);
    wait(80);
    set_val(BUTTON_15, 100.0);
    wait(80);
    set_val(BUTTON_15, 0.0);
    wait(20);
}
 
combo BuildStair {
    wait(20);
    set_val(BUTTON_15, 100.0);
    wait(80);
    set_val(BUTTON_15, 0.0);
    wait(80);
    set_val(BUTTON_4, 100.0);
    wait(80);
    set_val(BUTTON_4, 0.0);
    wait(80);
    set_val(BUTTON_4, 100.0);
    wait(80);
    set_val(BUTTON_4, 0.0);
    wait(200);
    set_val(BUTTON_5, 100.0);
    wait(80);
    set_val(BUTTON_5, 0.0);
    wait(80);
    set_val(BUTTON_15, 100.0);
    wait(80);
    set_val(BUTTON_15, 0.0);
    wait(20);
}
 
combo DoublePumpShotguns {
    set_val(BUTTON_5, 100.0);
    wait(50);
    set_val(BUTTON_5, 0.0);
    wait(50);
    set_val(BUTTON_4, 100.0);
    wait(50);
    set_val(BUTTON_4, 0.0);
    wait(650);
    set_val(BUTTON_5, 100.0);
    wait(50);
    set_val(BUTTON_5, 0.0);
    wait(50);
    set_val(BUTTON_7, 100.0);
    wait(50);
    set_val(BUTTON_7, 0.0);
    wait(650);
}
 
//------------------------------------------------------------------------------
// KEYBOARD SUPPORT
// view pressed key
void output_keycode() {
    static uint8 previous_keycode;
    uint8 keycode;
 
    keycode = key_check();
    if(keycode != previous_keycode) {
        if(keycode) {
            printf("Key Code: %02X", keycode);
        }
        previous_keycode = keycode;
    }
    return;
}
 
 


EDIT: See this post for current step by step instructions (combat pro layout)

viewtopic.php?f=26&t=7897&start=170#p60548

EDIT2: Updated generic script from above for the new Builder Pro layout

viewtopic.php?f=26&t=7897&start=250#p62036

Updated in the following two posts (follow the same overall instructions though in the combat pro layout posts)

viewtopic.php?f=26&t=7897&start=290#p62370

viewtopic.php?f=26&t=7897&start=310#p62605
Last edited by MAL8010 on Sat Apr 21, 2018 9:54 am, edited 3 times in total.
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby ungabunga9 » Sat Feb 03, 2018 8:19 pm

The best solution for me(fortnite players) would be if the T2 device could send both keyboard commands and controller commands to the console.

This would solve SO MANY PROBLEMS for fortnite players.

I'm currently using controller + mouse into the XIM4 for my hands.
Keyboard into T2 for my feet.
Pressing left side of keyboard sends F1 to the xbox for a wall.
Pressing spacebar of keyboard sends F2 to the xbox for a floor.
Pressing right side of keyboard sends F3 to the xbox for a stair.

Building selection is instant this way, but it took some getting used to.
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby antithesis » Sat Feb 03, 2018 9:53 pm

Good man, that'll save me some time nutting this out as I've just started playing Fortnite. Using a T2, we should be able to one-click build a basic fort.

I'll give it a bash asap and post feedback. Thanks for posting :)
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Sat Feb 03, 2018 10:00 pm

antithesis wrote:Good man, that'll save me some time nutting this out as I've just started playing Fortnite. Using a T2, we should be able to one-click build a basic fort.

I'll give it a bash asap and post feedback. Thanks for posting :)


I did think about that, but getting the timing right for turning 360 degrees proved tricky for me as well as different sensitivities people might use. Might be approaching it from the wrong angle though. I did see a YT vid that someone has managed to do it so it is possible

https://www.youtube.com/watch?v=5cKIIQstSEk&app=desktop
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Sat Feb 03, 2018 10:05 pm

ungabunga9 wrote:The best solution for me(fortnite players) would be if the T2 device could send both keyboard commands and controller commands to the console.

This would solve SO MANY PROBLEMS for fortnite players.

I'm currently using controller + mouse into the XIM4 for my hands.
Keyboard into T2 for my feet.
Pressing left side of keyboard sends F1 to the xbox for a wall.
Pressing spacebar of keyboard sends F2 to the xbox for a floor.
Pressing right side of keyboard sends F3 to the xbox for a stair.

Building selection is instant this way, but it took some getting used to.


Geez that is innovative to use a KB like that, must have taken some practice!
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby antithesis » Sat Feb 03, 2018 10:28 pm

For feet, perhaps consider a Stinky Board. That'd cover all 4 build pieces. I have a Stinky but rarely use it because it's pretty noisy and I game late at night.

Sensitivity for the fort auto-build can be set in the script, as can direction, so should work regardless of the user's sens values.

Also, that "aimbot" in the video is just ADS spam and could lead to reports for cheating. I'll try a different, more subtle method to see if it's viable.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby MAL8010 » Sun Feb 04, 2018 8:48 pm

I've thought about this some more and I think the best way forward is the following:

1. Remove FIRE from the building combo's - if you want to build multiple of the same object one after another, it's actually slower at the moment because you have to wait for it reset back to combat mode then go through the process of entering building mode, then RB/LB etc. Whereas on PC and even on a controller once you've built 1 stair it stays on stairs so you can easily build multiple in quick succession which is a common occurrence e.g. if rushing up to someone's base you'd build multiple stairs. This would then match how it works on PC - press a keybind, it moves to that building type, press FIRE to build, stay on same building type after.

2. The problem the above generates is that you then have to keep track of the following:
- whether we are in building or combat mode
- if in latter then just have to run the current combo as usual
- if in former then we have to know which of the 4 building types we currently have selected - thus can calculate which direction have to move to get to desired piece (either left or right) and how many steps e.g. if on a wall and press the key bind for stairs we would need 2 steps to the right (RB twice on an XBOX).

This would then match how it works on PC, for a given key bind wherever you are in combat more or building mode that key press will take you directly to that building piece then all you have to do is press FIRE to build it.

The above is way beyond my coding ability though, if someone could help with this it would be greatly appreciated and would be a very useful script IMO.

I've seen someone else look at tracking building/weapon slots on this thread viewtopic.php?f=6&t=7812

I don't think it's possible to do the same for weapons as unlike building, weapons slots don't have to all be filled and it would be impossible to work this out IMO.
User avatar
MAL8010
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 263
Joined: Sun Feb 05, 2017 3:12 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby antithesis » Sun Feb 04, 2018 9:44 pm

It would be possible to track the current building piece as well as combat vs build mode, but it could get tricky and may come unstuck eg dying in build mode in PvE (but then why would you need a quick fort in PvE?). A tracking reset button could resolve that and we'd have access to many spares on a kb.

Food for thought though, so thanks for the insight.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby ungabunga9 » Sun Feb 04, 2018 10:04 pm

Before I started using keyboard inputs (for instantaneous stairs/walls), I made a script that did keep track of the current building object. The problem was that it took far too long to send all the controller commands. You need long wait times between button presses for everything to register in this game. Last patch, they added a feature that should have improved this, but I had already found my keyboard solution. (They also reverted that building change this patch)

I would love to make the automatic base building, but I cannot send the fire command(rTrigger) while my T2 is setup for keyboard outputs(multi HID setting).

If the T2 could send keyboard+controller outputs to the console, we could do the following:

-Instant selection of wall/floor/stair from controller
-Extremely fast base building macro on controller or kb+m
-Add extra functionality to keyboard(XB1 keyboard lacks crouch,sprint,aiming,...)
-Tracking of weapon slots like you described(perfect double pumping)

If my dream above never comes true, the next best thing will be the new controller building scheme that Epic is currently testing. It will allow for a building experience similar to keyboard.
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: KB + XIM + Titan2 - Fortnite Combos

Postby bonefisher » Sun Feb 04, 2018 10:37 pm

You can build with one button on controller............ :smile0517: :innocent_smile_1:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 124 guests