Can someone please post a tutorial for right click warping? I have seen multiple rightclick to move tutorials, but most say they don't work, or are not what I need.
I need a tutorial that when you right click, it warps you there, not walks.
Any help?
~Braydok
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Code: If button = 2 then
Call PlayerWarp(x, y, myindex)
end if
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?
Um, okay, but would that warp the admin where they click on, on the map?
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Code: If Player(MyIndex).Access >= 4 then
If button = 2 then
Call PlayerWarp(x, y, myindex)
end if
end if
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?
Instead of just copy and pasting try understanding the code that Robin simply wrote up.
Code: If Player(MyIndex).Access >= 4 then ' If Player's access if larger then or equal to 4
If button = 2 then ' If right click then (next line plx)
Call PlayerWarp(x, y, myindex) ' call sub to warp
end if
end if
Okay, but I was wondering if the warpplayer(x,y, myindex) or whatever, would warp them to where you click, apparently it did. Thanks.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Sorry, I should of explained it a bit better. Was feeling a bit off with Tonsillitis.
Basically, when you click on the picScreen PictureBox Control, the subroutine which is called logs many different things.
Including the x and y coordinates of the registered 'click' and the button.
Button 1 is the left mouse button, Button 2 the right and Button 3 the scrolling wheel. (On a standard mouse setup).
What we've done is taken these saved variables and put them into our sub.
So, (I'm guessing that when you click on the picScreen, the subroutine which is already there changes the x and y values to the corresponding 32x32 tiles, because I think we click on the screen for a player search or something), we call the PlayerWarp subroutine (PlayerWarp()) and put these saved variables into the syntax, so we come to.
Code: PlayerWarp x, y, myindex (the index of the playing character)
Of course, if you wanted to do this serverside, you would use the variable which stores the packet senders index, eg. "index".
So, it would become:
Code: PlayerWarp x, y, index
You would of course have to send the x and y in a packet, and could then even take the players index from the index of that packet.
Hope that helped explain a bit ^^
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?
i think he needs the whole sub/packet, not just the click command :x
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Boo Wrote:i think he needs the whole sub/packet, not just the click command :x
Don't look at me like that.
Double click on the picScreen.
I can't give you an entire subroutine because it's already got code in it, and I don't know how much of his code affects it already.
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?
i hate that smiley code... its : x what im trying to do like "Speechless" :\ sorry lol
This might work, other than the fact that that the client does not have a playerwarp code.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Braydok Wrote:This might work, other than the fact that that the client does not have a playerwarp code.
Then send a packet to the server.
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?
I tried, but how do you send the x and y that you got to the server?
Would it work like this?
Code: call SendData("RIGHTWARP" & sep_char & x & sep_char & y & end_char)
And then on server side:
Code: if Lcase(parse(0)) = "rightwarp" then
Call PlayerWarp(index, GetPlayerMap(index), x, y)
end if
Would that work?
~Braydok
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Braydok Wrote:I tried, but how do you send the x and y that you got to the server?
Would it work like this?
Code: call SendData("RIGHTWARP" & sep_char & x & sep_char & y & end_char)
And then on server side:
Code: if Lcase(parse(0)) = "rightwarp" then
Call PlayerWarp(index, GetPlayerMap(index), x, y)
end if
Would that work?
~Braydok
You've got the right idea, but no. The server needs to know which part of the packet the x and y are.
So,
Code: if Lcase(parse(0)) = "rightwarp" then
x = Parse(1)
y = parse(2)
Call PlayerWarp(index, GetPlayerMap(index), x, y)
end if
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?
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?
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
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.
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?
Oops, it was under key down.  I think this should work.
It says that: "Variable is not defined" and highlights the "button = 2"
Huh?
you have to define it in modTypes
Like in a Rec or something add..
Button as String
or w-e u wanna use for it >.>
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Boo Wrote:you have to define it in modTypes
Like in a Rec or something add..
Button as String
or w-e u wanna use for it >.>
No you fucking don't you fucking retard.
Don't even try to give someone else help, you utter moron.
Code: Private Sub picScreen_MouseDown(button As Integer, shift As Integer, X As Single, Y As Single)
Put it in that, in the frmMirage code.
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?
thats the same fucking thing u idiot, just defining it in differnt place and as integer instead of a string but like i said change it to what u want
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Boo Wrote:thats the same fucking thing u idiot, just defining it in differnt place and as integer instead of a string but like i said change it to what u want
Having it in modTypes in a rec is doing fuck all!
You know nothing, so don't try and help someone else when they know more than you.
What I posted is the way the subroutine is handled by the windows api. Shut up.
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?
what you did was make it run in 1 packet but i don't see any other packet that uses Button so it wouldnt make a difference...
ANd i used rec as a place to put it so its not hard to find
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Boo Wrote:what you did was make it run in 1 packet but i don't see any other packet that uses Button so it wouldnt make a difference...
ANd i used rec as a place to put it so its not hard to find
Do you not get it?
Button, as an integer, is returned when the click on picScreen is returned.
Putting "Button" in a rec will do nothing at all.
How dare you act like you know what you are doing and think that you actually know more than me.
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?
go in modTypes add it anyone doesnt freaking matter
It'll work >.
Yep robin is completely correct. You define it in rec, its going to stay blank, you define it the way robin said, its actually going to be used, since if you notice, its an argument...
|