Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

Post gaming related scripts
User avatar
evilC
Posts: 4777
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

20 Feb 2019, 14:22

"how old are earth do I know which one is trigger or start?"

To tell what button number of your physical stick each button is:
Start -> joy.cpl
Preview the controller
Press a button on the controller
See which number lights up
TheFatal
Posts: 34
Joined: 30 Jan 2016, 06:58

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

24 Apr 2019, 09:46

hey evilc, can you please explain to me how can i use a while loop in ucr scripts ?

im usin if else construction at the moment:

Code: Select all

if (e){	
			static StickOps := UCR.Libraries.StickOpsa
                      
                        this.OutputButtons.OB1.SetState(1)
                        sleep 20
                        this.OutputButtons.OB1.SetState(0)
                        sleep 20
                        this.OutputButtons.OB1.SetState(1)
                        sleep 20
 	} else {
			this.OutputButtons.OB1.SetState(0)
		}
can i use while loop instead of if/else ? for example i need to hold button and repeat actions until button will be released
User avatar
evilC
Posts: 4777
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

24 Apr 2019, 13:33

You should not use any kind of long running loop, period.
You must use settimer. Your function must end as quickly as possible
AHK is not a multi-threaded language - a loop will stop other plugins from working, or other plugins will stop the loopfrom working
User avatar
evilC
Posts: 4777
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

24 Apr 2019, 13:59

Code: Select all

class MyPlugin extends _UCR.Classes.Plugin {
	Init(){
		this.SendFn := this.DoSend.Bind(this)
		; Normal Init code here...
	}

	MyHkChangedState(e){
		fn := this.SendFn
		if (e){
			SetTimer, % fn, 100
		} else {
			SetTimer, % fn, Off
		}
	}

	DoSend(){
		this.OutputButtons.OB1.SetState(1)
		sleep 20
		this.OutputButtons.OB1.SetState(0)
		sleep 20
		this.OutputButtons.OB1.SetState(1)
	}
}
Even then, when this fires, it will interfere with other plugins for ~60ms due to the 3x Sleep 20
ranin26
Posts: 2
Joined: 27 May 2019, 03:44

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

27 May 2019, 05:45

@evilC I want to send an output on button press and another on release. I saw you tell another guy to use code runner. I tried using code runner with this for the release output: Send vXBox Stick 1,B but that just types it out, how do I get the actual xbox button as output?
User avatar
evilC
Posts: 4777
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

28 May 2019, 10:51

@ranin26 You can't send vXBox output using the code runner
I wrote you a new plugin to allow you to do this - save this file to Plugins\Core
The plugin is called "ButtonToButtonPr" in the plugins list
It will be included in the next release of UCR

Code: Select all

class ButtonToButtonPr extends _UCR.Classes.Plugin {
	Type := "Remapper (Button To Button - Press / Release)"
	Description := "Remap press or release of input to press and release of output"
	Mode := 1	; 1 = Press, 0 = Release
	; The Init() method of a plugin is called when one is added. Use it to create your Gui etc
	Init(){
		; Create the GUI
		Gui, Add, GroupBox, Center xm ym w170 h60 section, Input Button
		this.AddControl("InputButton", "IB1", 0, this.MyHkChangedState.Bind(this), "xs+5 ys+20")
		this.AddControl("ButtonPreview", "", 0, this.IOControls.IB1, "x+5 yp+5")
		;Gui, Add, Text, y+10, % "Remap"
		Gui, Add, GroupBox, Center x190 ym w170 h60 section, Output Button
		this.AddControl("OutputButton", "OB1", 0, "xs+5 ys+20")
		this.AddControl("ButtonPreview", "", 0, this.IOControls.OB1, "x+5 yp+5")
		
		Gui, Add, GroupBox, Center x370 ym w220 h60 section, Settings
		Gui, Add, Text, xs+5 ys+30 w130 Center, % "Send press and release on"
		this.AddControl("DDL", "Pr", this.ModeSelect.Bind(this), "x+5 yp-3 w75 AltSubmit", "Press||Release")
	}
	
