Skip to content

Commit

Permalink
Daedalus function documentation layout updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Feb 11, 2024
1 parent 2050f88 commit 248a9e3
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 164 deletions.
326 changes: 173 additions & 153 deletions docs/zengin/scripts/extenders/lego/applications/trialoge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,171 +2,191 @@
title: Trialoge
description: LeGo package implementing trialogues to gothic
---

!!! info inline end
**Dependencies:**<br/>
- [AI_Function](../tools/ai_function.md)<br/>
**Implementation:**<br/>
[:material-github: Trialoge.d on GitHub](https://github.com/Lehona/LeGo/blob/dev/Trialoge.d)


# Trialoge
This package allows you to create conversations with any number of NPCs and control the camera during the dialog.

## Dependencies

- [AI_Function](../tools/ai_function.md)

## Initialization
Initialize with `LeGo_Trialoge` flag.

```dae
LeGo_Init(LeGo_Trialoge);
```
## Implementation
[:material-github: Trialoge.d on GitHub](https://github.com/Lehona/LeGo/blob/dev/Trialoge.d)

## Functions

### `EquipWeapon`
Sektenspinner's function. Makes NPC equip a weapon.
```dae
func void EquipWeapon(var C_NPC slf, var int ItemInstance)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to have a weapon equipped
- `#!dae var int ItemInstance`
Weapon instance ID to be equipped

**Configuration**

`#!dae const int EquipWeapon_TogglesEquip = 1`

Above constant configures the behaviour of the function when trying to equip an already equipped weapon:

- `0` - `EquipWeapon` will do nothing
- `1` - `EquipWeapon` will unequip this weapon

### `Npc_GetArmor`
Returns NPC's equipped armor.
```dae
func int Npc_GetArmor(var C_NPC slf)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to get the armor from

**Return value**

The function returns instance of armor worn by the NPC.

### `Npc_GetMeleeWeapon`
Returns NPC's equipped melee weapon.
```dae
func int Npc_GetMeleeWeapon(var C_NPC slf)
```
**Parameters**

- `#!dae 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`
Returns NPC's equipped ranged weapon.
```dae
func int Npc_GetRangedWeapon(var c_npc slf)
```
**Parameters**

- `#!dae 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`
Swaps NPCs equipped weapon.
```dae
func void Npc_TradeItem(var c_npc slf, var int itm0, var int itm1)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to perform operation on
- `#!dae var int itm0`
instance ID of item to remove
- `#!dae var int itm1`
instance ID of item to create and equip


### `DiaCAM_Update`
Sektenspinner's function that updates the dialogue camera. (Used internally.)
```dae
func void DiaCAM_Update()
```

### `DiaCAM_Disable`
Completely disable the dialogue cameras.
```dae
func void DiaCAM_Disable()
```

### `DiaCAM_Enable`
Resets the dialogue cameras to the default settings.
```dae
func void DiaCAM_Enable()
```
### `TRIA_Wait`
Makes `self` and `other` wait for each other, e.g. for `AI_GotoWP` actions for synchronization.
```dae
func void TRIA_Wait()
```

### `TRIA_Invite`
Invites an NPC into a conversation. Must be called before `TRIA_Start`.
```dae
func void TRIA_Invite(var C_NPC slf)
```
**Parameters**

- `#!dae var C_NPC slf`
The invited NPC

### `TRIA_Start`
Starts trialogues. Before that, all NPCs should be invited by `TRIA_Invite`.
```dae
func void TRIA_Start()
```

### `TRIA_Barrier`
Similar to `TRIA_Wait` but applies to all participating NPCs.
```dae
func void TRIA_Barrier()
```

### `TRIA_Next`
Sets the called npc to `self`.
```dae
func void TRIA_Next(var C_NPC n0)
```
**Parameters**

- `#!dae var C_NPC n0`
NPC to set to `self`

### `TRIA_Cam`
Starts a tracking shot.
```dae
func void TRIA_Cam(var string evt)
```
**Parameters**

- `#!dae var string evt`
The name of the tracking shot in Spacer. If `""` is passed, the running trace shot will be aborted.

### `TRIA_Finish`
Ends an ongoing trialogue. Must always be called at the end, otherwise no further trialogues can be started.
```dae
func void TRIA_Finish()
```
#### `EquipWeapon`
!!! function "`EquipWeapon`"
Sektenspinner's function. Makes NPC equip a weapon.

```dae
func void EquipWeapon(var C_NPC slf, var int ItemInstance)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to have a weapon equipped
- `#!dae var int ItemInstance`
Weapon instance ID to be equipped

**Configuration**

`#!dae const int EquipWeapon_TogglesEquip = 1`

Above constant configures the behaviour of the function when trying to equip an already equipped weapon:

- `0` - `EquipWeapon` will do nothing
- `1` - `EquipWeapon` will unequip this weapon

#### `Npc_GetArmor`
!!! function "`Npc_GetArmor`"
Returns NPC's equipped armor.
```dae
func int Npc_GetArmor(var C_NPC slf)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to get the armor from

**Return value**

The function returns instance of armor worn by the NPC.

#### `Npc_GetMeleeWeapon`
!!! function "`Npc_GetMeleeWeapon`"
Returns NPC's equipped melee weapon.
```dae
func int Npc_GetMeleeWeapon(var C_NPC slf)
```
**Parameters**

- `#!dae 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`
!!! function "`Npc_GetRangedWeapon`"
Returns NPC's equipped ranged weapon.
```dae
func int Npc_GetRangedWeapon(var c_npc slf)
```
**Parameters**

- `#!dae 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`
!!! function "`Npc_TradeItem`"
Swaps NPCs equipped weapon.
```dae
func void Npc_TradeItem(var c_npc slf, var int itm0, var int itm1)
```
**Parameters**

- `#!dae var C_NPC slf`
NPC to perform operation on
- `#!dae var int itm0`
instance ID of item to remove
- `#!dae var int itm1`
instance ID of item to create and equip

#### `DiaCAM_Update`
!!! function "`DiaCAM_Update`"
Sektenspinner's function that updates the dialogue camera. (Used internally.)
```dae
func void DiaCAM_Update()
```

#### `DiaCAM_Disable`
!!! function "`DiaCAM_Disable`"
Completely disable the dialogue cameras.
```dae
func void DiaCAM_Disable()
```

#### `DiaCAM_Enable`
!!! function "`DiaCAM_Enable`"
Resets the dialogue cameras to the default settings.
```dae
func void DiaCAM_Enable()
```

#### `TRIA_Wait`
!!! function "`TRIA_Wait`"
Makes `self` and `other` wait for each other, e.g. for `AI_GotoWP` actions for synchronization.
```dae
func void TRIA_Wait()
```

#### `TRIA_Invite`
!!! function "`TRIA_Invite`"
Invites an NPC into a conversation. Must be called before `TRIA_Start`.
```dae
func void TRIA_Invite(var C_NPC slf)
```
**Parameters**

- `#!dae var C_NPC slf`
The invited NPC

#### `TRIA_Start`
!!! function "`TRIA_Start`"
Starts trialogues. Before that, all NPCs should be invited by `TRIA_Invite`.
```dae
func void TRIA_Start()
```

#### `TRIA_Barrier`
!!! function "`TRIA_Barrier`"
Similar to `TRIA_Wait` but applies to all participating NPCs.
```dae
func void TRIA_Barrier()
```

#### `TRIA_Next`
!!! function "`TRIA_Next`"
Sets the called npc to `self`.
```dae
func void TRIA_Next(var C_NPC n0)
```
**Parameters**

- `#!dae var C_NPC n0`
NPC to set to `self`

#### `TRIA_Cam`
!!! function "`TRIA_Cam`"
Starts a tracking shot.
```dae
func void TRIA_Cam(var string evt)
```
**Parameters**

- `#!dae var string evt`
The name of the tracking shot in Spacer. If `""` is passed, the running trace shot will be aborted.

#### `TRIA_Finish`
!!! function "`TRIA_Finish`"
Ends an ongoing trialogue. Must always be called at the end, otherwise no further trialogues can be started.
```dae
func void TRIA_Finish()
```

## Examples

Expand Down
3 changes: 3 additions & 0 deletions overrides/assets/stylesheets/constants.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 248a9e3

Please sign in to comment.