Help with rpg damage in an action/active time combat system

Hello! See, im trying to make an rpg but with allies and enemies at the same time (basically imagine something like tales of symphonia or kingdom hearts). I still have no exact combat system yet, but here is a thing im worried about and any help is appreciated:

The game will have a skill/magic system, like any rpg, but something i wanna do is make it like fire emblem where you both can raise skill levels and change classes. This has to do with my question btw because

You can make units learn skills by giving them certain items or training them, but something i noticed is 1.) i noticed that if i wanted to make a skill, i probably have to make a event for EVERY mob/ally about the same skill, and i dunno if there is a better/more efficient way to do it and 2.) i have the objects devided in 3 groups, combatants, allies and enemies, allies and enemies both being combatants too, so im worried that if i make a damage formula with the health extension like (a.variable * variable - b.variable. Its nit exactly like that but i managed to make a rpg maker like damage formula using the health extension basically) BUT the damage/heal scales off from the wrong object’s variables/stats. For example, a ally used an fireball spell, but the damage of the fireball scaled out of EVERY combatant’s magical stat, or maybe uou used an ape slash, but the damage was reduced by EVERY enemy’s defense, rather than their own individual defense of every target.

Basically: is it possible to make both a skill database like rpg and just plug in a mob the skill/magic they can use?
How do i make sure an rpg like damage formula works without having to make an event of every skill for every mob individually?

I hope this made sense

Hello and welcome!

There are lots of ways you might go about this, but here are some of my ideas. You can reference groups in the events instead of objects. So, if you make your skill events reference “combatants”, then you only need to code the skill once and any ally or enemy can use it. However, one problem i frequently run into is that you cannot reference another instance of the same object. Meaning, if you want a skill to have a source object and a target object, you can’t use the same object or group. So you wouldn’t be able to make a skill from “combatant” target another “combatant”. For that reason, you might want to code the skills twice: once for ally to enemy, and once again for enemy to ally.

Now to prevent events from affecting all members of a group (or the wrong member of a group) you’ll need to understand how Gdevelop filters your instances during events. This took me a while to understand, but basically certain actions and a lot of conditions will automatically remove instances from being picked up by subsequent conditions & actions within the same event.

Do you have a box object or something that sits over ally objects the player clicks on, to indicate which ally is selected by the player to take an action? If you do, you could use “center point of that box is within ally object” condition in your event to filter out all the other instances of ally other than the one that has the box on it. That way, any subsequent actions in that event will only apply to that instance, such as reading an object variable for a stat number.

It can be tricky to predict exactly how the filtering works. Note that there are special conditions and actions called “+ pick every instance of the object” that will basically “unfilter” all the instances of the object so that subsequent events and sub events will pick those again.

Also note that every separate event always starts with all the instances unfiltered, so no need to use those unfilter actions every time if you are starting a new event… they are only needed for unfiltering during the same event (or, if you want to unfilter during a sub event underneath a parent event)

1 Like

Thanks for the reply!

So…does that mean that all i have to do is code/make an event for the same skill twice, each for a team?

Also, could you elaborate a bit on the conditions/filter parts abit? See, the game is action based, so there will be some aoe attacks, so if you could elaborate abit on that ig will be very helpful!