Difference between revisions of "Osiris/API/CharacterAddToParty"

From Divinity Engine Wiki
Jump to: navigation, search
(Fixed parameter types)
(Clarified that this is no substitute for CharacterRecruitCharacter, and updated usage notes)
Line 8: Line 8:
 
* This call will not do anything if '''_Character''' or '''_PartyCharacter''' is NULL, if '''_PartyCharacter''' is not in any party, or if '''_Character''' is already in another party.
 
* This call will not do anything if '''_Character''' or '''_PartyCharacter''' is NULL, if '''_PartyCharacter''' is not in any party, or if '''_Character''' is already in another party.
 
* '''_Character''' must be global.
 
* '''_Character''' must be global.
* The difference with [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]] is that this call does ''not'' turn '''_Character''' into a player character (although '''_Character''' can be a player character). In principle, the underlying routine supports adding individual totems, summons and plain NPCs to the party (as long as they are global, which makes it rather impractical for totems and summons).
+
* This API should only be used to add [[Osiris/API/CharacterIsPlayer|player-controlled characters]] to a new party after they have been removed from one with [[Osiris/API/CharacterRemoveFromParty|CharacterRemoveFromParty]]. This '''''must''''' be done in the same [[Osiris_Overview#Osiris_Frames|frame]] as the one in which the character was removed.
** Adding NPCs to a party is not supported though, and will result in unpredictable behaviour. Doing so will probably trigger an assert or failure in future versions.
+
* Use [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]] instead to recruit NPCs into a party (and make them a player).
** The only scenario in which this call is useful, and indeed mandatory, is if you remove a [[Osiris/API/CharacterIsPlayer|player-controlled character]] from a party using [[Osiris/API/CharacterRemoveFromParty|CharacterRemoveFromParty]] first. You then must add it to a new party again in the same frame, or many things may go wrong (the engine assumes player characters are always in a party).
 
 
===== See Also =====
 
===== See Also =====
 
* [[Osiris/API/AddToParty|AddToParty]]
 
* [[Osiris/API/AddToParty|AddToParty]]

Revision as of 15:27, 29 November 2017

Full Definition(s)
  • call CharacterAddToParty((CHARACTERGUID)_Character, (CHARACTERGUID)_PartyCharacter)
Description

Adds the character _Character to _PartyCharacter's party.

Normally, you should never use need nor use this call.

Notes
  • This call will not do anything if _Character or _PartyCharacter is NULL, if _PartyCharacter is not in any party, or if _Character is already in another party.
  • _Character must be global.
  • This API should only be used to add player-controlled characters to a new party after they have been removed from one with CharacterRemoveFromParty. This must be done in the same frame as the one in which the character was removed.
  • Use CharacterRecruitCharacter instead to recruit NPCs into a party (and make them a player).
See Also