Jump to content
argent77

Persistent MoveToObjectFollow()

Recommended Posts

I wanted to use the action MoveToObjectFollow() to guide a creature to a specific person in the same area. It works well for my purposes, but there is one big problem. Whatever I try, the creature won't stop following me after I have delivered it. IESDP states that a different action will cancel the behaviour, but I haven't found one so far. Neither NoAction() nor ClearActions() are working.

 

Is there even a way without killing the creature in the process?

Share this post


Link to post

You'll have to post the script. Obviously, something is still true (they'll stop moving/following if they break out of that action, but your script is apparently dropping them back into it).

Share this post


Link to post

You can use MoveToObject(), particularly if you do not want to follow it afterwards.

Share this post


Link to post

For testing reasons I have removed every script except for this dialog portion:

IF ~Global("A7Q5Delivered", "MYAREA", 0)~ fes.talk.1
 SAY ~What are your orders, master?~
 ++ ~Wait here!~ + fes.stay
 ++ ~Follow me!~ + fes.follow
END

IF ~~ fes.stay
 SAY ~I will wait here.~
 IF ~~ DO ~ClearActions(Myself)~ EXIT
END

IF ~~ fes.follow
 SAY ~I will follow you.~
 IF ~~ DO ~MoveToObjectFollow(LastTalkedToBy)~ EXIT
END

Still, the creature won't stop following me, ever.

 

You can use MoveToObject(), particularly if you do not want to follow it afterwards.

Yes, that would be an alternative. I have avoided it because it's more complicated to code and the creature will likely crash into my character everytime he stops for a moment.

Edited by argent77

Share this post


Link to post

not too sure of what i'm saying... :p

 

but try wrapping inside an ActionOverride() and specify the actor. even tho the actor is running the dialog sometimes they don't take the actions without being in an ActionOverride()

 

Else instead of ClearActions() try telling it to MoveToObject() so that maybe it will stop following

Share this post


Link to post

No, neither ActionOverride nor any of the MoveTo actions work. It looks like the creature is ignoring any scripting action after issuing MoveToObjectFollow().

 

I'm also unable to save the game after the creature starts following me.

Share this post


Link to post

try seeing if you can break the action from script rather than dialog. set a variable in the dialog and then if that's set give the actor a different action.

 

its at least worth a try.

 

BG2 scripting isn't really my thing. Might be easier to accomplish stuff but it's more complicated in other respects ^^

 

hope you can get what you want working

Share this post


Link to post

The Haiass mod uses MoveToObjectFollow and presumably other actions work with it (you can tell the wolf to wait, run away, etc. after that). I wouldn't do it with area variables in dialogue though. Just set some GLOBAL in the dialogue and have the creature's script respond to it (I believe that's how Haiass does it).

Share this post


Link to post

It works now! :)

 

I had to apply the actions indirectly, setting a variable via dialog option and responding to it in the script file. Thanks for the pointer to the Haiass mod, Miloch.

Edited by argent77

Share this post


Link to post
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×