Essentials Script Pokemon Birthsigns Page 14

Started by Lucidious89 May 7th, 2015 10:58 AM
  • 50264 views
  • 332 replies
Seen 8 Hours Ago
Posted 1 Week Ago
19 posts
2.3 Years
I'm not really sure how the method you were attempting was supposed to work, but it doesn't really matter because I've simplified how randomization works in the last update. You can accomplish what you're attempting to do in a more straight forward way.

def getSignList(month)
  return [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
          19,20,21,22,23,24,25,26,27,28,29,30,31,31,33][month-1]
end
if ZODIACSET==3 # Zodiac uses random signs
  rndm=rand(32)
  JAN_BIRTHSIGN = getSignList(rndm)
  FEB_BIRTHSIGN = getSignList((rndm+6)%33)
  MAR_BIRTHSIGN = getSignList((rndm+11)%33)
  APR_BIRTHSIGN = getSignList((rndm+2)%33)
  MAY_BIRTHSIGN = getSignList((rndm+8)%33)
  JUN_BIRTHSIGN = getSignList((rndm+3)%33)
  JUL_BIRTHSIGN = getSignList((rndm+7)%33)
  AUG_BIRTHSIGN = getSignList((rndm+4)%33)
  SEP_BIRTHSIGN = getSignList((rndm+10)%33)
  OCT_BIRTHSIGN = getSignList((rndm+1)%33)
  NOV_BIRTHSIGN = getSignList((rndm+9)%33)
  DEC_BIRTHSIGN = getSignList((rndm+5)%33)
end
This is how the randomized zodiac looks in the newest updated. If you want to delete particular signs from being selected at random, then simply remove the numbers corresponding to that birthsign from the "getSignList" array. Note that sign 0 is already ignored by default.

After that, you need to change "rand(32)" to reflect the total number of variables left in the getSignList array after you removed the undesirable ones. So if you removed 10 signs from the array lets say, then you'd use "rand(22)" instead. Next, you'll have to do the same thing with each "%33", and subtract that same number from each instance (making it %23 in this scenario).

Remember however that randomized zodiac sets will re-randomize each time you load the game.
Oh man, I am an idiot then.
I wanted to make it so that Wild Pokémon can't obtain some specific signs, not the Zodiacs. My bad.

elsif WILDBIRTHSIGNS==4
# Generates wild Pokemon with completely random signs
genwildpoke.setRandomsign

then this would be the thing I need to change, no?
Male
Seen 44 Minutes Ago
Posted 5 Days Ago
277 posts
6.1 Years
Oh man, I am an idiot then.
I wanted to make it so that Wild Pokémon can't obtain some specific signs, not the Zodiacs. My bad.

elsif WILDBIRTHSIGNS==4
# Generates wild Pokemon with completely random signs
genwildpoke.setRandomsign

then this would be the thing I need to change, no?
I see. Yes, that would be correct. You could probably just incorporate the same idea I outlined before more or less by using an array. I'd just make a new toggle under WILDBIRTHSIGNS==4 and set it to 5, that way you dont have to fiddle with the pre-existing toggles in case you end up needing them for some reason.

elsif WILDBIRTHSIGNS==5
        # Generates wild Pokemon with random signs out of a specified array
        signs=[1,2,3,4,5,6,7,8,9,10]
        genwildpoke.setBirthsign(signs[rand(9)])
Something like this would probably work. I listed signs 1-10 just as an example, but you could incorporate whichever sign numbers you like. You could do the same thing to set a random zodiac sign too, by using "genwildpoke.setZodiacsign(signs[rand(x)])" (instead of making it random out of every possible birthsign), but in that case instead of having the array list numbers associated with birthsigns (0-33), you'd use month numbers instead (1-12). This would ensure the randomly chosen signs are only ones found within your active zodiac set.
Male
Seen 44 Minutes Ago
Posted 5 Days Ago
277 posts
6.1 Years
Is there a method i can easily call something like pbismonth(JAN) so i can make month based events?
Hmm...could you explain a bit on what you're attempting to do with this? If you're trying to check for a particular month, Time.now.mon will call the current month. That's not a birthsigns thing, that's just something essentials has by default. You can set that to a particular month like "if Time.now.mon==4" to check for April, for example.
Male
Seen 44 Minutes Ago
Posted 5 Days Ago
277 posts
6.1 Years
Minor Update 5/13/20: Bug Fixes and Polishing
I made a second pass through all of the scripts in the last big update to comb through any potential bugs and errors, and I found several small ones (and one or two big ones) that I was able to fix. They're too minor and numerous to bother listing, but I'd recommend reinstalling the scripts again. The Zodiac Power script in particular had the bulk of the bugs, and all of the powers have been re-tested and polished up where needed. Some of the battle text has also been changed to be more clear in certain niche situations. The main birthsigns script has had a few unnecessary things trimmed that was causing errors in other areas, and the two new events added in the events script have been slightly changed to better match the existing events in the script.
Male
Seen 44 Minutes Ago
Posted 5 Days Ago
277 posts
6.1 Years
Update 5/22/20: Birthsign Journal Overhaul
The Birthsign Journal is personally one of my favorite things I've worked on, mostly because unlike most elements of this project, it's entirely there for flavor which makes working on it different than my other scripts. Despite this, the Journal script is probably the most outdated out of all the scripts in this project, and has undergone by far the least amount of changes and upgrades. Because of this, I thought I'd make an update dedicated entirely to sprucing up the Journal script to a higher standard of quality, and add a ton of new features to improve it. Nearly the entire script has been reworked to function more efficiently.



