madyotto Posted March 8, 2012 Author Share Posted March 8, 2012 how possible/complex would it be to script in an auto follow system for party'sIE. im in a party and i want another player to just stick by me automatically let says a tile or two behindmy project partner is quite good with vb and if i had a few tip of places the bits of code need to be scripted in and how to read the other players LOC im sure we would be able to manage the restDAM HIM BEING ON NIGHT'S HOW VERY INCONSIDERATE LOL.and thankswill also start a new thread so we can easily share the code when we are done Link to comment Share on other sites More sharing options...
Ruins of Hell Posted March 9, 2012 Share Posted March 9, 2012 @madyotto:> my project partner is quite good with vb and if i had a few tip of places the bits of code need to be scripted in and how to read the other players LOC im sure we would be able to manage the restPlease don't say scripted. Reading the other player's location is easy (GetPlayerX(i) and GetPlayerY(i) where i is the index). I don't think you want the location though, instead you want to see where they've been. Store the index of the person the player is following in TempPlayerRec. Then send an update whenever they've moved (or ask the server for an update/what prefer you). You could then do one of two things: one, use a combination of coordinates and direction to get where they were last tile), or two, add a basic pathfinding system so you can find the shortest path to their location. Link to comment Share on other sites More sharing options...
madyotto Posted March 9, 2012 Author Share Posted March 9, 2012 > Store the index of the person the player is following in TempPlayerRec. Then send an update whenever they've moved (or ask the server for an update/what prefer you). You could then do one of two things: one, use a combination of coordinates and direction to get where they were last tile), or two, add a basic pathfinding system so you can find the shortest path to their location.which would be easiest to program ? Link to comment Share on other sites More sharing options...
madyotto Posted March 9, 2012 Author Share Posted March 9, 2012 i have been thinking and i am wondering but tbh IDK if i am right but here's my thoughtinstead of using loc to actually follow a party member would it make the programming any easier if:you have a range of one tile before follow can be done so if more than a tile away the follow option is not given/allowedthis way it is a given that the player doing the following is only 1 tile away when the follow cmd startsand then program the following player to copy the movements of the player being followedso if x player moves up so does the following player would this be an easier mod to make Link to comment Share on other sites More sharing options...
Esmeyana Posted March 9, 2012 Share Posted March 9, 2012 Lightning did that in the pet system, so your pet follows you, he actually copied the code that makes the npc follow you when he is going to attack you when you get in his range. So what did he do? remove the attack, keep the following and make a button.Be creative, find the following-code of the npc, and do the same code but for player now.It's not as hard as you think, actually I think it don't need a lot of code.About the maximum range to follow a player, I don't know if there is a function like that in Eclipse, but you can make it using the select case statement. Like,```Private Function checkRange(ByVal target As Long, ByVal myIndex As Long) As BooleanDim rangeX As LongDim rangeY As LongrangeX = getplayerx(target) - getplayerx(myIndex) ''Calculate the x difference between the playersrangeY = getplayery(target) - getplayery(myIndex) ''Calculate the y difference between the playersSelect Case rangeX Case 1, 0, -1 '' When the difference on x equals to "1", "0"(wich must be impossible expect an epic lagg, or a no-block system in your game) or "-1" Select Case rangeY Case 1, 0, -1 '' Check if the difference on y also equals to 1, 0 or - 1. If GetPlayerMap(Target) = GetPlayerMap(myIndex) Then ''Check the player map is the same, or, you know what will happen if the maps are not the same. checkRange = True '' Make the value of checkRange "True" when x and y are in range, so you can start the following system with an if statement on the other side of the code. End If Case Else checkRange = False '' Make the value of checkRange "False" when x and y are not in range. End Select Case Else checkRange = False '' Make the value of checkRange "False" when x is not in range.End SelectEnd Function```This is the maximum help you can get, specially on this forum.I hope this helped you.EDIT: forgot to check if the maps are the same in the code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now