Help with modTypes

Could someone help me make a modTypes for a Pokemon engine, I’m kinda having a hard time with the logic of it…

I know PokemonRec will have Sprite, Cry, Attack, etc but there are some stuff related to combat and other to the species itself.

Really need help with it 😕

Its rather simple.

In modTypes, at the top, put there something like this.


public Pokemon(1 to MAX_POKEMON) as PokemonRec

Private Type PokemonRec

'values go here

end type

This is the basic structure. If you still don’t understand how it works, I’ll explain it.

LOL, I know how it works, I just think I’m missing some varibles or doing something I shouldn’t


'Constants

Public Const MAX_POKEMON_IN_BAG As Long = 6

Public Const MAX_POKEMONS As Long = 2

Public Const MAX_POKEMONITEMS As Long = 1000

Public Const MAX_POKEMonmoveS As Long = 3

'Types

Public Pokemon(1 To MAX_POKEMONS) As PokemonRec

Public PokemonInBag(1 To MAX_POKEMON_IN_BAG) As PokemonInBagRec

Public Bag() As BagRec

'Public PokemonPokemonBank(1 To MAX_PLAYERS) As PokemonPokemonBankRec

'Public PokemonItemBank(1 To MAX_PLAYERS) As PokemonItemBankRec

'Public PokemonItem(1 To MAX_POKEMONITEMS) As PokemonItemRec

Public Pokemonmoves(1 To MAX_POKEMonmoveS) As PokemonmovesRec

Public PokemonDefence As PokemonDefenceRec

Public Type PokemonDefenceRec

    Normal As Long

    Fire As Long

    Water As Long

    Electric As Long

    Grass As Long

    Ice As Long

    Fighting As Long

    Poison As Long

    Ground As Long

    Flying As Long

    Psychic As Long

    Bug As Long

    Rock As Long

    Ghost As Long

    Dragon As Long

    Dark As Long

    Steel As Long

End Type

Public Type PokemonRec

    ID As Long 'pokedex id

    Name As String * NAME_LENGTH 'Bulbasaur

    Sprite As Long

    PartySprite As Long

    Type1 As Long 'Grass,Normal,etc...

    Type2 As Long

    Description As String 'pokedex desc

    Cry As Long

    Footprint As Long

    EvolutionPokemon As Long 'pokemon to which it envolves

    EvolutionLevel As Long 'at which level it envolves to that pokemon

    EXPCurve As Byte 'fast,slow,medium,etc

    HP As Long

    Attack As Long

    Defense As Long

    SpAttack As Long

    SpDefense As Long

End Type

Public Type BagRec

    Type As Byte 'If 1-Items,2-Pokeballs,3-KeyItems,4-TMs/HMs

    Name As String * NAME_LENGTH

    Desc As String

    Script As Long

End Type

'Public Type PokemonPokemonBankRec

'    PokemonInBagRec(1 To MAX_BAGPOKEMON) As Long

'End Type

'Public Type PokemonItemBankRec

'    PokemonItem

'End Type

'Public Type PokemonItemRec

'End Type

Public Type PokemonmovesRec

    Name As String * NAME_LENGTH

    Type As Long

    CurPP As Long

    PP As Long

    Power As Long

    Accuracy As Long

    StatusAilment As Byte

    StatusAmount As Long 'for -Defense -Attack and stuff

    Animation As Long

    Script As Long

End Type

Public Type PokemonInBagRec

    BagSlot As Integer

    Data() As PokemonRec

    Name As String * NAME_LENGTH

    Level(1 To 100) As Integer

    Shiny As Boolean

    Status As Byte 'poisoned etc

    StatusRounds As Byte 'durations in rounds of the status ailment

    Moves(1 To 4) As PokemonmovesRec

    'hp up,pp up,attack up and that shits  XD

    HP_Up As Long

    Attack_Up As Long

    Defense_Up As Long

    SpAttack_Up As Long

    SpDefense_Up As Long

    Consumable_Limit As Long 'don't want pokemons with +100000 attack  XD

    Accuracy As Long 'raised to 3 with Growl or whatever, remember to refresh after battle if finished

    Wild As Byte ' 1 wild, 2 npc, 3 human

