Modding:Basic Entity: Difference between revisions

From Vintage Story Wiki
No edit summary
(8 intermediate revisions by 3 users not shown)
Line 47: Line 47:
=== Client ===
=== Client ===


The client type has different properties for client and server. This will cover the client side (rendering, shape, texture):
The client type has different properties for client and server. This will cover the client side (rendering, shape, texture)
 
(please note that // comments are actually not a valid json syntax, so if you want to use this json code in your projects, you'd have to remove these first)


<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
Line 123: Line 125:
             "chance": 0.2,
             "chance": 0.2,
             "slot": 0,
             "slot": 0,
             "prority": 1,
             "priority": 1,
             "accumType": "max"
             "accumType": "max"
           }
           }
Line 247: Line 249:
             "chance": 0.2,
             "chance": 0.2,
             "slot": 0,
             "slot": 0,
             "prority": 1,
             "priority": 1,
             "accumType": "max"
             "accumType": "max"
           }
           }
Line 294: Line 296:


== Shape ==
== Shape ==
If you want to know how to create the shape for the entity I suggest you checkout [[VS Model Creator]].
== Item ==
In order to spawn the entity we can create an item to do so:
<syntaxhighlight lang="c#">
{
  "code": "creature",
  "class": "ItemCreature",
  "maxstacksize": 64,
  "variantgroups": [
    {
      "code": "type",
      "states": [ "figure:littlefigure" ]
    }
  ],
  "shape": {
    "base": "figure:entity/land/littlefigure"
  },
  "texture": { "base": "game:block/wood/planks/birch1" },
  "creativeinventory": {
    "general": [ "*" ],
    "items": [ "*" ],
    "creatures": [ "*" ]
  },
  "materialDensity": 600,
  "guiTransform": {
    "rotation": {
      "x": 0,
      "y": -90,
      "z": -180
    },
    "origin": {
      "x": 0.5,
      "y": 0.15,
      "z": 0.5
    },
    "scale": 6
  },
  "fpHandTransform": {
    "rotation": {
      "x": 0,
      "y": -90,
      "z": 0
    },
    "origin": {
      "x": 0.5,
      "y": 0.15,
      "z": 0.5
    },
    "scale": 6
  },
  "groundTransform": {
    "translation": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": -90,
      "z": 0
    },
    "origin": {
      "x": 0.5,
      "y": 0.15,
      "z": 0.5
    },
    "scale": 6
  }
}
</syntaxhighlight>


== Testing/ Distribution ==
== Testing/ Distribution ==


[https://wiki.vintagestory.at/images/d/d8/Figure_v1.0.0.zip Figure v1.0.0]
<youtube>Ci9CB0fnK7U</youtube>


Download [https://wiki.vintagestory.at/images/d/d8/Figure_v1.0.0.zip Figure v1.0.0] for VintageStory 1.8




{{Navbox/modding|Vintage Story}}
{{Navbox/modding|Vintage Story}}
Confirmedusers, Bureaucrats, editor, Administrators
1,778

edits