Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 16:12:49 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Pokemon Stats Generator -  (Read 3191 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« on: 26 June, 2010, 07:22:18 »
0

I thought you guys might be interested in a little program I whipped up a while back. I used it to check my math in assembly, when working out some of the stats generation (and still use it because I think some stuff is wrong). Its not fully complete, but still pretty useful. Anyway check it out, just a simple C# app.

* Pokemon Stats.zip (99.1 KB - downloaded 153 times.)
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 10:47:05
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50634


Total Post Ratings: +2637

View Profile WWW
« Reply #1 on: 26 June, 2010, 07:25:49 »
0

Mhmm interesting. I assume this is useful mostly to know in advance what will be the stats of one of your Pokémon depending of certain parameters, right?
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« Reply #2 on: 26 June, 2010, 07:27:44 »
0

Correct. For example I just used it to check the maximum amount of damage a level 5 pidgey can do to a level 5 charmander. Which is 4 fyi
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 10:47:05
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50634


Total Post Ratings: +2637

View Profile WWW
« Reply #3 on: 26 June, 2010, 07:40:37 »
0

Nice Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #4 on: 26 June, 2010, 14:22:35 »
0

That's pretty nice. I was bored so I decided to do some error checking.

-In the attack list you have a couple attacks that have a different name such as:
9 gun = water gun
3 powder = poisonpowder
5 throw = rock throw

-For the attack calculator tab, I noticed that the IV/EV numberbox goes to 100 instead of 15/65535.
-If you crank the EV numberbox to anything over 32750, it will crash the program, but that's probably just because it's set to 16bit signed.
-For calculating the stats, If they go over 255, they will overflow and reset back to 0.
-Also, it doesn't look like the IVs get calculated into the stats, but they do for the damage.

It looks like this was made in Visual Studio 2010, seeing as how it's 'unknown version' in 2008. Did you use any 2010 specific tools to make this? if not I could probably find a way to open it in 2008 and make a couple fixes.

EDIT:Fixed it up. I also built it in Release as well as Debug.

EDIT2:Just wondering, how come you commented out the entire 'Moves Learned' code? It looks like you cover all of the pokemon and their moves.

* Pokemon Stats Fix.zip (158.68 KB - downloaded 80 times.)
« Last Edit: 26 June, 2010, 14:58:36 by Magic Banana » Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« Reply #5 on: 26 June, 2010, 19:01:13 »
0

Cool thanks magic banana.
For the attack list stuff, thats because I stole this from my asm macros and had to do a find and replace on the equates, because C# you can't define stuff Sad (although now that I think of it not sure why I didn't make them constants)
Good call on the other stuff, although the IVs would get calculated, the stats just wouldnt get updated Tongue.
As for why I commented out the moves learned code, I was too lazy to get it working. You can just select the move you want for the damage calculation Tongue. It works in the real game Tongue
« Last Edit: 26 June, 2010, 19:15:22 by BuckeyeDude » Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #6 on: 26 June, 2010, 19:40:35 »
0

No problem. Smiley

The only thing I couldn't figure out was how to organize a class by type so that I can get the attacks to be in alphabetical order. I've never worked in C# so I was just going off of what I knew in C and VB.NET to fix the other things. I've tried to use the normal Array.Sort( but it's not a 1 dimensional array. I tried to figure out how to use IComparable and CompareTo but I had no luck on it. If I can get that working, then I can just attach them to radio buttons so you can sort by index or name.
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« Reply #7 on: 26 June, 2010, 19:49:23 »
0

Just going off memory, you should override the Equals( method of the move class, compare the strings (string.Equals), then i think you can just say combobox.sorted = true;

EDIT: maybe combobox.sort() or combobox.items.sort() if any of those exist
« Last Edit: 26 June, 2010, 19:52:56 by BuckeyeDude » Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #8 on: 26 June, 2010, 21:18:25 »
0

Well, the combobox does have a sorted property, but using that just tears the program apart. I'm trying to think of a way to tell it which type it should be looking at when sorting the list before putting it into the combobox, because the normal Sort( commands just moves the name of the item and not all of the other members of that class. (I'm pretty sure Psychic isn't a normal move with 40 power and 30 pp).

I know CompareTo can be used to compare multiple data types, which can be changed using a public enum for the members in a class, but I don't know how to implement it.

If anything else, I can always make a second list and just replace the old one in the combobox, but that just seems like a waste of space for the program. Either that, or I can just rip out the index of the attacks since most people would probably prefer attacks to be sorted alphabetically while the pokemon are still sorted by index.
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« Reply #9 on: 26 June, 2010, 21:22:15 »
0

Well, the combobox does have a sorted property, but using that just tears the program apart. I'm trying to think of a way to tell it which type it should be looking at when sorting the list before putting it into the combobox, because the normal Sort( commands just moves the name of the item and not all of the other members of that class. (I'm pretty sure Psychic isn't a normal move with 40 power and 30 pp).
When using the sorted property, the sorting uses the Equals() method to compare items.

add this to the Moves class

1
2
3
4
public override bool Equals(object obj)
{
    return string.Equals(name, obj);
}
and then you can use the sorted property of the combobox
« Last Edit: 26 June, 2010, 21:23:15 by BuckeyeDude » Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #10 on: 26 June, 2010, 21:35:58 »
0

The code seems to change nothing at all. The sorted property for the combobox just doesn't do what we are trying to do here. Name changes only. Plus, if an item is currently selected when sorting it, the program crashes. I've even reset the selected index and it still happens. That, plus it never 'unsorts' it after it has been sorted means that the combobox sort isn't the best way to do this. I think I may have an idea though ...
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
BuckeyeDude
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 11 February, 2013, 13:05:34
Date Registered: 10 February, 2010, 04:13:50
Posts: 252


Topic starter
Total Post Ratings: +21

View Profile
« Reply #11 on: 26 June, 2010, 23:21:52 »
0

Ah my bad, I set this up horribly. A couple things had to be changed to fix this. One in addition to overriding the Equals() method, the ToString() method needed to be overridden too (I thought I had already done this).

1
2
3
4
public override string ToString()
        {
            return name;
        }
Then in the New_Move() method, comboBox.Item.Add() needs to add the move, not just the name.

1
2
allMoves[index] = new Move(index, name, type, pp, power, accuracy);
            movesComboBox.Items.Add(allMoves[index]);
Finally you need to call InitMoves() whenever you resort the list so they are added properly. There is a better way to do this, which I can explain if you want. Also make sure you add a comboBox.Items.Clear() in InitMoves() so you don't keep adding to the items already there.
Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #12 on: 26 June, 2010, 23:42:15 »
0

Well, for now I just took the cheap and ridiculously repetitive path by just making a second list.  Grin

I'm going to be busy for a while today so this will have to do until I hash out the details. You can feel free to work on it if you want, seeing as it's your program. I'm pretty sure it will convert from 2008 to 2010 pretty smoothly, especially if I was able to make it backwards compatible.

* Pokemon Stats Fix 2.zip (172.52 KB - downloaded 90 times.)
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.355 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.