End Type

The great thing about variables, you can always add more later if you realize you don’t have enough :P That being said, I doubt anyone knows enough about what you are planning on doing to actually go through and make sure you have variables for everything. That being said, I don’t see anything for current health, just HP. Maybe it is somewhere else in the coding, but I just see an HP (whether that is supposed to be max hp, or just hp idk.

'Public Type PokemonItemBankRec

’ PokemonItem

'End Type

Public Type BagRec

Type As Byte 'If 1-Items,2-Pokeballs,3-KeyItems,4-TMs/HMs

Name As String * NAME_LENGTH

Desc As String

Script As Long

End Type

All the problems I could find are in these recs.

not working on the items yet, I’m still just trying to create the pokemons and make them have moves, and have them in your party (up to 6), and then I’ll work in the battle system

The great thing about variables, you can always add more later if you realize you don’t have enough :P That being said, I doubt anyone knows enough about what you are planning on doing to actually go through and make sure you have variables for everything. That being said, I don’t see anything for current health, just HP. Maybe it is somewhere else in the coding, but I just see an HP (whether that is supposed to be max hp, or just hp idk.

Pokemon have an HP formula that it based on their BaseHealth (http://bulbapedia.bu….net/wiki/Stats)

That HP is the base health of the pokemon

Its rather simple.

In modTypes, at the top, put there something like this.


public Pokemon(1 to MAX_POKEMON) as PokemonRec

Private Type PokemonRec

'values go here

end type

This is the basic structure. If you still don’t understand how it works, I’ll explain it.

Matt, let’s not forget where this should be placed in the recs. You should probably have it places under PlayerRec or NpcRec. Depends on if you’re defining the npc as a Pokemon Type in the editor or when this Pokemon is on the team of a player…for example>

Like Matt said.


Public Pokemon(1 To MAX_POKEMONS) As PokeRec

In Private Type PlayerRec.


' Pokemon

Team(1 To 6) As PokeTeamRec

Matt, let’s not forget where this should be placed in the recs. You should probably have it places under PlayerRec or NpcRec. Depends on if you’re defining the npc as a Pokemon Type in the editor or when this Pokemon is on the team of a player…for example>

Like Matt said.


Public Pokemon(1 To MAX_POKEMONS) As PokeRec

In Private Type PlayerRec.


' Pokemon

Team(1 To 4) As PokeTeamRec

He asked

Could someone help me make a modTypes for a Pokemon engine, I’m kinda having a hard time with the logic of it…

so I tried to make it as simple as possible.


Public Moves(1 To MAX_MOVES) As MoveRec

For an example of the Move code, just a snippet of what I contain in a project of mine.


Public Sub SendSaveMove(ByVal movenum As Long)

    Dim Buffer As clsBuffer

    Dim MoveSize As Long

    Dim MoveData() As Byte

    Set Buffer = New clsBuffer

    MoveSize = LenB(Moves(movenum))

    ReDim MoveData(MoveSize - 1)

    CopyMemory MoveData(0), ByVal VarPtr(Moves(movenum)), MoveSize

    Buffer.WriteLong CSaveMove

    Buffer.WriteLong movenum

    Buffer.WriteBytes MoveData

    SendData Buffer.ToArray()

    Set Buffer = Nothing

End Sub

You’d have to handle moves via editor unless you wanted them ini based in which would be horrid.

Just to point it out, I’m making a Pokemon Silver kind of game, not a Pokemon Mistery Dungeon XD

Just to point it out, I’m making a Pokemon Silver kind of game, not a Pokemon Mistery Dungeon XD

Hence a team of six, if you didn’t notice. You’d have to individually edit each move in an editor, etc…

Log in to reply