Need help from people with ps and(or) xbox and steam deck controllers

Not sure where to create such request, general discussion seems fitting.

What i want is - you start this demo using a controller: https://qiujiu.itch.io/qj-bullet-plugin

Then say which button is used for shooting, and which - for interaction. That's all. Just please write what controller you are using.

UPDATE: What's above no longer relevant. I want the owners of Playstation and Steam Deck controllers to assign something (even the script from the demo) to page up or page down, and see what buttons on those controllers would activate it.
I already told you that demo project uses the mouse click for shooting.
1741905864581.png


These are the default (xbox) controller buttons as mapped in the RPG Maker engine
Code:
Input.gamepadMapper = {
    0: 'ok',        // A
    1: 'cancel',    // B
    2: 'shift',     // X
    3: 'menu',      // Y
    4: 'pageup',    // LB
    5: 'pagedown',  // RB
    12: 'up',       // D-pad up
    13: 'down',     // D-pad down
    14: 'left',     // D-pad left
    15: 'right',    // D-pad right
};
If you want to change the bullet trigger to controller buttons you need to change TouchInput.isPressed() to for example, Input.isPressed('ok')

You also need to change the bullet InitialRotation from M[] to PD[] or whatever the player direction code was in the plugin
These are the default (xbox)
What about PS and Steam Deck controllers?

If you want to change the bullet trigger to controller buttons you need to change TouchInput.isPressed() to for example, Input.isPressed('ok')
So it is impossible to keep it for left mouse on pc if you want to also use it on the controller?
Or can i create 2 parallel events, one for pc, and another for gamepad?
What about PS and Steam Deck controllers?
I don't know, you can Google it.

So it is impossible to keep it for left mouse on pc if you want to also use it on the controller?
Or can i create 2 parallel events, one for pc, and another for gamepad?
You can check for both triggers with a compound conditional script, the problem would be the initial rotation which would either be the mouse click/touch screen input position or the player direction based on if they're using the mouse or gamepad. You're probably just going to have to have two separate bullet objects and put the second one under an else if statement.
I don't know, you can Google it.
Could not find any clear info about it, so i created this post, it will be better if someone will confirm the information with certainty.

You're probably just going to have to have two separate bullet objects and put the second one under an else if statement.
Yes, i was thinking about two seperate bullets, one activated by touch (so left mouse), and another - by page up or down (so rb or lb on controller). I doubt that players will press page buttons during gameplay on pc so it should probably be fine even without else. But i do not really understand your proposal with it, what should be the initional action that is followed by else?
I'm suggesting you do this
1741970280051.png
I'm suggesting you do this
View attachment 334286
Oh, yes, that will be better than my idea, thank you.

Then, i only need people with PS and SD controllers to see if page down or up will also equal RT and LT.
I'm suggesting you do this
View attachment 334286
So it works with most bullets except one.
Seems like this condition -
1747492309070.png

is working only when button is just pressed, but the bullet only works when player is holding the button. Is there a script that would check if player is holding the button instead of just pressing?
You can use Input.isLongPressed('ok')

If you want it even longer you will have to tick up a variable to your desired length then fire the bullet once the variable reaches that threshhold
You can use Input.isLongPressed('ok')

