Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Model Engine 4 Model Engine 4
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 111
    • Issues 111
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • Model Engine 4Model Engine 4
  • Wiki
    • Skills
    • Mechanics
  • State

State · Changes

Page history
wiki standardization authored Oct 21, 2024 by Lxlp's avatar Lxlp
Hide whitespace changes
Inline Side-by-side
Showing with 1 addition and 1 deletion
+1 -1
  • Skills/Mechanics/State.md Skills/Mechanics/State.md +1 -1
  • No files found.
Skills/Mechanics/State.md 0 → 100644
View page @ 058ef9f7
[< Back to mechanic page](/Skills/Mechanics)
## Description
Play or stop an animation on a model.
## Attributes
| Attribute | Aliases | Description | Type | Default |
|-----------|---------------|------------------------------------------|---------|---------|
| modelid | m, mid, model | The model receiving a state change | String | |
| state | s | The animation being played | String | |
| remove | r | Is this mechanic used for removing state | Boolean | false |
#### When remove = false
| Attribute | Aliases | Description | Type | Default |
|-----------|---------|------------------------------------------------------------------------------------------------|-----------|---------|
| speed | sp | Speed multiplier of the state | Double | 1 |
| lerpin | li | Transition tick when the animation starts | Integer | 0 |
| lerpout | lo | Transition tick when the animation ends | Integer | 1 |
| force | f | Should the animation be played again even if it is already playing | Boolean | true |
| priority | p, pr | Set the priority of the animation.<br/>Only parsed when model is using Hybrid system | Integer | 1 |
| loop | l | Forced loop mode of the animation.<br>If not set, the mechanic use default animation loop mode | Loop Mode | |
| override | ov | Forced override mode of the animation.<br>If not set, the mechanic use default override mode | Boolean | |
#### When remove = true
| Attribute | Aliases | Description | Type | Default |
|------------|---------|--------------------------------------------------------------------------------------------------------|---------|---------|
| ignorelerp | i | Should the state be instantly removed without transition | Boolean | false |
| priority | p, pr | Target the animation of a particular priority<br/>Only parsed when model is using new animation system | Integer | 1 |
### Loop Attribute
This attribute type has 3 possible values, as described below:
| Value | Description |
|-------|--------------------------------------------------------------------------------------|
| ONCE | Cause the animation to only play once and exit the animation when it reaches the end |
| LOOP | Cause the animation to loop repeatedly until the animation is removed |
| HOLD | Cause the animation to hold on the last frame until the animation is removed |
## Examples
#### Playing an animation:
This will play an animation when the mob attacks.
The animation would take 3 ticks to transition in, and another 3 ticks to transition out.
```yaml
Skills:
# Play an attack animation that will only play once
- state{mid=kindletronjr;s=attack;li=3;lo=3} @self ~onAttack
```
> Note: In practice, this will only work if your animation has no wind up animation.
> If you want your animation to line up with your attack, you will have
> to [delay the attack](#syncing-animations-with-attacks).
---
#### Stopping an animation:
This stops an animation after a certain delay.
```yaml
Skills:
# Play a looping stun animation that won't stop automatically
- state{mid=kindletronjr;s=stunned;li=3;lo=3} @self
# Wait 4 seconds
- delay 80
# Remove the animation
- state{mid=kindletronjr;s=stunned;r=true} @self
```
---
#### Syncing animations with attacks:
As [described above](#playing-an-animation), if you play an attack animation with wind up using the attack trigger,
the animation would look delayed, i.e. "the damaging blow" of the animation is played after the target is damaged.
To fix this, we will have to:
* Cancel the attack event
* Play the animation
* Damage the target manually after a certain delay
```yaml
Skills:
- skill{s=[
- cancelevent
- skill{s=[
- state{s=attack} @self
- delay 5
- damage{a=2;type=ATTACK} @EIC{r=3;a=180;conditions=[ - isPlayer{} true ]}
];cooldown=1}
];sync=true} ~onAttack
```
---
#### Overlapping animations:
In some cases, you will want the model to play multiple animations at once. For example, a model holding up
its weapon while doing a charging animation.
By default, the Priority Animation System assign priority to each animation on model import.
Higher priority animations will automatically be applied later. For more information, check out
the [animation system guide](/Technical/Animation-Systems).
```yaml
Skills:
# Play the hold_axe animation, which has a lower priority
- state{mid=kindletronjr;s=hold_axe;li=3;lo=3} @self
# Play the charge animation, which has a higher priority
- state{mid=kindletronjr;s=charge;li=3;lo=3} @self
```
---
#### Overlapping animations using the Hybrid system:
The new Hybrid system no longer assign priority to each animation. Instead, priority is set
based on the `priority` attribute of this mechanic.
```yaml
Skills:
# Play the hold_axe animation, which we assign a lower priority
- state{mid=kindletronjr;s=hold_axe;li=3;lo=3;priority=1} @self
# Play the charge animation, which we assign a higher priority
- state{mid=kindletronjr;s=charge;li=3;lo=3;priority=2} @self
```
## Aliases
- [x] animation
\ No newline at end of file
Clone repository
Home
FAQ / Common Issues
Commands & Permissions
Configuration

Modeling
  • Creating a Model
    • Hitbox & Eye Height
    • Shadow
  • Bone Behaviors
  • Animating a Model
  • Importing a Model
  • Scriptable Keyframes
  • Optional Tools
MythicMobs
  • Mechanics
  • Conditions
  • Targeters
Citizens (R4.0.4)
  • Trait
  • Commands & Permissions

API
  • Basic
    • Apply / Remove Model
    • Play / Stop Animation
    • Configure Bone Behaviors
    • Mounting / Dismounting Model
    • Per-Player Model
    • Events
  • Advanced
    • Custom Base Entity
    • Custom Mount Controller
    • Custom Importer
    • Custom Bone Behaviors
    • Custom Script Reader
    • Custom Timeline
    • Custom Animation Handler
    • Custom Render Type

Technical
  • Terminology
  • Animation Systems
  • Mount Controllers
Promotional Material