1
\$\begingroup\$

TLDR QUESTION the main thing I don't understand how do i make it so that when i press a keybind i activate not a skill but a slot in the skillbar and the slot in the skillbar activates the skill

extra details :

The system im trying to achieve is basically Minecraft + Classic mmos.

tool bar with 3 tools on the side of an array of 3x24 so 75 slots in total, mouse wheel to scroll through the tools, left click to use the main function of the tool and right click to use the secondary function of the wheel, in the image there is a crossair even tho it is kind of transparent and hard to see in this screenshot. I plan to eventually have at least 7 classes, 10 skills per class which means 70 total skills and other skill tress that are classes and by classless i mean they don't have any classic mmorpg archetype of theme attached to it like being an archer/warrior/mage and so on..

each skill can be used while holding any tool whatsover, and the characters have 4 ways of hold things.... Iron guard like in the image, where you hold any long object behind you be it a sword spear or axe whatever, an universal holding system that applies to anything and looks natural with any tool, dual wielding, and shield+ sword

kind of like in guild wars 2 .

so each skill has 4 variations for the animation which can seem crazy "omg this guy wants to make 280 different animations! it's impossible" .... not really all I have to do is take one animation that already exists, adjust the arms by doing a bunch of copy and paste and each animation can be adapted in a few minutes even seconds.

so it's more a question of each skill having 4 possible states which isn't that crazy at all, it's just if elif elif elif else.

and for now my third person controller script looks like that : https://github.com/Ceisri/Velsia-Action-combat-/blob/main/scripts/Action%20combat.gd

i had another script with another character model and more animations but i realized something like "wait it is useless that i spend all this time with all those attacks and such things, i first need to understand how to make a skill"

so now that i fixed a bunch of problems with movement mechanics, like dodging, sliding, teleporting and climbing....all i need to do is to add a crouching system and swimming system and then i can work on adding a skill bar and a skill tree.

enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

In general you need these:

  1. HUD elements, which ideally would be Controls. So the bar is a Control and each slot is a Control (and you probably use Containers to arrange them).

  2. Scripts attached to those Controls, so they can take input (not disimilar to how the player controller takes input). So they can react to the actions the player presses to activate the skills.

  3. Custom Resources to represent the skills, then you can have an export var on the Control scripts to associate them to each slot.

  4. A way to communicate with the player. I suggest you an autoload (sigleton) for that. You might, for example define a signal in the autoload, the Control emits the signal passing the skill Resource... And the player controller (or another Node in the same scene) can subscribe the signal in the autoload and acutally execute the skill. Yes, the autoload would be a signal bus (event bus).

The execution of each skill might differ, of course. Some aspects you might configure with properties on the Resource. But presumably skills not only have difference of degree but also differences of kind... So you want to associate behavior to them... To do that, give them PackedScene properties of the things they would instantiate (e.g. which projectile it shoots, or particles, or whatever you need), which can each have a custom script attached, so they all have unique behavior.

Assuming the instantiated scenes need access to the data on the Resource that represents the skill, you can have a method in the Resource class that handles the instantiation and also injects itself in the instance.

See How to implement a composable character/skill system in the Godot 4.0 Game Engine? for a more elaborated version of this (I'm aware you are on Godot 3, but the idea is the same).

And, of course, you would further develop the UI, to allow the player to customize which skill goes where (e.g. drag and drop).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .