HM Field Effects without the moves themselves?

MuralSongChris

Rookie
Member
Joined
Sep 2, 2020
Posts
1
Age
24
Hello all! I've been working on a fangame for the past few weeks and I've hit a snag that I'm having trouble sorting out regarding what seems to be a pretty unique feature I'm trying to implement.

The feature I'm trying to add is effectively a complete overhaul of how field moves work. One of the first items you're given is a Mini TV, which you can use to show your mons training videos and workout videos that replace TMs and vitamin drinks like Protein. You can also show them instructional videos that teach them to do things like clear away plants, shake trees, carry you while swimming, etc... effectively the things that HMs do, but without the need to learn a potentially useless move.

Thing is, even with all the searching and asking around I've done, I'm having a heck of a time figuring out how to script such a thing. I think the best way would be to have the Field Move script check whether your Pokemon has used the relevant item (i.e., watched the relevant video)... but I really am stumped on how to write that out.

I made an account just to ask this, so I really hope someone can give me some good advice!
 

TechSkylander1518

Wiki Dweeb
Member
Joined
Mar 24, 2017
Posts
381
Oh, that's a fun idea! I hope you can figure it out!

One place I think might be a good starting point is the script section PokeBattle_Pokemon. That's got a spot that defines all the variables that can be attached to a Pokemon, like this:

Ruby:
class PokeBattle_Pokemon
  attr_reader(:totalhp)       # Current Total HP
  attr_reader(:attack)        # Current Attack stat
  attr_reader(:defense)       # Current Defense stat
  attr_reader(:speed)         # Current Speed stat
  attr_reader(:spatk)         # Current Special Attack stat
  attr_reader(:spdef)         # Current Special Defense stat
  attr_accessor(:iv)          # Array of 6 Individual Values for HP, Atk, Def,
                              #    Speed, Sp Atk, and Sp Def
  attr_accessor(:ev)          # Effort Values
  attr_accessor(:species)     # Species (National Pokedex number)
  attr_accessor(:personalID)  # Personal ID
  attr_accessor(:trainerID)   # 32-bit Trainer ID (the secret ID is in the upper
                              #    16 bits)

So, what if you added in some more variables for each move? attr_accessor(:cut), attr_accessor(:surf), etc, or even just one attr:acessor like iv and make each number correspond to a move.The Mini TV would then just change that quality, and then your Field Moves script would check for it!

And then, under this section:
Ruby:
# Creates a new Pokémon object.
#    species   - Pokémon species.
#    level     - Pokémon level.
#    player    - PokeBattle_Trainer object for the original trainer.
#    withMoves - If false, this Pokémon has no moves.
  def initialize(species,level,player=nil,withMoves=true)
    if species.is_a?(String) || species.is_a?(Symbol)
      species = getID(PBSpecies,species)
    end
    cname = getConstantName(PBSpecies,species) rescue nil
    if !species || species<1 || species>PBSpecies.maxValue || !cname
      raise ArgumentError.new(_INTL("The species number (no. {1} of {2}) is invalid.",species,PBSpecies.maxValue))
      return nil
    end
    @special       = false
    @species       = species
    @name          = PBSpecies.getName(@species)
    @personalID    = rand(256)
    @personalID    |= rand(256)<<8
    @personalID    |= rand(256)<<16
    @personalID    |= rand(256)<<24
    @hp            = 1
    @totalhp       = 1
    @ev            = [0,0,0,0,0,0]

You'd add something like
Ruby:
    @cut            = 0
    @surf            = 0

or
Ruby:
    @hmoves        = [0,0,0,0,0,0]


And I would think you could just do pkmn.cut=1 or pkmn.hmoves[0]=1 to set the value to 1, and then have the Field Moves script check for that?
 
Last edited by a moderator:
Top