Difference between revisions of "User:AVS/Spell Format Version2"

From VCMI Project Wiki
Jump to: navigation, search
(Effect format)
(Level format)
 
(21 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
  
"bonus.effectName":{[bonus format]}
+
"effectName":{[bonus format]}
  
//or
+
</syntaxhighlight>
 +
 
 +
== Direct damage ==
 +
 
 +
<syntaxhighlight lang="javascript">
 +
 
 +
"effectName":{
  
"modID:bonus.effectName":{[bonus format]}
+
"effect":"directDamage",
 +
 
 +
}
  
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Direct damage ==
+
== Summon ==
 +
 
 +
<syntaxhighlight lang="javascript">
 +
 
 +
"effectName":{
 +
"effect":"summon",
 +
"id":"core:creature.airElemental",
 +
"amount":10,
 +
"permanent": false
 +
}
  
== Summon ==
+
</syntaxhighlight>
  
 
== Heal ==
 
== Heal ==
 +
<syntaxhighlight lang="javascript">
 +
 +
"effectName":{
 +
"effect":"heal",
 +
"resurrect":true,//false
 +
"permanent":true //false
 +
}
 +
 +
</syntaxhighlight>
  
 
== Obstacles ==
 
== Obstacles ==
 +
 +
<syntaxhighlight lang="javascript">
 +
 +
"effectName":{
 +
"effect":"placeObstacle",
 +
"type":"QUICKSAND", //"LAND_MINE", "FIRE_WALL", "FORCE_FIELD"
 +
"turnsRemaining": 2, //0 = infinite ( (!) -1 inside engine)
 +
"visibleForOtherSide": true, //false
 +
}
 +
 +
</syntaxhighlight>
 +
 +
 +
<syntaxhighlight lang="javascript">
 +
 +
"effectName":{
 +
"effect":"removeObstacle"
 +
}
 +
 +
</syntaxhighlight>
  
 
== Special ==
 
== Special ==
Indicates effect, implemented inside engine of mod scripts. No configuration possible except disabling it.
+
Describes effect, implemented inside engine or mod scripts. No configuration possible except disabling/enabling it. Effect identifies by "effectName".
  
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
  
//"modID:special.effectName"
+
"effectName":
"special.effectName":
 
 
{
 
{
"enabled": true //false
+
"effect":"special",
 +
//mandatory, boolean,
 +
"enabled": true //false
 
}
 
}
  
Line 58: Line 105:
 
"targetModifier":
 
"targetModifier":
 
{
 
{
"massive": true, //true: all targets; false: based on range
+
"smart": false, //true: friendly/hostile based on positiveness; false: all targets
"smart": false //true: friendly/hostile based on positiveness; false: all targets
+
"clearTarget": false, //LOCATION target only. Target hex/tile must be clear
 +
"clearAffected": false, //LOCATION target only. All affected hexes/tile must be clear
 
}
 
}
  
Line 69: Line 117:
 
"effects":
 
"effects":
 
{
 
{
{effect format]},
+
[effect format],
 
//[...]
 
//[...]
 
 
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
= Animation format =
 +
 +
= Localization format =
  
 
= Spell format =
 
= Spell format =
Line 86: Line 138:
 
 
 
//Mandatory, spell target type
 
//Mandatory, spell target type
"targetType":"NO_TARGET",//"CREATURE","OBSTACLE"
+
"targetType":"NO_TARGET",//"CREATURE", "OBSTACLE", "LOCATION"
  
 
//Mandatory
 
//Mandatory
Line 114: Line 166:
  
 
//dictionary: mod-id (string) - arbitrary data (object)
 
//dictionary: mod-id (string) - arbitrary data (object)
//Initialized here, r/w accessible in-game, serializable.
+
//Initialized here, r/w accessible in-game, persistent.
 
"modData":{
 
"modData":{
 
"firstModID":{},
 
"firstModID":{},
Line 123: Line 175:
 
//</SCRIPT RELATED>
 
//</SCRIPT RELATED>
 
 
//  anim: main effect animation (AC format), -1 - none
 
//TODO: more flexible system to allow defining custom spell effects DEPRECATED
 
"anim": -1,
 
 
 
 
//countering spells, flags structure of spell ids (spell. prefix is required)
 
//countering spells, flags structure of spell ids (spell. prefix is required)
Line 149: Line 198:
 
//flags structure of bonus names, presence of all bonuses required to be affected by
 
//flags structure of bonus names, presence of all bonuses required to be affected by
 
"limit": {"BONUS_NAME": true, ...},
 
"limit": {"BONUS_NAME": true, ...},
 +
 +
//flags structure of bonus names, presence of all bonuses required to be affected by,cant be negated
 +
"absoluteLimit": {"BONUS_NAME": true, ...},
 +
 +
"animation": {[animation format]},
 +
 +
"texts": {[localization format]},
  
 
//graphics; mandatory; object;
 
//graphics; mandatory; object;
Line 174: Line 230:
 
//resource path of icon for spell scrolls
 
//resource path of icon for spell scrolls
 
"iconScroll": "MYSPELL_E"
 
"iconScroll": "MYSPELL_E"
 
 
},
 
},
  
//OPTIONAL; object; TODO
+
//OPTIONAL; object;
 
"sounds":
 
"sounds":
 
{
 
{

Latest revision as of 11:48, 8 March 2015

Current version. WiP.

Effect format

Bonus

"effectName":{[bonus format]}

Direct damage

"effectName":{

	"effect":"directDamage",

}

Summon

"effectName":{
	"effect":"summon",
	"id":"core:creature.airElemental",
	"amount":10,
	"permanent": false 
}

Heal

"effectName":{
	"effect":"heal",
	"resurrect":true,//false
	"permanent":true //false
}

Obstacles

"effectName":{
	"effect":"placeObstacle",
	"type":"QUICKSAND", //"LAND_MINE", "FIRE_WALL", "FORCE_FIELD"
	"turnsRemaining": 2, //0 = infinite ( (!) -1 inside engine)
	"visibleForOtherSide": true, //false
}


"effectName":{
	"effect":"removeObstacle"
}

Special

Describes effect, implemented inside engine or mod scripts. No configuration possible except disabling/enabling it. Effect identifies by "effectName".

"effectName":
{
	"effect":"special",
	//mandatory, boolean,
	"enabled": true //false
}

Level format

{
	//Mandatory, localizable description
	//Use {xxx} for formatting
	"description": "",


	//Mandatory, number, 
	//cost in mana points
	"cost": 1,
	//Mandatory, number
	"power": 10,

	//Mandatory, number
	"aiValue": 20,

	//Mandatory, flags structure //TODO
	// modifiers make sense for creature target
	//
	//
	"targetModifier":
	{
		"smart": false,	//true: friendly/hostile based on positiveness; false: all targets
		"clearTarget": false,	//LOCATION target only. Target hex/tile must be clear
		"clearAffected": false,	//LOCATION target only. All affected hexes/tile must be clear
	}

	//Mandatory
	//spell range description in SRSL
	"range": "X",
	//Optional, arbitrary name - bonus format map
	//timed effects, overriding by name
	"effects":
	{
		[effect format],
	//[...]
			
	}

Animation format

Localization format

Spell format

{
	"spellName":
	{	//numeric id of spell required only for original spells, prohibited for new spells
		"index": 0,
		//Original Heroes 3 info
		//Mandatory, spell type 
		"type": "adventure",//"adventure", "combat", "ability"
		
		//Mandatory, spell target type
		"targetType":"NO_TARGET",//"CREATURE", "OBSTACLE", "LOCATION"

		//Mandatory
		"name": "Localizable name",
		//Mandatory, flags structure of school names, Spell schools this spell belongs to
		"school": {"air":true, "earth":true, "fire":true, "water":true},
		//number, mandatory, Spell level, value in range 1-5
		"level": 1,
		//Mandatory, base power
		"power": 10,
		//Mandatory, default chance for this spell to appear in Mage Guilds
		//Used only if chance for a faction is not set in gainChance field
		"defaultGainChance": 0, 
		//Optional, chance for it to appear in Mage Guild of a specific faction
		//NOTE: this field is linker with faction configuration
		"gainChance":
		{
			"factionName": 3
		},
		//VCMI info

		//<SCRIPT RELATED> For a bit distant future. Just ideas.
		//
		// script identifier
		"mechanicsClient":"myClientScript",
		"mechanicsServer":"myServerScript",

		//dictionary: mod-id (string) - arbitrary data (object)
		//Initialized here, r/w accessible in-game, persistent.
		"modData":{
			"firstModID":{},
			"secondModID":{} 
			// [...]
		},

		//</SCRIPT RELATED>
	
			
		//countering spells, flags structure of spell ids (spell. prefix is required)
		"counters": {"spell.spellID1":true, ...}

		//Mandatory,flags structure:
		//              indifferent, negative, positive - Positiveness of spell for target (required)
		//		damage - spell does damage (direct or indirect)
		//		offensive - direct damage (implicitly sets damage and negative)
		//		rising - rising spell (implicitly sets positive)
		//		summoning //todo:
		//		special - can be obtained only with bonus::SPELL

		"flags" : {"flag1": true, "flag2": true},

		//flags structure of bonus names,any one of these bonus grants immunity
		"immunity": {"BONUS_NAME":true, ...},
			
		//optional| no default |flags structure of bonus names
		//any one of these bonus grants immunity, cant be negated
		"absoluteImmunity": {"BONUS_NAME": true, ...},

		//flags structure of bonus names, presence of all bonuses required to be affected by
		"limit": {"BONUS_NAME": true, ...},

		//flags structure of bonus names, presence of all bonuses required to be affected by,cant be negated
		"absoluteLimit": {"BONUS_NAME": true, ...},

		"animation": {[animation format]},

		"texts": {[localization format]},

		//graphics; mandatory; object;
		"graphics":
		{
			//  ! will be moved to bonus type config in next bonus config version
			//  iconImmune - OPTIONAL; string; 
			//resource path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)
			"iconImmune":"ZVS/LIB1.RES/E_SPMET",


			//  iconScenarioBonus- mandatory, string, image resource path
			//resource path of icon for scenario bonus
			"iconScenarioBonus": "MYSPELL_B",

			//  iconEffect- mandatory, string, image resource path
			//resource path of icon for spell effects during battle
			"iconEffect": "MYSPELL_E",

			//  iconBook- mandatory, string, image resource path
			//resource path of icon for spellbook
			"iconBook": "MYSPELL_E",

			//  iconScroll- mandatory, string, image resource path
			//resource path of icon for spell scrolls
			"iconScroll": "MYSPELL_E"
		},

		//OPTIONAL; object;
		"sounds":
		{
			//OPTIONAL; resourse path, casting sound
			"cast":"LIGHTBLT"

		},

		//Mandatory structure
		//configuration for no skill, basic, adv, expert
		"levels":{
		"none":{ [level format]
		},
		"basic":{...},"advanced":{...},"expert":{...}
		}
	}

}


Modding related articles

Main articles
Modding changelog Modding guidelines How to create a town mod Mod Handler


Formats
Mod file Format
Town Format Creature Format Hero Classes Format
Artifact Format Animation Format Hero Format
Bonus Format Object Format Spell Format


Work-in-progress formats
Building bonuses Map format
Bonus Type Format Random map template


Outdated pages
Mod system proposal