Cossacks 3 Modding Tools

Discussion in 'Modding' started by egnaro, Sep 28, 2016.

  1. Fimti

    Fimti New Member

    Lieutenant-Général
    Can you make a simple step-by-step tutorial on how to use this mod tool ? :)

    I have 7 files i have to modify and i can't figure out how to tell this tool which file it should read.

    When i run the c3mm.py file, the command window opens only for a split second then closes again. Is it supposed to that?? (i got the latest 3.5.* python version)
     
  2. Lieutenant-Général

    Lieutenant-Général Active Member

    To install a mod:
    You have to click on "file" button of window explorer and launch the command window.
    Then, type "python c3mm.py install mod.txt" with mod.txt the mod file.

    To create a mod:
    1)Create a "mod.txt" file
    In the first line write the name and version + version number.
    Ex: "MyFirstMod version 1.0.0"

    2)Write "*PATH*" and the path of the file.
    Ex: "*PATH*data/script/unit/lib/unit.script"

    3)In this file, find lines you want modify and copy then.
    Past in "mod.txt" under the the path.
    Ex:
    "*PATH*data/script/unit/lib/unit.script
    pikeman.shield=5
    pikeman.slash=9"


    4)Next, write "*REPLACE*"
    Ex:
    "*PATH*data/script/unit/lib/unit.script

    pikeman.shield=5
    pikeman.slash=9*REPLACE*"

    5)And now write what do you want.
    Ex:You want invincible pikeman?
    "*PATH*data/script/unit/lib/unit.script

    pikeman.shield=5
    pikeman.slash=9*REPLACE*pikeman.shield=999
    pikeman.slash=999"

    6)To finish, write "*END*"
    Ex:
    "*PATH*data/script/unit/lib/unit.script

    pikeman.shield=5
    pikeman.slash=9*REPLACE*pikeman.shield=999
    pikeman.slash=9*END*"

    If you want change other lines of the same file, repeat steps 3) to 6)
    If you want change an other file, go to step 2)

    Warning : go to the line only:
    After the name and version of your mod
    After the paths names
     
  3. Lieutenant-Général

    Lieutenant-Général Active Member

  4. StriKe jk

    StriKe jk Member

    Sorry I didn't expect to get an update this quick so I hadn't have the time to elaborate what I wanted and tell you the file that you need to check. :(

    What I meant was the version of the Cossacks 3 game (because an update can break some mods). So it should check if the version of the game has changed since the last time someone installed a mod, so that he re-installs the mod after the version number changed. (to circumvent the rare chance that they changed exactly that part in the files.)

    Nonetheless your update is also highly welcomed (to be honest I didn't even think of that).

    Anyway, here is the file where the game version is stored:
    Code:
    project.main.prj
    And this is the path:
    Code:
    Cossacks 3\data\projects\
    This is the string where you can read it from:
    Code:
    BuildVersion = 1.0.4
    SVNVersion = 3856
    You may also need the data version which is stored here:
    Code:
    serial.script
    In this path:
    Code:
    Cossacks 3\data\scripts\lib\
    With this string:
    Code:
    gDataVersion:=46;
    Thank you again :p

    -StriKe
     
  5. Francesco_Cavalli

    Francesco_Cavalli Active Member

    Hi Egnaro, I've used your great tool to check adding melee animations to dragoons - It works perfectly in your viewer, however once I've modded the aaf with the attach line taken from the Cuirasser file and paired it with a new melee entry in the unit.script, when the dragoons engage the enemy they either do nothing or glitch until death - do you know what I might be doing wrong, oer whether it's just too difficult to add animations via text editing at this stage?
     
  6. StriKe jk

    StriKe jk Member

    can you link the code that you changed? Maybe we can spot the error this way.
     
  7. Francesco_Cavalli

    Francesco_Cavalli Active Member

    Thanks for the offer - here's what I've changed. I've worked out how to change rates of fire etc but this is a stab in the dark!

    in animation file (dragoon18.aaf):

    AAF
    9
    "idle",505,589,morph
    "idle0",418,502,morph
    "idle_rest",335,415,morph
    "walk",614,637,morph
    "death",49,119,morph
    "attack1",592,604,morph
    "prepare1",214,227,morph
    "unprepare1",200,213,morph
    "attack0",640,653,morph
    "prepare0",504,505,morph
    "unprepare0",504,505,morph
    "death0",124,195,morph

    and in unit.script:

    'dragoon18', 'dragoon18dip', 'lightcavalry', 'lightcavalrydip' : begin
    objbase.maxhp := 200;
    SetObjBaseWeapon(objprop, objbase, 0, 18, 0, 35, 65, 0, 400, gc_obj_weapon_kind_pike, True);
    objprop.weapon[0].attmask := objprop.weapon[0].attmask or (1 shl gc_obj_material_body);
    objprop.weapon[0].attmask := objprop.weapon[0].attmask or (1 shl gc_obj_material_woodwall);
    SetObjBaseWeapon(objprop, objbase, 1, 18, 250, default, default, default, default, gc_obj_weapon_kind_bullet, True);
    objbase.weapon[1].dispertion := _misc_PixelsToTiles(250);
    objprop.weapon[1].addradius := _misc_PixelsToTiles(32);
    SetObjBasePrice(objbase, 70, 0, 0, 45, 15, 0);
    SetObjBaseSearchBuildVisionScore(objprop, objbase, default, 1750, default, 40);
    objprop.consume[gc_resource_type_gold] := 85;
    objprop.weapon[1].fxshot := 'shotmusketdrag';
     
  8. StriKe jk

    StriKe jk Member

    I build it myself and got it working. I didn't use your code tho but my own instead (kinda confusing to use other peoples work to be honest, it was much easier just building it myself). Nonetheless the only thing which I found being wrong is this:

    This needs to be the same number as the amount of animations you have in that list. In your case 12
    But don't freak out to early because you can't just mix different unit animations together, the graphics will go crazy. But you can always use the unit animation that you already have.
    Here is my example (I just used the same animations twice):

    Code:
    AAF
    14
    "idle",505,589,morph
    "idle0",418,502,morph
    "idle_rest",335,415,morph
    "walk",614,637,morph
    "death",49,119,morph
    "attack0",592,604,morph
    "prepare0",214,227,morph
    "unprepare0",200,213,morph
    "death0",124,195,morph
    "idle1",418,502,morph
    "attack1",592,604,morph
    "prepare1",214,227,morph
    "unprepare1",200,213,morph
    "death1",124,195,morph
     
  9. Francesco_Cavalli

    Francesco_Cavalli Active Member

    Thanks for taking a look - I got a bit over excited when the mod tool didn't crash and played the dragoon with cuirasser animations! Guess we'll have to wait a little longer
     
  10. StriKe jk

    StriKe jk Member

    You got the animations working? For me it glitched out the screen.
     
  11. Francesco_Cavalli

    Francesco_Cavalli Active Member

    Only in the tool - in game it causes a weird graphic glitch and the unit gets stuck until it dies. *I think* it may be because dragoon18 is part of the parent dragoon entry in the unit script, but I wasn't keen on trialling something like this on more than one unit at a time
     
  12. Francesco_Cavalli

    Francesco_Cavalli Active Member

    I figure there should be no problem as all cavalry units share the same skeleton. In AOEiii it was very easy to assign animations to different units of the same type
     
  13. Hugojackson18

    Hugojackson18 Member

    Amazing!!!

    I just downloaded it and unfortunately, everytime I try to import an OBJ, it crashes. Loading an FBX just loads nothing unfortunately.
    Whats your process for it?

    Here's the OBJ+ textures (very very rough texture just for test), if you could test it that would be awesome!
    https://drive.google.com/open?id=0B6-HjHGVgDRmSXJXaTMtZG5NLWc
     
  14. egnaro

    egnaro Member

    Ohh, I apologies for this - it crashes because your model contains normals.
    Because game models do not contain normals (game calculates normals on demand) - I didn't implement their support in my tool.

    I'll fix this in the next version. In the meanwhile - just re-save your OBJ file w/o normals and it should load just fine.

    Yes, this would work in the next version.

    Thanks a lot for the feedback!
     
  15. Hugojackson18

    Hugojackson18 Member

    Nice one thanks! I assumed it was something to do with the way I exported the OBJ but didnt think it would actually make it crash, and it was 2am so didnt feel like testing more!

    I'll retry tonight. Thanks!
     
  16. Hugojackson18

    Hugojackson18 Member

    Another thing, Exporting OSS to FBX replaces every bone by an empty group in Maya.
    Im not sure if you had even implemented it correctly yet but as the option was here, I tried it out =D
     
    egnaro likes this.
  17. egnaro

    egnaro Member

    Unfortunatelly - the game format OSS doesn't contain bones hierarchy as well as bind pose. Also it stores absolute bones transformations.
    It's nearly impossible to properly export the skeleton from OSS to FBX.

    I might try to implement some "smart" algorithm to "guess" bones hierarchy, but that would require a lot of time and effort, so it won't be implemented any soon.
     
  18. Hugojackson18

    Hugojackson18 Member

    Fair enough. Do you have an idea in mind to be able to replace models for reusing animations of other units?

    EDIT: Recreating the hierarchy wouldnt be difficult in Maya, but I would be interested in getting the animations exported, being able to tweak the skeletons, change the animations and what not. But as a first start, if you find a way to re-use animation with a new model, please let me know how to do! I've got a stormtrooper model that I wanted to use to test this.
     
  19. Furious Peasant

    Furious Peasant Active Member

    Are you making progress with this? Is it now possible to get new models into Cossacks 3?
    I modelled some fortifications and new units, I want to add to the game.

    Why is GSC so silent? They said they want to add the workshop integration and give us plugins and tutorials. But we still have nothing.
     
  20. A. Soldier

    A. Soldier Active Member

    So you have finished them? I was just about to ask you on Steam about the progress on those things but I noticed you weren't online.

    Still, good to hear it. I'm really interested in that white Grenadier with Musketeer hat and your fortifications.

    I also asked Hugo Jackson on the progress of his Warhammer Fort/Blockhouse or whatever you want to call it but no reply so far.