Jump to content


Photo

Persistent MoveToObjectFollow()


8 replies to this topic

#1 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 05 March 2012 - 03:22 PM

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?

#2 devSin

devSin
  • Fixpackers
  • 3017 posts
  • Gender:Male

Posted 05 March 2012 - 03:51 PM

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).

#3 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2247 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 05 March 2012 - 04:14 PM

You can use MoveToObject(), particularly if you do not want to follow it afterwards.
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#4 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 05 March 2012 - 04:31 PM

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, 05 March 2012 - 04:33 PM.


#5 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 05 March 2012 - 04:38 PM

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
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm

#6 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 05 March 2012 - 04:59 PM

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.

#7 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 05 March 2012 - 06:20 PM

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
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm

#8 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 05 March 2012 - 07:34 PM

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).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#9 argent77

argent77
  • Members
  • 254 posts
  • Gender:Male

Posted 06 March 2012 - 02:48 AM

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, 06 March 2012 - 02:48 AM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users