Game definition jsons - Achievements

Learn the .json format
used to define characteristics of units and other game elements
Post Reply
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Game definition jsons - Achievements

Post by Stratego (dev) »

Here is the first version for the achievements.json file:

Code: Select all

{
"achievementDefinitions":[
  {"id":"ACH_ZXXXKILL_10_UNITS",		"cntType":"KILL_ANY_OF_WHATS_AMOUNT_TIMES","amount":10, "scope":"GLOBAL","gameType":"ANY", "imgName":"art_game_won.png","googleId":"0"},
  {"id":"ACH_ZXXXKILL_5_UNITS_IN_ONE_GAME", 	"cntType":"KILL_ANY_OF_WHATS_AMOUNT_TIMES","amount":5, "scope":"IN_ONE_GAME","gameType":"ANY", "imgName":"art_game_won.png","googleId":"0"},
  {"id":"ACH_ZXXXKILL_3_UNITS_IN_ONE_TURN", 	"cntType":"KILL_ANY_OF_WHATS_AMOUNT_TIMES","amount":3, "scope":"IN_ONE_TURN","gameType":"ANY", "imgName":"art_game_won.png","googleId":"0"},
  {"id":"ACH_ZXXXKILL_5_UNITS_IN_ONE_TURN", 	"cntType":"KILL_ANY_OF_WHATS_AMOUNT_TIMES","amount":5, "scope":"IN_ONE_TURN","gameType":"ANY", "imgName":"art_game_won.png","googleId":"0"},
  {"id":"ACH_BUILD_20_GATES", 			"cntType":"PRODUCE_ANY_OF_WHATS_AMOUNT_TIMES","amount":20, "scope":"GLOBAL","gameType":"ANY", "imgName":"build.png", "trnWhat":{"unitTypes":["UNIT_GATE"]}, "googleId":"0"},
  {"id":"ACH_BUILD_4_MEGA_BLD_IN_ONE_GAME", 	"cntType":"PRODUCE_ANY_OF_WHATS_AMOUNT_TIMES","amount":4, "scope":"IN_ONE_GAME","gameType":"ANY", "imgName":"build.png", "trnWhat":{"unitTypes":["UNIT_ELF_BUILDING_GREAT_TREE", "UNIT_MEGA_BUILDING_CASTLE", "UNIT_UND_BUILDING_MANSION", "UNIT_ORC_BUILDING_VOLCANO"]}, "googleId":"0"}

]
}
where:
"id":"ACH_ZXXXKILL_10_UNITS", - this must be unique among a game version, must starts with "ACH_"
"cntType":"KILL_ANY_OF_WHATS_AMOUNT_TIMES", - possible types are listed below
"amount":10, - how many needed to be killed/built/bought and so on.
"scope":"GLOBAL", - is it in-game or global , see list below
"gameType":"ANY", - see lsit below (means which type of games will use this achievements)
"imgName":"art_game_won.png", - the image of the achievement
"googleId":"0" - when it will be be joined to google here will be the google id.
"trnWhat": is a unitlist, you can define unit types, unit categories and exceptions (like you do in unit definitions json-s) - see sample above - this is for eg. a kill 3 archers with mounted units - here u define any kind of archers as WHAT.
"trnWith": is a unitlist, you can define unit types, unit categories and exceptions - this is for eg. a kill 3 archers with mounted units - here u define mounteds as "actor": WITH

Code: Select all

	cntType :
		KILL_ANY_OF_WHATS_AMOUNT_TIMES,
		KILL_ALL_OF_WHATS,
		
		PRODUCE_ANY_OF_WHATS_AMOUNT_TIMES,	//production or building a building
		PRODUCE_ALL_WHATS,					//production or building a building
		
		CONVERT_ANY_OF_WHATS_AMOUNT_TIMES,
		CONVERT_ALL_OF_WHATS,
		
		PLAY_AMOUNT_NUMBER_OF_TURNS,
		
		BUY_AMOUNT_OF_UPGRADE,
		BUY_AMOUNT_GEMCOST_OF_UPGRADE,
		
		GET_AMOUNT_GEMS_BY_DONATE,
		
		UPGRADE_EFFECT_USED_AMOUNT_TIMES_OUT_GAME,
		UPGRADE_EFFECT_USED_AMOUNT_TIMES_IN_GAME,
		CHAT_USED_AMOUNT_TIMES,
		
		WON_CAMPAINGN_MAP,
		WON_RANDOM_MAP,
		WON_MULTIPLAYER_MAP,
		
	}
	/**
	 * in which time scale the countuing counts, eg. in one turn, in one game or in 24 hours sand so on
	 */
	scope
		GLOBAL, // global countings
		IN_ONE_GAME, //in one game 
		IN_ONE_TURN, // in one turn 
		IN_ONE_DAY // in 24 hours 
	
	/**
	 * which type of game it is counted in
	 */
	gameType 
		NA, //null ot this value means this achievement is not even game related (eg. get 5 upgrades)
 		ANY, // on any maps (except own maps section), so MULTIPLAYER_OR_CAMPAIGN+RANDOM
		MULTIPLAYER, //in only multiplayer game 
		MULTIPLAYER_OR_CAMPAIGN, // in multiplayer or campaign map
		CAMPAIGN, //if campaign
		RANDOM // in random maps


Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Achievements

Post by Stratego (dev) »

added the WHAT and WITH lists
"trnWhat": is a unitlist, you can define unit types, unit categories and exceptions (like you do in unit definitions json-s) - see sample above - this is for eg. a kill 3 archers with mounted units - here u define any kind of archers as WHAT.
"trnWith": is a unitlist, you can define unit types, unit categories and exceptions - this is for eg. a kill 3 archers with mounted units - here u define mounteds as "actor": WITH


also to samples

Code: Select all

 
{"id":"ACH_BUILD_20_GATES",          "cntType":"PRODUCE_ANY_OF_WHATS_AMOUNT_TIMES","amount":20, "scope":"GLOBAL","gameType":"ANY", "imgName":"build.png", "trnWhat":{"unitTypes":["UNIT_GATE"]}, "googleId":"0"},
{"id":"ACH_BUILD_4_MEGA_BLD_IN_ONE_GAME",    "cntType":"PRODUCE_ANY_OF_WHATS_AMOUNT_TIMES","amount":4, "scope":"IN_ONE_GAME","gameType":"ANY", "imgName":"build.png", "trnWhat":{"unitTypes":["UNIT_ELF_BUILDING_GREAT_TREE", "UNIT_MEGA_BUILDING_CASTLE", "UNIT_UND_BUILDING_MANSION", "UNIT_ORC_BUILDING_VOLCANO"]}, "googleId":"0"}
Post Reply

Return to “Game Definition .JSON”