Mirage Source http://web.miragesource.net/forums/ |
|
Right-click warping http://web.miragesource.net/forums/viewtopic.php?f=210&t=1578 |
Page 2 of 3 |
Author: | Braydok [ Thu Apr 26, 2007 11:22 pm ] |
Post subject: | |
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 |
Author: | Da Undead [ Sat Apr 28, 2007 3:55 am ] |
Post subject: | |
what is this for? |
Author: | Robin [ Sat Apr 28, 2007 11:20 am ] |
Post subject: | |
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) |
Author: | Braydok [ Sat Apr 28, 2007 5:37 pm ] |
Post subject: | |
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 |
Author: | Robin [ Sat Apr 28, 2007 5:43 pm ] |
Post subject: | |
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. ~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... |
Author: | Braydok [ Sun Apr 29, 2007 9:03 pm ] |
Post subject: | |
I'm gona chose to ignore that... Anyway, thanks! it really works, now thers right-click warping. :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) Thanks a million Robin, ~Braydok |
Author: | justinc [ Sun Jul 13, 2008 2:24 pm ] |
Post subject: | Re: Right-click warping |
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 ? |
Author: | Rian [ Sun Jul 13, 2008 2:33 pm ] |
Post subject: | Re: Right-click warping |
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. |
Author: | Robin [ Sun Jul 13, 2008 6:48 pm ] |
Post subject: | Re: Right-click warping |
What source are you using? |
Author: | justinc [ Sun Jul 13, 2008 7:07 pm ] |
Post subject: | Re: Right-click warping |
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 |
Author: | Robin [ Sun Jul 13, 2008 7:10 pm ] |
Post subject: | Re: Right-click warping |
2.29 of what? |
Author: | justinc [ Sun Jul 13, 2008 7:28 pm ] |
Post subject: | Re: Right-click warping |
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 |
Page 2 of 3 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |