Trunk discussion / complains

You mean you have message like this?

Invalid or unsupported charset: CP1250

That’s bad - boost locale fails to convert text to UTF-8.
Most likely caused by either one of:
a) boost-locale was compiled without charset conversion support. I think it needs ICU or iconv available for this.
b) encoding names can be system-specific. On my side they are named “CP1250”, “CP1251”, “CP1252”.

Not sure what exactly causing this though.

EDIT: I can add a workaround to skip conversion for ASCII-only files but this may work only as temporary solution - we’ll need proper fix for release.

More precisely, displayed charset name is empty.

Try to set encoding to either CP1252 or CP1250 via launcher or by editing config file directly:

"general" : {
		"encoding" : "CP1250"
}

Which config file is that?

Anyway, I tried to change encoding in launcher. Default is 1250. With 1252 it crashes just teh same, but next time the launcher shows 1250 again.

That’s config/settings.json

Is it possible that config/schemas/settings.json used by client/launcher is outdated? Outdated file may cause such behavior.

Heyy it worked, sorry for trouble :>

First hi this is my first post and this i great project :slight_smile:
Second i’m not sure this is the right place but here is my question
why when i build vcmi from source when i run it without root privileges shows me this

Starting... 
Creating console 0
	 Initialization: 20
	 Data loading: 190
	Mod handler: 0
	 Mod filesystems: 90