If you want it even longer you will have to tick up a variable to your desired length then fire the bullet once the variable reaches that threshhold
It does not work, portals also appear (and for some reason one extra at character's position) but do not do anything. The only difference is that this time moving cancels them as well (it should not).

I do not need specific length, i need the spell to be active as long as player holds the button.

I tried the variable variant, but i am just generally bad with them and hardly have an idea what i am doing. This is what i tried -
1747550642514.png
And it does not work at all (portals not even spawning), also it blocks the touch input version as well so it can no longer be used after pagedown is pressed.
Tried with your script as well instead of standard command, same outcome.


Perhaps, you can spot where i made a mistake?
And it does not work at all (portals not even spawning),
You shouldn't need a loop if this is already a parallel event. Why not do some basic troubleshooting and press F9 to see if your Control Variable 3 is increasing at all?
You shouldn't need a loop if this is already a parallel event. Why not do some basic troubleshooting and press F9 to see if your Control Variable 3 is increasing at all?
You are correct, the variable does not rise with loop. Or, rather, it stops on 1.

But i need loop, if i remove it, portals stack one on top of another. It seems like they spawn and disappear all the time while button is being held, and without loop they do not despawn.

Also, if i remove loop from the pagedown event, it does not change anything, it is not working even despite variable counting.

For me it looks like since RM does not have any native support for holding a button instead of pushing it, and it can be only done trough variables and stuff there is no way to use this bullet on anything but touch input, making it impossible to use on the controller.

That, of course, if you don't know any other way to check if player is holding the button pressed.

UPDATE: i tested the

Input.isPressed('pagedown')

That should be absolutly valid script, and it does summon portals, but they don't fire anyting, and as before one extra portal blinks on top of the character. It's so weird, the entire script are exactly the same, but if you only change touch input to button hold it becomes bugged like that... for no reason at all.


UPDATE 2: Ok i got it to work, but it is still not working! Or, rather, it breaks after first cycle.
I realized that the second command, and the command inside the enemy should be written starting from the exclamation mark. No idea what it does, but i assume that it serves as a check if button is held instead of pressed. So the proper event looks like this:
1747585645422.png

But it still breaks.

- If i put it in the same event as main one (touch input) under else statement, it breaks both of the events.

- If i put the separate parallel event only with this command, it works perfectly until i release the button. Afterward it does not work at all, nothing happens when i press it. WHYYYYY? Now it's exactly the same as the original one! Unlike touch input - something stops it from repeating itself, but what? THEY ARE THE SAAAAAME! I even made seperate enemy events for the pagedown press.
This works for me for holding down a button to fire a bullet. No loop needed.
1747586724416.png
This works for me for holding down a button to fire a bullet. No loop needed.
View attachment 340724
But that is not a portal summoning bullet. Portals work different from ordinary bullets.
In QJ demo they are called "Fawn Farsia Bit"


In edits above i was barely able to fix it, found the right script call, but for some absolutly ridiculous reason the loop does not continue with anything but touch control.
But that is not a portal summoning bullet. Portals work different from ordinary bullets.
In QJ demo they are called "Fawn Farsia Bit"


In edits above i was barely able to fix it, found the right script call, but for some absolutly ridiculous reason the loop does not continue with anything but touch control.
Because the spawned event itself is checking whether touch is being pressed and if not it unspawns itself. You need to edit the spawned events to also check for button/key press
1747591099386.png


1747591165293.png
Because the spawned event itself is checking whether touch is being pressed and if not it unspawns itself. You need to edit the spawned events to also check for button/key press
View attachment 340745

View attachment 340746
Wow, it's actually working! Thank you, again!

But i don't understand the logic. If you will have a bit more time, can you explain please?
I editted the enemies before as well, they were matching my main event, looked like this -
1747594425441.png

From what you did i understood few things:
Instead of else statement you used the || symbols to seperate the two commands. I guess it's script equalent of else. It also does not work if you don't put () around entire block, but after the ! (didn't notice that at first so it wasn't working without that).

But for me it looks like your option should do pretty much the same as mine. Except that yours work, and mine disables entire event after first activation. And only difference is that... you put the dividers instead of else or new event? So it is probably not exact equalet of else. But if else was the problem, then double event solution would work...

At this point i am really curious what's going on, because i thought the i understood even'ts logic a bit, but it appears that i did not. Explaining this is not essential if you are busy, since my problem is solved. But if you can, i would be interested to read about it.
|| means 'or' in javascript. You can also use && to mean 'and'. It's how you check for multiple conditions to be true or false.

If I use
if(a || b)
It will be true if either a or b is true.
In that way I can check if either the touch input or button is pressed, e.g. TouchInput.isPressed() || Input.isPressed('ok')

! means 'not'. Where you put it matters.

TouchInput.isPressed() || Input.isPressed('ok')
"The touch input or the 'ok' button is pressed"

Without the parentheses:
!TouchInput.isPressed() || Input.isPressed('ok')
"The touch input is NOT pressed or the ok button IS pressed"

!(TouchInput.isPressed() || Input.isPressed('ok'))
"Neither the touch input nor the ok button is pressed" / "The touch input or the ok button is NOT pressed"

Original thread: https://forums.rpgmakerweb.com/threads/need-help-from-people-with-ps-and-or-xbox-and-steam-deck-controllers.176213/