Skip to content

Looking for a way to limit the duration of MoveToObject

chimericchimeric Member Posts: 1,163
MoveToObject in a script sends a creature to the target; when it reaches him/her, a second or two pass and the creature calms down, the order fulfilled. But when several creatures are told to go to the same object, they throng about, darting in and out, rubbing sides and stepping on toes. It seems that they prevent each other from getting that close contact, that intimate climax of the action. They can never get enough of the target, and if the target moves, they go after him like a college of perverts, still trying to complete their task, even though it's not the Follow version of the action. Well, commanding a crowd at once is just what I need, so I'm going to have to come up with a way to tell the creatures to quit a few seconds into this - a round should move them along far enough.

Or I can ask you, people. I've been conjuring up wild tricks for days, I feel kind of burned out.

Comments

  • ArdanisArdanis Member Posts: 1,736
    Use Range() check to stop moving when too close. If you want them to move for one round only, regardless of distance, then use timer expiration check.
  • chimericchimeric Member Posts: 1,163
    Like I said, the engine considers the MoveToObject action complete when a creature has reached the object and spent about a second there. Until then the moving just goes on and on. I can't put anything after the Move command, the creatures will never get to those actions. It's like Attack(). Local timers are a better idea. Won't they stress out performance, though, for a crowd of creatures?
  • ArdanisArdanis Member Posts: 1,736
    This works:
    
    IF
      Range("mytarget",10)
    THEN
      RESPONSE #100
        // do something, e.g. set a var
    END
    
    IF
      !Range("mytarget",10)
    THEN
      RESPONSE #100
        MoveToObject("mytarget")
    END
    ...however, I do seem to recall it only worked well within party's line of sight, otherwise artificial idiots would ignore the first block. Nevertheless, they'd still eventually stop trying to pile atop each other.

    Timers are ok, there're worse things to choke down performance.
Sign In or Register to comment.