Basic initialization: 300
vcmiclient: /home/msimeonov/devel/vcmi/trunk/lib/JsonDetail.h:51: const char& constString::operator](size_t): Assertion `position < datasize' failed.
Aborted (core dumped)

and if i run it with sudo i can play it

i forgot to tell what system i run
Fedora 19 x64 uptodate

PS
i hadnt tried to play with prebuild binaries from the site

You shouldn’t start vcmi as root.

I will take a closer look on this tomorrow. For now - try to delete files in ~/.vcmi/config/ directory and make sure that vcmi has full access to it (chmod u+rwx ~/.vcmi/config)

That was the problem it was my mistake at first :blush:
as i tried to start vcmi i may try to run it as root and that must change the rights for /home/~/.vcmi
thanks for the quick respond :slight_smile:
keep up the good work i may try to contribute for the project :slight_smile:

I compiled VCMI under windows with VS12 to test if it’s possible to use std::function in CFunctionList class because of a bug which can occur when using boost::bind/function and std::bind/function. See this report: bugs.vcmi.eu/view.php?id=1601
Don’t know where to put this, but I think we need a additional category for such types of mantis reports, e.g. General or API which affects several categories.

While I tried to compile VCMI with VS12, I have noticed a few things:

  • Not all compilation units were included in project files (@Warmonger/Tow: Do you commit project files regularly?) -> I would suggest to ignore all not relevant files (generated files, dll files -> qt5, etc., …) with SVN or to put those files somewhere outside SVN. Otherwise it may be difficult to recognize which files have been changed or should be added. (perhaps I did something wrong, but when I turned on ‘show unversioned files’ then I got a few 100 files)
  • I added a few more filters to the project files to reflect the underlying directory structure a bit better and to keep h/cpp files more organized.
  • I received a lot of warnings when compiling VCMI. Is it possible to ignore a few warnings and probably to fix a few others? Otherwise you may oversee some important warnings. As compared to MSVC the count of warnings is 0 when using GCC/Clang with the highest warning level turned on and a few warnings exluded.

EDIT:
@Ivan:
Is it possible that the JSON parser ignores 0 byte JSON files and doesn’t test any assertions? If something went wrong on VCMI startup because of missing data files the modSettings.json and settings.json will be created but with 0 bytes (another solution would be to create a valid JSON file directly when creating the file). The next time you start VCMI in debug mode it will complain about asserts which fail. Perhaps it would also be better to throw exceptions and handle them somewhere. -> Asserts are excluded in release build and user provided json files can always contain some errors and with exceptions you can effectively react on them.

Assertions? I know only about one I accidentally caused by unicode check (position < datasize). Easy one to fix. Anything else I don’t know about?

In this particular case - no. This is purely debug check to make sure that json parser is in valid state.

No, just the unicode check (position < datasize).

Super, then it’s OK.

Can’t compile logical expressions :frowning:

Error	7	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall LogicalExpression<class BuildingID>::toString(class std::function<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl(class BuildingID const &)>)const " (__imp_?toString@?$LogicalExpression@VBuildingID@@@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$function@$$A6A?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVBuildingID@@@Z@3@@Z)	E:\Programowanie\VCMI\vcmi\client\CCastleInterface.obj
Error	8	error LNK1120: 1 unresolved externals	E:\Programowanie\VCMI\VCMI_client.exe	1
Error	9	error LNK2005: "protected: __thiscall boost::static_visitor<bool>::static_visitor<bool>(void)" (??0?$static_visitor@_N@boost@@IAE@XZ) already defined in VCMI_lib.lib(VCMI_lib.dll)	E:\Programowanie\VCMI\vcmi\scripting\erm\* CIL library *(* CIL module *)
Error	10	error LNK2005: "protected: __thiscall boost::static_visitor<bool>::~static_visitor<bool>(void)" (??1?$static_visitor@_N@boost@@IAE@XZ) already defined in VCMI_lib.lib(VCMI_lib.dll)	E:\Programowanie\VCMI\vcmi\scripting\erm\* CIL library *(* CIL module *)
Error	11	error LNK1169: one or more multiply defined symbols found	E:\Programowanie\VCMI\Scripting\ERM.dll	1
Error	12	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::vector<class BuildingID,class std::allocator<class BuildingID> > __thiscall LogicalExpression<class BuildingID>::getFulfillmentCandidates(class std::function<bool __cdecl(class BuildingID const &)>)const " (__imp_?getFulfillmentCandidates@?$LogicalExpression@VBuildingID@@@@QBE?AV?$vector@VBuildingID@@V?$allocator@VBuildingID@@@std@@@std@@V?$function@$$A6A_NABVBuildingID@@@Z@3@@Z)	E:\Programowanie\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	13	error LNK1120: 1 unresolved externals	E:\Programowanie\VCMI\AI\VCAI.dll	1

Tried including LogicalExpression.h to some files, but it must be something else.

DLL_LINKAGE strikes again?
These two methods (toString and getFulfillmentCandidates) should be instantiated by client and VCAI. But since class is marked as DLL_LINKAGE msvc treats them as external methods that don’t need instantiation.

removing dll_linkage from all symbols in header may fix this but this is just a guess.
Another option is to instantiate template explicitly in .cpp

I really need to find a way to make gcc more strict on this matter…

That worked, but I also needed to include LogicalExpression.cpp by force.

With current trunk I receive following log messages:

Parsing mod data: 50 ms
Data in rampart is invalid!
At /town/buildings/dwellingLvl6/requires/0
	 Error: Type mismatch! Expected number
At /town/buildings/dwellingLvl6/requires/1
	 Error: Type mismatch! Expected number
At /town/buildings/dwellingLvl6/requires/2
	 Error: Type mismatch! Expected number

		[FAIL] Original game files
		[SKIP] VCMI essential files
	Loading mod data: 240ms

/config/factions/rampart.json contains string values whereas the schema only allows numbers:

"dwellingLvl6":   { "id" : 35, "requires" :  "allOf",  "dwellingLvl3" ],  "dwellingLvl4" ] ] }

Are these warnings I can ignore for now?

Just wanted to say that the above problem has been resolved:)

Are there any campaigns where it is possible to choose a different map to conquer at the bonus screen? If yes for which heroes version is it possible, WoG / SoD? VCMI code shows that it could be possible at least.

Another question, is there any easy way to make a GUI component visible / invisible? There is no visible property in CIntObject. I can disable / enable a component which does the trick, but only if I redraw the screen. Is this the preferred way?

  1. There are several such campaigns. Examples:
    RoE - Spoils of War, first two scenarios.
    AB - Armageddon’s Blade 1st and 2nd scenario

Spoils of War 3rd scenario is also interesting - you can choose side on which you will play. Here vcmi should select correct set of heroes - either set from 1st scenario or heroes from 2nd scenario.

  1. Pretty much yes. Except that instead of redrawing whole screen (GH.totalRedraw()) you can redraw current window (CIntObject::redraw()).

OK, thanks!