Mirage Source
Right-click warping - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Right-click warping (/showthread.php?tid=850)

Pages: 1 2


- Braydok - 26-04-2007

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


- Da Undead - 28-04-2007

what is this for?


- Robin - 28-04-2007

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)



- Braydok - 28-04-2007

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


- Robin - 28-04-2007

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


- Braydok - 29-04-2007

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


Re: Right-click warping - justinc - 13-07-2008

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 ?


Re: Right-click warping - Rian - 13-07-2008

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.


Re: Right-click warping - Robin - 13-07-2008

What source are you using?


Re: Right-click warping - justinc - 13-07-2008

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


Re: Right-click warping - Robin - 13-07-2008

2.29 of what?


Re: Right-click warping - justinc - 13-07-2008

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