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

[EO 2.0 / EO 3.0] Click to Move


Wortel Angels
 Share

Recommended Posts

All Client Side

At modGlobals add at bottom
```
'Pathfinding
Public MovXD As Integer
Public MovYD As Integer
Public MouseMove As Boolean
```At modGeneral Sub Main add at top
```
' Set Default MouseMove Boolean to False
MouseMove = False
```Search
```
Sub CheckInputKeys
```Replace with
```
Public Sub CheckInputKeys()
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If GetKeyState(vbKeyShift) < 0 Then
        ShiftDown = True
    Else
        ShiftDown = False
    End If

    If GetKeyState(vbKeyReturn) < 0 Then
        CheckMapGetItem
    End If

    If GetKeyState(vbKeyControl) < 0 Then
        ControlDown = True
    Else
        ControlDown = False
    End If

    'Move Up
    If GetKeyState(vbKeyUp) < 0 Then
        DirUp = True
        DirDown = False
        DirLeft = False
        DirRight = False
        MouseMove = False
        Exit Sub
    Else
        DirUp = False
    End If

    'Move Right
    If GetKeyState(vbKeyRight) < 0 Then
        DirUp = False
        DirDown = False
        DirLeft = False
        DirRight = True
        MouseMove = False
        Exit Sub
    Else
        DirRight = False
    End If

    'Move down
    If GetKeyState(vbKeyDown) < 0 Then
        DirUp = False
        DirDown = True
        DirLeft = False
        DirRight = False
        MouseMove = False
        Exit Sub
    Else
        DirDown = False
    End If

    'Move left
    If GetKeyState(vbKeyLeft) < 0 Then
        DirUp = False
        DirDown = False
        DirLeft = True
        DirRight = False
        MouseMove = False
        Exit Sub
    Else
        DirLeft = False
    End If

    If (GetPlayerX(MyIndex) <> MovXD Or GetPlayerY(MyIndex) <> MovYD) And MouseMove Then
        MoveNextStep
    Else
        MouseMove = False
    End If

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "CheckInputKeys", "modInput", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```At bottom add
```
Public Sub MoveNextStep()

            DirUp = False
            DirDown = False
            DirLeft = False
            DirRight = False

            If (Abs(MovXD - GetPlayerX(MyIndex)) > Abs(MovYD - GetPlayerY(MyIndex))) Then
                'Move Right
                If MovXD > GetPlayerX(MyIndex) Then
                    DirRight = True
                'Move Left
                Else
                    DirLeft = True
                End If
            Else
                'Move Down
                If MovYD > GetPlayerY(MyIndex) Then
                    DirDown = True
                'Move Up
                Else
                    DirUp = True
                End If
            End If
End Sub
```on frmMain, picScreen_Mousedown add
```
'Pathfinding
            MouseMove = True
            MovXD = CurX
            MovYD = CurY
```under
```
        ' left click
        If Button = vbLeftButton Then
```
Search in modGameLogic
```
Call CheckKeys
```and change to
```
' Call CheckKeys
```
Credits to bamm he added the tut faster than me
Now if you make an Left-klick youll walk to this position :D

Hope it Help ;-)
Link to comment
Share on other sites

In **Public Sub CheckInputKeys** have this:

```
chaton
```
You used the tutorial on shortcuts, but forgot to remove for mounting the tutorial. Fixes it.

Other than that, almost perfect. xD
If you have NPC on the map, or blocked, the player simply has to click there and elsewhere for him to walk. Or use the arrow keys.
Link to comment
Share on other sites

I found another bug. This did not mean it xD
And it is quite strange.
For example, you click on the map and as he walks to get to it you use the Alt + Tab to switch window. When you return to the game window, he ta round and round the map nothing to do with the coordinate. At least when you back it goes right to coordinated, but it's still pretty weird.
Link to comment
Share on other sites

@Mortal:

> lol… but if you play an mmorpg you wont switch if you walk ;-)

When i play Eclipse games i swithc windows… so what now... u will make a rule that doesnt allow switching windows while playing?
He reported you a bug, go fix it! xD
Link to comment
Share on other sites

IDK how to fix it but… normally you dont switch if you walk else your character will walk to the desired point if you switch back ;-) and its walks not to the klicked point if you switch because the route is temp saved in the client and if you switch it lost it for the time you switched...

So help me to fix it or don't switch or just switch if you dont walk else youll walk untill you got an block ;-)
Link to comment
Share on other sites

Well, I wrote this tutorial I do not know why that is in this section, except that I wrote in the Spanish section.
I'm new to eclipse, but I feel good that do not give me credit for it.

this is original tuto. http://www.touchofdeathforums.com/smf2/index.php/topic,82162.0.html
Link to comment
Share on other sites

I'm new, and it is my first source I do and I share. I did not go faster than you, I was the only one who did this source, you only copied it, please remove the link in your signature. I just discouraged to continue programming. I am the sole author of this source.
Link to comment
Share on other sites

If this source had a different origin, it would be exactly the same, this is a copy, you can see clearly. Any programmer can tell, is a copy. I read you,

the same variables, the same lines of code, the only thing different are the comments that you removed, but is exactly the same, it is possible that another person has written exactly the same at the same time, and it shows an hour after it I showed you, this is a copy, accept. and removes your signature tutorial please.

I know that may not be important for some people, but I care ami that will take time.

Here I leave the address for anyone to compare which is exactly the same source.

http://www.touchofdeathforums.com/smf2/index.php/topic,82162.0.html
Link to comment
Share on other sites

@Mortal Angels and @bamm….

I am going to re-iterate what I just said in bamms topic. Mortal Angel either took bamms source and converted it to english or took pieces from 2 separate tutorials and put them together as he stated. I don't care which way it happend, bamm should receive credit. Which he does (refer to first post). So everyone be happy and live your lives... lets not forget that both of your topics are based off of this one.

http://www.touchofdeathforums.com/smf2/index.php/topic,68580.0.html
Link to comment
Share on other sites

@Darkbeast the first problem you put it to modGlobal and you need it in modGeneral
And the second has nothing to do with this tutorial
@JcSnider Yes its not one of these 2 ways but bamm got credits idk if its build of from Rob Janes version but im happy i dont need Credits i do it just to help the Peoples so its for me Fine ;-)
@bamm i send you an pm from where i ripped it -.- Hate peoples who think i copy things sorry but if you rip it from the same engine or use the same things its not my problem you got credits so stop cry-.-
How stupid must i be to steal some work and release it at the SAME forum sorry but please use your brain just 1 minute
Link to comment
Share on other sites

Darkbeast , I was wrong,  these lines should not go there in the original post in the Spanish section put the change. Here I leave the lines that you remove.

this change is in modInput

```
If frmMain.txtMyChat.text = "" Then
          frmMain.lblEventChatContinue_Click
End If

```
Link to comment
Share on other sites

  • 1 month later...

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...