Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Right-click warping
#26
Code:
Private Sub picScreen_MouseDown(button As Integer, shift As Integer, x As Single, y As Single)
    Call EditorMouseDown(button, shift, x, y)
    Call PlayerSearch(button, shift, x, y)
    If Player(MyIndex).Access >= 4 Then
  If button = 2 Then
    Dim Packet As String
    Packet = "RIGHTWARP" & SEP_CHAR & x & SEP_CHAR & y & END_CHAR
        Call SendData(Packet)
  End If
End If
    
End Sub
Private Sub picScreen_MouseMove(button As Integer, shift As Integer, x As Single, y As Single)
    Call EditorMouseDown(button, shift, x, y)
End Sub

map: 1 X: 274 Y: 215
Reply
#27
what is this for?
Reply
#28
Braydok, you are gonna have to make it so it divides the x and y by 32 before warping.

If you do that, It'll warp to: Map: 1, X: 8, Y: 6

To do that, You'll need to add this piece of code before it sends the packet:

Code:
X = Int(X / 32)
Y = Int(Y / 32)
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#29
Oh, okay. I suppose that little part just slipped your mind.
Thanks, I'll try it out when I get back to my comp.

~Braydok
Reply
#30
Braydok Wrote:Oh, okay. I suppose that little part just slipped your mind.
Thanks, I'll try it out when I get back to my comp.

~Braydok

No, no it didn't.

Robin Wrote:
Braydok Wrote:I knew that... Thanks, I'll try it. Smile

~Braydok


Edit:

Um, lol. When I right click, it warps me to like, x: 160 and y: 170 or something.

What's up?

My code:
Code:
If Player(MyIndex).Access >= 4 Then
  If button = 2 Then
    Dim Packet As String
    Packet = "RIGHTWARP" & SEP_CHAR & x & SEP_CHAR & y & END_CHAR
        Call SendData(Packet)
  End If
End If
Code:
' :::::::::::::::::::::::::::::
    ' :: Right Click Warp Packet ::
    ' :::::::::::::::::::::::::::::
    If LCase(Parse(0)) = "rightwarp" Then
        x = Parse(1)
        y = Parse(2)
    Call PlayerWarp(Index, GetPlayerMap(Index), x, y)
    End If

Anything wrong?

You'll need to make it so it warps you to the corresponding 32x32 tile, rather than the pixel.

I thought it was already translated in the "click" sub of the picScreen.

You just can't read...
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#31
I'm gona chose to ignore that...

Anyway, thanks! it really works, now thers right-click warping. Smile Smile Smile Smile Smile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile SmileSmile Smile Smile Smile

Thanks a million Robin,
~Braydok
Reply
#32
Hi ive tried implimenting this code but when i click it just shuts the client down is it me or should i try it on a non scrolling maps server? would it make much difference ?
Reply
#33
I really see no reason that this would shutdown the client, with or without scrolling maps. Though, I'd imagine it's not gonna work exactly like it's supposed to with scrolling maps, without touching it up a little.
Reply
#34
What source are you using?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#35
ok well im using 2.29 but i seem to have gotten it working the only problem i had was that instead of EditorMouseDown which it kept saying function not defined i had to change to MapeditorMouseDown and it worked well ive found no problem as far as it stands
Reply
#36
2.29 of what?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#37
its ok ive managed to do it the only issue was warping while in editor but thats sorted now simple visible = fales comand and fully working i havent tried on the scrolling map server yet so thats the next one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)