	; Called when the hotkey changes state (key is pressed or released)
	MyHkChangedState(e){
		if (this.Mode == e){
			;~ Tooltip % e
			this.IOControls.OB1.Set(1)
			Sleep 50
			this.IOControls.OB1.Set(0)
		}
	}
	
	ModeSelect(value){
		this.Mode := ( value == 1 ? 1 : 0)
	}
}
Goodentree
Posts: 1
Joined: 09 Jun 2019, 08:25

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

09 Jun 2019, 09:09

Keep Getting. Error in include usrmain.ahk
Call to non-existent function
Line 141
Messagethreadfilter.ahk

The above is running UCR.ahk

Launching the ucr.exe just launches then disappears
michielsweb
Posts: 1
Joined: 25 Jul 2019, 01:33

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

25 Jul 2019, 02:39

Hi i had a issue, but i was able to party solve it whit ucr and vjoy. i was just wondering. if u could help me whit a minor solution

can there be a option like this implentend in ucr?
keyboard combo on press = turn on vjoy button 1
other keyboard combo on press = turn off vjoy button 1

motivation:
i got a toggle switch hooked up to a usb inport card which has 56 digital input. but only suport 32 joystick buttons from himself,
now i can map the rest whit keyboard command per pin. whit active and lose active keyboard commands.
and make off = always off not sometimes on and sometimes off. depending how the toggle was when card is connected :)

i want down to be on. and up off on my toggle. :)

