• Pokemon! Attempt #3
    53 replies, posted
  • Avatar of PortalGod
  • Hey. I'm PortalGod, and you probably know that already. I recently decided to remake my old Pokemon gamemode from scratch (not that I have a choice, I lost all of the original files). You might remember the old version from [url=http://www.facepunch.com/threads/1011100-Pokémon-gamemode]this thread[/url]. In all honesty, I'm pretty embarrassed of it. Since I'm a perfectionist, I couldn't keep passing by the pokemon folder in my gamemodes folder, and eventually got fed up. Contrary to the last two times, however, I have a (near) full understanding of GLua, and the resources to complete this. I've also decided to start with the harder, behind-the-scenes type stuff first. Unfortunately, this means I have very little to post. The reason I'm creating this thread now, and not when the gamemode is done, if not almost done, is because I want this to be a full log of my development process. So, after that wall of text, here we go. [release] [h2]Stuff that's done[/h2] [QUOTE=PortalGod;31425991]I decided to give making a Pokemon gamemode another try. This time, doing the hard stuff first. I've got all the move sets stored as usable data: [img]http://puu.sh/3Pbp[/img] And I've got functions worked out for drawing the pokemon sprites: [img]http://puu.sh/3PbG[/img] And it's all worked out on a spritesheet, so there's only one texture to download, instead of 4*151=604. The complete code for the above is: [lua] surface.SetDrawColor(255, 255, 255) surface.DrawPokemonFront(16, 16, 64, 64, "kakuna") //x, y, w, h, name surface.DrawPokemonBack(88, 16, 64, 64, 14) //all functions take pokemon names as well as IDs as an argument surface.DrawPokemonIcon1(160, 16, 32, 32, 14) surface.DrawPokemonIcon2(160, 48, 32, 32, 14) [/lua] Not really anything to show off about, but I wanted to share my progress and announce my gamemode. Unfortunately, I have marching band camp (American Pie joke here) every weekday from noon to nine, which doesn't leave that much time for working on this. I'll still post whatever I get done, though.[/QUOTE] [/release] [release] [h2]WIP stuff[/h2] I'm working on getting all the base information for pokemon, like type and evolutions. [img]http://puu.sh/3SW2[/img] All I have to do now is shove it in a table, and save it as usable data. Funny story about that, actually: I was using [url=http://bulbapedia.bulbagarden.net/wiki/Bulbasaur_(Pokémon)]this page[/url] to sort through all the HTML to find the element that had the overview info, and I had to ask my friend for help with regex. He pointed out I could just use [url=http://bulbapedia.bulbagarden.net/w/index.php?title=Bulbasaur_(Pok%C3%A9mon)&action=edit]this[/url], and it took 15 minutes to format it into usable code :v: [/release] [release] [h2]To-do[/h2] • Everything but the data [/release] So yeah. Leave any comments, CC, or expectations below, and I'll be sure to think about them.
  • Avatar of Jamie932
  • It's great that your picking this back up. It seemed a very interesting idea to achieve within GMod back when you posted the original post.
  • Avatar of PortalGod
  • Yeah, too bad I barely knew lua at that point. I'm hoping that since I'm doing the data first, (the point I had to stop at the first time), I can just blow through this. Also, why does it say I posted the OP with XP and IE? I don't have either installed..
  • Avatar of Thermadyle
  • I can't wait to try this out, is it going to support multiplayer? If it does, feel free to give me a message when you need someone to try out something. Also, if you don't have the pokemon sounds/themes and you need them; I would gladly get them for you.
  • Avatar of PortalGod
  • It's planned, yeah. I'll add you. Whatever happened to your hat gamemode? Haven't seen any updates on that in a while.
  • Avatar of CmdrMatthew
  • Is this going to have giant maps? Or will it just be limited by normal source map dimensions with nothing making the map appear larger?
  • Avatar of PortalGod
  • It doesn't seem like the source map dimensions would be a problem, but yeah, that might be something to consider. What would you guys want in the map? Rate agree for something new, or disagree for a recreation of one of the pokemon games.
  • Avatar of Sam
  • I wan this to happen, it'll just be plain fun to play. :)
  • Avatar of vexx21322
  • [QUOTE=PortalGod;31468814]It doesn't seem like the source map dimensions would be a problem, but yeah, that might be something to consider. What would you guys want in the map? Rate agree for something new, or disagree for a recreation of one of the pokemon games.[/QUOTE] Mix. Use the most popular or famous parts from the old games but also add new areas and such.
  • Avatar of CmdrMatthew
  • [QUOTE=PortalGod;31468814]It doesn't seem like the source map dimensions would be a problem, but yeah, that might be something to consider. What would you guys want in the map? Rate agree for something new, or disagree for a recreation of one of the Pokemon games.[/QUOTE] Create a new region, but keep the same basic workings as the latest Pokemon games and add some more stuff to make it more interesting.
  • Avatar of PortalGod
  • Well, it took forever, but I finally got around to getting the data for evolutions, an overview of the pokemon, and the base stats. Progress from here on out may be slow, because I can't have gmod open for more than 15 minutes without my graphics drivers failing. 7197 lines of goodness: [img]http://puu.sh/4ece[/img]
  • [QUOTE=DogLatrop;31735396][t]http://puu.sh/4mEw[/t] And here we gooooo [editline]a[/editline] Much better: [img]http://puu.sh/4mW6[/img][/QUOTE]
  • I got garry's approval, my life is complete [QUOTE=DogLatrop;31749256][QUOTE=garry;31748221]More plz[/QUOTE] What I have done on the map so far: [t]http://dl.dropbox.com/u/32605179/garrysmod/screenshots/pk_kanto0000.jpg[/t] Details (there's no pokemon center or pokemart in the second screenshot because I have to scale them and stuff): [t]http://dl.dropbox.com/u/32605179/garrysmod/screenshots/pk_kanto0001.jpg[/t] [t]http://dl.dropbox.com/u/32605179/garrysmod/screenshots/pk_kanto0002.jpg[/t] Credit to [url=http://www.facepunch.com/members/286242-Plasma]Plasma[/url] for making the [url=http://www.facepunch.com/threads/927268-Pokemon-Map-Assets]models and materials[/url], and for giving me the max files to do my own stuff to them. He's awesome.[/QUOTE]
  • Avatar of Hentie
  • Is he going to being using some sort of tile editor? Mapping something like pokemon in valve hammer seems sort of counter-productive.
  • Using hammer. You made me realize that I should work on the gamemode stuff, instead of expanding the map, though. Thanks.
  • Avatar of KatNotDinner
  • Hope it gets finished, has server with 10-20 players and doesn't die like most of the epic gamemodes.
  • Avatar of PortalGod
  • School and band are taking up most of my time, leaving me with only 2 hours a day, most of that time, I don't feel like working on this. So, progress will be slow from here until November.
  • Avatar of PortalGod
  • [QUOTE=PortalGod;31983533]Through hacky methods, I managed to make my own pause menu for my gamemode. [img]http://puu.sh/4SnM[/img] The code I used: [lua] FakeConsole:SetVisible(false) local ConsoleOpen = false local FakeConsoleOpen = false function GM:HUDPaint() ConsoleOpen = false end function GM:PostRenderVGUI() if(ConsoleOpen) then RunConsoleCommand("cancelselect") FakeConsoleOpen = not FakeConsoleOpen FakeConsole:SetVisible(FakeConsoleOpen) end ConsoleOpen = true end [/lua][/QUOTE]
  • Avatar of PortalGod
  • Another update, mostly just for me. [QUOTE=PortalGod;32096895]Made a metatable for my pokemon, which makes my life a whole lot easier. [img]http://puu.sh/590V[/img] The entire code to draw that is: [lua] for k,v in pairs(pokemon.GetAll()) do surface.SetDrawColor(0, 0, 0) surface.DrawOutlinedRect(-224 + (258*k), 16, 256, 64) surface.SetDrawColor(255, 255, 255) surface.DrawPokemonFront(-224 + (258*k), 16, 64, 64, v:GetName()) surface.SetTextColor(255, 255, 255) surface.SetFont("defaultlarge") surface.SetTextPos(-160 + (258*k), 24) surface.DrawText("Name: "..v:GetName()) surface.SetTextPos(-160 + (258*k), 48) surface.DrawText("Level: "..v:GetLevel()) surface.SetTextPos(-48 + (258*k), 24) surface.DrawText("Real XP: "..v:GetXP()) surface.SetTextPos(-64 + (258*k), 48) surface.DrawText("Draw XP: "..v:GetDrawXP()) surface.SetDrawColor(80, 104, 96) surface.DrawRect(-220 + (258*k), 72, 248, 4) surface.SetDrawColor(64, 200, 248) surface.DrawRect(-220 + (258*k), 72, v:GetCurLevelXPFrac()*248, 4) end[/lua] And the best part, the code to create it: [lua] local Pikachu = Pokemon("pikachu") Pokemon:AddXP(202) [/lua] All the functions I have so far: [code] Pokemon(Name or ID) //Create a new pokemon object Pokemon:AddXP(XP) //Lerps the "fake" XP variable to the number given Pokemon:GetCurLevelXPFrac() //returns a frac from 0-1 based on a lerped xp variable (for drawing) Pokemon:GetDrawXP() //returns the lerping XP Pokemon:GetID() Pokemon:GetLevel() Pokemon:GetName() Pokemon:GetXP() Pokemon:LevelXP(Level) //returns the xp needed for the given level Pokemon:SetLevel(Level) Pokemon:SetXP(XP) //Sets XP without lerping [/code] HUGE thanks to TGiFallen for help, and the level function library.[/QUOTE]