Topic: Button input through script

Hello

i am working on an AI project, using the UFE as game base for training purposes.
I want to access button inputs through script, to give the AI  the ability to press individual buttons, rather than accessing moves. I cant find the correlating function though, which handles the inputs of the buttons.
Thanks for your help!

Share

Thumbs up Thumbs down

Re: Button input through script

I don't think you can fake button input with vanilla unity (maddening). I know control freak has that function built in and is super easy and I'll bet the other 3rd party input plugins do as well.

Share

Thumbs up +2 Thumbs down

Re: Button input through script

Ok, found out that the Windows Input Simulator works, though it has some major flaws in the case im using it. Having very repetitive button presses it seems to get stuck at a certain point, having only key downs, not key ups. So i would like to get back to function input.
Doesn't anybody know, where the function is located, that handles the input of the button press (keyboard or controller, from the Unity Input Manager)? Or does anybody have a different idea to give the ai the ability of individual moves, not already the combos?

Share

Thumbs up Thumbs down

Re: Button input through script

After searching for quite some time, i finally found a solution for my problem:
Accessing the AbstractInputController.cs
making the protected Dictionary currentFrameInput  public
and than changing the value like this :  UFE.GetPlayer1Controller().humanController.currentFrameInputs[UFE.config.player1_Inputs[2]] = new InputEvents(true);

Using this, i can access all pressable buttons like this manually through script.

Share

Thumbs up +2 Thumbs down

Re: Button input through script

I couldn't find AbstractInputController.cs
Is this only available in the Source version of UFE?

Share

Thumbs up Thumbs down

Re: Button input through script

Seraphyx wrote:

I couldn't find AbstractInputController.cs
Is this only available in the Source version of UFE?

Yes

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.