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

Travel Menu (EO)


deathtaker26
 Share

Recommended Posts

;D hey I was working on a part for my game that when a player goes on a ferry or goes all the way to the left of there base it pulls up a menu of places asking them where they want to go and it has a list of map names and areas to take them to I made it to work with a scripted tile it kinda sucks atm im going to make it so that it can call up different menus but for now its just 1 menu all the same for every tile so…. yeah but I will make it better.

**Please rate 1-10 on how I did cause this was my first time using packets**

anyway for now this is what I have

Client
with the other tiles add this to constants

```
Public Const TILE_TYPE_MENU As Byte = 15
```
in the enum's above this

```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT
```
add this
```
SDUNMENU
```
and still in the enums but above this

```
    ' Make sure CMSG_COUNT is below everything else
    CMSG_COUNT
```
add this

```
CDUNMENU
```

now in mod handle data under
```
HandleDataSub(STradeStatus) = GetAddress(AddressOf HandleTradeStatus)
```
add
```
HandleDataSub(SDUNMENU) = GetAddress(AddressOf HandleDUNMENU)

```
still in the mod handle data some where with all the other subs add this
```
Private Sub HandleDUNMENU(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
  Frmdunmenu.Visible = True
End Sub
```
in modclienttcp add
```
Public Sub DUNMENU()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
    Buffer.WriteLong CDUNMENU
    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
now in the frmeditor_map with all the other attributes make an optdunmenu don't put anything in the code for it

now in modgameeditor under
```
                ' trap
                If frmEditor_Map.optTrap.Value Then
                    .Type = TILE_TYPE_TRAP
                    .Data1 = MapEditorHealAmount
                    .Data2 = 0
                    .Data3 = 0
                End If
```
add
```
                'dungeon menu
                If frmEditor_Map.OptDunmenu.Value Then
                .Type = TILE_TYPE_MENU
                .Data1 = 0
                .Data2 = 0
                .Data3 = 0
                End If
```
now in mod text under
```
                            Case TILE_TYPE_WARP
                                DrawText TexthDC, tX, tY, "W", QBColor(BrightBlue)
```
add
```
                                Case TILE_TYPE_MENU
                                DrawText TexthDC, tX, tY, "DM", QBColor(BrightBlue)
```
done with client now to server

SERVER SIDE

In ModPlayer under
```
        If .Type = TILE_TYPE_WARP Then
            MapNum = .Data1
            x = .Data2
            y = .Data3
            'TempPlayer(Index).CanPlayerMove = 1
            Call PlayerWarp(index, MapNum, x, y)
            Moved = YES
        End If
```add

```
    If .Type = TILE_TYPE_MENU Then
    Call Dungeonmenu(index)
        Moved = YES
        End If
```
with the constants under rest of the tiles add
```
Public Const TILE_TYPE_MENU As Byte = 15
```
in the enum's above this

```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT
```
add this
```
SDUNMENU
```
and still in the enums but above this

```
    ' Make sure CMSG_COUNT is below everything else
    CMSG_COUNT
```
add this

```
CDUNMENU
```
in modplayer under
```
Public Sub StunNPC(ByVal index As Long, ByVal MapNum As Long, ByVal spellnum As Long)
    ' check if it's a stunning spell
    If Spell(spellnum).StunDuration > 0 Then
        ' set the values on index
        MapNpc(MapNum).Npc(index).StunDuration = Spell(spellnum).StunDuration
        MapNpc(MapNum).Npc(index).StunTimer = GetTickCount
    End If
End Sub
```
add
```
Sub Dungeonmenu(ByVal index As Long)
Call DUNMENU(index)
End Sub
```
in modhandldata add this under all the rest of these things but above the end sub

```
    HandleDataSub(CDUNMENU) = GetAddress(AddressOf HandleDUNMENU)
```
above
```
Private Sub HandlePlayerMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

```
add
```
Private Sub HandleDUNMENU(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
Call DUNMENU(index)
Set Buffer = Nothing
End Sub
```
now in modservertcp above
```
Public Sub MapMsg(ByVal MapNum As Long, ByVal msg As String, ByVal Color As Long)

```
add
```
Public Sub DUNMENU(ByVal index As Long)
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer

    Buffer.WriteLong SDUNMENU
    SendDataTo index, Buffer.ToArray
    Set Buffer = Nothing
End Sub
```
now back to the client just add the attached files
http://www.freemmorpgmaker.com/files/imagehost/pics/8082086c73a0982ff2d32d34f628e4c7.rar

to edit the list just got to frmdunmenu and retype on the list
and add these to the codes for the travel button and dblclick list
If list1.text = "(your map name here)" then
call warpto( your map number here)
exit sub
end if

[![](http://www.freemmorpgmaker.com/files/imagehost/pics/e12c834332efff0457281441ddc05a19.jpg)](http://www.freemmorpgmaker.com/files/imagehost/#e12c834332efff0457281441ddc05a19.jpg)
Link to comment
Share on other sites

  • 1 year later...
sorry for the necro post, but I'm going to test this and see if it works with EO2.0, because it's actually a good system. Then I will report back

Edit: It doesn't work, but after a few modifications I got it to work on EO2.0, only problem is when you warp it warps to the same coords as the other map, so if your travel tile is on top of a block on the other map, it will be glitched.
Link to comment
Share on other sites

I posted the fix on the source index page forgot to post it here I have this in my source and i added where u can choose what x and y spot  u go too not just the map number also got to work with the conversation  system I'm adding in a travel cost ill post them all here when i finish cause I didn't really like the map tile :)
Link to comment
Share on other sites

@Captain:

> Son, you've got a while to go before you move to C++. This code is horrendously messy and needs a clean up.

That is why I don't use the edit I worked on anymore and just pay you to share you wonderful coding skills =) oh did I mention he does great work for cheap?
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
I would think this stuff would work in CS:DE since it doesnt rely on the DD7 Modules very much at all, obviously there might be some changes to the source to make this work however. Hmm, might be worth a try to make one more feature for CS:DE.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...