Difference between revisions of "Talk:Town Format"

From VCMI Project Wiki
Jump to: navigation, search
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
+
<syntaxhighlight lang="javascript">
 
"mytown" :  {
 
"mytown" :  {
//mod ship will appear when bought in town of this faction, or when hero of faction buys ship in shipyard.
+
  //mod ship will appear when bought in town of this faction, or when hero of faction buys ship in shipyard.
//if not defined, will be taken by alignment like previously it was
+
  //if not defined, will be taken by alignment like previously it was
//if ship has bonus FLYING, it will appear near town on free cell, shipyard building will also be available always (there is no need to have water near)
+
  //if ship has bonus FLYING, it will appear near town on free cell, shipyard building will also be available always (there is no need to have water near)
//If hero boards FLYING ship, he will exit it when player chooses to visit map object or attack creatures/enemy heroes (is FREE_SHIP_BOARDING is not set it bonuses,
+
  //If hero boards FLYING ship, he will exit it when player chooses to visit map object or attack creatures/enemy heroes (if FREE_SHIP_BOARDING is not set in bonuses,
//it will cost remaining movement point)
+
  //it will cost remaining movement point)
"boat":
+
  "boat":
 
   {
 
   {
    "animation":"mytown-boat/AB22.def",                                                                                 
+
    "animation":"mytown-boat/AB22.def",                                                                                 
    "bonuses":
+
    "bonuses":
        [
+
    [
            {
+
      {
                "type": "<hero bonus name>",        //there are bonuses for hero. Boat can be treated as artefact in game. Mostly there are bonuses like
+
        "type": "<hero bonus name>",        //there are bonuses for hero. Boat can be treated as artefact in game. Mostly there are bonuses like
                                                      //SEA_MOVEMENT, FLYING (for zeppelins, planes etc), WHIRLPOOL_PROTECTION, FREE_SHIP_BOARDING etc
+
                                            //SEA_MOVEMENT, FLYING (for zeppelins, planes etc), WHIRLPOOL_PROTECTION, FREE_SHIP_BOARDING etc
                ....
+
              ....
               
+
      }
            }
+
    ]
          ]
 
 
   }
 
   }
}
+
}
 +
</syntaxhighlight>
 +
 
 +
It's topic for my writings about special town buildings format
 +
<syntaxhighlight lang="javascript">
 +
"tavern":
 +
{
 +
  "type":"TAVERN", // string related with BuildingID::TAVERN. from it VCMI will decide how to act when clicked
 +
  "bonuses":
 +
  [
 +
    {
 +
      "type":"MORALE", //can be "LUCK", maybe "BLOCK_LUCK","BLOCK_MORALE"
 +
      "val":1 //gives morale during siege
 +
    }
 +
  ]
 +
}
 +
"grail":
 +
{
 +
  "type":"GRAIL_CASTLE", // string related with BuildingID::GRAIL for castle giving morale and movement. from it VCMI will decide how to act when clicked
 +
  "bonuses":
 +
  [
 +
    {
 +
      "type":"MORALE", //can be "LUCK", maybe "BLOCK_LUCK","BLOCK_MORALE"
 +
      "val":1 //gives morale during siege
 +
    }
 +
  ]
 +
}
 +
</syntaxhighlight>
 +
I plan to change hardcoded buildings identifiers in code to types of buildings bonuses. Now it will be that if town has 2 buildings with same type of buildings, first found will function (if first building is not built and second built, than second bonus will be used).
 +
 
 +
Macron1
 +
 
 +
Please use formatting when posting on wiki:
 +
* Sign your comments with 4 tildas: ~ ~ ~ ~
 +
* Use wiki formatting to format text, e.g. "= text =" to create titles/topic names
 +
* When posting code surround it with:
 +
** < syntaxhighlight lang="javascript" > ... < /syntaxhighlight > for JSON code
 +
** < syntaxhighlight lang="cpp" > ... < /syntaxhighlight > for C/C++ code
 +
** < pre > ... < /pre > for rest of text that must have code-like formatting
 +
 
 +
On topic - please keep it in one place, either here or on forum to make it easier to track. You may also write all of this on your own page (click on your user name on top of the page to get there).
 +
[[User:Ivan|Ivan]] ([[User talk:Ivan|talk]]) 15:47, 27 April 2014 (CEST)

Latest revision as of 13:47, 27 April 2014

"mytown" :   {
  //mod ship will appear when bought in town of this faction, or when hero of faction buys ship in shipyard.
  //if not defined, will be taken by alignment like previously it was
  //if ship has bonus FLYING, it will appear near town on free cell, shipyard building will also be available always (there is no need to have water near)
  //If hero boards FLYING ship, he will exit it when player chooses to visit map object or attack creatures/enemy heroes (if FREE_SHIP_BOARDING is not set in bonuses,
  //it will cost remaining movement point)
  "boat":
  {
    "animation":"mytown-boat/AB22.def",                                                                                
    "bonuses":
    [
      {
        "type": "<hero bonus name>",         //there are bonuses for hero. Boat can be treated as artefact in game. Mostly there are bonuses like
                                             //SEA_MOVEMENT, FLYING (for zeppelins, planes etc), WHIRLPOOL_PROTECTION, FREE_SHIP_BOARDING etc
               ....
      }
    ]
  }
}

It's topic for my writings about special town buildings format

"tavern":
{
  "type":"TAVERN", // string related with BuildingID::TAVERN. from it VCMI will decide how to act when clicked
  "bonuses":
  [
    {
      "type":"MORALE", //can be "LUCK", maybe "BLOCK_LUCK","BLOCK_MORALE"
      "val":1 //gives morale during siege
    }
  ]
}
"grail":
{
  "type":"GRAIL_CASTLE", // string related with BuildingID::GRAIL for castle giving morale and movement. from it VCMI will decide how to act when clicked
  "bonuses":
  [
    {
      "type":"MORALE", //can be "LUCK", maybe "BLOCK_LUCK","BLOCK_MORALE"
      "val":1 //gives morale during siege
    }
  ]
}

I plan to change hardcoded buildings identifiers in code to types of buildings bonuses. Now it will be that if town has 2 buildings with same type of buildings, first found will function (if first building is not built and second built, than second bonus will be used).

Macron1

Please use formatting when posting on wiki:

  • Sign your comments with 4 tildas: ~ ~ ~ ~
  • Use wiki formatting to format text, e.g. "= text =" to create titles/topic names
  • When posting code surround it with:
    • < syntaxhighlight lang="javascript" > ... < /syntaxhighlight > for JSON code
    • < syntaxhighlight lang="cpp" > ... < /syntaxhighlight > for C/C++ code
    • < pre > ... < /pre > for rest of text that must have code-like formatting

On topic - please keep it in one place, either here or on forum to make it easier to track. You may also write all of this on your own page (click on your user name on top of the page to get there). Ivan (talk) 15:47, 27 April 2014 (CEST)