From Divinity Engine Wiki
Jump to: navigation, search
Full Definition(s)
  • call CharacterSetDetached((CHARACTERGUID)_Character, (INTEGER)_Value)

Depending on whether _Value is 0 or 1, attaches or detaches _Character to/from the AI-grid and display.

By default, all characters are attached to the AI-grid. When a character is detached,

  • it remains active: its reactions and scriptframes in behaviour scripts will run, and statuses on this character will keep ticking;
  • it will keep receiving events;
  • it becomes invisible on the client side, but not on server side; this means that while you won't see it on screen, e.g. CharacterSawCharacter events will still be thrown and CharacterCanSee queries will still succeed. To make it invisible on server side as well, see the comments of SetVisible;
  • it won't take up room on the AI-grid: other items/characters can occupy the space where the object was located
  • Unlike when setting a player off-stage, making a player detached keeps the camera focused on the place where the player was located.
  • In addition to making the character invisible on server side, it is also a good idea to disable all generic behaviours (in case this is an NPC), and the ability to join combat turn order when making a character detached.
  • This call is used for the player characters while they get abducted in Reaper's Cave:
    • The cocoon held by the insects is just an effect played on the insects
    • Setting the players off-stage resulted in the camera switching focus to other characters (possibly in a completely different place in the game world)
    • Making them merely invisible resulted in them still taking up room on the AI-grid, so other characters could not walk in the same spot and they would take damage from surfaces and area-of-effect skills affecting those spots
  • This call is new in DOS2 Patch 5.
See Also