Hello. Great work, it takes a while since I forced this to work. Iam not good in programming stuf (also in english ) so my question is: is it possible to write comments in mods code? You know, something like /* comment */. Because i want to replace many lines e.g. in pikeman stats and i want to comment that to avoid mess between units. And the other thing, can you pls post some short example of code in which will you change about 3-4 lines in a row? (i have trouble with using "\n") Greetings from Slovakia and many thanks for your work.
Sadly no, json format don't support comment. Easier way is to use notepad++. Create a new file in notepad++ and paste in the text you want modify. Next, press "Ctrl+F", click "replace", in search mod check "extend search", in search field enter "\r\n" and in the replace filed enter "\\n", and finally press "replace all".
1.4.0 -Add a gui! -Remove file verification, that was be very ineffective. Now, after a cossacks3 update, the best way is to delete "c3mm" folder and check your game cache in steam before manager launch. -Remove console options.
1.4.1 -Graphics ameliorations -Fix a bug occured when a mod isn't valid (thank to Vova Dumanskiy for report) -Add few feed back in case of an invalid mod. -Now log.txt save only last session. -Now, show an alert if a new version of a mod is detected. -Now, Mod Manager don't relaunch after each install/uninstall
An official cossacks mod manager has been released! ... But we can only replace original game file by others... It is a first step. So, you can use official mod manager or my mod manager, but not the both, because modifications given by my program may be erased by the official mod manager.
1.4.2 -Correct a bug occured when a mod isn't valid and user press "install_all" -Some intern modifications -Add a "config" field How 'config field' does if work? Write Code: "config":{ "PIKEMAN_ARMOR":"12000" }, "file":{ "data/scritps/lib/unit.script": { "pikeman.armor=2":"pikeman.armor=PIKEMAN_ARMOR" } } is equivalent to write: Code: "file":{ "data/scritps/lib/unit.script": { "pikeman.armor=2":"pikeman.armor=12000" } } It isn't very useful for little mod, but for large unit modifications mod...
Is it possible to make some upgrade to your mod manager, that can replace block of text like now, but in format which was writen in? I meen that for example this part of code: Code: _aus : member := 'croat'; _ukr : member := 'cossacksich'; _pol : member := 'wingedhussar'; ... can I replace in similar form, e.g.: Code: _alg : member := 'mammeluke'; _ukr : member := 'cossacksich'; _rus : member := 'vityaz'; Instead of making "spagetti" code with using many "\n"? (one of reasons is that not all text lines are unique) Something like: Code: *** _aus : member := 'croat'; _ukr : member := 'cossacksich'; _pol : member := 'wingedhussar'; *** /// *** _alg : member := 'mammeluke'; _ukr : member := 'cossacksich'; _rus : member := 'vityaz'; ***
I currently use the json format, so the best i can do is Code: ["_aus : member := 'croat';", "_ukr : member := 'cossacksich';", "_pol : member := 'wingedhussar';"]:["_alg : member := 'mammeluke';", "_ukr : member := 'cossacksich';", "_rus : member := 'vityaz';"] if you want. I can also change mod format, but ->All old mod will become incompatible ->Json is a powerfull format, it is hard for me to code all for begining However, i can code a little tools who transform Code: *** _aus : member := 'croat'; _ukr : member := 'cossacksich'; _pol : member := 'wingedhussar'; *** /// *** _alg : member := 'mammeluke'; _ukr : member := 'cossacksich'; _rus : member := 'vityaz'; *** in json file. Actually, the "config" field add in last update circumvents the problem with regroup in top of your mod all important modifications.
And for 1.4.3 i work on a "option" field who give to user possibility to change mods value in the c3mm interface.
Code: ["_aus : member := 'croat';", "_ukr : member := 'cossacksich';", "_pol : member := 'wingedhussar';"]:["_alg : member := 'mammeluke';", "_ukr : member := 'cossacksich';", "_rus : member := 'vityaz';"] I think that this will be good. But if you can also do the tool to trasform "default code":"new code" with its format into *json, it will be interesting. For now it is really frustrating for example to withdraw winged husar from group of other two mounted units and place it somewhere else in the code. Much faster is to just rewrite some text parts in "country.script" file but it has huge disadvantage - every new patch of the game.
Okay, i add it to the 1.4.3 to-do-list. For the tools, the best way is to make a mod editor. I will work on after 1.4.3 release.
1.4.3 -Add an "option" field and a "optionpath" field. -Add multi-line -Re-write code from tkinter GUI lib to easytk Now, you this code Code: "begin\ndo something\nend":"begin\ndo nothing\ndo nothing\nend" and this code Code: "begin\ndo something\nend": ["begin", "do nothing", "do nothing", "end"] have the same effect. Option file: Now, in mod manager you have a button "option". Yes, interface is very ugly, i know. Options values work like config value, but users can modify them. Enter option like this: Code: "option":[ ["name1", "defautvalue1"], ["name2", "defautvalue2"], ... ] In case of a big number of options, you can export your mod options choice as a ".c3mmc" file. Then, other user have just to press "load" and select your mod options file. You can also share a mod option file with your mod. In this case, add a field "optionpath" in your mod, then c3mm load automatically this option file.
Code: { "name":"mod", "version":"1.0", "info":"nothing", "author":"yquinox", "file":{ "data/scripts/lib/unit.script":{ ["'tur', 'alg' : begin", "objbase.maxhp := 100;", "SetObjBaseWeapon(objprop, objbase, 0, 9, default, default, 110, default, default, default, True);", "SetObjBasePrice(objbase, 55, 0, 0, 0, 2, 0);", "SetObjBaseProtection(objbase, 0, 0, 0, 0, 0, 0);", "end;"]:["'tur', 'alg' : begin", "objbase.maxhp := 200;", "SetObjBaseWeapon(objprop, objbase, 0, 9, default, default, 110, default, default, default, True);", "SetObjBasePrice(objbase, 55, 0, 0, 0, 2, 0);", "SetObjBaseProtection(objbase, 0, 0, 0, 0, 0, 0);", "end;"] } }, "add_file":{}, "replace_file":{}, "remove_file":[] } Mod isnt valid. Can you pls check it and tell me, why is it so?
Sorry, i make a mistake, json don't accept list as key. They work only for second member, not for the first. I'm working on an alternative solution. For the moment, you can only Code: { "name":"mod", "version":"1.0", "info":"nothing", "author":"yquinox", "file":{ "data/scripts/lib/unit.script":{ "'tur', 'alg' : begin\nobjbase.maxhp := 100;\nSetObjBaseWeapon(objprop, objbase, 0, 9, default, default, 110, default, default, default, True);\nSetObjBasePrice(objbase, 55, 0, 0, 0, 2, 0);",\nSetObjBaseProtection(objbase, 0, 0, 0, 0, 0, 0);\nend;":["'tur', 'alg' : begin", "objbase.maxhp := 200;", "SetObjBaseWeapon(objprop, objbase, 0, 9, default, default, 110, default, default, default, True);", "SetObjBasePrice(objbase, 55, 0, 0, 0, 2, 0);", "SetObjBaseProtection(objbase, 0, 0, 0, 0, 0, 0);", "end;"] } }, "add_file":{}, "replace_file":{}, "remove_file":[] }