Trialoge
Info
Dependencies:
- AI_Function
Implementation:
 Trialoge.d on GitHub
This package allows you to create conversations with any number of NPCs and control the camera during the dialog.
Initialization
Initialize with LeGo_Trialoge flag.
Functions
EquipWeapon
EquipWeapon
Sektenspinner's function. Makes NPC equip a weapon.
- var C_NPC slf
 NPC to have a weapon equipped
- var int ItemInstance
 Weapon instance ID to be equipped
Configuration
const int EquipWeapon_TogglesEquip = 1
Above constant configures the behaviour of the function when trying to equip an already equipped weapon:
- 0-- EquipWeaponwill do nothing
- 1-- EquipWeaponwill unequip this weapon
Npc_GetArmor
Npc_GetArmor
Returns NPC's equipped armor.
- var C_NPC slf
 NPC to get the armor from
Return value
The function returns instance of armor worn by the NPC.
Npc_GetMeleeWeapon
Npc_GetMeleeWeapon
Returns NPC's equipped melee weapon.
- var C_NPC slf
 NPC to get the weapon from
Return value
The function returns instance ID of melee weapon equipped by the NPC.
Npc_GetRangedWeapon
Npc_GetRangedWeapon
Returns NPC's equipped ranged weapon.
- var C_NPC slf
 NPC to get the weapon from
Return value
The function returns instance ID of ranged weapon equipped by the NPC.
Npc_TradeItem
Npc_TradeItem
Swaps NPCs equipped weapon.
- var C_NPC slf
 NPC to perform operation on
- var int itm0
 instance ID of item to remove
- var int itm1
 instance ID of item to create and equip
DiaCAM_Update
DiaCAM_Update
Sektenspinner's function that updates the dialogue camera. (Used internally.)
DiaCAM_Disable
DiaCAM_Enable
TRIA_Wait
TRIA_Wait
Makes self and other wait for each other, e.g. for AI_GotoWP actions for synchronization. 
TRIA_Invite
TRIA_Invite
Invites an NPC into a conversation. Must be called before TRIA_Start.
- var C_NPC slf
 The invited NPC
TRIA_Start
TRIA_Start
Starts trialogues. Before that, all NPCs should be invited by TRIA_Invite.
TRIA_Barrier
TRIA_Next
TRIA_Next
Sets the called npc to self.
- var C_NPC n0
 NPC to set to- self
TRIA_Cam
TRIA_Cam
Starts a tracking shot.
- var string evt
 The name of the tracking shot in Spacer. If- ""is passed, the running trace shot will be aborted.
TRIA_Finish
TRIA_Finish
Ends an ongoing trialogue. Must always be called at the end, otherwise no further trialogues can be started.
Examples
A Simple Trialogue
The following conversation is resolved via the trialogues:
- Arto: I'm sorry Hero, but you can't pass here.
- Hero: Why not?
- Horka: The city has been closed.
- Hero: I have some gold with me, can we trade?
- Squelto: No. We are not open to bribery.
- Hero: Sure?
- Arto: I have to ask you to leave now.
- Hero: Well...
Note
In addition, here are still Dialoggestures used.