I have this action bar that has many slots and each slot has its own key assigned to it. The problem i have is when i drag a skill on it. When i then press any of the action bar slot keys it executes the skill just like when the skill was dragged to all slots at the same time
I have this logic where it checks which slot is assigned to which key exactly. It seems that it does not work for some reason.
and here the skill on the actionbar⊠No matter where it is any key from the action bar will execute the skill.
I hope someone can help to fix this. The branch on the first screenshot after the key bindings are checked for each individual slot returns the message key pressed when i press any of the keyâs.
Asking, as there should never be any need to loop through anything to do something like this. You press the slot key and execute whatâs in the relevant slot directly.
Worst case scenario in some uncanny and unique setup, Iâd map key-widget. I am judging by the description but may not see the whole picture here, ofc.
You then tell the user widget to execute whatâs inside its NamedSlot, do nothing if no child is present. This make re-parenting and handling drag & drop pretty straightforward.
Re: original question:
If this triggers for all - the mapping is incorrectly set up. What do you get when you print-compare the keys?
I made them from this tutorial https://www.youtube.com/watch?v=UjidNRD-hSU
and on part 2 of it is where those action bar slots the keybindings of them can be changed on the go not sure if that was the loop forâŠ
How can i do that ? I wanted as well to find out how to print string individual slotsâŠ
I dont think i used those ânamed slotsâ it was a normal button. Here is the individual slot alone and how it looks like
I really appreciate the help on this one. I think (not 100% sure) yestarday it worked i dragged a skill and i could use on the individual slot key the skill but something happend or i changed something. I dont know what happend and it stopped working . Iâm sitting scince yestarday working on this but i cant make it work again. Today alone im sitting around 5-6 hours on it and i dont know how to make this to work
On my last screenshot i can open the keybinding window and set a key to a different one and it updates it immidiatly. Lets say the action bar slot 1 to RMB (right mouse button) then i see it changed to RMB⊠Iâm not sure what to do now or where to print string to check that.
Btw, this is a 2 year old tut. If youâre using UE5, the old input systems are now deprecated. So Iâd need to assume the tutorial it is not using Enhanced Input which supports a much better key mapping system.
Iâm expecting Epic to completely phase out the old input at some point. Usually takes a year or so. The legacy currently works. I now see the tut is using Input Selector - itâs been a couple of years since I dabbled - not sure how much assistance I can offer here, would need to refresh my memory - itâs just not a worthy investment at this point.
But printing the results should give you a clear overview regarding what is being checked against what. Iâd start there.
and i pressed all the buttons 1 by 1 starting from 1 then 2,3,4,5⊠and so on here is what came out-
Is this not working ? it seems when i press key 1 it is counted as 1 and so on. Why i cant put my skill on slot 1 and use key 1 to trigger it ? if i drag my skill to slot 1 any other slot key will trigger it as well⊠Am i connecting my skill at the end (after the print string was) to execute the skill false there ?
So yeah, the result is always true, as expected. Look into the logic of how this is supposed to work then - I cannot tell from the snippets provided. Why is the mapping and key always the same?
Assuming the mapping is correct - why is the key behaving like this? Are you calling Check Binding in a loop as well and provide a new key?!
No im not looping the âcheck bindingsâ function anywhere.
Is this not working as it should when pressing key one and print strings 1 as well then 2 and so on ?
Actually there is outside the check binding in the event graph this one
I think itâs working correctly, youâre comparing the wrong thing in the wrong place. Youâre checking for corresponding keys and they do, indeed, seem to match up nicely.
This is the time to send a message to the underlying widget to execute its ability if it has one. Youâre dropping widgets into slots - how does a slot currently know it has something - a widget ability - to execute?
This is your slot:
When happens when you drop? You must be storing a reference to what you dropped, right? Or setting some kind of value? An enumerator? Int? String? Something that tells you what sits in the slot. Perhaps each ability is a widget? How does it work?
i put a custom event on my player character bp which connects to the skill i want to trigger. Then in the check bindings i try to connect the custom event but it triggers it on any key⊠I assume i need to put the trigger logic when i press the key somewhere else but not on check bindings right ? i awso try to reverse it and get check bindings to my character bp and trigger the skill but it isnt working âŠ
The cast button has this on it to know something get dragged to it
Where should i put the skill on to trigger it when pressing the key ? Theonly thing that worked was on check bindings but it triggers it on any key. The same happens if i move the skill on the skillbutton itself same result
The skilldata structure from which it knows when i drag a skill from my skill tree only stores the basic information how the skill looks like (skill image/icon) and description text but it has no idea what the skill does or how it triggers. The skill is separate on my character bp and i have it there either on a pre defined key like âEâ for example and i want to move it to the action bar keys if i only know how i can trigger a skill from there. If i press key 1 and it print strings 1 should i not put my skills in connection to this function somehow? Where would you put the skill to be triggered when pressing the actionbar keys ?
No is not part of the tutorial and i am combining 2 tutorial of his but they are separate and does not contain info how to trigger skills only how the skilltree is build with the data struckture and data table. So i can open my skill tree purchase skills then drag the skills to my action bar and i see the images updating i can move them from 1 slot to the other. But the data structure dont tell them anything where the skill itself is located or how to trigger it. I need to somewhow link my skill to be triggered when i drag skill X⊠the skill itself on the skill tree with the icon does acctually know that âteleport skillâ is the teleport skill because it unlocks it and i could then click on it on the action bar or better say i can press the key after i drag it down there. But all the keys trigger the skill hmm
I need to only replace the predifined key 1 to the action bar key to start executing it somehow so maybe with a custom event and then call this custom event on the key i press on the action bar. If i can do that then this will be solved. But when i try to change the 1 key with custom event and connect the custom event to the âcheck bindingsâ for example it iant working properly then any action bar key triggers it. But it seems to work partially . I need to purchase on the skilltree the skill first then drag the skill on the action bar and then i can trigger it - the only problem is that any key from the action bar triggers the skill and not the specified key on the action bar where i dragged the skillâŠ
So you have a massive list of abilities the player already knows upfront, not matter how many theyâve unlocked so far.
We can work with that but itâs not the way to do it. This will be nightmare to refactor in case you ever need to change how things work. Can we see whatâs in the struct? Is there some kind of ID a skill has, a name? Are the names unique enough to use them?
And yes they have an ID which is the skill name with a prefix Like âTeleport_Skillâ
this i can then lock in the character bp and make it only usable if it is purchased with a skillpoint.
Mana cost and cast time are not even used i directly put the mana cost on the skill itself.
Problem remains tough that i only need to trigger the skill properly after i drag it on the action bar. As of now all action bar key trigger the skill when i drag it anywhere on it
If those key print string correctly the keys i am pressing on the action bar, then how would i go about to make this key i am pressing to acctually trigger the skill (instead of all action bar keys to trigger it) ?
Yeah thatâs correct. All my skills are on my character right now
Edit:
The skill tree shows all the skills and the player has them all in the playerBP but they are locked in the beginning logic of the skill so they cannot be used unless they are purchased with a skill point. So befor that they are not usable. Not sure if this answers the question if the player âknowsâ the skills but thats how the skill work.