What's new:
Spoiler:
GENERAL
The script now generally performs better, and comes with several QoL improvements as well as full compatibility with Luka's Easy Mouse Module.
Spoiler:
  • Smoother Transitions
    Opening and closing a page in the Journal will transition more smoothly now. Previously, it would just suddenly open a page without a fade out transition, and would make it feel very jumpy.

  • Quick Select
    When scrolling through the zodiac wheel with the up/down arrow keys, you may now also use the left arrow key to immediately jump to the rival sign relative to the sign you're currently highlighting. Similarly, pressing right will jump you to the nearest partner sign.

  • Mouse Compatibility
    The Birthsign Journal can now be fully controlled via mouse inputs by clicking the icons on screen. Mousing over a token on the zodiac wheel will now highlight that token, and clicking it will move the cursor to that sign. Clicking a highlighted sign on the wheel will open up the info page of that birthsign. Mousing over the center of the wheel will highlight the exit button, which can then be clicked to back out of the journal.
    While on an info page, you can now click the on-screen X button to exit the page, and clicking the on-screen Z button will open the Zodiac Power panel. Clicking anywhere will toggle the panel off.

    If you don't have mouse functionality installed in your project, the script will still function perfectly fine.

  • Page Scrolling
    While an info page for a particular birthsign is open, you can now use the up and down arrow keys to cycle through to the previous or next pages, without having to close the current page and select a new one. This is similar to how you can scroll through Pokemon Summary screens in the party with Up/Down.

    In addition to this, whenever you press the Left arrow key, the page will skip to the Rival birthsign of the page you were just on. So if you had January's birthsign page open, for example, pressing Left will skip to July's birthsign page. Similarly, pressing the Right arrow key will jump you to the nearest Partner birthsign page relative to the current sign's page you have open. This is useful to quickly reference compatible birthsigns.

    Mouse Controls:
    If controlling the journal with a mouse, you can now simply click the Partner/Rival tokens that appear on the info pages to jump to those respective pages. You can also click the up/down arrow icons at the top of the screen to scroll backwards/forwards through pages, as if you pressed the up/down arrow keys. Alternatively, you may also simulate this by scrolling up/down with your mouse, if you have that feature enabled.



DISPLAY
The first thing you'll notice after installing this update is that the home screen for the birthsign journal is packed with new graphics and information. I'll break down all the new additions.
Spoiler:
  • Current Date


    In the top left hand corner of the home screen, the current date will now be displayed.


  • Current Sign


    In the top right hand corner of the home screen, there is now a graphic that displays the birthsign token of the current month's birthsign. This is handy as a quick reference when you're curious about what the current month's sign is, without having to scroll through the list.

    Note: Clicking on this token with mouse controls will instantly highlight this sign's token on the zodiac wheel. If the token is already highlighted, it will open that sign's page.


  • Trainer Sign


    In the bottom left hand corner of the home screen, there is now a graphic that displays the birthsign token of your trainer's birthsign. This is handy as a quick reference if you don't remember what your character's sign is, and an alternative (and probably more useful) place to display this than the Trainer Card. If your Trainer has been blessed, a golden blessed token graphic will be displayed instead.

    Note: Clicking on this token with mouse controls will instantly highlight this sign's token on the zodiac wheel. If the token is already highlighted, it will open that sign's page.


  • Party Signs


    In the bottom right hand corner of the home screen, there is now a new display with 6 Pokeballs, representing your Pokemon party slots. While you scroll through the zodiac wheel, this display will be updated every time you highlight a new birthsign. If any Pokemon in your party have the same birthsign as the one you are currently highlighting, their sprite will appear over the pokeball relative to their place in the party. This is a handy way of quickly referencing which Pokemon in your party have a particular birthsign while you scroll through the journal.

    Note: Clicking on a Pokemon's sprite will play its cry.



