Difference between revisions of "Osiris/API/Follow"

From Divinity Engine Wiki
Jump to: navigation, search
m (links)
(CharacterFollowCharacter does NOT result in CharacterIsPlayer returning 1 for the follower character; there's a difference between these "regular followers" and "party followers" :|)
Line 4: Line 4:
 
Makes '''_Character''' start following '''_ToCharacter'''. '''_Running''' indicates whether '''_Character''' should walk or run.
 
Makes '''_Character''' start following '''_ToCharacter'''. '''_Running''' indicates whether '''_Character''' should walk or run.
 
===== Notes =====
 
===== Notes =====
* As long as '''_Character''' is following '''_ToCharacter''', the [[Osiris/API/CharacterIsPlayer|CharacterIsPlayer]] query will return '''1''' for '''_Character'''.
 
 
* Preferably use [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] from the Shared mod. This will ensure that '''_Character''''s following behaviour gets suspended when it enters combat, and resumed afterwards.
 
* Preferably use [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] from the Shared mod. This will ensure that '''_Character''''s following behaviour gets suspended when it enters combat, and resumed afterwards.
 
* Use [[Osiris/API/CharacterStopFollow|CharacterStopFollow]] to stop the following behaviour (or [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]] if you used [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]).
 
* Use [[Osiris/API/CharacterStopFollow|CharacterStopFollow]] to stop the following behaviour (or [[Osiris/Shared/ProcCharacterStopFollow|ProcCharacterStopFollow]] if you used [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]).
 
* Make sure to stop following a previous character before starting to follow a new one. [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] will automatically take care of this.
 
* Make sure to stop following a previous character before starting to follow a new one. [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]] will automatically take care of this.
 +
* Note that this call does ''not'' turn '''_Character''' in a so-called "party-follower" or minion, which is done via [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]. The difference between "regular followers" (as created by this routine) and party followers/minions is that regular followers simply follow any other character around (you can have one NPC follow another one, if you want), while party followers/minions always follow a player-controlled character and can be partially controlled by the [[Osiris/API/CharacterGetReservedUserID|user]] that controls this player character.
 
===== See Also =====
 
===== See Also =====
 +
* [[Osiris/API/CharacterAddToPlayerCharacter|CharacterAddToPlayerCharacter]]
 
* [[Osiris/API/CharacterStopFollow|CharacterStopFollow]]
 
* [[Osiris/API/CharacterStopFollow|CharacterStopFollow]]
 
* Helper [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]
 
* Helper [[Osiris/Shared/ProcCharacterFollowCharacter|ProcCharacterFollowCharacter]]

Revision as of 21:10, 28 November 2017

Full Definition(s)
  • call CharacterFollowCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_ToCharacter, (INTEGER)_Running)
Description

Makes _Character start following _ToCharacter. _Running indicates whether _Character should walk or run.

Notes
  • Preferably use ProcCharacterFollowCharacter from the Shared mod. This will ensure that _Character's following behaviour gets suspended when it enters combat, and resumed afterwards.
  • Use CharacterStopFollow to stop the following behaviour (or ProcCharacterStopFollow if you used ProcCharacterFollowCharacter).
  • Make sure to stop following a previous character before starting to follow a new one. ProcCharacterFollowCharacter will automatically take care of this.
  • Note that this call does not turn _Character in a so-called "party-follower" or minion, which is done via CharacterAddToPlayerCharacter. The difference between "regular followers" (as created by this routine) and party followers/minions is that regular followers simply follow any other character around (you can have one NPC follow another one, if you want), while party followers/minions always follow a player-controlled character and can be partially controlled by the user that controls this player character.
See Also