Skip to content

Commit

Permalink
Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed May 27, 2021
1 parent a763923 commit f48ad87
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 3 deletions.
40 changes: 37 additions & 3 deletions docs/gettingstarted/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,43 @@ This is the CCI Editor. This is where you will spend most of your time setting C

Here is a numbered picture and a description of what each element does.

The Toolbar:
![](./images/editor/editortoolbar.png){: class="img_center"}
 

| No. | Name | Description | Additional Info |
|-----|-----------------------|--------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| 1 | Profile Selector | Opens a dropdown to select a profile | |
| 2 | New Profile | Opens a prompt to add a new profile | Shift-clicking will open your profile directory |
| 3 | Event Viewer | Opens the Event Viewer | Shift-clicking will hide the variable values when opened |
| 4 | Connections Window | Opens the Connections Window | Allows you to disconnect or reconnect your sockets |
| 5 | Server-able Indicator | Shows if you can do server-side outcomes. More on this later | |
| 6 | Help Window | Opens the Help window | Also has buttons for statistics, the setup wizard, and debug mode |
| 7 | Reload Configurations | Reloads all configuration files from disk | Only useful if you edit your files by hand |
| 8 | Save Configurations | Saves and applies all your configuration files if changed | |
| 9 | Exit Button | Exits the Editor GUI | Shift-clicking saves (and applies) all your configurations before exiting |

 
 
The Navigator:
![](./images/editor/editornavigation.png){: class="img_center"}
| No. | Name | Description | Additional Info |
|-----|-----------------------|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| 1 | Collapse All | Collapses all the navigational trees in #7 | |
| 2 | Expand All In Current | Opens all the navigational trees for the selected object | |
| 3 | View Specific Config | For use of viewing a specific config | Use this if your config list is so long it goes off screen |
| 4 | View Specific Library | To view the contents of a specific library | Libraries will be explained in detail later |
| 5 | Event Configurations | List of event configurations | Also known as configs |
| 6 | Constants | View constants | |
| 7 | Navigational Area | Tree-style navigation for navigation | You cannot edit anything here. Only navigate. Editing is on the right side |

INSERT TABLE (no this is not a SQL command)
If you are reading this, the docs are still WIP.
 
 
In our example, this window was blank. We've selected something to show in this screenshot to help explain...
The Content Editor:
![](./images/editor/editornavigation.png){: class="img_center"}
| No. | Name | Description | Additional Info |
|-----|-------------------------------|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 | Field Name | The name of the field in the object you have selected | |
| 2 | Field Value | The value of the field in the object you have selected | If `null`, the text is greyed out. What is [null](https://www.quora.com/How-can-I-explain-the-concept-of-null-to-a-non-programmer)? |
| 3 | Variable Marker | A variable marker | For readability |
| 4 | Description of Selected Field | Describes what the selected field is for | Description. Of. Selected. Field. Was this additional info really necessary? If you thought No, you're wrong. |
77 changes: 77 additions & 0 deletions docs/gettingstarted/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Dissecting an Event
===================

The way CCI works, is it receives Stream Events, breaks it down, and passes it along to you in a way you can understand, to be passed into events. An important attribute of this, are what we call variables.

## Variables

Variables are, as the name implies, variables. They are essentially a key -> value mapping and are referenced using the `$` symbol.

For example:
A chat message comes in:
```
Toto: I bless the rains down in Africa.
```

The stream event comes in and gets processed, `Toto` is put in the `user` variable, and `I bless the rains down in Africa.` is put in the `message` variable.

So you get something like this:
```
user => Toto
message => I bless the rains down in Africa.
```

This is where variables become important. The variable `user` and `message` never changes. But the person sending a chat message might be a different person, with a different message.

To address this issue, you always reference the name of the variable, with the `$` symbol. Keep this in mind. Also note that variable names are case-sensitive.
 

### Global Variables

Global variables function on the same concept, but they are always available. Normally, when a stream event happens, information gets put into variables, and once processed, are discarded.

Global variables allows information to persist so you can reference them in different Events.

These are some global variables that are created when the mod is started:

| Variable Name | Description |
|---------------|-----------------------------------------------------------------------------------|
| streamer | The name you put in during the First Launch Wizard. Your Minecraft name otherwise |
| playerName | Your Minecraft name |
| mcVersion | The version of Minecraft you are running |

There may be more Global variables inserted later on as you use CCI.
 
 

The Event Viewer
================

By default, CCI generates a set of default configs for you. However, not everyone wants a toast to pop up when a chat message comes in, or a in-game chat message when someone resubs. This is where we introduce the Event Viewer.

Now, open up your Event Viewer. That's the `Events` button on the top left in the CCI Editor in case you've forgotten.

Our example here will already have an example event (A chat message), so yours will likely look a little simpler and cleaner.

The Events Viewer:
![](./images/events/eventviewer.png){: class="img_center"}
| No. | Name | Description | Additional Info |
|-----|-----------------------------|--------------------------------------------------------------|----------------------------------------------------------------------------|
| 1 | Event Index | The cached event index | |
| 2 | Hide Variable Values Toggle | Toggles whether to hide the variable values or not | Hold Shift when opening the Event Viewer to enable this by default |
| 3 | List of sockets | The list of sockets you have available | Clicking between these will change which events you're looking at, for your selected socket |
| 4 | Global Variables | This lets you look at the Global Variables available | |
| 5 | Notes | This lets you look at the Notes that have been loaded | |
| 6 | Variables List | List of variables associated with this event | Left side are variable names. Right are their values. Ctrl+C copies the name, Ctrl+Shift+C copies the value, to your clipboard |
| 7 | Left Event Index | Shifts the index to see a more recent event | <-- |
| 8 | Replay Event Button | Replays the event so CCI will act on it again | |
| 9 | Right Event Index | Shifts the index to see an older event | --> |
| 10 | Dump Events | Dumps all cached events' variables into a dump.json file | Use this for debugging purposes. If you're testing, consider using a `LogArgsCondition` |
| 11 | Clear Queues Button | Clears all the events in the queue, if you have one set up | |
| 12 | OK | OK | OK |

This event viewer will be helpful in building a custom Event. In the variables list (that's #6), you can see the list of variables and their values **after** the event had already been processed, meaning there may have been variable manipulation, including changes, deletion, or addition. Be mindful of this.

Variables starting with `cci-type` are for your reference, and are usually filtered and handled by CCI elsewhere.

Now that we are familiar with variables and their uses, go back to the main editor screen.
Binary file added docs/gettingstarted/images/events/eventviewer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/gettingstarted/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ What this means is that the mod configuration files are not interchangeable. Cli
If you would like to read more on installing CCI on a server, [read here](./ccionservers/).
&nbsp;

### Important Distinctions

Throughout these docs there will be a couple of mentions of similarly sounding words. This is the list of important distinctions and differences between the similarly sounding words.

| Stream Event | Event |
| These are events that happen on stream. Subscriptions, cheers, chat messages. | These are events configured in CCI to act on Stream Events. These contain conditions, outcomes, etc. More on that later. |
&nbsp;
| Mod Config | Config |
| The mod configuration file used to configure the mod. These contain your socket keys and should never be shown to others. | The configuration files CCI uses to understand what to do with your Stream Events. These collectively form Events and are saved in JSON files. |
&nbsp;
&nbsp;

First Launch
------------

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pages:
- Getting Started:
- First Launch and Setup: 'gettingstarted/index.md'
- The CCI Editor: 'gettingstarted/editor.md'
- Dissecting an Event: 'gettingstarted/events.md'
- First Launch, Mod Configs and Commands: 'gettingstarted/configs.md'
- Opening the Config Editor: 'gettingstarted/openingconfigeditor.md'
- Important Definitions: 'gettingstarted/importantdefinitions.md'
Expand Down

0 comments on commit f48ad87

Please sign in to comment.