example.
currently the card puts this out for vjoy
right alt + 1 = on and right alt +`1 when release again. whit toggle to prevent flutter. as i have 30 buttons mapped like this example later.
my card software allows me to make seperate command for active and release. so if i can ucr to understand this logic. i can
make toggle active right alt +1 = button 1 on.
make toggle not active right alt +2 = button 1 off witch wil emulate real toggle switches. :) whit toggle function would be super if posseble against flutter
fara74
Posts: 1
Joined: 30 Sep 2019, 02:06

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

30 Sep 2019, 02:15

lt rt not show in ucr help
GoodCharles
Posts: 1
Joined: 17 Nov 2019, 00:47

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

17 Nov 2019, 00:57

@evilC
First of all thank you so much for creating UCR !!

I literally want a very simple setup with UCR but I can't seem to get it to work.
All I want is to set my W,A,S,D keyboard keys to trigger Up, Left, Down, Right respectively on the Left Stick. (Basically simulating an FPS game's movement)
Goal for this: Moving my FPS game character Forward, Left, Backwards and Right

(I'm willing to give any information to solve this)
May anyone please help? Thanks
DMarci
Posts: 2
Joined: 24 Nov 2019, 06:50

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

24 Nov 2019, 06:59

I am having just the same problem as the guy before me. Dpad seems to be broken. All the other buttons work after I bound them to different keys of the keyboard but Dpad seems to fail. It just cannot trigger the movements it was supposed to do...
I would like some help with this.. but I see that Evil is not so active recently.. I wonder why ;-;
DMarci
Posts: 2
Joined: 24 Nov 2019, 06:50

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

25 Nov 2019, 15:59

Okay, solved it already (I'm so stupid it took me hours, but YouTube is a useless thing for sure about UCR, they do everything so complicated and stupid in the tutorials, using like 4 programs to move one damn character when UCR itself can do it and others are misleading), now I have new problems XD
I think I will be testing now how to add multiple controllers.
Because Steam added the "Remote Play Together" feature and one needs to have a controller of course, but I have no Xbox controllers.
The only thing I could do yet is to set an Xbox controller onto my PC and my sister's PC as well. The result was that we played on different keyboards but the keys she pressed moved my character as well as the controls were the same. SOOOO to fix that I had to set keys on my keyboard that she will not press as she won't need them. Which makes it a bit hard but it is ok. In case more players want to play though we would need a "larger keyboard" for sure (joke) XDD Actually I will try to fix it somehow, maybe I will set buttons to a normal cheap controller or maybe I should mess with the profiles menu or the order of the xbox devices oooor maybe I just shouldn't have set it for my PC when she plays to make Steam see only her keyboard as a controller, ughhh its really complicated because I do not know exactly how Steam is using this new feature. In the news they said they "share" the keyboard, controller or mouse. That kinda makes no sense if there is no controller connected to my PC then there is nothing to share, right? but I know about youtubers who used a keyboard and a controller to play a game, therefore it does not "share" the controller but senses it on the other player's PC... Gives me a mind fff-heck. Idk yet, but I'll be on it.
TheFatal
Posts: 34
Joined: 30 Jan 2016, 06:58

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

01 Dec 2019, 05:09

hey @evilC , i need your help with 1 more thing: im using UCR 0.0.7 and mapped my WASD keys to axys by your "button to axis plugin", now i need to map axys to buttons for input overlay in obs because it does not recognise vjoys axys, so i "used axys to button" plugin and it worked perfect, bit it works only if i press buttons myself not in the my macro scripts, how can i map my macros axys to buttons ?
FlyingFree
Posts: 10
Joined: 24 Apr 2018, 01:52

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

13 Dec 2019, 07:16

I have JoystickCurves and UCR (I've been told they can be used together). I'm attempting to merge two axes into one. I have vJoy Monitor running and the JoystickCurves virtual axes are registering in the monitor but not the new virtual axis from UCR. The output preview in UCR shows the virtual axis output preview working. Am I missing a step? Is there a tutorial specifically covering axis merging?
Untitled.jpg
Untitled.jpg (71.35 KiB) Viewed 4596 times
Last edited by FlyingFree on 09 Jan 2020, 09:20, edited 1 time in total.
Pastuleo23
Posts: 1
Joined: 09 Jan 2020, 06:40

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

09 Jan 2020, 06:44

evilC wrote:
25 Dec 2015, 14:12
In version 0.1.4 you lost the ability to scroll the left pane. This means I cannot add more than 8 binds. Could you please fix this?
HeroMax
Posts: 1
Joined: 14 Jan 2020, 12:34

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

14 Jan 2020, 12:51

Would something like this be possible with UCR:

A mouse mode where the mouse movement in games acts smoothly, just like an analog stick.

I remember that some stategy games had a similiar mode, where pressing the middle mouse button would activate a pan view mode, so you could smoothly pan the camera around the map. The further you push the mouse from the center, the faster the camera movement. The Firefox browser actually also has such a function when pressing the middle mouse button.

Here are 2 example GIFs, watch in HD to view them in 60 FPS (otherwise you won't notice a difference):

normal mouse movement
https gfycat.com /practicalwildhornbill Broken Link for safety

smooth pan view (I used a gamepad for this)
https gfycat.com /smoggyelegantamericanbulldog Broken Link for safety

Basically in this mode, the mouse would act exactly like an analog stick:
  • to start this mouse mode, toggle or hold down a specific key (e.g. middle mouse button)
  • the current mouse position becomes the center
  • moving the mouse away from the center causes the mouse to keep moving in that direction, with a constant speed
  • the further you move the mouse away from the center, the faster the movement becomes
  • there is a limit for the maximum speed
The idea behind it is to enable cinematic panning in games that are usually best played with mouse & keyboard (FPS, 3rd person shooters). I find this really enhances the atmosphere especially in games with a big focus on exploration!

So during normal gameplay, you have the normal precise mouse movement, and during atmospheric scenes you can toggle the cinematic mouse panning to get a nice overview of the game's location.
User avatar
evilC
Posts: 4777
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

17 Jan 2020, 07:46

Your problem is going to be hiding the input from the game
When in "smooth pan" mode, you need to stop the game from seeing the normal input and generate your own
This would require something like windows hooks or AutoHotInterception (see link in sig)
Dixip52
Posts: 2
Joined: 18 Jan 2020, 05:04

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

18 Jan 2020, 05:14

My RX and Ry axis are not offered by URC (thanks google translation) : https zupimages.net /up/20/03/r1m1.png Broken Link for safety
Dixip52
Posts: 2
Joined: 18 Jan 2020, 05:04

Re: Universal Control Remapper (UCR) - v0.1.22 28th Oct 2018

18 Jan 2020, 05:49

@shaul Its not offering me Rx and Ry in the input

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 14 guests