• 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.

Pokemon Birthsigns

1,399
Posts
10
Years
  • Age 35
  • Online now
i wanted to put in the part of my game that explains birthsign would you mind telling me how i should word it

I more or less summarized it in the first post. But if you want something more specific:

A Birthsign is a special attribute a Pokemon may have that is determined by its time of birth. There are 12 different signs that form a zodiac, which correspond to the 12 months of the year. A Pokemon will inherit the sign that is tied to the month it was born in. Each of these 12 signs grant unique perks to the Pokemon with a variety of effects, and can even be called upon in battle to unleash a Zodiac Power if the proper item is held. Each sign has two corresponding "partner" signs, and one corresponding "rival" sign. When breeding, parents may yield better offspring if they share compatible signs. However, offspring may be of poorer quality if the parents have rivaling signs. It is impossible to alter a Pokemon's sign through normal means, but it is possible for a Pokemon to convert to a different sign if it receives a blessing from some divine force. However, once a Pokemon has been blessed, it may no longer receive a different blessing.


^That basically sums up the mechanics of the entire birthsign system in a paragraph.

in a event is the scritp suposse to go like this pokemon.setRandomSign for a random one i keep getting errors

Define what "pokemon" is. You have to actually define what setRandomSign is targeting. I just wrote "pokemon" in there as placeholder. Just write it out in the event the same way you would if you were to try and change a Pokemon's IV's, Nature, Shininess, etc...
 

Venomous_Zero86

Pokemon Chosen Ones (Coming Soon)
120
Posts
8
Years
  • Age 21
  • Seen Feb 11, 2022
I more or less summarized it in the first post. But if you want something more specific:

A Birthsign is a special attribute a Pokemon may have that is determined by its time of birth. There are 12 different signs that form a zodiac, which correspond to the 12 months of the year. A Pokemon will inherit the sign that is tied to the month it was born in. Each of these 12 signs grant unique perks to the Pokemon with a variety of effects, and can even be called upon in battle to unleash a Zodiac Power if the proper item is held. Each sign has two corresponding "partner" signs, and one corresponding "rival" sign. When breeding, parents may yield better offspring if they share compatible signs. However, offspring may be of poorer quality if the parents have rivaling signs. It is impossible to alter a Pokemon's sign through normal means, but it is possible for a Pokemon to convert to a different sign if it receives a blessing from some divine force. However, once a Pokemon has been blessed, it may no longer receive a different blessing.


^That basically sums up the mechanics of the entire birthsign system in a paragraph.



Define what "pokemon" is. You have to actually define what setRandomSign is targeting. I just wrote "pokemon" in there as placeholder. Just write it out in the event the same way you would if you were to try and change a Pokemon's IV's, Nature, Shininess, etc...


Oh ok thanks alot ill pu at npc hat stops and explains this o you with your expanation this will help alot i just didn add zotiac powers tho
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
By overwrites PokeBattle_Pokemon's constructor, the potential call to "getFormOnCreation" is overwritten. This causes Pokémon that would normally have a different form upon creation to have form 0.

This could be fixed either by aliasing the constructor to add your instance variables in, or to add the missing code (can originally be found in Pokemon_Forms, line 42) to your overwritten constructor:
Code:
    f=MultipleForms.call("getFormOnCreation",self)
    if f
      self.form=f
      self.resetMoves
    end

I'd highly suggest aliasing though. By overwriting the constructor, you break all other scripts that touch it (regardless of whether they alias or overwrite).

Sorry if I'm speaking too technical terms, I can clarify further if you'd like.
 
Last edited:
1,399
Posts
10
Years
  • Age 35
  • Online now
By overwrites PokeBattle_Pokemon's constructor, the potential call to "getFormOnCreation" is overwritten. This causes Pokémon that would normally have a different form upon creation to have form 0.

This could be fixed either by aliasing the constructor to add your instance variables in, or to add the missing code (can originally be found in Pokemon_Forms, line 42) to your overwritten constructor:
Code:
    f=MultipleForms.call("getFormOnCreation",self)
    if f
      self.form=f
      self.resetMoves
    end

I'd highly suggest aliasing though. By overwriting the constructor, you break all other scripts that touch it (regardless of whether they alias or overwrite).

Sorry if I'm speaking too technical terms, I can clarify further if you'd like.

