Jump to content

How do you find out if you've moved to a new parcel from a script?


Hilary Querrien
 Share

You are about to reply to a thread that has been inactive for 526 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm a bit new to scripting, so apologies if this has been asked and answered before, but I'd like to be able to tell if I've moved to a new parcel in a script (which would be attached to a hud). I can see from the script wiki I get an event when the region has changed, and I can see how to work out what parcel I'm in right now, but I can't see any way other than starting a timer which waits for a second or so, and then checks the current parcel, which seems like it would not be a terribly nice thing to do in terms of making things laggy.

Any help would be greatly appreciated

Hils

Edited by Hilary Querrien
typo in title
Link to comment
Share on other sites

  • Hilary Querrien changed the title to How do you find out if you've moved to a new parcel from a script?

Agree with Rolig said. Timers by themselves aren't bad, even fast ones; what you do with them, and how many there are, matter more.

Even a timer mashing parcel info at the highest possible rate uses about 0.01 ms of script time; checking parcel info once per second is 0.001 (for comparison: an idle script that does nothing is 0.0001). That once per second would be more than enough for checking for parcel changes at normal movement speeds.

  • Like 1
Link to comment
Share on other sites

You might, depending on your needs and considering the limitations of it, try the "moving_end" event.  It won't detect if someone  long range sits, and i'm not sure if sitting and then the object moving and un-sitting them will trigger it, but in a lot of cases it will fire when the avatar changes position.

  • Like 1
Link to comment
Share on other sites

8 hours ago, Hilary Querrien said:

Oh? It does? I read the description and couldn't understand it.... Thanks, I'll have another look at that.

Addendum: Wow. You get about a DOZEN moving_end events after a teleport.

Yikes. I had no idea.  I've never played much with it personally, I just knew it existed and might fill the need.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 526 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...