Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Golf

Members
  • Posts

    148
  • Joined

  • Last visited

    Never

Posts posted by Golf

  1. Its really simple…

    I will show you example how to send message from server to client and open it in message box.

    This is working for eclipse origins.

    SERVER

    In monEnumerations in enum ServerPackets we will add new packet SSomething

    Now in modServerTCP we will add sub:

    ```
    Sub SendMessageToPlayer(ByVal index as Long,ByVal msg as String)
    Dim buffer as clsBuffer
    Set buffer = New clsBuffer
    buffer.writelong SSomething
    buffer.writestring msg
    senddatato index,buffer.toarray
    set buffer = nothing
    end sub

    ```
    Here we write a string and packet and send it to player (index)

    So when you want to send message write this 

    ```
    SendMessageToPlayer index,"Hello Eclipse bla bla"

    ```
    Now we need client side to read the message and show it in message box.

    In monEnumerations in enum ServerPackets  add  SSomething

    in modHandleData in sub initMessages on the bottom add:

    ```
    HandleDataSub(SSomething) = GetAddress(AddressOf HandlePlayerMessage)

    ```
    now in the same module add :

    ```
    Sub HandlePlayerMessage (ByVal index as long,byref data() as byte,byval Startaddr as long,byval extravar as long)

    dim msg as string
    dim buffer as clsbuffer
    set buffer = new clsbuffer
    buffer.writebytes data
    msg = buffer.readstring

    msgbox(msg)

    set buffer = nothing
    end sub

    ```
    Here we will write data we got and read message from it, then show msgbox with new msg.

    You can do much more this is one of the easiest.
  2. I think this works. I'm not sure it wasnt tested i wrote it now without vb6.

    Well one way is to convert your .mp3 file to .wav file then paste .wav file in Sound folder, after that you should add new Server enum on server and client side

    ```
    SPlayBattleSound

    ```
    in modConstats(Server) add 

    ```
    Public Const BattleMusic as String = "Battle.wav" 'or whatever filename

    ```
    Then in modServerTCP(Server) add:

    ```
    Sub SendPlayBattleMusic(ByVal Index as Long)
    dim buffer as clsbuffer
    set buffer = new clsbuffer
    buffer.writelong SPlayBattleSound
    buffer.writestring BattleMusic
    senddatato index,buffer.toarray
    set buffer = nothing
    end sub

    ```
    Now on client side in modHandleData add 

    ```
    Sub HandlePlayBattleSound (byval index as long,byref Data() as byte,byval StartAddr as long,byval ExtraVar as long)
    dim sound as string
    dim buffer as clsbuffer
    set buffer = new clsbuffer
    buffer.writebytes Data
    sound = buffer.readstring
    playsound sound
    set buffer = nothing
    end sub

    ```
    Also (client side) in sub initMessages copy last line before end sub and paste it in the same sub then replace SSomething with SPlayBattleSound and HandleSomething with HandlePlayBattleSound

    This will play music (sound).To make it in battle  on server side in PlayerAttackPlayer you need to add  

    ```
    Call SendPlayBattleMusic (Attacker)
    Call SendPlayBattleMusic (Victim)

    ```
    I dont know line where you should paste this because I dont have VB6 here right now I wrote all this from my head , but I think this should work.

    If you want to play music when you attack npc add this (I dont know wich line) in PlayerAttackNPC sub

    ```
    Call SendPlayBattleMusic (Index) 'I'm not sure if its attacker but i think its index

    ```
    Good luck
  3. @[member="CMFiend420"] If you are making Pokemon mmo alone and you are not a programmer after some time it will be full of bugs also you dont want for your game to be the same , you want to update it and add new features. I think for making pokemon mmo you need to know VB6 very well.
×
×
  • Create New...