I'd appreciate if you would. I think I understand what the issue is that you're pointing out, but it does go slightly above my head, and I don't have any experience using aliases or how they really work. This entire project has been built so far from just taking apart existing things I've found in the default Essentials script, and teaching myself how to put them back together in a way that suits my ideas. So I'm not exactly well versed on the technical end on problems like this.

Basically what im getting from you is that by making my overwrites to PokeBattle_Pokemon, it somehow omits something that allows Pokemon to spawn naturally in forms other than the default form 0. And that this can be fixed most efficiently by utilizing an alias as to not break other scripts that rely on the untouched version of the PokeBattle_Pokemon script. Is this correct?
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
I'd appreciate if you would. I think I understand what the issue is that you're pointing out, but it does go slightly above my head, and I don't have any experience using aliases or how they really work. This entire project has been built so far from just taking apart existing things I've found in the default Essentials script, and teaching myself how to put them back together in a way that suits my ideas. So I'm not exactly well versed on the technical end on problems like this.

Basically what im getting from you is that by making my overwrites to PokeBattle_Pokemon, it somehow omits something that allows Pokemon to spawn naturally in forms other than the default form 0. And that this can be fixed most efficiently by utilizing an alias as to not break other scripts that rely on the untouched version of the PokeBattle_Pokemon script. Is this correct?

Yeah, what you said is basically right. I'll break down what alias does real quick.

Essentially all alias itself does it copy method a to method b, meaning that you have two methods that do the exact same. It's usually written as alias newmethod oldmethod. You can then call the oldmethod method with newmethod as well. Example:
Code:
def say_hi
  p "Hi!"
end

say_hi # Prints "Hi"

say_hello # Undefined method say_hello, obviously

# This copies say_hi to say_hello
alias say_hello say_hi

say_hello # Prints "Hi!"

What this allows you to do is to add code to a method without needing to overwrite the whole entire method, like so:


Code:
def greet
  p "Greetings"
end

greet # Prints "Greetings"

alias oldgreet greet
def greet
  p "Welcome"
  oldgreet
end


greet
#This now first prints "Welcome", and then prints "Greetings" after because it's calling that "oldgreet" alias. That method is still what the "greet" method USED to be, without the welcome part.[/code]


And this oldgreet stuff is essentially what Essentials itself does in its own script. If you then completely overwrite/redefine the method, you lose all those aliases because the method is just completely overwritten.

Code:
def greet
  p "Greetings"
end

greet # Prints "Greetings"

alias oldgreet greet
def greet
  oldgreet
  p "Welcome!"
end

greet # Prints "Greetings", then "Welcome!"


# Now this is what your script does:
def greet
  p "Greetings"
  # Custom functionality
end

greet # Prints "Greetings"

So as you can see in this example, you lose the p "Welcome!" code because it was overwritten. Now imagine the p "whatever" statements is actual code which is of importance such as setting the Pokémon's form upon creation, you lose that code. So either you could add that code yourself by simply copy-pasting what was in the alias like below:

Code:
def greet
  p "Greetings"
  p "Welcome!"
  p # Custom functionality
end

That would be one way to fix it. "Greetings" being the old code, "Welcome" being the aliased code, and then your custom logic. However, you could also use an alias which automatically also has the other changes made to the method with other aliases:

Code:
alias oldgreet greet
def greet
  oldgreet # This would be "Greetings" and "Welcome!"
  # Custom functionality
end

This way you don't need to copy any other code and you keep support for other custom scripts (and even all Essentials-native scripts).


I hope this has made it a little more clear. If not, you could try looking at what alias is and how it's used online. I also have a detailed Ruby basics tutorial if you need any more clarification about methods: https://www.pokecommunity.com/showthread.php?t=410026
 
Last edited:
1,399
Posts
10
Years
  • Age 35
  • Online now
I hope this has made it a little more clear. If not, you could try looking at what alias is and how it's used online.

