FunkinCrew / Funkin

A rhythm game made with HaxeFlixel
https://www.newgrounds.com/portal/view/770371
Other
2.9k stars 2.26k forks source link

Question:how does the game read controls and where in the source code #1752

Closed UNSTOP4BLE closed 4 months ago

UNSTOP4BLE commented 3 years ago

Please check for duplicates or similar issues before asking your question.

What is your question?

Maniues commented 3 years ago

Reading Controls is not a part of Friday Night Funkin. It's low-level function, programmed in packages like HaxeFlixel, OpenFL, Lime, or Haxe itself. As declared in Controls.hx, FNF reads controls from: flixel.input.actions.*, flixel.input.gamepad.*, flixel.input.keyboard* So reading controls from keyboard may be part of Operating System, but interpreter is part of FNF: Controls.hx

UNSTOP4BLE commented 3 years ago

So i cant just rebind them without external tools and engines?

Maniues commented 3 years ago

You can. You can bind up arrow as a other key, g as down arror and any another key. The only restriction is that applies only in game. You cannot rebind you keyboard (modify drivers) but in game - yes

UNSTOP4BLE commented 3 years ago

how?

Maniues commented 3 years ago

@UNSTOP4BLE Just modify the source, then compile the game. What you want to rebind?

UNSTOP4BLE commented 3 years ago

Dont ask why but i want A, S to be the same And i want Z to be D, and X to be W, i also want W to be X and D to be Z

Maniues commented 3 years ago

@UNSTOP4BLE You want to keep old binds?

UNSTOP4BLE commented 3 years ago

No? Edit: i just relised how stupid i am, i will put a image

Maniues commented 3 years ago

Wait, I will tell you what I mean:

Dont ask why but i want A, S to be the same

So, either A and S must work?

UNSTOP4BLE commented 3 years ago

download

UNSTOP4BLE commented 3 years ago

A and S stay default

Maniues commented 3 years ago

@UNSTOP4BLE You can choose only some parameters. If you you Kade Engine, you can rebind game (image) If you use vanilla FNF, give me parameters from the image, and I will rebind FNF, and I will send you source and binaries image

UNSTOP4BLE commented 3 years ago

sry i didnt tell u this but im trying to do it for a ios port FunkinIOS (the source code is 99% the same) so that explains the weird control scheme and wdym by parameters?

Maniues commented 3 years ago

sry i didnt tell u this but im trying to do it for a ios port FunkinIOS (the source code is 99% the same) so that explains the weird control scheme and wdym by parameters?

Can you limit your scheme to above image or it's impossible? I can change Controls.hx for you, but I don't have Iphone/Mac so I won't compile it.

UNSTOP4BLE commented 3 years ago

i can compile it but make sure you get controls.hx from the funkinios link above, also what does limit the scheme mean. sry if its a stupid question EDIT: oh do you mean by limit the scheme to the image above just pasting the buttons if thats what you mean here ya go: 133488958-bd833cc4-c535-4182-896a-592a76e6525b

Maniues commented 3 years ago

@UNSTOP4BLE oh, thanks for updating. I will check it

Maniues commented 3 years ago

@UNSTOP4BLE "ACCEPT" means "ENTER" and "PAUSE" too?

UNSTOP4BLE commented 3 years ago

Yes i think?

UNSTOP4BLE commented 3 years ago

actually i dont think so, it is bound to Z witch in the original game only means like advance through the menu, not pause

UNSTOP4BLE commented 3 years ago

@Maniues did you do it?

Maniues commented 3 years ago

@UNSTOP4BLE I'm going to try it at the moment.

UNSTOP4BLE commented 3 years ago

oh, cool. i made the sprites

Maniues commented 3 years ago

@UNSTOP4BLE I sent you invitation to get a copy of rebinded game on GitHub. If you compile it, may you make a release in repo?

UNSTOP4BLE commented 3 years ago

Ok, i will try it tomorow after school

Maniues commented 3 years ago

Okay

UNSTOP4BLE commented 2 years ago

Well, i somehow got a cold so i cant go to school. I will try to compile the game now

UNSTOP4BLE commented 2 years ago

@Maniues sadly it hasnt chaned anything, i think that there are controls in other files like mainmenustate.hx and others

UNSTOP4BLE commented 2 years ago

@Maniues what did you change in controls.hx?

Maniues commented 2 years ago

@UNSTOP4BLE Did you compile game from this? See the commit

UNSTOP4BLE commented 2 years ago

yeah, i see what you chaned rn too, tryng to change other stuff too

UNSTOP4BLE commented 2 years ago

why do you have inline bindKeys(Control.UP, [W, FlxKey.UP]); and inline bindKeys(Control.UP, [X, FlxKey.UP]); in the same section? edit:nvm it was only in the commit

Maniues commented 2 years ago

@UNSTOP4BLE I will check this

UNSTOP4BLE commented 2 years ago

no i didnt relise it was just in the commit, the source code is fine

UNSTOP4BLE commented 2 years ago

this is so wierd! no matter what i change in controls.hx nothing changes, maybe the dev just put it in another file?

Maniues commented 2 years ago

@UNSTOP4BLE vanilla FNF works with Control.hx. Maybe iOS port changed the file.

Maniues commented 2 years ago

Does the FNF allow you to port it to iOS without using that fork?

UNSTOP4BLE commented 2 years ago

Nope, this one has on screen controls

UNSTOP4BLE commented 2 years ago

maybe it is possible to port the luckydog7's android port to ios? i have seen it on web browsers and they do work but i wanna play mods

Maniues commented 2 years ago

@UNSTOP4BLE It is possible (probably). Haxe is CROSS-PLATFORM. Just type lime build/test ios and it should work.

UNSTOP4BLE commented 2 years ago

wow, thats not the answer i expected! gonna try it now

Maniues commented 2 years ago

wow, thats not the answer i expected! gonna try it now

I think It should work, but the same applies for C/C++ Language. This port may use Android API (I didn't check), and it may don't work, but yea, try!

UNSTOP4BLE commented 2 years ago

ok!

UNSTOP4BLE commented 2 years ago

do i have to do it in mac os? if i do it gives me Error: Source path "/usr/local/lib/haxe/lib/extension-webm/git/ndll/iPhone/libextension-webm.iphoneos.a" does not exist

UNSTOP4BLE commented 2 years ago

@Maniues on windows it gives me error Source path "C:/HaxeToolkit/haxe/lib/extension-webm/git/ndll/iPhone/libextension-webm.iphoneos.a"

UNSTOP4BLE commented 2 years ago

on xcode it gives me Command ExternalBuildToolExecution failed with a nonzero exit code the build tool is "make"

Maniues commented 2 years ago

@UNSTOP4BLE It means that you must have Iphone version of "extension-webm". Try to get it here: https://github.com/KadeDev/extension-webm

UNSTOP4BLE commented 2 years ago

ok

UNSTOP4BLE commented 2 years ago

how do i install it?

Maniues commented 2 years ago

@UNSTOP4BLE Using HaxeLib. But you must select version from KadeDev . I think "haxelib install" and link to github. You must have installed openfl

UNSTOP4BLE commented 2 years ago

so like haxelib install https://github.com/KadeDev/extension-webm