Plugin Object Creation Guide
Follow these steps to create a plugin object:
-
Create two folders in your project:
A
andB
.
TheA
folder will store the object textures, and theB
folder will store the object configuration files. -
In the
B/object/
folder, create ajson
configuration file for the object. The file naming format should be:ID+.json
. -
In the
A/object/
folder, place the object texture files with the.png
extension.
Note: Comments are not supported in JSON format, so you need to remove the comments before using it.
Example JSON Configuration Files and Explanation
{
"ID": "Fallen_skeleton", // Unique identifier for the object
"type": "Feature", // Object type; Feature refers to a scene object
"mod": "SimplePhysics", // Physics module; available options: SimplePhysics, NoPhysics
"can_interactive": false, // Whether the object is interactive (true means interactive)
"texture": "Fallen_skeleton", // Texture file name (without extension)
"collision": "(20,64)", // Collision box dimensions (in pixels)
"place": { // Object placement rules
"scene": "Fallen_skeleton", // Scene name
"rarity": 10, // Rarity; higher value increases the probability of appearance
"map_name": ["dungeon", "castle"]
}
}
{
"ID": "Goldframe_Apple", // Unique identifier for the object
"type": "Feature", // Object type
"mod": "NoPhysics", // No physics effect
"can_interactive": false, // Not interactive
"texture": "painting/Goldframe_Apple", // Path to the texture file
"collision": "(10,10)", // Collision box size
"place": { // Object placement rules
"scene": "Goldframe_Apple", // Scene name
"rarity": 1, // Rarity
"map_name": ["dungeon", "castle"]
}
}
{
"ID": "Wooden_barrel", // Unique identifier for the object
"type": "Feature", // Object type
"mod": "SimplePhysics", // Use simple physics module
"can_interactive": true, // Interactive
"texture": "Wooden_barrel", // Initial texture file
"collision": "(20,30)", // Collision box size
"place": { // Object placement rules
"scene": "Wooden_barrel", // Scene name
"rarity": 22, // Rarity
"map_name": ["dungeon", "castle"]
},
"interactions": { // Interaction logic
"Drop": [ // Items dropped upon interaction
{
"scene": "NULL", // No items drop
"rarity": 100 // Probability weight
},
{
"scene": "Iron-Ingot", // Drop Iron Ingot
"rarity": 20 // Probability weight
},
{
"scene": "bone", // Drop Bone
"rarity": 50 // Probability weight
}
],
"coin": [0, 3, 5], // Random coin drop (0, 3, or 5)
"After_interaction": { // State after interaction
"state": "Opened", // Change state to "Opened" (Original state allows infinite interactions)
"sound": "Score", // Play "Score" sound effect
"texture": "Wooden_barrel_opened" // Replace texture after interaction, or use initial texture
}
}
}
The map_name
key under the place
object indicates where the object can spawn. Possible values are "dungeon", "castle", and "cave".
For the texture
, use the path to the .png
file in the A/object/
folder, excluding the file extension. For example, if the texture file is located at A/object/folder/Apple.png
, the texture field should be filled with folder/Apple
.
Finally, add the object ID to the plugin.json
configuration.
Example plugin.json:
{
"plugin_name": "Environment Extension",
"version": 1.0,
"author": "Realm of Echoes",
"description": "Core extension",
"configuration": {
"object": [
"Wooden_barrel",
"Fallen_skeleton",
"Skull_pile",
"Goldframe_Apple",
"Goldframe_Beetle",
"Goldframe_Cloud",
"Goldframe_Clouds_Long",
"Goldframe_Grass_Sunset",
"Goldframe_Lady_Bug",
"Goldframe_Sail_Boat",
"Goldframe_Sea_Scape",
"Goldframe_Coral",
"Goldframe_Star",
"Goldframe_Cottage_No_Animation",
"Goldframe_Sunset_Desert",
"Goldframe_Desert1",
"Goldframe_Tree",
"Goldframe_Grass_Clouds_Small",
"Goldframe_Tree_Scene",
"Goldframe_Grass_Field",
"Goldframe_Windmill"
]
}
}
After configuring, you can install the plugin in the game and view it on the Options > Extensions page.