Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.4:charactercontrolling [2022/06/21 21:27] – [Hotkeys] admin | 0.8.4:charactercontrolling [2022/06/21 21:38] (current) – [Audio Manager Controller] admin | ||
---|---|---|---|
Line 18: | Line 18: | ||
In short this means: if the input controller detects a hotkey, it will forward the event to the character controller. | In short this means: if the input controller detects a hotkey, it will forward the event to the character controller. | ||
- | And then the character controller will react on the hotkey event by a specific operation, like moving | + | And then the character controller will react on the hotkey event by a specific operation, like moving |
By default the character controllery already defines standardized hotkeys, like W-A-S-D for movement. | By default the character controllery already defines standardized hotkeys, like W-A-S-D for movement. | ||
Line 78: | Line 78: | ||
For individual treatment you can disable or overwrite those predefined hotkeys. | For individual treatment you can disable or overwrite those predefined hotkeys. | ||
- | The basis character controller component catches all input events, handles them and throws back user-friendly events. | + | The basic character controller component catches all input events, handles them and throws back user-friendly events. |
^Event ^Description^ | ^Event ^Description^ | ||
Line 194: | Line 194: | ||
It's usual to handle different things during character controlling. So you'd like to check for special positions in 3D space and execute actions when getting triggered. Or you like to playback sounds on specific states or refer to a sound-map. | It's usual to handle different things during character controlling. So you'd like to check for special positions in 3D space and execute actions when getting triggered. Or you like to playback sounds on specific states or refer to a sound-map. | ||
- | Therefore you're able to link out TGorillaTriggerPointManager or the TGorillaAudioManagerController. | ||
- | ==== TriggerPoints Management ==== | ||
- | TriggerPoints | + | The following components |
- | In a triggerpoint specific event you can react on that feedback and start the conversation ([[Dialogues|Dialogues]]). | + | * [[triggerpoints|TGorillaTriggerPointManager]] |
+ | * [[audiomanagercontroller|TGorillaAudioManagerController]] | ||
+ | * [[animationcontroller|TGorillaAnimationController]] | ||
- | <file pascal> | ||
- | procedure TGameWindow.DoOnWheelTriggered(ASender : TGorillaTriggerPointManager; | ||
- | const APos, AViewDir : TPoint3D; const APoint : TGorillaTriggerPoint; | ||
- | const ADistance : Single); | ||
- | begin | ||
- | FMX.Types.Log.D(' | ||
- | end; | ||
- | |||
- | procedure TGameWindow.DoOnWheelUnTriggered(ASender : TGorillaTriggerPointManager; | ||
- | const APos, AViewDir : TPoint3D; const APoint : TGorillaTriggerPoint; | ||
- | const ADistance : Single); | ||
- | begin | ||
- | FMX.Types.Log.D(' | ||
- | end; | ||
- | |||
- | [...] | ||
- | |||
- | |||
- | FTriggerPoints := TGorillaTriggerPointManager.Create(Self); | ||
- | // we don't want to check against camera, but againts the character model | ||
- | FTriggerPoints.RelatedControl := FCharacter; | ||
- | FTriggerPoints.Enabled := true; | ||
- | |||
- | // creata a single trigger point at runtime | ||
- | LTP := FTriggerPoints.AddTriggerPoint(' | ||
- | LTP.LookInDirection := false; // trigger only if character is nearby | ||
- | LTP.Kind := TGorillaTriggerPointKind.StaticTriggerPoint; | ||
- | LTP.Data := TValue.From< | ||
- | LTP.Tag | ||
- | LTP.OnTriggered := DoOnWheelTriggered; | ||
- | LTP.OnUnTriggered := DoOnWheelUnTriggered; | ||
- | </ | ||
- | ==== Audio Manager Controller ==== | ||
- | |||
- | The audio manager controller is an exchange layer between your character controller and an audio manager. | ||
- | You can playback sounds automatically, | ||
- | |||
- | The following example showing how to setup an audio manager controller at runtime. Here we show the usage of | ||
- | an input stated handling by keyboard input. | ||
- | |||
- | <file pascal> | ||
- | FAudioCtrl := TGorillaAudioManagerController.Create(Self); | ||
- | FAudioCtrl.AudioManager := Self.FAudioManager; | ||
- | FAudioCtrl.AddHotKeyMapping(' | ||
- | TGorillaCharacterControllerHotKey.KeyboardMoveForward, | ||
- | FAudioCtrl.AddHotKeyMapping(' | ||
- | TGorillaCharacterControllerHotKey.KeyboardMoveBackward, | ||
- | FAudioCtrl.AddHotKeyMapping(' | ||
- | TGorillaCharacterControllerHotKey.KeyboardMoveForward, | ||
- | FAudioCtrl.AddHotKeyMapping(' | ||
- | TGorillaCharacterControllerHotKey.KeyboardMoveBackward, | ||
- | </ | ||
===== Physics Character Controller ===== | ===== Physics Character Controller ===== | ||