Yes, I think this helped out a lot. By using what you wrote, and looking at other examples in the script, I ended up changing the original code:
Code:
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
    @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]
    @iv            = []
    for i in 0...6
      @iv[i]       = rand(32)
    end
    @moves         = []
    @status        = 0
    @statusCount   = 0
    @item          = 0
    @mail          = nil
    @fused         = nil
    @ribbons       = []
    @ballused      = 0
    @eggsteps      = 0
    #===========================================================================
    # Newly generated Pokemon have all flags set to neutral
    #===========================================================================
    @zodiacflag    = 0
    @leafflag      = 0
    @celestial     = false
    @blessed       = false
    #===========================================================================
    if player
      @trainerID   = player.id
      @ot          = player.name
      @otgender    = player.gender
      @language    = player.language
    else
      @trainerID   = 0
      @ot          = ""
      @otgender    = 2
    end
    if $game_map
      @obtainMap   = $game_map.map_id
      @obtainText  = nil
      @obtainLevel = level
    else
      @obtainMap   = 0
      @obtainText  = nil
      @obtainLevel = level
    end
    @obtainMode    = 0   # Met
    @obtainMode    = 4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH]
    @hatchedMap    = 0
    @timeReceived  = pbGetTimeNow.to_i
    self.level     = level
    calcStats
    @hp            = @totalhp
    dexdata = pbOpenDexData
    pbDexDataOffset(dexdata,self.fSpecies,19)
    @happiness     = dexdata.fgetb
    dexdata.close
    if withMoves
      self.resetMoves
    else
      for i in 0...4
        @moves[i] = PBMove.new(0)
      end
    end
  end



into this updated code:
Code:
alias birthsign_initialize initialize  
  def initialize(*args)
    birthsign_initialize(*args)
    #===========================================================================
    # Newly generated Pokemon have all flags set to neutral
    #===========================================================================
    @zodiacflag    = 0
    @leafflag      = 0
    @celestial     = false
    @blessed       = false
    #===========================================================================
  end


Everything seems to work as intended. I tested this out against wild Unown, and I can see the difference. Previously, the way I had the code set up before would only spawn Unown in their default "A" form. But now they properly spawn in randomized forms. Ill update my script in the link with these changes. Perhaps there are other areas of my scripts I can utilize aliasing with to condense the code a bit?
 
3
Posts
11
Years
  • Seen Jan 11, 2024
Hi!
I was wondering if it would be possible for you to explain how you did the art used for the birthsigns?
I wanted to change the birthsigns with some other mons etc. And I wanted to know if you could explain how you did the art?
 
220
Posts
9
Years
Yes, I think this helped out a lot. By using what you wrote, and looking at other examples in the script, I ended up changing the original code:
Code:
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
    @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]
    @iv            = []
    for i in 0...6
      @iv[i]       = rand(32)
    end
    @moves         = []
    @status        = 0
    @statusCount   = 0
    @item          = 0
    @mail          = nil
    @fused         = nil
    @ribbons       = []
    @ballused      = 0
    @eggsteps      = 0
    #===========================================================================
    # Newly generated Pokemon have all flags set to neutral
    #===========================================================================
    @zodiacflag    = 0
    @leafflag      = 0
    @celestial     = false
    @blessed       = false
    #===========================================================================
    if player
      @trainerID   = player.id
      @ot          = player.name
      @otgender    = player.gender
      @language    = player.language
    else
      @trainerID   = 0
      @ot          = ""
      @otgender    = 2
    end
    if $game_map
      @obtainMap   = $game_map.map_id
      @obtainText  = nil
      @obtainLevel = level
    else
      @obtainMap   = 0
      @obtainText  = nil
      @obtainLevel = level
    end
    @obtainMode    = 0   # Met
    @obtainMode    = 4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH]
    @hatchedMap    = 0
    @timeReceived  = pbGetTimeNow.to_i
    self.level     = level
    calcStats
    @hp            = @totalhp
    dexdata = pbOpenDexData
    pbDexDataOffset(dexdata,self.fSpecies,19)
    @happiness     = dexdata.fgetb
    dexdata.close
    if withMoves
      self.resetMoves
    else
      for i in 0...4
        @moves[i] = PBMove.new(0)
      end
    end
  end



into this updated code:
Code:
alias birthsign_initialize initialize  
  def initialize(*args)
    birthsign_initialize(*args)
    #===========================================================================
    # Newly generated Pokemon have all flags set to neutral
    #===========================================================================
    @zodiacflag    = 0
    @leafflag      = 0
    @celestial     = false
    @blessed       = false
    #===========================================================================
  end


Everything seems to work as intended. I tested this out against wild Unown, and I can see the difference. Previously, the way I had the code set up before would only spawn Unown in their default "A" form. But now they properly spawn in randomized forms. Ill update my script in the link with these changes. Perhaps there are other areas of my scripts I can utilize aliasing with to condense the code a bit?

