Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

Hey Yal, I'm wondering if you could help me on what to do for making moves that can do the following:

-Metronome like effect, completely random move

-A random move from a specific type (Example: Channel, uses a random Ghost type move)

I'd also like to make one that deals a random status effect, a random move from a list of specific moves, and a random stat lower or raise, but those ones I could probably figure out on my own once I know how to make those two. Also, I guess the metronome like move would need a blacklist so you don't pull out a boss-only move or something.

The answer to all of them basically boils down to "make a list of all moves and then pick a random entry from the list"... for very narrow categories you could build these lists manually, but for large lists (e.g. Metronome specifically) you could do this automatically: loop over all moves (after you've defined them in init_moves) and add the move ID to the list if it's valid (you could check validity using a new "valid for metronome" property, or your own list of invalid moves)

Now for the tricky part, when to do the table lookup and how to work it into the move system... I think this would be the easiest way:

  • Make the move target the user (movetarg_USER), be of movecat_SUPPORT category, have no damage, but a 100% chance to trigger a special effect
  • The special effect is of a new movespfx_METRONOME type, the "detail" field could be a reference to which random list of moves to pull from
  • When the side effect is rolled (battlecontrol step event, line 778 onwards ("Side effects (user)"), you action_enqueue_prio the new move you pick from the list (thus making it be performed immediately instead of being scheduled based on the Speed stat). You can use battle_get_random_targets() to get a random valid target for the move, see the bcontrolstate_ACTIONSELECT_ENEMY section at line 393 onwards where it selects moves from the AI.