• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Adjusting the Whole Party's Happiness at Once///Streamlining my Professor.

  • 76
    Posts
    10
    Years
    • Seen Mar 31, 2014
    Ok, I've got an area set up where I want all Able Pokemon in the player's party to gain happiness upon crossing a specific event tile (that is, all Pokemon that are not eggs or knocked out). I figure that I can borrow some of the code from the sample Daisy, but I'm not 100% certain how to change a certain aspect of it.

    I know Daisy does this:
    poke.changeHappiness("groom")
    poke.beauty+=40

    So I presume, in the Event code, I need to do something like:
    poke.changeHappiness("labyrinth")
    poke.smart+=20

    Then, in the PokeBattle_Pokemon script, I presume I need to add something like:
    when "labyrinth"
    gain=5

    However, Daisy's code makes the player select an able Pokemon. I just want it it to give it to the whole team without a fuss, so I'm not sure what I need to do on the Event end of the code.

    ************************************************************
    Also, I've got a functional Professor at the moment, but I'd like to streamline her code because my current understanding of how to use the choices and conditional branches is still on the more basic end of things, so it's bulky and bound to get nasty as the game progresses. I've got this thing where if you spot certain Pokemon, it turns a "Sighting" switch on, and you can tell the professor about it. Right now I just have two whole sets of conversation trees based on whether or not you saw (and touched) Mew, but as I add sightings, this method would get crazy due to having to make a separate conversation tree for every possible combination of activated sightings. I know I can do different versions of her to help cut down the size of any one code, but even that could get crazy if I make more than necessary. How do I get it so I just have one list and it only shows the sightings that are turned on and just skips over the ones that aren't? I know "If" statements would be in there somewhere, but I can't quite envision what the code would look like.

    Here's how she's currently coded (with a teensy bit of skipping toward the bottom):
    Adjusting the Whole Party's Happiness at Once///Streamlining my Professor.



    Thanks!
     
    Last edited:

    Nickalooose

    --------------------
  • 1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Okay, for your first question.
    poke.changeHappiness("labyrinth")
    poke.smart+=20
    This will almost certainly do nothing, unless you add this to some code, another thing would be, passing a specific tile would make this more complicated, from what I gather, you want to raise/lower a Pokémons happiness at a certain point, as long as they aren't at 0 HP and/or an egg, that's easy... Walking over a specific tile, not so much... It sounds to me you don't need to mess with scripts, just make a player touch event and change their happiness, in that sense, you could probably just make a completely new def.
    Code:
      def labHapp
        for i in $Trainer.party
          i.happiness+=10 if i.hp>0 && !i.egg?
        end
      end
    On the tile you want to change their happiness, just have a touch event with a script code "labHapp", and you're done.

    Second question.
    There's nothing you can do about having scrappy events, otherwise, you'll have to create a new def and do everything in there, it may even be easier that way.
     
  • 76
    Posts
    10
    Years
    • Seen Mar 31, 2014
    I finally got the chance to test this today and (once I figured out exactly where the definition needed to go :P) it worked! Thank you! ^o^
     
    Back
    Top