Skip to content

Commit

Permalink
changed effect basics
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanthiax committed Feb 18, 2024
1 parent cb4c6b6 commit 8cca232
Show file tree
Hide file tree
Showing 18 changed files with 278 additions and 131 deletions.
2 changes: 1 addition & 1 deletion docs/all-plugins/custom-entity-ai/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ A goal consists of a key, a priority, and some arguments (options) - for example
speed: 0.6
canBeScared: false
```
Priorities are calculated in descending order, so 0 is the top priority, et cetera.
Priorities are calculated in descending order, so 0 is the top priority, etc..
All items use item lookup strings, as do all entities, so you can use custom items and entities in your goals.
2 changes: 1 addition & 1 deletion docs/boosters/how-to-make-a-custom-booster.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ gui:
**messages:** The messages that are broadcast when a booster activates/deactivates. You can use %player% as a placeholder.
**gui:** Config for how the booster looks in gui: the item, the lore, the name, et cetera.
**gui:** Config for how the booster looks in gui: the item, the lore, the name, etc..
### Effects + Conditions
Expand Down
2 changes: 1 addition & 1 deletion docs/ecocrates/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "EcoCrates"

## What sets EcoCrates apart from other crate plugins?

EcoCrates is designed to get rid of the pain in making crates. No more dealing with terribly made in-game editors, a lack of custom item / custom enchant support, poor performance, and all the other issues that you usually get with other crate plugins. Instead, EcoCrates gives you a fast, polished platform to make as many crates as you want - and, crucially, it's designed to make you money. It gives you a plethora of ways to rig your crates any way you want - give certain ranks chance multipliers for certain rewards, have fake display chances that affect animations to hone in on the near-miss effect, use placeholders to calculate chances, and more. It also gives you sounds, animations, fireworks, broadcasts, messages, and all the rest of it in order to maximize the dopamine from opening crates and get your players opening as many as they can. That's not to say it's all about profit, it's great for gameplay systems as players can pay money to open crates rather than using keys (if you want), add rerolls to stop people feeling hard done by, make vote crates, et cetera - it's a complete variable-reward system.
EcoCrates is designed to get rid of the pain in making crates. No more dealing with terribly made in-game editors, a lack of custom item / custom enchant support, poor performance, and all the other issues that you usually get with other crate plugins. Instead, EcoCrates gives you a fast, polished platform to make as many crates as you want - and, crucially, it's designed to make you money. It gives you a plethora of ways to rig your crates any way you want - give certain ranks chance multipliers for certain rewards, have fake display chances that affect animations to hone in on the near-miss effect, use placeholders to calculate chances, and more. It also gives you sounds, animations, fireworks, broadcasts, messages, and all the rest of it in order to maximize the dopamine from opening crates and get your players opening as many as they can. That's not to say it's all about profit, it's great for gameplay systems as players can pay money to open crates rather than using keys (if you want), add rerolls to stop people feeling hard done by, make vote crates, etc. - it's a complete variable-reward system.

## Check out our partners! (Click to visit)

Expand Down
2 changes: 1 addition & 1 deletion docs/ecojobs/how-to-make-a-custom-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dX
**level-xp-requirements:** The XP requirements for each level
**xp-gain-methods:** The way the job can be levelled. Each ID is a trigger - triggers give values such as damage dealt (with attack triggers), distance moved (with the move trigger), et cetera. Other triggers with no obvious value give an output of 1.
**xp-gain-methods:** The way the job can be levelled. Each ID is a trigger - triggers give values such as damage dealt (with attack triggers), distance moved (with the move trigger), etc.. Other triggers with no obvious value give an output of 1.
**level-placeholders:** Custom placeholders for messages / lore
Expand Down
2 changes: 1 addition & 1 deletion docs/ecopets/how-to-make-a-custom-pet.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ spawn-egg:

**level-xp-requirements:** The XP requirements for each level

**xp-gain-methods:** The way the pet can be levelled. Each ID is a trigger - triggers give values such as damage dealt (with attack triggers), distance moved (with the move trigger), et cetera. Other triggers with no obvious value give an output of 1.
**xp-gain-methods:** The way the pet can be levelled. Each ID is a trigger - triggers give values such as damage dealt (with attack triggers), distance moved (with the move trigger), etc.. Other triggers with no obvious value give an output of 1.

**level-placeholders:** Custom placeholders for messages / lore

Expand Down
2 changes: 1 addition & 1 deletion docs/ecoshop/how-to-make-an-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Let's break down each section:
to use a unique ID for every item in all of your shops.

`item`: This is the actual item we're selling. It supports custom items, enchantments,
custom names, amounts, reforges, et cetera - read
custom names, amounts, reforges, etc. - read
more [here](https://plugins.auxilor.io/all-plugins/the-item-lookup-system)

`buy`: If you want to make your item purchasable, this is where you specify the buy price.
Expand Down
2 changes: 1 addition & 1 deletion docs/effects/all-effects/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "All Effects",
"position": 3
"position": 4
}
2 changes: 1 addition & 1 deletion docs/effects/all-filters/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "All Filters",
"position": 5
"position": 6
}
2 changes: 1 addition & 1 deletion docs/effects/all-mutators/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "All Mutators",
"position": 4
"position": 6
}
2 changes: 1 addition & 1 deletion docs/effects/all-triggers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "All Triggers"
sidebar_position: 6
sidebar_position: 7
---

Triggered effects require a trigger, permanent effects do not support triggers and instead always apply when the effect
Expand Down
161 changes: 161 additions & 0 deletions docs/effects/configuring-a-chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
title: Configuring an Effect Chain
sidebar_position: 2
---
## Effect Chains
### What is an Effect Chain?
Effect chains are groups of effects that can be executed together. This is very useful if you want to create a
chance-based effect with several components: chance is calculated independently on each trigger, so without chains,
particles and messages could send when the effects don't activate, and vice-versa.

Effects in chains run isolated, so applying a mutator to one effect in the chain will apply it only to that effect -
however, you can specify a mutator to the parent effect which will be applied to all
effects in the chain. The same works for delays, e.g. if an effect in a chain has a delay of 2, it won't hold up other
effects down the chain.

Effect chains are also useful to re-use more complex logic, via custom arguments that you can specify.
These work like regular placeholders, and you reference them in your chains with `%<id>%`, for example `%size%` if you
had a size argument.

## Reusable Chains

One of the ways to create chains is in "chains.yml" in "/plugins/libreforge". This is great if you want to use chains more than once.

Chains created here are universally accessible. You can use them in Enchants, Skills, Jobs or any other effect holders.


You don't need to specify triggers in your chain, these are handled by the `run_chain` effect (see below).

### The Basic Layout
```yaml
chains:
- id: <chain id>
effects:
- <effect 1>
- <effect 2>
- <effect 3>
```
### Chain Config Example
```yaml
- id: mining_effect
effects:
- id: play_sound
args:
sound: BLOCK_AMETHYST_CLUSTER_BREAK
pitch: 0.7
volume: 10
- id: spawn_particle
args:
particle: soul
amount: 10
mutators:
- id: translate_location
args:
add_x: 0.5
add_y: 0.5
add_z: 0.5
```
You can add or remove as many chains as you want. Then, if you want to call a chain, use the `run_chain` effect, like
this:

### Calling Your Chain
```yaml
id: run_chain
args:
chain: mining_effect # The ID of the chain
chance: 50 * (%player_health% / 20) # Example to demonstrate placeholders in config
cooldown: 2
triggers:
- mine_block
filters:
blocks:
- diamond_ore
- emerald_ore
- ancient_debris
```

Custom arguments can be specified like this:

```yaml
id: run_chain
args:
chain: <chain id>
chain_args:
strength: %player_y% * 100 # You can put anything you want, doesn't only have to be numbers - you can use strings too!
... add whichever arguments you use in your chain
```

## Inline Chains

If you don't want to re-use chains, or if you prefer having them specified directly under the effect, you can specify
effects inline instead.

### The Basic Layout
```yaml
effects:
- <effect 1>
- <effect 2>
- <effect 3>
triggers:
- mine_block
args:
every: 3 # You can use Optional Args here: https://plugins.auxilor.io/effects/configuring-an-effect#optional-arguments
```

### Example Inline Chain
```yaml
effects:
- triggers:
- mine_block
filters:
blocks:
- diamond_ore
- emerald_ore
- ancient_debris
effects:
- id: play_sound
args:
sound: BLOCK_AMETHYST_CLUSTER_BREAK
pitch: 0.7
volume: 10
- id: spawn_particle
args:
particle: soul
amount: 10
mutators:
- id: translate_location
args:
add_x: 0.5
add_y: 0.5
add_z: 0.5
```

Inline chains also support custom arguments, just like regular chains.

## Run Types
Effect chains also support several run types:

- **normal**: All effects in the chain will be ran, sequentially, one after another
- **cycle**: Only one effect will be ran, and it cycles through each effect each time the chain is triggered
- **random**: Only one effect will be ran, chosen at random each time the chain is triggered

To specify the run type, add the `run-type` argument into config:

```yml
effects:
- triggers:
- alt_click
effects:
- <effect 1>
- <effect 2>
- <effect 3>
args:
run-type: random
chance: 30
... filters, mutators, etc
```

This is an alternative way of configuring your effects; you don't specify a top-level effect ID, instead you specify a
list of effects to be called. This can be thought of as being more trigger-centric; multiple triggers to multiple
effects straight away, no worrying about the underlying chain.
2 changes: 1 addition & 1 deletion docs/effects/configuring-a-condition.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Configuring a Condition"
sidebar_position: 2
sidebar_position: 3
---

Like effects, mutators, and entity goals, conditions consist of an ID and arguments.
Expand Down
Loading

0 comments on commit 8cca232

Please sign in to comment.