Targeting Random En...
 
Notifications
Clear all

Targeting Random Enemies and Levelling Up Skills

7 Posts
2 Users
0 Reactions
254 Views
0
Topic starter

Hi all! I have a couple questions about combat, as per the title. 

  • Is it possible to have skills that target random enemies and
  • Is it possible to level up the damage of skills alongside the heroes? I can see that it's possible to unlock new skills as the heroes level up, but I don't want previous skills to become obsolete because their damage output is less significant. 

I'm new to coding and game making in general, so, while I suspect it's something to do with variables, I just don't know how I would go about it. Any help would be appreciated, thanks a bunch 

3 Answers
0
  1. I'm not sure how to target a random enemy, but if the ID of an enemy within a troop can be retrieved in a formula you could do something like "Target: All enemies. Target formula: t.id === Math.random()*troop.count". I attached a screenshot below, but this doesn't actually work! The enemy ID and troop size probably have to be something different.
  2. Of course it is! Skills that incorporate any stat already kind of level with you but you probably want to read the user's Level and deal damage based off that? If you want to deal 10 damage per user's level you should use the damage formula "u.lv*10". If you can give the specific idea you want, I can help you with that, as well!

Random enemy mockup (does not work!)

Damage based on level:

 

If you want to share your specific damage-idea, I'll gladly help out!

Blep.13 Topic starter 05/05/2025 2:56 pm

@the_ramen_dutchman Thanks for your answer! I did end up working out how to scale with level shortly after posting after I learned what the abbreviations in the original formulae meant, haha, but I appreciate your breaking it down! I ended up scrapping the idea for random targets, at least until I get a better understanding of how to build skills.

With a similar thought in mind, do you know how to utilise the 'temporarily change target' option in effects? I read the section in RPG Paper Maker's guide, but I don't know what 'you have to return an array of battlers' actually means in practice.

0

Sorry for the belated reply!

I think you mean "Temporarily change target: You can temporarily change the target for this effect only. You have to return an array of battlers. Example: [u.battler] will be the user of the item/skill/weapon." from the Effects description, right?

From that description I'm not exactly sure what it does, either. I'll look at the game scripts and try some things out..!

Blep.13 Topic starter 08/05/2025 11:09 pm

@the_ramen_dutchman No worries! 🙂

That's the one! I appreciate the aid and wish you smooth sailing with your own project 🙂

0

@blep-13 Did you figure out how to target a random enemy? 'cause I'm not sure I have 😅

I can confirm that "t.id" does not refer to the first, second, third etc. enemy in the troop but to the enemy type ID in the database, referring to this ID:

This is still useful; if I'd ever want to make a skill that targets a specific enemy or deals more/less damage to a specific enemy type I could use this rather than referring to someone that might change such as their English name.

But that does mean that setting a skill to target all enemies and then using this target formula does not do what you want:

t.hp > 0 && t.id === Math.floor(Math.random() * 3)

I was hoping this would randomly target the first, second or third enemy in the troop but instead it randomly decides whether it targets Woolies, Mushroomies or nobody 🙃

Blep.13 Topic starter 10/05/2025 12:17 am

@the_ramen_dutchman I haven't yet. A random spark of an idea though - within the status window, one of the affects that a status can have is to 'attack a random enemy'. Would it be possible to afflict a status within the skill that applies the 'attack random enemy' restriction before the attacking part of the skill? I have no idea if that made any sense, or if this is just the ramblings of the chronically sleep deprived - my apologies if it's the latter.

on the plus side, I suppose that formula would work if your enemy troops were only made up of the same enemy types. 🙂

The Ramen Dutchman The Ramen Dutchman 12/05/2025 6:57 pm
This post was modified 3 weeks ago by The Ramen Dutchman

Posted by: @blep-13

one of the affects that a status can have is to 'attack a random enemy'.

You got me searching on the right track, though!

Based on what I see in a battle script here https://github.com/RPG-Paper-Maker/Game-Scripts/blob/develop/src/Scene/BattleStartTurn.ts#L205

If I could access a battle side from a formula or script, such as `battle.side[CharacterKind::Monster][Mathf.random(0, battle.side[CharacterKind::Monster].length -1)]` that would fix this but I think this needs an extensive plugin to fix... Sorry for now!

Share: