-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
122 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Constants, the Solution to Insanity | ||
=================================== | ||
|
||
As you probably have seen, the term "constants" have been used every now and then. Constants are, to a degree, a way to direct a Config Event Object to a static reference. | ||
|
||
Think of it this way. When you get bits, you spawn a pig. You get a subscription, you spawn a pig. You get raided, you spawn a pig, You get a follow, you sp-well, you see the pattern. In every one of those Config Events, you have a `CommandOutcome` that spawns the pig. But then round comes October, and in your "festive" mood, you decide to spawn a ~~Zombie Pigman~~ Piglin instead. There you go changing 4+ Outcomes. | ||
|
||
Here's where you're thinking: "*There has to be a better way!*". The solution to that, is Constants. Have all those Outcomes point to the same, one Constant, change the Constant, change them all. That's the idea. | ||
|
||
## How to use Constants | ||
|
||
First, let's look at Constants in the Editor: | ||
|
||
![](./images/constants/constants.png){: class="img_center"} | ||
<br /> | ||
<br /> | ||
|
||
Off the bat, you can see there's three different type of Constants. Conditions, Outcomes and Config Events. To add a Constant, you first need to think of a name for it. This will be the reference to the constant, so you cannot use conflicting names. Set the name, and if you're adding a Condition or an Outcome, select one. Do whatever you want inside the Object, at this point I'd hope you'd know how to do that (You may have to go back to the Getting Started section for a refresher if you don't). | ||
|
||
For the purposes of this guide, I'll be adding a `ToastOutcome` to the constant name `ConstantToastExample`: | ||
|
||
![](./images/constants/toastexample.png){: class="img_center"} | ||
<br /> | ||
<br /> | ||
|
||
Now, you're probably wondering, how to reference this. Config Events and Conditions/Outcomes differ slightly, as such: | ||
|
||
#### Event | ||
|
||
Config Events use the `constantName` field. | ||
|
||
![](./images/constants/eventconstantname.png){: class="img_center"} | ||
<br /> | ||
<br /> | ||
|
||
When using this field, some of the Config Event's behaviour changes. Most of the Config Event's fields are ignored (the Constant Event's is used instead) except for the following: | ||
|
||
* Queues & Play Time | ||
* Delays | ||
* Cooldowns | ||
|
||
These are intentionally kept separate from the Constant Event as different Event Types may have different queues etc. In the Constant Event, you may check the Event type and such by checking the `cci-type` variables. | ||
|
||
#### Conditions and Outcomes | ||
|
||
These use the `ConstantCondition` or `ConstantOutcome` Objects. Double clicking on the `name` field will open up the Constants selector. Shift Double Clicking will open up the usual String editor for manual input. | ||
|
||
Here in this `ConstantOutcome` you can see our only Constant Outcome in the list, the `ConstantToastExample`: | ||
|
||
![](./images/constants/outcomeconstantname.png){: class="img_center"} | ||
<br /> | ||
<br /> | ||
<br /> | ||
|
||
#### Final Note | ||
|
||
Be careful not to reference a constant recursively without having some kind of break out of that loop. If you do, the game will lock up and crash. CCI makes no checks for this. | ||
|
||
The `constantName` and `name` fields in Event and Condition/Outcome also support Variable Insertion. Be mindful of this! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Debugging the PEBKAC Issue | ||
========================== | ||
|
||
Naturally, with the flexibility that CCI offers, there will be hiccups here or there. This page aims to help you figure out what went wrong, and where. | ||
|
||
Unfortunately, CCI was not built with debugging in mind. As such, debug functions are lackluster. What can be offered, however, are two simple tools: The `LogArgsCondition` and the `Dump Events` functions. We will not talk about `Debug Mode` here, that is explained [here](url.tbd). | ||
|
||
## The Log Args Condition | ||
|
||
Errorously named, [this condition](url.tbd) is more akin to a "Log Variables Condition". To use this, you first need the Java Console open, as this conditions spits out the information there. You'll have to look up how to open this console for your specific launcher, I'm afraid. | ||
|
||
### How it works | ||
|
||
The `LogArgsCondition`, when triggered, collects all of the Global Variables and Local Variables and puts them into the Java Console. As the Event Viewer only shows you variables *after* the Event has been processed, this lets you see how the variables change as Conditions and Outcomes change them. | ||
|
||
To use this in within the Outcomes block, use a `ConditionalOutcome`. | ||
|
||
<br /> | ||
|
||
## Dump Events | ||
|
||
In the Event Viewer, there is a button called `Dump Events`. | ||
|
||
![](./images/debugging/dumpevents.png){: class="img_center"} | ||
<br /> | ||
<br /> | ||
|
||
Clicking on this button dumps the variables of all **cached** Events, for all the socket layers connected at the time, into a `dump.json` file, in your profile folder. However, this function was made pre-dating the CCI Editor, so what this essentially does is [serialises](https://en.wikipedia.org/wiki/Serialization) what you can see in the Event Viewer. |
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
I'm Making A Note Here, Huge Success! | ||
===================================== | ||
|
||
~~For the good of all of us, except the ones who are dead~~ | ||
|
||
Here we talk about Notes, and how they differ from Variables. Notes are, essentially, variables that save to disk. Variables are all kept in memory and thus are lost when the Event ends or Minecraft closes. Notes are loaded up when the profile loads, and saved to disk when added/modified. | ||
|
||
These are the few Event Objects you can use to work with Notes: | ||
|
||
| Type | Name | ID | Description | | ||
| --------- | ------------------------------ | -------------- | --------------------------------------------- | | ||
| Condition | [NoteCondition](url.tbd) | `note` | Loads a note into a variable (if not expired) | | ||
| Condition | [NotesListCondition](url.tbd) | `notesList` | Puts the list of note names into a variable | | ||
| Outcome | [NoteOutcome](url.tbd) | `note` | Saves a note to disk | | ||
| Outcome | [NoteDeletionOutcome](url.tbd) | `noteDeletion` | Deletes a note from disk | | ||
|
||
Notes only bridge the gap between the disk and CCI. Essentially, you load a note into a variable, and save a variable into a note. Check the individual pages of the Event Objects above for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters