Shortcuts

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Shortcuts

Post by SealDev »

I use CinemachinePriority very often but it takes a while to type or switch to a different conversation when I don't have another node to copy the text from.

Is there a way to write a much shorter word to replace just that text, and will the sequencer command still work?

Example:
CinemachinePriority(Cam,1)
Cam(Cam,1)
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Shortcuts

Post by Tony Li »

Hi,

Yes. Use sequencer shortcuts.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: Shortcuts

Post by SealDev »

Those are nice, but what if I have many cameras and I need just a very general shortcut which is very quick to type?

For example CinemachinePriority() vs C(), which would allow me to fill in the same parameters and trigger the original function. Existing shortcuts only work very specifically with 1 single camera, set to 1 specific priority.

Can I create my own shortcut as a pointer to the cinemachinepriority? I think this feature would be cool, especially when you use a command thousands of times.

Copy pasting from other nodes/conversations is way slower by comparison.
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Shortcuts

Post by Tony Li »

Hi,

Create a new sequencer command that's just an "alias" for the original command. Such as:

SequencerCommandC.cs

Code: Select all

using UnityEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
    public class SequencerCommandC : SequencerCommandCinemachinePriority {}
}
Then you can use C(), and it will be just like using CinemachinePriority().
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: Shortcuts

Post by SealDev »

Thank you so much!

By the way, "except:" parameter does the same thing as "all:" for the cinemachinepriority command. How can I fix it?

Is SendMessage() not publicly exposed? How can create an alias shortcut for it as well?
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Shortcuts

Post by Tony Li »

For performance, most of the built-in sequencer commands that are able to run immediately, such as SendMessage(), are internally defined and not subclassable. But you can write your own version if you like. Duplicate SequencerCommandTemplate.cs, rename it to SequencerCommandSM.cs, and fill in the code to find the subject and send the the message.
Post Reply