Mirage Source

Free ORPG making software.
It is currently Sun Apr 28, 2024 7:26 pm

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Right-click warping
PostPosted: Tue Mar 27, 2007 10:34 pm 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 9:00 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 10:58 am 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
Um, okay, but would that warp the admin where they click on, on the map?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 1:38 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 1:52 pm 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
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

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 3:58 pm 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
Okay, but I was wondering if the warpplayer(x,y, myindex) or whatever, would warp them to where you click, apparently it did. Thanks. :)

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 4:30 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 8:26 pm 
i think he needs the whole sub/packet, not just the click command :x


Top
  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 8:28 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 8:33 pm 
i hate that smiley code... its : x what im trying to do like "Speechless" :\ sorry lol


Top
  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 11:16 am 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
This might work, other than the fact that that the client does not have a playerwarp code.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 11:35 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 10:48 pm 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
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

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 10:59 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 12:14 pm 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
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?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 11, 2007 4:48 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:11 am 
Offline
Regular
User avatar

Joined: Fri Mar 02, 2007 6:19 pm
Posts: 93
Location: Nonya
Oops, it was under key down. :P I think this should work.



It says that: "Variable is not defined" and highlights the "button = 2"
Huh?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:00 pm 
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 >.>


Top
  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:06 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:10 pm 
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


Top
  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:13 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:16 pm 
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


Top
  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:19 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:19 pm 
go in modTypes add it anyone doesnt freaking matter

It'll work >.<!


Top
  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:22 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
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...

_________________
xFire:- funkynut


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group