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.
     
    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.
     
    Demoul likes 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.:(
     
  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