FEATURES
The journal now has a bonus functionality that ties in with the Celestial Bosses found in the Birthsign Events script.
Spoiler:
  • Celestial Boss Counter


    In the top left hand corner of the home page, underneath the display for the date, there will be a new display that unlocks after the first time you encounter a Celestial Boss. This display will keep track of how many Celestials you have encountered, essentially keeping a tab on your progress and making it easier for you to keep track of how many you've defeated.


  • Celestial Tokens


    In addition to the counter, whenever a Celestial Boss is defeated, the birthsign token on the zodiac wheel relative to that defeated boss will be replaced with a golden blessed token. This will be a visual indication of which particular bosses you have defeated, and which ones still remain to be discovered. There's just something so rewarding about collecting all 12 tokens.


    Note: All Celestial features in the journal are disabled when utilizing ZODIACSET=3. This is because set 3 uses a randomly generated zodiac that changes each time you load the game, making it impossible to keep an accurate account of which particular bosses have been defeated. If you want to utilize the Celestial features of the journal, you need to maintain a constant zodiac set. Changing out signs will likely mess up the counter.

    However, if you ever do find yourself in a position where the counter is broken and you want to reset everything back to square one, you can run this script:
    pbBossCountReset

  • Here's a final example picture to show off what a full screen might look like (all bosses fought, full party with a sign, trainer blessed)



Installation:
Spoiler:
1) A new graphic needs to be installed into the Birthsigns/Other folder, and one old one needs to be replaced. These has already been updated in the link in the main post.
Journal Info Graphic
Journal Selection


2) Minor changes to both the Pokemon Birthsigns and Birthsign Events scripts need to be made. You may either follow the instructions below, or simply redownload the entire scripts found in the main post.
Spoiler:
  • In Pokemon Birthsigns, paste this anywhere in the upper portion of the script. I recommend right under the code for pbLastMonthDay.
    # Returns the total number of defeated Celestial Bosses
    def getBossNum
      ret = 0
      for i in 0...12
        ret+=1 if $Trainer.celestialcheck[i]!=nil
      end
      return ret
    end
    
    # Resets celestial boss counter
    def pbBossCountReset
      for i in 0..12
        $Trainer.celestialcheck[i]=nil
      end
    end
  • In Pokemon Birthsigns, find the line "class PokeBattle_Trainer", and paste this directly below it:
    attr_accessor(:celestialcheck)
  • Not much further down, find the line "@zodiacflag=$PokemonGlobal.startTime.mon" and paste these lines directly below it:
    @blessed=false
        @celestialcheck=[]
        for i in 0..12
          @celestialcheck[i]=nil
        end
  • In the Birthsign Events script, scroll down to the section under the heading "Celestial Boss Event", and from there, find both instances of "pbDoubleWildBattle" and "pbWildBattle". For both cases, make sure the final three variables of each are:
    1,false,true
  • Then a few lines down, search for "if pbSetSelfSwitch(thisEvent.id,"A",true)". Paste this line directly below it:
    if $game_variables[1]==4 || $game_variables[1]==1
                  $Trainer.celestialcheck[monthnum-1] = poke.birthsign if ZODIACSET!=3
                end

  • OPTIONAL: If you want even more birthsign functions in your Debug_Menu script make these following changes below. Note that all these changes are already present in the Debug_Menu script found in the main post.

    • In the "Birthsigns - Debug Options" section, find the last line "_INTL("Toggle a blessing on your sign."))", and paste the following below it:
      commands.add("birthsigns","maxcounter",_INTL("Max Boss Counter"),
              _INTL("Max out journal counter for Celestial Bosses."))
          commands.add("birthsigns","resetcounter",_INTL("Reset Boss Counter"),
              _INTL("Reset journal counter for Celestial Bosses."))
    • Further down, after all of the code for when "blessing", paste this:
      #=============================================================================
        # Birthsigns - Max Boss Counter
        #=============================================================================
        when "maxcounter"
          if ZODIACSET!=3
            $Trainer.celestialcheck[0]=JAN_BIRTHSIGN
            $Trainer.celestialcheck[1]=FEB_BIRTHSIGN
            $Trainer.celestialcheck[2]=MAR_BIRTHSIGN
            $Trainer.celestialcheck[3]=APR_BIRTHSIGN
            $Trainer.celestialcheck[4]=MAY_BIRTHSIGN
            $Trainer.celestialcheck[5]=JUN_BIRTHSIGN
            $Trainer.celestialcheck[6]=JUL_BIRTHSIGN
            $Trainer.celestialcheck[7]=AUG_BIRTHSIGN
            $Trainer.celestialcheck[8]=SEP_BIRTHSIGN
            $Trainer.celestialcheck[9]=OCT_BIRTHSIGN
            $Trainer.celestialcheck[10]=NOV_BIRTHSIGN
            $Trainer.celestialcheck[11]=DEC_BIRTHSIGN
            Kernel.pbMessage(_INTL("Boss counter maxed."))
          else
            Kernel.pbMessage(_INTL("Can't apply boss counters when a randomized zodiac is active!"))
          end
        #=============================================================================
        # Birthsigns - Reset Boss Counter
        #=============================================================================
        when "resetcounter"
          pbBossCountReset
          Kernel.pbMessage(_INTL("Boss counter reset."))
        #=============================================================================


3) Reinstall the Birthsign Journal script.