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

How to change this:


vitinho444
 Share

Recommended Posts

no guys… c'mon!!

so do you know the left click on Eclipse Stable that make target on some NPC or Player!!

Thats what im talkin' about, i wanna change it so when you click on a player a window comes up (i know is source edit this)

i just wanna know how to left click call the window made in vb6..
Link to comment
Share on other sites

if you mean like kryces (which funnily enough i made the right click search function for ES a while back when askelJ was having trouble with it, he asked me to do that bit then he made the sadscript section for it.

but anyway, if you mean like how kryce has it

>! [![](http://www.freemmorpgmaker.com/files/imagehost/pics/fc3a4d8005dcc433be237940cf44a2d3.jpg)](http://www.freemmorpgmaker.com/files/imagehost/#fc3a4d8005dcc433be237940cf44a2d3.jpg)
[/spolier]
>! then you would have to source edit it.
Link to comment
Share on other sites

if askel didnt change the sub names then in the server its

> Public Sub Packet_RightSearch(ByVal Index As Long, ByVal CurX As Long, ByVal CurY As Long, ByVal X As Long, ByVal Y As Long)

jsut try searching 'RightSearch'

then you'll have to send a packet to the client with the player selected index in it, or store it in a variable in the server, then edit the clients packet handler to show the window you want it to
Link to comment
Share on other sites

i'll put a tut together tomorrow or monday when i'm a tad more sober.

if you've done vb6 all your doing is in Packet_RightSearch(server)

is using SendDataTo(index, "packet") just make the packet have a command name and the player selected's index like packet = "rightconfirm" & SEP_CHAR & Target & END_CHAR

something maybe?

then in the client in ModHandleData add something which shows a picture box on frmmirage or frmstable, which holds controls or buttons
Link to comment
Share on other sites

He stated before that he wants to make it so that it works when you left-click on another player. This just requires a small source edit to both the Client and Server.

**Server**

Head over to **modHandleData**, and find this:

```
Public Sub Packet_Search(ByVal Index As Long, ByVal X As Long, ByVal Y As Long)
    Dim i As Long

    If X < 0 Or X > MAX_MAPX Then
        Exit Sub
    End If

    If Y < 0 Or Y > MAX_MAPY Then
        Exit Sub
    End If

    ' Check for a player
    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
            If GetPlayerMap(Index) = GetPlayerMap(i) Then
                If GetPlayerX(i) = X Then
                    If GetPlayerY(i) = Y Then

                        ' Change the target.
                        Player(Index).Target = i
                        Player(Index).TargetType = TARGET_TYPE_PLAYER

                        Call PlayerMsg(Index, "Your target is now " & GetPlayerName(i) & ".", YELLOW)

                        Exit Sub
                    End If
                End If
            End If

        End If
    Next i

    ' Check for an NPC.
    For i = 1 To MAX_MAP_NPCS
        If MapNPC(GetPlayerMap(Index), i).num > 0 Then
            If MapNPC(GetPlayerMap(Index), i).X = X Then
                If MapNPC(GetPlayerMap(Index), i).Y = Y Then
                    Player(Index).TargetNPC = i
                    Player(Index).TargetType = TARGET_TYPE_NPC

                    Call PlayerMsg(Index, "Your target is now a " & Trim$(NPC(MapNPC(GetPlayerMap(Index), i).num).Name) & ".", YELLOW)

                    Exit Sub
                End If
            End If
        End If
    Next i

    ' Check for an item on the ground.
    For i = 1 To MAX_MAP_ITEMS
        If MapItem(GetPlayerMap(Index), i).num > 0 Then
            If MapItem(GetPlayerMap(Index), i).X = X Then
                If MapItem(GetPlayerMap(Index), i).Y = Y Then
                    Call PlayerMsg(Index, "You see a " & Trim$(Item(MapItem(GetPlayerMap(Index), i).num).Name) & ".", YELLOW)
                    Exit Sub
                End If
            End If
        End If
    Next i

    ' Check for an OnClick tile.
    If Map(GetPlayerMap(Index)).Tile(X, Y).Type = TILE_TYPE_ONCLICK Then
        If SCRIPTING = 1 Then
            MyScript.ExecuteStatement "Scripts\Main.txt", "OnClick " & Index & "," & Map(GetPlayerMap(Index)).Tile(X, Y).Data1
        End If
    End If
End Sub
```
Change that entire Sub to look like this:

```
Public Sub Packet_Search(ByVal Index As Long, ByVal X As Long, ByVal Y As Long)
    Dim i As Long

    If X < 0 Or X > MAX_MAPX Then
        Exit Sub
    End If

    If Y < 0 Or Y > MAX_MAPY Then
        Exit Sub
    End If

    ' Check for a player
    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
            If GetPlayerMap(Index) = GetPlayerMap(i) Then
                If GetPlayerX(i) = X Then
                    If GetPlayerY(i) = Y Then

                        ' Change the target.
                        Player(Index).Target = i
                        Player(Index).TargetType = TARGET_TYPE_PLAYER

                        Call SendDataTo(Index, "playeroptions" & END_CHAR)

                        Exit Sub
                    End If
                End If
            End If

        End If
    Next i

    ' Check for an NPC.
    For i = 1 To MAX_MAP_NPCS
        If MapNPC(GetPlayerMap(Index), i).num > 0 Then
            If MapNPC(GetPlayerMap(Index), i).X = X Then
                If MapNPC(GetPlayerMap(Index), i).Y = Y Then
                    Player(Index).TargetNPC = i
                    Player(Index).TargetType = TARGET_TYPE_NPC

                    Call PlayerMsg(Index, "Your target is now a " & Trim$(NPC(MapNPC(GetPlayerMap(Index), i).num).Name) & ".", YELLOW)

                    Exit Sub
                End If
            End If
        End If
    Next i

    ' Check for an item on the ground.
    For i = 1 To MAX_MAP_ITEMS
        If MapItem(GetPlayerMap(Index), i).num > 0 Then
            If MapItem(GetPlayerMap(Index), i).X = X Then
                If MapItem(GetPlayerMap(Index), i).Y = Y Then
                    Call PlayerMsg(Index, "You see a " & Trim$(Item(MapItem(GetPlayerMap(Index), i).num).Name) & ".", YELLOW)
                    Exit Sub
                End If
            End If
        End If
    Next i

    ' Check for an OnClick tile.
    If Map(GetPlayerMap(Index)).Tile(X, Y).Type = TILE_TYPE_ONCLICK Then
        If SCRIPTING = 1 Then
            MyScript.ExecuteStatement "Scripts\Main.txt", "OnClick " & Index & "," & Map(GetPlayerMap(Index)).Tile(X, Y).Data1
        End If
    End If
End Sub
```
Now we just need to handle the packet on the Client.

**Client**

Go to **modHandleData**, and add this as a new Case or casestring. I'm using casestring because I use Eclipse Evolution 2.7:

```
If casestring = "playeroptions" Then
    frmMirage.picbox.Visible = True
    Exit Sub
End If
```
Replace the _picbox_ variable with the name of the Picturebox you create on **frmMirage** that has all of the other player commands. You also will need to do some sort of calculation to set the Picturebox's left and top so that it will appear over the player.

You will need to do some more to get this to work properly, however. As stated before, you will need to create your own Picturebox and program each command that you choose to place on it.

Besides that, though, everything else should be done.
Link to comment
Share on other sites

vitinho coding is not something you can jsut C&P to make it work, you msut read entire posts otherwise i can garuntee 75% of the time it will nto work for you…

it clearly stats in the post where in the source. He also states that 'casestring' is for ee2.7

es may use a different handler.
Link to comment
Share on other sites

@[THE-KRIS:

> link=topic=59796.msg634520#msg634520 date=1273056968]
>
> > Client
> >
> > Go to modHandleData,
>
> if you go in there its kinda obvious…

REALLY!!!???
FLASH NEWS!! ITS IN MODHANDLEDATA!!!

I KNOW THAT..

sorry be rude man.. but where i place it? at the end? at the beginning?
Link to comment
Share on other sites

@vitinho444:

> REALLY!!!???
> FLASH NEWS!! ITS IN MODHANDLEDATA!!!

Acting like a spoilt kid isn't going to help you out here, lad. If you actually structured your questions properly we'd be able to answer them.

Think before opening your mouth.
Link to comment
Share on other sites

@Robin:

> @vitinho444:
>
> > REALLY!!!???
> > FLASH NEWS!! ITS IN MODHANDLEDATA!!!
>
> Acting like a spoilt kid isn't going to help you out here, lad. If you actually structured your questions properly we'd be able to answer them.
>
> Think before opening your mouth.

sorry then.. im just 12
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...