Author Topic: Character Movement  (Read 10263 times)

0 Members and 1 Guest are viewing this topic.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Character Movement
« on: August 25, 2015, 08:29:47 AM »
0
this is something I have not really looked into or can understand too well so I'm after some help
I'm wanting a character to move to a certain spot but from a starting spot that may change (not by too much) but I have no idea the best way to do this,
 I'm looking for something like this
 Press num9 - char runs to a spot
 Press num8 - char runs to a different spot
 press num7 - char runs to another spot

what would be the best way to do this guys and how would I key activate it?

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #1 on: August 25, 2015, 08:34:59 AM »
0
Well, if you're talking short distances with nothing major that is path blocking you can probably use event pathfind, the other option is to use the move function.  Since you don't care the starting point with those functions, it shouldn't be too hard.  Now, if you're talking about navigation through complex problems (a maze, down around the corner of a hall, 5 screens away) then it becomes more problematic.  However, you could rail them all and have it call a rail depending on where it starts. 

Can you describe the conditions a bit more and I can give better insights on what would work safely and be the easiest to implement.
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #2 on: August 25, 2015, 09:08:13 AM »
0
Okay, You need a rail for each place you want to go.  Setting up the rails could be a pain, but there are ways to automate it but easier to hard code it for short rails, IMO.

Here's an example of what you might like to do.  As long as you are relatively close to your starting node like you say, it should be able to move to the first node without problem.  If not, we can implement 'find starting node' function or something that handles difficult moves...

Code: [Select]


set %RailOneX1 100
set %RailOneY1 300
set %RailOneX2 110
set %RailOneY2 300
set %RailOneX3 110
set %RailOneY3 290
set %RailOneCnt 3

set %RailTwoX1 100
set %RailTwoY1 300
set %RailTwoX2 90
set %RailTwoY2 300
set %RailTwoX3 90
set %RailTwoY3 310
set %RailTwoCnt 3

set %RailThreeX1 100
set %RailThreeY1 300
set %RailThreeX2 110
set %RailThreeY2 300
set %RailThreeX3 110
set %RailThreeY3 290
set %RailThreeCnt 3

while #true
{
   onhotkey 1
      gosub MoveRail RailOne
   onhotkey 2
      gosub MoveRail RailTwo
   onhotkey 3
      gosub MoveRail RailThree
}

halt

sub MoveRail
     namespace push
     namespace local MR , #systime
     
     set !Cnt %1 , Cnt
     set !Cnt % . !Cnt
     set !SX %1 , X
     set !SY %1 , Y
     display ok !Cnt
     
     for !i 1 !Cnt
     {
         set !nX !SX , !i
         set !nY !SY , !i
         set !nX % . !nX
         set !nY % . !nY
         
         move !nX !nY 1 5s   ;you might have to adjust timeout depending on move length
     }
     
     namespace clear
     namespace pop
return

R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #3 on: August 25, 2015, 09:57:14 AM »
0
I got it working but I get a system message box popup, how do I remove that?
Also how would I make the number pad numbers the hotkey and not the numbers above the letters on the keyboard?

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #4 on: August 25, 2015, 10:12:06 AM »
0
Sorry for your luck
http://www.easyuo.com/forum/viewtopic.php?p=366467#366467

Here is a list of keys
http://wiki.easyuo.com/index.php?title=OnHotKey

Delete the display ok !Cnt line in the move rail sub.
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #5 on: August 25, 2015, 11:46:00 AM »
0
thanks for your help, I seems to have the basics up and running, an Issue I am having now however is with "always run on" it seems to be missing tiles and making it a slow process with it off however it works perfectly
anyway around that issue?

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #6 on: August 25, 2015, 12:41:54 PM »
0
I am at work ok my phone so forgive the brevity in my response.   You may try changing the tolerance in the move command if it is necessary to hit exactly that tile.  Change the 1 to 0.


Also you may want to try and wrap the move command in a while loop that runs until #charposx = !nX && #charposy =!nY
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #7 on: August 25, 2015, 02:27:34 PM »
0
thank you very much for your help, seems to be working perfectly now!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #8 on: August 25, 2015, 04:45:56 PM »
0
Bad Maniac's Automagic Pathfinding Sub can be of use too.   simple to use.

https://www.easyuo.com/forum/viewtopic.php?f=3&t=19305

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Character Movement
« Reply #9 on: August 27, 2015, 11:52:51 AM »
0
you all set then Ketchup ??
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #10 on: August 28, 2015, 09:08:16 AM »
0
it worked great for what I needed it for at the time, however I'm now building crazy things with it and having issues, these are seriously long routes too

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #11 on: August 28, 2015, 09:57:25 AM »
0
Why not recall to a known spot and then rail a simple rail? 

Railing is a pita if you have a tight and narrow path to run.
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #12 on: August 28, 2015, 11:06:10 AM »
0
lost lands and dungeons you cannot recall in =(

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Character Movement
« Reply #13 on: August 28, 2015, 11:07:31 AM »
0
I'll just throw out there what I decided to attempt after, I wanted to do a spawn checker to run round all the spawns and alert me if I hit any active spawns

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Character Movement
« Reply #14 on: August 28, 2015, 12:18:41 PM »
0
Ah, okay, now you're talking about a challenging rail system. 

That is not some simple running, as you have to run into teleporters and what not.  I remember trying to do something along these lines with openEUO, and i had to use UO.Macro(5,X) commands (event macro 5 X in easyUO) to step into teleporters and dungeons. 
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Tags: