Page 1 of 1

Support realm for SetAnchor()

Posted: Thu May 15, 2008 1:37 pm
by *Edwards
Yeah, I was wondering if it was already supported and if yes, nevermind.

Posted: Sun May 18, 2008 5:31 am
by ncrsn
While I understand the possible usability of this (e.g. checking if NPC is in correct realm or lured into another), I don't know if this is worth implementation.

See, as far as I know, anchor is only checked when NPC is walking in peacemode. If so happens and the NPC somehow walks into the "wrong" realm, what exactly did you think the anchor should do? The way I see it, should this feature be added, the NPC wouldn't be able to move if anchored into another realm. Thus the question I'd like to get a answer to is, what possibilities would a scripter get out from this?

I can only think of this:

Code: Select all

// snippet from NPC's AI script
var anchorrealm := "britannia";

---
    /*
        Instead of this...
    if (me.realm != anchorrealm)
        TeleportToAnchor();
    else
        Wander();
    endif
    
         Script could be...
    */

    if (!Wander())
        // Moving failed!
        if (me.realm != anchorrealm)
            TeleportToAnchor();
        endif
    endif
So this would ideally save, what, a one if-statement? IF NPC's current anchor could be read somehow (npc.anchor or NPC::GetAnchor()), scripter wouldn't have to save the anchor into a cprop (or in a variable in the script like in the example), but as it is now, I don't get the benefits.

Not saying this is a bad idea, maybe I just did not understood it properly. If so, could someone put me right?