Difference between revisions of "Osiris/API/CharacterAssignToUser"

From Divinity Engine Wiki
Jump to: navigation, search
m
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
===== Full Definition(s) =====
 
===== Full Definition(s) =====
* call '''CharacterAssignToUser'''('''''[in]'''(INTEGER)'''''_UserID''','''''[in]'''(CHARACTERGUID)'''''_Character''')
+
* call '''CharacterAssignToUser'''(''(INTEGER)'''''_UserID''', ''(CHARACTERGUID)'''''_Character''')
 
===== Description =====
 
===== Description =====
Assigns control over the player-controlled character '''_Character''' to the user with ID '''_UserID'''.
+
Assigns control over the [[Osiris/API/CharacterIsPlayer|player-controlled character]] '''_Character''' to the [[Osiris/API/CharacterGetReservedUserID|user]] with ID '''_UserID'''. The character will also be moved to the new user's [[Osiris/API/AddToParty|party]].
 
===== Notes =====
 
===== Notes =====
* UserIDs are volatile: they can change at any time, in particular when loading a saved game, or when someone disconnects and reconnects. Never store this value in a database. Only use it immediately after requesting it, within the same frame.
+
* This routine does nothing if '''_Character''' is '''NULL''', if it's not a player-controlled character, or if it is already assigned to the user with ID '''_UserID'''.
 +
* Characters can also be assigned to users by the game engine itself when they connect to a game or when someone else disconnects.
 
===== See Also =====
 
===== See Also =====
 
* [[Osiris/API/CharacterGetReservedUserID|CharacterGetReservedUserID]]
 
* [[Osiris/API/CharacterGetReservedUserID|CharacterGetReservedUserID]]
 +
* [[Osiris/API/CharacterMakeNPC|CharacterMakeNPC]]
 
* [[Osiris/API/CharacterMakePlayer|CharacterMakePlayer]]
 
* [[Osiris/API/CharacterMakePlayer|CharacterMakePlayer]]
 
* [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]]
 
* [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]]
+
* [[Osiris/API/CharacterReservedUserIDChanged|CharacterReservedUserIDChanged]]
[[Category:Osiris Calls]]
+
 
 +
[[Category:Osiris Calls|CharacterAssignToUser]]

Latest revision as of 16:13, 19 December 2017

Full Definition(s)
  • call CharacterAssignToUser((INTEGER)_UserID, (CHARACTERGUID)_Character)
Description

Assigns control over the player-controlled character _Character to the user with ID _UserID. The character will also be moved to the new user's party.

Notes
  • This routine does nothing if _Character is NULL, if it's not a player-controlled character, or if it is already assigned to the user with ID _UserID.
  • Characters can also be assigned to users by the game engine itself when they connect to a game or when someone else disconnects.
See Also