Author Topic: Is my logic sound here?  (Read 2938 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Is my logic sound here?
« on: September 23, 2014, 01:36:18 PM »
0
Hi all,

I'm using the code below to make certain I get to the coords in event pathfind.  It seems to work fine, but wondering if there are any issues doing it like this:

Code: [Select]
top:
event pathfind 2149 1415 -23 3s
wait 1s
if #charposx <> 2149 && #charposy <> 1415
   {
    wait 10
    goto top
   }
else
halt

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Is my logic sound here?
« Reply #1 on: September 23, 2014, 03:37:01 PM »
0
Most pathfind function work like this.  Sometimes you can put a timer in there to make sure you actually make it to where you're going.  If you don't make it to the coords in a given amount of time, you can try another set of coords.  Just something to think about.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Is my logic sound here?
« Reply #2 on: September 24, 2014, 10:19:06 AM »
0
Hey TM...
Yea, you're right about alternative coords and waits of course.  If I were pathfinding around a dungeon or somewhere where unexpected stuff might get in the way, then I'd have alternatives.  Most my pathfind scripts are for running around my 5 houses, etc. so I generally know there's no reason to not get there.....
 ;)

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Is my logic sound here?
« Reply #3 on: September 28, 2014, 02:22:55 AM »
0
Usually you will want to use A Move Command with event pathfind as your backup plan. This will give you smoother Movement across Uneven Z Terrains( Like in T2a)


Move %X %Y 0 3s
if #Charposx <> %X || #Charposy <> %Y
{
Event Pathfind %X %Y
set %Time_Limit #scnt + 5
While ( #Charposx <> %X || #Charposy <> %Y ) && %Time_Limit > #Scnt
wait 1 
}

Untested code, but just showing concept of Move with a backup Pathfind.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: