Skip to content

Commit

Permalink
More docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed May 28, 2021
1 parent 3853da2 commit 9780f51
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/gettingstarted/processingevent.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Optional. Go to the existing Config Event and name it `Toast`. This will be help
<br />
<br />

And that concludes our tutorial. Hopefully this Getting Started segment has helped you understand how CCI works and how to use it. The other pages in this segment are additional tidbits that are worth reading, but the basics are done.
And that concludes our tutorial. Hopefully this Getting Started segment has helped you understand how CCI works and how to use it. The other pages in this segment are additional tidbits that are worth reading, but the basics are done. For more reading, check out the Intermediate and Advanced section in the sidebar, or check out the How To's section for more targeted approaches.

**Good luck** getting things working the way you want it to, _this is only the beginning_.

Expand Down
145 changes: 145 additions & 0 deletions docs/intermediate/configspecifics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
Getting the Most Out of Your Event Configuration
================================================

Whilst going through the Getting Started section, I'm sure you noticed a lot of other fields in the various components of the `EventConfiguration`.

This page hopes to list them in more detail, and their functions.

## EventConfiguration

Nothing much of note here. There is the `init` array, which can be used to set certain variables when the `EventConfiguration` is loaded, and is normally used along with `Constants`. This is covered in more detail [there](url.tbd).

## Configuration

### Event Type Filter (name: `types`)

We already covered this in our Getting Started section, but this bit deserves special mention. If the event type is set to `all` (case sensitive), the Config Events in this type are added **in addition** to the Config Events of the Event's type, and **tested first**.

So, if you want have a Config Event in the `all` type, remember to also enable `allowsOtherEventsToTrigger` to let other Config Events get tested too.

<br />

### Queues (name: `queues`)

Queues work alongside Config Events to allow them to trigger in order, with a set time in between each Config Event, rather than having them trigger their outcomes as they happen. For example, you have an entity spawned when a subscription happens, but then a subscriber gift bomb happens, and suddenly you have 50 angry Witches snarling at you. Queues will stagger them to your predetermined time.

#### Setting up a Queue

First thing first, you need to find out the event type you would like to queue. The default Event Configuration should cover most if not all of the event types you would normally care about. We will be using Streamlabs (and their default Event Configuration) for this example.

![](./images/configspecifics/queuetypes.png){: class="img_center"}
<br />
<br />

In the above picture, you can see that the event types are `bits`, `subMysteryGift`, `subscription`, `follow`, `host`, `raid`. Now, to set up a queue, go to the Configuration. You'll notice the `queue` already has two set. Double click on `queue`

![](./images/configspecifics/queuesdefault.png){: class="img_center"}
<br />
<br />

See the `host+subscription+bits` and `follow`? What this means is that there are two queues. `host`, `subscription`, `bits` all share the same queue, and `follow` has a queue of its own. However, just like this, the queues just...*exist*. You have to configure the Config Events to use them.

Move to the Event inside the `subscription` event type.

![](./images/configspecifics/subevent.png){: class="img_center"}
<br />
<br />

Pay attention to the `playTime` field. This has been set to 20 ticks (20 ticks is one second). This event is also of the `subscription` type. What this means is when this Config Event is tested and passes, it gets added to the `host+subscription+bits` queue, triggers if it is the first in queue, and then CCI waits 20 ticks, before triggering the next Config Event in the queue.

Removing the value of the `playTime` field, or setting it to a value below 0, will make it trigger immediately without joining the queue.

<br />

### Ignored Types (name: `ignoredTypes`)

Sometimes, the sockets will spit out jargon that you don't really care about or need. The problem is, this jargon is still an Event and clogs up your Event cache with unnecessary data *(I'm looking at you, streamlabels)*. Setting this to those event types makes CCI just ignore those Events.

<br />

### Platform Filter (name: `for`)

This is a filter that defines what platform this Configuration is for. Eg, in Chat's Event Configuration, we use it to discern between Twitch and YouTube.

Setting this to `null` disables the filter, and CCI will funnel all Events into this Configuration. Bear in mind that CCI works from a top to bottom principle. If this Configuration is the very first one, all later Configurations are ignored.

<br />
<br />

## Event

Some of these are self-explanatory. I'll detail some that needs special mention.

### Constant Name (name: `constantName`)

Explained in [Constants](url.tbd)

<br />

### Single Outcome Only (name: `singleOutcomeOnly`)

Normally, when an event triggers, all of the outcomes are triggered. Turning this on (setting it to `true`), tries the outcomes in order (top to bottom, as usual) until one passes (yeah, outcomes can potentially fail, too), and then it stops there. Randomly selecting an Outcome however, is explained further down, in Outcomes.

<br />

### Delay (name: `delay`)

Adds a delay (in ticks), before triggering the outcomes. Can also work in queues.

<br />

### Cooldown (name: `cooldown`)

This sets how frequently the Config Event can trigger, in ticks. If the Config Event is tested and passes and it is on a cooldown, it short circuits and CCI stops processing, which leads us to...

<br />

### Disable Short Circuit When On Cooldown (name: `disableShortCircuitWhenOnCooldown`)

Turning this on prevents the short circuit mentioned above and allows other Config Events below it to be tested instead.

<br />
<br />

## Conditions

"Conditions" are a bad name. For the most part, they are indeed conditions, they were developed as such, but eventually there was a need to do other things (eg, functions, math, etc) and it was absorbed into the Conditions system. That leads to a bunch of Conditions being known as "Unconditional".

What this means is that this Condition always passes. You can tell if a Condition is Unconditional by looking at the description when adding a Condition:

![](./images/configspecifics/unconditional.png){: class="img_center"}
<br />
<br />

This bit only covers Conditions in general, each condition has their own fields and different behaviours. Check them out on their own documentation page.

### Inverse Match / Reverse Result (name: `inverseMatch`)

Inverse match, well, reverses the result.

Eg, if you're checking if a variable exists, the condition will fail if the variable doesn't exist, and pass if it does. With inverse match, the condition passes if the variable doesn't exist, and fails if it does.

## Outcomes

Similarly to Conditions, this bit only covers Outcomes in general, each outcome has their own fields and different behaviours. Check them out on their own documentation page.

### Outcome Weight (name: `weight`)

Weight only matters when multiple outcomes are pooled together, such as in a Config Event. The weight of all the outcomes in the pool are added together to calculate the total weight and one of the outcomes is selected randomly. To illustrate this better, imagine this:

| Outcome | Weight |
| ------------ | ------ |
| Outcome A | 2 |
| Outcome B | 5 |
| Outcome C | 3 |
| Total Weight | 10 |

Random number, 1-in-10: **4**

```
Outcome: A | B | C
Weight: ==+++++xxx
Random: ---^------
Outcome B is selected.
```
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/intermediate/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Intermediate Difficulty, the old Advanced Difficulty
====================================================

So, you've made it through the Getting Started section, or somehow stumbled your way here, or both. CCI (proudly) flaunts itself as a flexible, versatile bridge between content creators and their supporters.

To achieve that sort of versatility, many many different features of varying complexities exist. This section aims to cover the more challenging yet more frequently used feature-set that generally takes a bit more effort and time to get set up.

Good luck.
10 changes: 7 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ pages:
- Processing an Event: 'gettingstarted/processingevent.md'
- The Client Mod Config File: 'gettingstarted/clientconfig.md'
- CCI on Servers: 'gettingstarted/ccionservers.md'
# - Intermediate Guides:
# -
# Suggested topics: Intermediate Guides, the new Advanced Level. Constants, Libraries, Understanding the Log File, Notes.
- Intermediate Guides:
- Intermediate Difficulty, the old Advanced Difficulty: 'intermediate/index.md'
- Getting the Most Out of Your Event Configuration: 'intermediate/configspecifics.md'
# Suggested intermediate: Constants, Notes. Math. . . Queues, Delays, Cooldowns. Unconditionals. Ignored Types. For.
# Suggested advanced: Libraries, Understanding the Log File, Arrays, Strings, Dump.json/LogArgsCondition aka debugging, Online Configs. Init Events.
# Suggested expert: Game Hooks.
# How to, random mob, random chance, repeat outcome
- How To's:
- How To's, a How To: 'howto/index.md'
- Capturing Twitch's Channel Point Rewards: 'howto/twitchchannelpointreward.md'
Expand Down
2 changes: 1 addition & 1 deletion theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2 class="sidebar-heading">
</main>
<div class="wrapper">
<footer>
Built with <a href="https://www.mkdocs.org">MkDocs</a> using a custom theme. Hosted by <a href="https://readthedocs.org">Read the Docs</a>.
Built with <a href="https://www.mkdocs.org">MkDocs</a> using a custom theme. Hosted by <a href="https://readthedocs.org">Read the Docs</a>. ReadTheDocs project base taken from <a href="https://minecraftforge.net/">Minecraft Forge</a> with permission.
<div class="theme-switch-wrapper">
Enable Dark Theme
<label class="theme-switch">
Expand Down
2 changes: 1 addition & 1 deletion theme/css/img_center.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
padding: 20px;
margin-left: auto;
margin-right: auto;
width: 95%;
max-width: 95%;
}

0 comments on commit 9780f51

Please sign in to comment.