19th Century Mod

Discussion in 'Modding' started by Loner, Feb 17, 2019.

  1. Loner

    Loner Active Member

    Russia.JPG
    Russia..........................Hussar..................................................................................................................................Cuirassier.
     
    ComDiv, Johny and Demoul like this.
  2. Loner

    Loner Active Member

    Saxony.JPG
    Saxony..............................Hussar..................................................................................................................................................Uhlan.
     
    ComDiv and Johny like this.
  3. Loner

    Loner Active Member

    Scotland.JPG
    Scotland.......................Hussar...................................................................................................................................................Lancer.
     
    Johny, Demoul and ComDiv like this.
  4. Loner

    Loner Active Member

    Spain.JPG
    Spain.....................................Hussar..............................................................................................................................................Lancer.
     
    ComDiv and Demoul like this.
  5. Loner

    Loner Active Member

    Sweden.JPG
    Sweden........................Hussar...............................................................................................................................................Cuirassier.
     
    ComDiv and Demoul like this.
  6. Loner

    Loner Active Member

    Switzerland.JPG
    Switzerland.....................Hussar.........................................................................................................................................Cuirassier.
     
    Demoul and ComDiv like this.
  7. Loner

    Loner Active Member

    Turkey.JPG
    Turkey...........................Sipahi........................................................................................................................................Suvarilaris.
     
    Johny and Demoul like this.
  8. Loner

    Loner Active Member

    Ukraine.JPG
    Ukraine...............Sich Cossack..............................................................................................................................................Register Cossack.
     
    Johny and Demoul like this.
  9. Loner

    Loner Active Member

    Venice.JPG
    Venice...........................Hussar.......................................................................................................................................Lancer.
     
    Johny and Demoul like this.
  10. Loner

    Loner Active Member

    I've hit a bit of a brick wall, I'm trying to get the A.I to randomly produce either one or the other of the available Cavalry units, I've managed to do this with the Infantry but no luck with the Cavalry.
    I think it has something to do with these lines of code from progresseconomicai.inc but I'm not sure;

    [*] = ;function _ai_GetCav17Unit(plind, cid : Integer) : Integer;
    [*] = ;begin
    [*] = ; Result := gc_ai_unit_reitar;
    [*] = ; if (cid<>cid_rus) and (_ai_NationIsEurope(cid) and (gPlayer[plind].aidata.bFlags[gc_ai_flag_drag_cav17])) then
    [*] = ; Result := gc_ai_unit_dragoon17;

    I've tried various ideas but the A.I only wants to produce Heavy Cavalry, no Hussars, any suggestions would be most welcome, thanks.:)
     
    Last edited: Sep 27, 2019
  11. Demoul

    Demoul Well-Known Member

    You should ask Awar. Only he can help you in the technical part. )
     
    Loner likes this.
  12. Awar

    Awar Well-Known Member

    function _ai_GetCav17Unit. It is only for Cavalry of 17th century and it is only for one type cavalry.
    The type of cavalry is determined randomly at start or load of game.
     
    Loner likes this.
  13. Awar

    Awar Well-Known Member

    Another method, as the AI can produce cavalry.
    AI produces a new type of cavalry depending on the number of stables.

    For example,
    1-2 stables: AI produces heavy cavalry,
    3 horse stables - AI produces heavy cavalry and Dragoons
    4 stables AI produces hussars
     
    Loner likes this.
  14. Loner

    Loner Active Member

    Thanks Awar, is there anyway around this, 4 stables seems a lot.
     
  15. Loner

    Loner Active Member

    Finally got it fixed, the daft thing is, I used the same method for the Cavalry as I did for the Infantry.:oops::rolleyes:

    [*] = ;function _ai_GetInf17Unit(plind, cid : Integer) : Integer;
    [*] = ;begin
    [*] = ; Result := gc_ai_unit_infantry17;
    [*] = ; if (cid=cid_alg) and ((gPlayer[plind].aidata.bFlags[gc_ai_flag_uniq_inf17]) or (bIsWaterMap)) then
    [*] = ; Result := gc_ai_unit_uniq_inf17
    [*] = ; else
    [*] = ; if ((cid=cid_aus) or (cid=cid_tur) or (cid=cid_eng) or (cid=cid_fra) or (cid=cid_bav) or (cid=cid_den) or (cid=cid_hun) or (cid=cid_net) or (cid=cid_pie) or (cid=cid_pol) or (cid=cid_por) or (cid=cid_pru) or (cid=cid_rus) or (cid=cid_sco) or (cid=cid_sax) or (cid=cid_spa) or (cid=cid_swe) or (cid=cid_swi) or (cid=cid_ven) or (cid=cid_ukr)) and ((gPlayer[plind].aidata.bFlags[gc_ai_flag_uniq_inf17]) and (not bIsWaterMap)) then
    [*] = ; Result := gc_ai_unit_uniq_inf17;
    [*] = ;end;
    [*] = ;
    [*] = ;function _ai_GetCav17Unit(plind, cid : Integer) : Integer;
    [*] = ;begin
    [*] = ; Result := gc_ai_unit_reitar;
    [*] = ; if (cid=cid_alg) and ((gPlayer[plind].aidata.bFlags[gc_ai_flag_uniq_cav17]) or (bIsWaterMap)) then
    [*] = ; Result := gc_ai_unit_uniq_cav17
    [*] = ; else
    [*] = ; if ((cid=cid_aus) or (cid=cid_tur) or (cid=cid_eng) or (cid=cid_fra) or (cid=cid_bav) or (cid=cid_den) or (cid=cid_hun) or (cid=cid_net) or (cid=cid_pie) or (cid=cid_pol) or (cid=cid_por) or (cid=cid_pru) or (cid=cid_rus) or (cid=cid_sco) or (cid=cid_sax) or (cid=cid_spa) or (cid=cid_swe) or (cid=cid_swi) or (cid=cid_ven) or (cid=cid_ukr)) and ((gPlayer[plind].aidata.bFlags[gc_ai_flag_uniq_cav17]) and (not bIsWaterMap)) then
    [*] = ; Result := gc_ai_unit_uniq_cav17;
    [*] = ;end;
     
    Awar likes this.
  16. Loner

    Loner Active Member

    For some reason Ukraine will only produce Serdiuk as their Infantry unit, even though I've given them a second one. I've tried loads of different changes to the code including changing musk17 to infantry17 but still no joy.:(
     
  17. Loner

    Loner Active Member

    Sorry it's been a bit quiet on here recently I've been producing the Icons for each unit.:D
     
    Npeter87 likes this.
  18. Ftoomsh

    Ftoomsh Well-Known Member

    Have you got Ukraine producing a second infantry unit yet? I'm sure I've seen a mod or two that does that. Maybe State vs. Country and Cossacks Annihilation. In Cossacks 1, I modded Davout's OCMOD1. I gave Ukraine the ability to build log cabins late game because they were not allowed to make towers. Then I gave the log cabin the ability to make serdiuks too. It gave Ukraine a new lease of life in the late game (because they were modded to not be so over-powering mid-game). It was fun to see troops coming out of the log cabins. For some reason the log cabins would not fire when they were producing serdiuks. It was a pure fluke but I thought it was a good thing. Only thing was, I had no build stages for the log cabin so the peasants would work around a foundation (grass on grass for Ukraine so it was invisible) until the log cabin would suddenly pop up fully built. LOL.

    On the topic of log cabins, I have always thought they should need to be garrisoned to fire. Otherwise, where did the muskets come from and who is firing them?
     
  19. Loner

    Loner Active Member

    No unfortunately not, having them come out of a different building is an interesting idea, but my technical ability is very limited, I'll have a look and see what I can do.
    I agree on your view of Log Cabins.:cool:
     
  20. Ftoomsh

    Ftoomsh Well-Known Member

    In C3, I tinkered with Ukraine having pikes coming out of the Town Center! I used reassigned Polish pikes which also wear heavy coats that kinda match those of serdiuks. The idea was that the pikes were militia. Ukraine produce plenty of peasants so the next part of the idea was that once there were sufficient peasants, one could produce militia out of the town centers. But by that phase of the game it was the wrong time window for militia. I abandoned the idea. I am pretty sure I experimented with have mercenary grenadiers coming out of the actual barracks. It was another idea I abandoned but IIRC I did get that unit to come out of the barracks. It's all coming back to me... my crazy experiments, lol. You have to define what the building is allowed to produce either in country script or units script. I will have a look shortly.
     
    Loner likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice