1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

Programming SmogDex Teambuilder

Discussion in 'Technical Projects' started by sandshrewz, Aug 11, 2013.

  1. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    It now tells you how many EVs you have left! A lot of help from Toast here though! :) lol this change took quite a while !
  2. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Double posta~ You can now pick items not listed in the moveset. Items within the moveset and items outside the moveset are separated by an empty option. Should be easy to implement this for moves as well, but I gotta go study for now xD

    Should I let the ability option allow all abilities or only those that the Pokemon has? I'm probably just going to allow any move on the Pokemon since the on-site database can be wrong and I don't wanna extract moves unless there really is a need to haha x) This means you can pick moves are incompatible with the Pokemon though like you can on damage calcs! That should be fine right ??? :O!
  3. GCSChris

    GCSChris

    Joined:
    Dec 25, 2012
    Messages:
    434
    I would do only the abilities it can have but any move cause of what you said, it would be less of a pain, and could cause incorrect things.
  4. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Thanks for the input! I've also asked a couple of people so that's what I went with~ You now have the option to pick abilities outside of the set but only those that the Pokemon have; you shouldn't be picking abilities outside the set most of the time anyway lol! You can now pick any move as well. Same goes for nature! edit: oops x_x also thanks to @TalkTakesTime for making the array of moves so I don't have to make one xD

    I'll probably move on to getting the relevant stats highlighted as you change natures; eg if you use Admanant, Atk becomes green and SpA becomes red. Don't think I'll be doing it PS style with + and - after the number cos it's harder to programme that lol! After that, I'll probably go on to doing stat calcs.

    Feel free to throw me more suggestions! :)

    Edit: I've made a GitHub repo some time back here. It contains a file with the SCMS entry for the team builder. It's mainly just for me to keep track of stuff lol! Feel free to add issues there or here. :) You can find what I'm planning to do from there~
    Last edited: Aug 30, 2013
    GCSChris likes this.
  5. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Fixed a bug whereby the previous change made the move options put only the first slashed move on top instead of having all slashed moves as the first few options. Sorry for the incovenience caused! >_> The next update will most likely bring a button that links you to the analysis. I personally like reading analysis while building and this is the last feature that the DP Team Builder Cathy made had which I hadn't added yet~ Stay tuned! :)
  6. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Not a really important update but I've just added a button that links to the analysis. It brings you directly to the set your chose or the Pokemon in the appropriate tier if you didn't pick a set. It also links to the main Pokedex if you didn't pick a Pokemon! It opens them in a new tab though! :)
  7. scorpdestroyer

    scorpdestroyer is a pious radio
    is a Tiering Contributoris a Contributor to Smogon
    Mentor

    Joined:
    Oct 2, 2012
    Messages:
    1,885
    If everything has been selected for a certain Pokemon, and then the set is changed to empty, the Pokemon doesn't show up in the export at all. In other words if I select a set complete with all the moves, then switch the set back to empty, it doesn't show up
  8. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Welllll that was meant to be intentional haha >_>! I made the exporter ignore anything that does not have a chosen Pokemon or set. I should probably make it have a chosen ability and at least one move y/n? It'll probably be better that way I think?
  9. scorpdestroyer

    scorpdestroyer is a pious radio
    is a Tiering Contributoris a Contributor to Smogon
    Mentor

    Joined:
    Oct 2, 2012
    Messages:
    1,885
    I meant that when I finish making all my moves, abilities, etc., and I switch the set to an empty one (the moves, abilities still remain), the thing doesn't show up in exportable. Maybe I didn't understand you correctly?
  10. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Yeaaa I know what you mean. I made the exporter not export if the set is left blank, even if you've filled in the other stuff. I should probably remove that and make the export only require at least one move and a chosen ability instead of having a set chosen.
  11. scorpdestroyer

    scorpdestroyer is a pious radio
    is a Tiering Contributoris a Contributor to Smogon
    Mentor

    Joined:
    Oct 2, 2012
    Messages:
    1,885
    Yeah, I guess I misunderstood you. You should probably do that
  12. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Okay, updated the exporter with the new validation. It'll no longer ignore the Pokemon if there's no set chosen. It'll export Pokemon with at least one move and ability. I didn't think anyone would set the set back to blank after building lol >_>! Thanks for raising this up @scorpdestroyer :)!
  13. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Relatively big update as compared to the recent ones ? Natures now show which stats are boosted / reduced by highlighting the stat name with green / red respectively. Thanks to @V4Victini for teaching me some object-oriented programming stuff that I couldn't really Google. :) Also as per his suggestion, you can now pick options even when you don't have an option selected. A Pokemon must be selected though! In this case, the level is defaulted to 100; I'll make it go according to tier soon. Abilities as usual only let you pick those of that Pokemon.

    Also thanks to @The Immortal and @Toast++ for helping with bug fixing :)
    scorpdestroyer likes this.
  14. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Major update???? Base stats and stat calucation is now implemented! This took quite a while lol >_>! That's probably one of the most important part of a teambuilder? With this, the SmogDex Teambuilder is officially done :)

    I'll probably look into some code optimization soon-ish but it won't really make a noticeable difference for users though! Enjoy~! Do feel free to continue making suggestions etc! :)
  15. DittoCrow

    DittoCrow
    is a Tiering Contributoris a Site Staff Alumnusis a Forum Moderator Alumnusis a Community Contributor Alumnusis a Contributor Alumnusis a Past SPL Winner
    Mentor

    Joined:
    Mar 15, 2010
    Messages:
    1,477
    This is excellent! I'm going to be using it a ton =p. Just one nitpick: can the IVs change in the teambuilder or vice-versa depending on which Hidden Power is chosen (like on PO)?
  16. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Not atm. This is something I might look into though! I've always used DJD's damage calc to tweak IVs for Hidden Power since PS doesn't tell you what Hidden Power you get from those IVs although it does set the default IVs for Hidden Power. If I were to implement it I'll probably do it both ways. Thanks for pointing that out or I might forget xD
  17. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Adding a new to-do: Calculate Hidden Power based on IVs and change IVs according to Hidden Power. Automatically lower Speed IVs if using Trick Room / Gyro Ball and still maintain the same Hidden Power BP and type. Thanks to people in #showdown for suggesting this! :)
  18. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Added a Help tab for those new to the teambuilder. Should have all the info there I think. I'll tackle Hidden Power tomorrow, not tonight though haha! :p
  19. scorpdestroyer

    scorpdestroyer is a pious radio
    is a Tiering Contributoris a Contributor to Smogon
    Mentor

    Joined:
    Oct 2, 2012
    Messages:
    1,885
    The export doesn't export out specific IV numbers. For example, SubSalac Scolipede doesnt have 30 HP IVs in the export, even though it is stated in the teambuilder
  20. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Erm it works for me? Haha. Can you screenshot me what you have on the teambuilder and what the export text had? I'll double check the code later haha.
  21. scorpdestroyer

    scorpdestroyer is a pious radio
    is a Tiering Contributoris a Contributor to Smogon
    Mentor

    Joined:
    Oct 2, 2012
    Messages:
    1,885
    Erm, it's suddenly working for me now. Idk what happened just now lol ._."
  22. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    If anyone does experience weird bugs with the export, do paste me the export or screenshot what your team has that might be causing the problem haha. It was probably just an accident in the above case I guessss. I don't find any bug in the code atm. So it shouldn't have any problems xD if it does, oops haha!

    Anyway, the teambuilder now tells you the Hidden Power type and Base Power at the bottom right. :D Next step: if you have Hidden Power [Type] as one of your moves, it'll automatically change the IVs if the moveset does not specify IVs. Also @V4Victini is a ninja and fixed Hidden Power on PS's teambuilder roflol. u_u! haha :p
  23. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Actually @scorpdestroyer was right. I managed to find the annoying bug by accident. If you picked a set that has unchanged IVs, it'll reset all IVs back to 31 for all Pokemon due to a bad code from v long ago >_>! I've fixed that now. Also, when you pick sets that uses Hidden Power and has unspecified IVs, eg Shell Smash Gorebyss, it now alters the IV automatically for you. If it has altered IVs, eg Venusaur Chlorophyll Sweeper, it retains the set's IVs.

    I'll work on changing IVs when you pick another Hidden Power next~

    EDIT: Hidden Power will give you the IV spread with the highest possible Speed like on PS even though it might result in poorer overall IVs. PO on the other hand gives you the max IVs possible and gives you 30 Spe IVs sometimes when 31 Spe is possible. This probably only affects like HP Flying, Water, and Ice iirc. But yea I'm following PS on this one. Thanks to everyone who helped me make this decision~! :)
    Last edited: Sep 11, 2013
    scorpdestroyer likes this.
  24. sandshrewz

    sandshrewz
    is a Site Staff Alumnusis an Artist Alumnusis a Forum Moderator Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Oct 18, 2010
    Messages:
    2,435
    Updated Hidden Power. Choosing Gyro Ball / Trick Room now lowers your Speed IV to 0, or to match your Hidden Power type and give a BP of 70. Similarly, if you pick Hidden Power while having either Gyro Ball or Trick Room, your Speed IV will lower to match the Hidden Power type and give 70 BP. Also thanks to @V4Victini for letting me know that SpeedIV%4 is the one to hit haha :) sorry for tagging you so many times >_>!

    Feel free to bring up more suggestions! :)
  25. redundant

    redundant

    Joined:
    Jul 11, 2010
    Messages:
    33
    This is a wonderful tool sandshrewz, thank you for making it. I can't seem to get it to work for Darmanitan though. Otherwise it's incredibly useful for expediting the teambuilding process. Should be on the front page.

Users Viewing Thread (Users: 0, Guests: 0)