Berserker 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 16788 
	
		
	 | 
	
		
 | 
	| 02.12.2017 19:25 | 
	
		
	 | 
	
		
		Berserker 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 16788 
	
		
	 | 
	
		
 | 
	| 03.12.2017 00:44 | 
	
		
	 | 
	
		
		Berserker 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 16788 
	
		
	 | 
	
		
			
			 
			
				Version 2.6.2
------------------------
 
Code: 
 [+] Added localization support for ERM scripts. All Lang\*.json files are loaded and merged into single dictionary of key => value pairs with language data. 
Json files must be saved in UTF-8 encoding with preferably Unix line endings (#10 = 0x0A). The format is the following: 
 
{ 
  "unique global key": "translation", 
  "another key": "another translation" 
} 
 
During file loading text is converted from UTF-8 (Unicode, i.e Russian, Polish, Chinese and any other language is supported) into ANSI-encoding, used by player's operational system, ex. Windows-1251. 
Thus you may ship the translation, other people may open and edit it without loss and characters, not representable on particular PC, will be replaced with "?". 
 
Real example: 
 
{ 
  "eqs.this_day_savegame_name": "@day@_@player@", 
  "eqs.end_turn_autosave_name": "@day@_@player@_End", 
  "eqs.quicksave_name":         "@day@_@player@_Quick", 
  "eqs.saved_msg":              "Saved!", 
  "eqs.quicksaved_msg":         "Quicksaved!" 
} 
 
It's recommended to prefix each key with string, unique for mod or author, like "pm." for "Phoenix Mod". 
 
Translations may have parameters in the form of "@parameter name@". Those parameters are replaced with actual values during translation. 
New ERM command !!SN:T is used to translate strings by key. 
!!SN:T(key)/?(z-variable to place result to)/(parameter name 1)/(parameter value 1)/(parameter name 2)/(parameter value 2)...; 
 
Example: 
 
!!OW:R-1/6/?y1; y1 - player's gold amount 
!!SN:T^test.gold_amount_report^/?z2/^gold^/y1; 
!!IF:M^%Z2^; prints "You have 12850 gold left. Not bad!" 
 
my test.json: 
 
{ 
  "test.gold_amount_report": "You have @gold@ gold left. Not bad!" 
} 
 
[+] Added possibility to set secondary skills texts without z-variables dependence. SN:H^secskill^/skill 0..27/0 (name) or skill level/new hint. 
[+] Added GET-syntax for all SN:H commands, allowing to get previously set hint for objects or current skill/specialty texts for heroes. 
[+] v1-v10 and z1 will be restored after (OnKeyPress) event to the value, they had before event. 
[+] Added fixes by Algor for 30 wog - enhanced secondary skills.erm, 75 wog - secondary skills boost.erm and 78 wog - wogify.erm. No more hardcoded numbers, !!SS is used instead. 
[+] "Quick Saving" script is converted into default standalone mod, using named functions, unique SN:W variables and Era 2.6.2 localization means. Mod is now compatible with almost any other mod. 
[+] Added msvcr90.dll (Microsoft Visual C++ Redistributable 2009) to support plugins, written with this dependency. 
[+] Added meaningful messages to many asserts in code, making assertion crashes easier to understand. 
[*] Each *.bin patch obtains unique name prefix, no more conflicts with 'no hota maps.bin', shipped with HD mod. 
[*] Yona creature abilities are now off by default and need to be manually switched on via mod ini file. 
[-] Fixed bug: SN:H^object^/x/y/z/hint didn't update hint. 
[-] Removed Jim Vogan's scripts from WoG mod.
  
			 
			
			
  
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов 
Поддержать проект 
			
		 |  
	 
 | 
	| 03.12.2017 01:17 | 
	
		
	 | 
	
		
		Algor 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 3883 
	
		
	 | 
	
		
 | 
	| 03.12.2017 11:26 | 
	
		
	 | 
	
		
		Algor 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 3883 
	
		
	 | 
	
		
			
			 
			
				Berserker, эра карашится при запуске, если в json-файле есть параметры без кавычек (json-стандарт это разрешает): 
{     "par.name": 1, 
}
 
Хотелось бы иметь возможность подгружать числовые значения через !!SN:T^par.name^/?y1; чтобы не конвертить дополнительно. 
И может при неудачной подгрузке значения (нет ключа) вместо/кроме установки значения в <имя ключа> выставлять какой-нить флаг?
 
Upd: Всё не критично, если что   
			 
			
			
  
			
		 |  
	 
 | 
	| 03.12.2017 19:31 | 
	
		
	 | 
	
		
		Berserker 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 16788 
	
		
	 | 
	
		
 | 
	| 03.12.2017 21:42 | 
	
		
	 | 
	
		
		gamecreator 
 
 
		
		
		
			
			
			
 
 
			
Posts: 7107 
	
		
	 | 
	
		
 | 
	| 03.12.2017 22:45 | 
	
		
	 | 
	
		
		Berserker 
 
 
		
		
		
			
			
 
 
			
 
 
			
Posts: 16788 
	
		
	 | 
	
		
 | 
	| 03.12.2017 23:10 | 
	
		
	 |