XIM Community

A Discussion: How hard would it be to support Titan 2 scripts with Xim Link.  (Read 296 times)

Offline MRog40

  • MVP
  • *
  • Posts: 790
  • FPS games are 10% Aim and 90% positioning
    • View Profile
  • PSN ID: MRog40
I'm just curious. I'm wondering if there was a way to use AHK but have it automatically convert T2 scripts to AHK and run them.

Basically a way to interface the T2 language to control AHK, or use a different system entirely that will just natively run the scripts and send XInput.

I don't have enough programming experience to even know where to begin with this. In my opinion, the number one thing holding Link back is AutoHotKey. Very few people know how to or are willing to script with it. Even a simple method to convert Titan 2 scripts to AHK would help make Link a more viable replacement.
« Last Edit: 08:58 AM - 06/14/18 by MRog40 »
Xim Apex | PS4 | PC | G502 | Corsair K65 LUX RGB | C24FG70 | Astro A40 TR | QcK XXL

Offline W11cE

  • Moderator
  • MVP
  • *
  • Posts: 1421
    • View Profile
Ok, lets discuss.

First, AHK and T2 macros work completely differently. T2 is polling based (script is applied to every report), while AHK is event based (needs a hotkey or separate loop). This itself makes the writing of the scripts very different. Conversion from one to another automatically is not possible.

However, I have already thought about a way to do T2 style polling based scripts with AHK. It should be possible in theory, but requires quite a lot of IPC and I am not sure how well AHK itself can keep up with it. This is also quite a lot of code, so it is not just something that can be done over weekend.

Then the parsing of the T2 scripts. This could be possible, however doing runtime parsing is extremely inefficient. Luckily power and resources are not a problem with Link. This itself requires quite a lot of code and debugging for all different scenarios.

Then there are certain functions that dont have counterpart on Link. The question is how to handle those. Like this:
Code: [Select]
uint8 statusIn,  protocolIn,  deviceIn;
uint8 statusOut, protocolOut, deviceOut;
 
main {
    statusIn  = port_status(PORT_USB_A, &protocolIn,  &deviceIn);
    statusOut = port_status(PORT_USB_C, &protocolOut, &deviceOut);
 
    if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4)
    {
   ------------------------The actual stuff you want to do---------------------------
    }
}

Since there are no different protocols for in or out in Link, this
Code: [Select]
if(protocolIn == PROTOCOL_XB1 || protocolIn == PROTOCOL_XB1_WRC && protocolOut == PROTOCOL_PS4) should always return true for the script to work. But there could be different behavior for other protocols somewhere else, what to do then? Are both true or not?

The scripts would still need some sort of understanding to work. It is not as simple as just copypaste and it will work.

Offline MRog40

  • MVP
  • *
  • Posts: 790
  • FPS games are 10% Aim and 90% positioning
    • View Profile
  • PSN ID: MRog40
Thanks for the input, I didn't realize that T2 wasn't event driven, but I guess it makes sense. Would it be possible to stray away from AHK all together and develop an XInput based live polling scripting system for Link?

I know there is lots of other work to be done for Link first, and this would be a lot of work for you, but I know that functionality like that would be great for Link.
Xim Apex | PS4 | PC | G502 | Corsair K65 LUX RGB | C24FG70 | Astro A40 TR | QcK XXL

Offline antithesis

  • MVP
  • *
  • Posts: 5824
    • View Profile
Or buy a T2...just sayin.

Offline MRog40

  • MVP
  • *
  • Posts: 790
  • FPS games are 10% Aim and 90% positioning
    • View Profile
  • PSN ID: MRog40
Or buy a T2...just sayin.
Not going to throw $100 at a product I can do myself. I can write scripts for Link just fine, the T2 support would be for others.
Xim Apex | PS4 | PC | G502 | Corsair K65 LUX RGB | C24FG70 | Astro A40 TR | QcK XXL