Did you update the birthsigns with this recent change? In my pokemon essentials v17.2, i had problems with pokemon forms, i already told about that to Maruno, he said that some people had the same error after capturing a pokemon that contain forms. I used a fix from him, but pokemon like unown, don't randomize itself in battles. So, maybe, with your update, i can get the thing "fixed".
 
1,399
Posts
10
Years
  • Age 35
  • Online now
Did you update the birthsigns with this recent change? In my pokemon essentials v17.2, i had problems with pokemon forms, i already told about that to Maruno, he said that some people had the same error after capturing a pokemon that contain forms. I used a fix from him, but pokemon like unown, don't randomize itself in battles. So, maybe, with your update, i can get the thing "fixed".
Yes, I already updated my script with this yesterday. So if you've recently reinstalled it, you should be good. If not, just replace that section of code in my post with the new one.
 
1,399
Posts
10
Years
  • Age 35
  • Online now
Hi!
I was wondering if it would be possible for you to explain how you did the art used for the birthsigns?
I wanted to change the birthsigns with some other mons etc. And I wanted to know if you could explain how you did the art?

It's rather easy. All I did was copy/paste the official art of a species (taken off Bulbapedia) into whatever image editing program you use. I used paint.net since it's free. Then I just adjust the darkness of the image to make it completely black so it looks like a silhouette. Then merge it on top of that starry sky image I use, then use the magic wand tool to highlight the Pokemon image and press delete to cut a pokemon-shaped hole in the starry sky. Then just layer a new sky image underneath the cut-out, and darken the bottom sky image a little. Now it'll look like there's a pokemon-shaped shadow in the sky.

After that you just find a star graphic on Google images and paste them around the Pokemon, and connect the dots to create a constellation.
 
220
Posts
9
Years
Yes, I already updated my script with this yesterday. So if you've recently reinstalled it, you should be good. If not, just replace that section of code in my post with the new one.

It worked like a charm. :D

Thx and i will give credits in my game final credits, like i did for others too.
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
apologies if necroposting is frowned upon here.

I've been browsing both here and RelicCastle getting scripts for my projects, and most scripts on both sides saying they were made for V17 of essentials do work on V16, which is awesome as it allows more creative, free, and open ended game play to add replay ability to future projects, and this script (along with a death script that glitches out for a different reason all together not related to compatibility) have been on my mind as great add-ons to my projects. for that reason I was wondering if this script could be written to work with V16 of essentials as I have no real ability to rewrite code. when using V16 of essentials with the current code it just crashes upon trying to apply a birthsign and as well as looking at a pokemon in the box.

On an unrelated note do you think it's possible for opponent trainers to have birthsigns as well? it'd be sick if they could have "The Martyr" on their team.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
apologies if necroposting is frowned upon here.

I've been browsing both here and RelicCastle getting scripts for my projects, and most scripts on both sides saying they were made for V17 of essentials do work on V16, which is awesome as it allows more creative, free, and open ended game play to add replay ability to future projects, and this script (along with a death script that glitches out for a different reason all together not related to compatibility) have been on my mind as great add-ons to my projects. for that reason I was wondering if this script could be written to work with V16 of essentials as I have no real ability to rewrite code. when using V16 of essentials with the current code it just crashes upon trying to apply a birthsign and as well as looking at a pokemon in the box.

On an unrelated note do you think it's possible for opponent trainers to have birthsigns as well? it'd be sick if they could have "The Martyr" on their team.

Necroposting is fine in Game Development and subforums :)

Obviously it's totally fine to ask people to port things back to v16, but I wouldn't be too surprised if you were able to do it yourself. It's usually a pretty simple task, just a matter of working out how the names of methods and variables have changed between v16 and v17, and often you can compare other similar scripts' v16 and v17 code to have a guess about what those changes might be.

Birthsigns on opposing trainers does sound really cool! I imagine this is another thing that you could probably get working without too much effort, if no-one else does it for you.

The PokéCommunity and Relic Castle Discord servers often have people that can help you work out how to write some code (huge shoutout to Vendily who goes above and beyond in that regard).
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
Good to know. I joined both and have begun to search out help. thanks for the help
 
Last edited:
1,399
Posts
10
Years
  • Age 35
  • Online now
apologies if necroposting is frowned upon here.

