Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple question... prob for most of you.
#1
Ok im learning how MS works. I know how to send data with winsock myself but when with MS im confused.

More less I want to add more stuff to the characters files. Like for my pokemon game pokemon and their info.

So I want the client to send that to the server with the rest of the character info and then the server send it back when called for...

could someone give me an example of adding just 1 thing and I can work from there.

Thanks.
Reply
#2
Under your Pokemon type or class, add more variables for whatever you want. Like:

Type Pokemon
Name as String
EvolutionPercent as Byte
End Type

That would be for both server-side and client-side. Send the data using winsock with SendData. When it reaches the server, save it to the file or database, and then you may call it or update it whenever you wish.

Hopefully that helps.
Reply
#3
Okay you're going to want to setup Pokemon for the player so you'll have something similar to

Please Read Over This to make sense out of it.

Code:
Type PokemonAttackRec
    AttackNum as Long
End Type

Type PokemonRec
    Name as String * NAME_LENGTH
    EvolvesTo as Long
    Type as Byte ' This way you can setup like Fire/Grass/Water, and not have to do 5000000+ if/case statements
    EvolveMethod as Byte ' Some Could Evolve With Stones or by level or whatever...
    EvolveLevel as Integer ' Because didn't they evolve at a certain Point?

    ' These Might be different... depends on what YOU want
    HP as Long
    MP as Long
    SP as Long

    ' Attacks
    PlayerPokemonAttacks(0 to 4) as PokemonAttackRec
End Type

Type PlayerRec
    ...
    PlayerPokemon(0 to max_player_pokemon) as PokemonRec
    ...
End Type

Pokemon(1 to max_pokemon) as Pokemon Rec

Now if you did it this way, you'd have to make "Pokemon" directly editable, like Items... unless you just replaced "Npcs" with them, but i figured you didnt so you could leave the people walking around as the NPCs, but whatever. You'd also have to make an "Attack Editor", so you could do things like name the attack, the damage that it does, etc.

Hope this helps, and i hope you could make some sense out of it!
Reply
#4
I dont need all of that.

Just how to send 1 thing of info when it makes the char and saves and all of that.

for example when it sends your name or something everything you have to do to add that.

Like help me just add 1 thing to the character file and I can work from there.

Im going to add all their info to their character file.
Reply
#5
Sounds like you dont know packets? If so, check this:
http://ms.shannaracorp.com/forums/viewtopic.php?t=418
Reply
#6
yeah but I mean to send it with the character info
Reply
#7
I guess we just misunderstood... just update the "playerdata" packets...
Reply
#8
Obsidian Wrote:I guess we just misunderstood... just update the "playerdata" packets...
Basicly you just add:

Code:
SEP_CHAR & variable & SEP_CHAR & variable2 & SEP_CHAR & END_CHAR

And then make sure to receive it in the server by using:

Code:
Dim test as long
test = Val(Parse$(num))

Do you understand?
Reply
#9
Yeah I understand

I just want it to save with all the character info and load then as well

I will figure it out I guess
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)