Difference between revisions of "Object Format"

From VCMI Project Wiki
Jump to: navigation, search
(Object format)
(Replaced content with "{{Template:MovedToWebpage|https://vcmi.eu/modders/Map_Object_Format/}}")
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Object type format ==
+
{{Template:MovedToWebpage|https://vcmi.eu/modders/Map_Object_Format/}}
 
 
''Current draft. WiP.''
 
 
 
<syntaxhighlight lang="javascript">
 
 
 
{
 
  "objectTypes":
 
  [
 
 
"myCoolObject":{
 
//numeric ID, mandatory for h3/wog objects, shall be unique is defined
 
//not recommended for VCMI objects, shall be unique is defined, default: engine defined
 
"id":689,
 
 
"blockVisit" : true,
 
 
 
//range of numeric sub id`s, mapped to this object type. Optional for h3/wog objects.
 
//not recommended for VCMI objects.
 
"subIdMax":0,
 
"subIdMin":1
 
}
 
 
 
  ]
 
}
 
 
 
 
 
</syntaxhighlight>
 
 
 
'''Example:'''
 
 
 
<syntaxhighlight lang="javascript">
 
 
 
{
 
  "objectTypes":
 
  [
 
 
"artifact":{
 
"id":5,
 
"blockVisit" : true
 
},
 
 
 
"treasureChest":{
 
"id":101,
 
"subIdMax":0,
 
"blockVisit" : true
 
},
 
 
 
"treasureChestWoG":{
 
"id":101,
 
"subIdMin":1,
 
"blockVisit" : true
 
},
 
 
 
"pyramid": {
 
"id":63,
 
"subIdMax":0 //subtype 0
 
},
 
 
 
"wogObject": {
 
"id":63,
 
"subIdMin":1 //subtype> 0
 
}
 
 
 
  ]
 
}
 
 
 
</syntaxhighlight>
 
 
 
== Object format ==
 
 
 
''Current draft. WiP.''
 
 
 
* Used by editor, RMG, (???) by engine for random new objects.
 
* analogue of "ZOBJCTS.TXT", "ZEOBJTS.TXT", "ZAOBJTS.TXT" from WoG.
 
 
 
<syntaxhighlight lang="javascript">
 
 
 
{"objects":[
 
 
 
{
 
//mandatory
 
//resource ID  of animation, relative to SPRITES(def file or json file (*) )
 
"animation":"DEFNAME",
 
 
//mandatory
 
//bit mask of passability. (???) use more readable array and|or predefined templates
 
"passability":[
 
"11111111",
 
"11111111",
 
"11111111",
 
"11111111",
 
"11111111",
 
"11111110"],
 
 
 
//mandatory
 
//bit mask of activatable tiles (???) use more readable array and|or predefined templates
 
"actions": [
 
"00000000",
 
"00000000",
 
"00000000",
 
"00000000",
 
"00000000",
 
"00000001"],
 
 
 
// mandatory
 
// list of tiles from which this object is visible, mostly needed for server
 
// to detect if object is visible by player
 
"visibility": [
 
"000",
 
"001",
 
"011"],
 
 
 
//mandatory (?)
 
"id":"objectType", //object type from object type config. (!) Only string id`s.
 
 
 
//allowed terrain types to place object too, can be overridden in editor. Affects also RMG.
 
"landscape":["dirt", "sand"],
 
 
 
// List of tags that can be used to locate object in map editor
 
"tags":["dirt", "sand", "mine"],
 
 
 
//mandatory
 
//numeric ((?) needed) or full string object id
 
//(?) id not required if subid in full identifier
 
"subId":34,//or "objectType.objectName" f.e. "creature.pikeman"
 
 
//
 
"group":"",
 
 
 
//optional, default false,
 
"isOverlay": true, //false, true
 
 
 
}
 
 
 
]}
 
 
 
</syntaxhighlight>
 
 
 
 
 
{{Modding}}
 

Latest revision as of 16:18, 16 July 2024

Logo256.png    Page moved to VCMI-Homepage