I've been browsing both here and RelicCastle getting scripts for my projects, and most scripts on both sides saying they were made for V17 of essentials do work on V16, which is awesome as it allows more creative, free, and open ended game play to add replay ability to future projects, and this script (along with a death script that glitches out for a different reason all together not related to compatibility) have been on my mind as great add-ons to my projects. for that reason I was wondering if this script could be written to work with V16 of essentials as I have no real ability to rewrite code. when using V16 of essentials with the current code it just crashes upon trying to apply a birthsign and as well as looking at a pokemon in the box.

On an unrelated note do you think it's possible for opponent trainers to have birthsigns as well? it'd be sick if they could have "The Martyr" on their team.
It's already possible for opponents to have birthsigns. I give instructions on how to do this in the main post, near the bottom of the "useful things to know" section. It requires changing some code, but it's rather simple to do. This allows you to add zodiac signs to trainer's Pokemon in the trainer PBS files.

As for reverting to v16, it's not impossible to do, I don't remember there being anything super tricky to change when updating from v16 to v17. However, I don't really have the motivation to go back and undo everything myself.
 

Pokeminer20

PDM20, Coder of Chaos!
412
Posts
10
Years
It's already possible for opponents to have birthsigns. I give instructions on how to do this in the main post, near the bottom of the "useful things to know" section. It requires changing some code, but it's rather simple to do. This allows you to add zodiac signs to trainer's Pokemon in the trainer PBS files.

As for reverting to v16, it's not impossible to do, I don't remember there being anything super tricky to change when updating from v16 to v17. However, I don't really have the motivation to go back and undo everything myself.

thanks for the info, I'll look into the opposing trainer thing asap.

as for the reverting thing, don't worry about it. my reasoning for wanting a V16 script of this was for a quirk of V16 that was removed in V17, but with help from the discord and sheer luck I was able to mod a copy of V17 that allows that odd quirk to work again. also, would have been heck to revert all the add-ons as well
 
1,399
Posts
10
Years
  • Age 35
  • Online now
Update 7/21/19: Trainer Sign Update
This is a relatively small update expanding upon the Trainer Sign mechanic. Previously, the player's sign was merely a cosmetic feature that would give the trainer a birthsign that would appear on their trainer card based on the starting month of their adventure. While the mechanic still functions as a cosmetic feature (no actual bonuses or perks are attributed), the trainer sign has been expanded mechanically so that you may now assign your trainer any birthsign you wish within your zodiac, and it is no longer locked in based on your start time. Furthermore, your trainer's sign is now a legitimate variable ($Trainer.birthsign) that may be called upon by other scripts. You can utilize trainer signs almost identically to how you can use Pokemon signs, and much of the same code and functions that work when dealing with Pokemon signs can be used in the same manner for your trainer sign.

Furthermore, this update brings with it various bug fixes and smaller updates to other areas of the project.


What's new?
Spoiler:


Updates
Spoiler:


Fixes
Spoiler:


Installation
Spoiler:


All of the above will be added to the main post

~
 

JoelMatthews

Trans Dude with a Chill 'Tude
21
Posts
5
Years
  • Age 24
  • USA
  • Seen Mar 16, 2024
Excellent script, and very well made! You know a mechanic is well made when developing with it feels like a game in and of itself. So much easier to use than I thought it would be. It fits the theme of my fangame so well, too! Definitely plan on using this. It's well structured and I haven't encountered a bug as of yet. I would love to see more signs implemented in the future! I'm excited to see more scripts from you, even if not this one. All of them have been so entertaining to tinker with. ^_^
 
1,399
Posts
10
Years
  • Age 35
  • Online now
Excellent script, and very well made! You know a mechanic is well made when developing with it feels like a game in and of itself. So much easier to use than I thought it would be. It fits the theme of my fangame so well, too! Definitely plan on using this. It's well structured and I haven't encountered a bug as of yet. I would love to see more signs implemented in the future! I'm excited to see more scripts from you, even if not this one. All of them have been so entertaining to tinker with. ^_^

I take this as high praise, thank you. My goal with this has always been to make it as user-friendly as possible and to provide people with a lot of options to use the scripts in creative ways. It's gone through a tremendous amount of revisions since I first posted it (I knew nothing about scripting when I first started this project), so I'm pretty proud of how much its improved. I'm glad you haven't discovered any bugs, but please let me know if you do so I can correct them.

I'm always trying to come up with new ideas for signs, and they've slowly become more complex as I've introduced new ones. I haven't come up with any interesting ideas lately, but if you have any suggestions or ideas, I'd be open to hearing them.
 
Back
Top