Skip to content

Commit 0a6c3f5

Browse files
committed
reorganize dmodels scripts into multiple files
1 parent 612fafa commit 0a6c3f5

File tree

2 files changed

+104
-58
lines changed

2 files changed

+104
-58
lines changed

scripts/dmodels_main.dsc

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# +---------------------------
2+
# |
3+
# | D e n i z en M o d e l s
4+
# | AKA DModels - dynamically animated models in minecraft
5+
# |
6+
# +---------------------------
7+
#
8+
# @author mcmonkey
9+
# @date 2022/06/01
10+
# @updated 2022/06/13
11+
# @denizen-build REL-1772
12+
# @script-version 1.3
13+
#
14+
# This takes BlockBench "BBModel" files, converts them (via external program) to resource pack + Denizen-compatible file,
15+
# then is able to display them in minecraft and even animate them, by spawning and moving invisible armor stands with resource pack items on their heads.
16+
#
17+
# Installation:
18+
# 1: Add "models.dsc" to your "plugins/Denizen/scripts" and "/ex reload"
19+
# 2: Make sure you have DenizenModelsConverter.exe on hand, either downloaded or compiled yourself from https://github.com/mcmonkeyprojects/DenizenModels
20+
# 3: Note that you must know the basics of operating resource packs - the pack content will be generated for you, but you must know how to configure the "mcmeta" pack file and how to install a pack on your client
21+
# 4: Take a look at the config settings in the bottom of this file in case you want to change any of them.
22+
#
23+
# Usage:
24+
# 1: Create a model using blockbench - https://www.blockbench.net/
25+
# 1.1 Create as a 'Generic Model'
26+
# 1.2 Make basically anything you want
27+
# 1.3 Note that there is a scale limit, of roughly 73 blockbench units (about 4 minecraft block-widths),
28+
# meaning you cannot have a section of block more than 36 blockbench units from its pivot point.
29+
# If you need a larger object, add more Outliner groups with pivots moved over.
30+
# 1.4 Make sure pivot points are as correct as possible to minimize glitchiness from animations
31+
# (for example, if you have a bone pivot point in the center of a block, but the block's own pivot point is left at default 0,0,0, this can lead to the armor stand having to move and rotate at the same time, and lose sync when doing so)
32+
# 1.5 Animate freely, make sure the animation names are clear
33+
# 2: Save the ".bbmodel" file
34+
# 3: Use the DenizenModelsConverter program to convert the bbmodel to a ".dmodel.yml" and a resource pack
35+
# 4: Save the ".dmodel.yml" file into "plugins/Denizen/data/models"
36+
# 5: Load the resource pack on your client (or include it in your server's automatic resource pack)
37+
# 6: Spawn your model and control it using the Denizen scripting API documented below
38+
#
39+
# #########
40+
#
41+
# API usage examples:
42+
# # First load a model
43+
# - ~run dmodels_load_model def.model_name:goat
44+
# # Then you can spawn it
45+
# - run dmodels_spawn_model def.model_name:goat def.location:<player.location> save:spawned
46+
# - define root <entry[spawned].created_queue.determination.first>
47+
# # To move the whole model
48+
# - teleport <[root]> <player.location>
49+
# - run dmodels_reset_model_position def.root_entity:<[root]>
50+
# # To start an automatic animation
51+
# - run dmodels_animate def.root_entity:<[root]> def.animation:idle
52+
# # To end an automatic animation
53+
# - run dmodels_end_animation def.root_entity:<[root]>
54+
# # To move the entity to a single frame of an animation (timespot is a decimal number of seconds from the start of the animation)
55+
# - run dmodels_move_to_frame def.root_entity:<[root]> def.animation:idle def.timespot:0.5
56+
# # To remove a model
57+
# - run dmodels_delete def.root_entity:<[root]>
58+
#
59+
# #########
60+
#
61+
# API details:
62+
# Runnable Tasks:
63+
# dmodels_load_model
64+
# Usage: Loads a model from source data by name into server memory (flags).
65+
# Input definitions:
66+
# model_name: The name of the model to load, must correspond to the relevant ".dmodel.yml" file.
67+
# dmodels_spawn_model
68+
# Usage: Spawns a single instance of a model using real armor stand entities at a location.
69+
# Input definitions:
70+
# model_name: The name of the model to spawn, must already be loaded via 'dmodels_load_model'.
71+
# location: The location to spawn the model at.
72+
# Supplies determination: EntityTag of the model root entity.
73+
# dmodels_delete
74+
# Usage: Deletes a spawned model.
75+
# Input definitions:
76+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
77+
# dmodels_reset_model_position
78+
# Usage: Resets any animation data on a model, moving the model back to its default positioning.
79+
# Input definitions:
80+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
81+
# dmodels_end_animation
82+
# Usage: Stops any animation currently playing on a model, and resets its position.
83+
# Input definitions:
84+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
85+
# dmodels_animate
86+
# Usage: Starts a model animating the given animation, until the animation ends (if it does at all) or until the animation is changed or ended.
87+
# Input definitions:
88+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
89+
# animation: The name of the animation to play (as set in BlockBench).
90+
# dmodels_move_to_frame
91+
# Usage: Moves a model's position to a single frame of an animation. Not intended for external use except for debugging animation issues.
92+
# Input definitions:
93+
# root_entity: The root entity gotten from 'dmodels_spawn_model'.
94+
# animation: The name of the animation to play (as set in BlockBench).
95+
# timespot: The time (in seconds) from the start of the animation to select as the frame.
96+
# delay_pose: 'true' if playing fluidly to offset the pose application over time, 'false' to snap exactly to frame position.
97+
#
98+
################################################
99+
Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,7 @@
1-
# +---------------------------
2-
# |
3-
# | D e n i z en M o d e l s
4-
# | AKA DModels - dynamically animated models in minecraft
5-
# |
6-
# +---------------------------
7-
#
8-
# @author mcmonkey
9-
# @date 2022/06/01
10-
# @updated 2022/06/06
11-
# @denizen-build REL-1772
12-
# @script-version 1.2
13-
#
14-
# This takes BlockBench "BBModel" files, converts them (via external program) to resource pack + Denizen-compatible file,
15-
# then is able to display them in minecraft and even animate them, by spawning and moving invisible armor stands with resource pack items on their heads.
16-
#
17-
# Installation:
18-
# 1: Add "models.dsc" to your "plugins/Denizen/scripts" and "/ex reload"
19-
# 2: Make sure you have DenizenModelsConverter.exe on hand, either downloaded or compiled yourself from https://github.com/mcmonkeyprojects/DenizenModels
20-
# 3: Note that you must know the basics of operating resource packs - the pack content will be generated for you, but you must know how to configure the "mcmeta" pack file and how to install a pack on your client
21-
#
22-
# Usage:
23-
# 1: Create a model using blockbench - https://www.blockbench.net/
24-
# 1.1 Create as a 'Generic Model'
25-
# 1.2 Make basically anything you want
26-
# 1.3 Note that there is a scale limit, of roughly 73 blockbench units (about 4 minecraft block-widths),
27-
# meaning you cannot have a section of block more than 36 blockbench units from its pivot point.
28-
# If you need a larger object, add more Outliner groups with pivots moved over.
29-
# 1.4 Make sure pivot points are as correct as possible to minimize glitchiness from animations
30-
# (for example, if you have a bone pivot point in the center of a block, but the block's own pivot point is left at default 0,0,0, this can lead to the armor stand having to move and rotate at the same time, and lose sync when doing so)
31-
# 1.5 Animate freely, make sure the animation names are clear
32-
# 2: Save the ".bbmodel" file
33-
# 3: Use the DenizenModelsConverter program to convert the bbmodel to a ".dmodel.yml" and a resource pack
34-
# 4: Save the ".dmodel.yml" file into "plugins/Denizen/data/models"
35-
# 5: Load the resource pack on your client (or include it in your server's automatic resource pack)
36-
# 6: Spawn your model and control it using the Denizen scripting API documented below
37-
#
38-
# API usage examples:
39-
# # First load a model
40-
# - ~run dmodels_load_model def.model_name:goat
41-
# # Then you can spawn it
42-
# - run dmodels_spawn_model def.model_name:goat def.location:<player.location> save:spawned
43-
# - define root <entry[spawned].created_queue.determination.first>
44-
# # To move the whole model
45-
# - teleport <[root]> <player.location>
46-
# - run dmodels_reset_model_position def.root_entity:<[root]>
47-
# # To start an automatic animation
48-
# - run dmodels_animate def.root_entity:<[root]> def.animation:idle
49-
# # To end an automatic animation
50-
# - run dmodels_end_animation def.root_entity:<[root]>
51-
# # To move the entity to a single frame of an animation (timespot is a decimal number of seconds from the start of the animation)
52-
# - run dmodels_move_to_frame def.root_entity:<[root]> def.animation:idle def.timespot:0.5
53-
# # To remove a model
54-
# - run dmodels_delete def.root_entity:<[root]>
55-
#
56-
################################################
57-
1+
###########################
2+
# This file is part of dModels / Denizen Models.
3+
# Refer to the header of "dmodels_main.dsc" for more information.
4+
###########################
585

596

607
dmodel_part_stand:
@@ -98,7 +45,7 @@ dmodels_load_model:
9845
dmodels_spawn_model:
9946
type: task
10047
debug: false
101-
definitions: model_name|location
48+
definitions: model_name|location|tracking_range
10249
script:
10350
- if !<server.has_flag[dmodels_data.model_<[model_name]>]>:
10451
- debug error "[DModels] cannot spawn model <[model_name]>, model not loaded"

0 commit comments

Comments
 (0)