Page 3 of 3 FirstFirst 123
Results 41 to 45 of 45

Thread: Fleet_to_army_supply effect bundle?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: Fleet_to_army_supply effect bundle?

    Quote Originally Posted by Jake Armitage View Post
    please, post the entire script.
    probably you're adding a function to DeI's supply_system.lua, and I would need the entire script to begin understanding something (with your function included).
    Seems to me, by a preliminary glance, the number of end you've put are too many and I'm not sure if the position of the return is correct.
    Not sure though, post the script and I'll have a look.

    Also, can you describe what you want to do, in terms of difference regarding DeI's lua?
    OK, thanks!

    This is the DeI's supply_system.lua poked by me....I'me trying to spawn this effect "Fleet_to_Army_Supply" to fleets supplying land armies and transport shipt. The army and transport already have a bundle in DeI. The new effect is a negative giving penalties to fleets supplying armies/transports

    https://www.mediafire.com/file/67t1l...timbe.txt/file

  2. #2
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,689

    Default Re: Fleet_to_army_supply effect bundle?

    ok, hope I can help you

  3. #3

    Default Re: Fleet_to_army_supply effect bundle?

    Quote Originally Posted by Jake Armitage View Post
    ok, hope I can help you
    God speed Jake! I owe you big time

  4. #4
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,689

    Default Re: Fleet_to_army_supply effect bundle?

    You surely chose something nasty to work with...

    I've quickly begun making comparisons and at first glance it seems you erased this function (which is present into vanilla script)

    function SupplyAdmiralFleetReadyToTakeOff(curr_char)
    local SupplyCosts = 0;
    local army = curr_char:cqi()

    LogSupply("SupplyAdmiralFleetReadyToTakeOff(curr_char)","Remove naval effect bundles for: "..army)
    RemoveBundle(army, naval_effect_bundles)
    LogSupply("SupplyAdmiralFleetReadyToTakeOff(curr_char)","add Navy_in_port"..army)

    if curr_char:faction():culture() == "rom_Barbarian"
    then scripting.game_interface:apply_effect_bundle_to_characters_force("Navy_in_port", army,-1)
    else scripting.game_interface:apply_effect_bundle_to_characters_force("CIV_Navy_in_port", army,-1)
    SupplyCosts = 2;
    return SupplyCosts;
    end;
    end;


    but you kept this part of the script which, without the function above, will probably make your script "useless" (since you're saying that "SupplyCosts = something that does not exists")

    local SupplyCosts = 0;
    if curr_char:has_garrison_residence()
    then SupplyCosts = SupplyAdmiralFleetReadyToTakeOff(curr_char)
    return SupplyCosts;
    end;

    Can you send me the last version of your script that was working in-game?
    Otherwise I would have to check it for everything you changed. And after that check every change to see where the problems are (if I'm able to understand, well, this I can't say, I'm not a pro at all and this is the first time I check this script which is really complex).

    -----

    I've seen you've added some libraries into the "function SupplyArmySize(military_force)"
    Did you put the units' names into "supply_system_units.lua"?

    -----
    Send me the complete pack with the Db part too, I'll check if you did something wrong regarding the effect you're adding
    Last edited by Jake Armitage; May 22, 2019 at 06:07 AM.

  5. #5

    Default Re: Fleet_to_army_supply effect bundle?

    Quote Originally Posted by Jake Armitage View Post
    You surely chose something nasty to work with...

    I've quickly begun making comparisons and at first glance it seems you erased this function (which is present into vanilla script)

    function SupplyAdmiralFleetReadyToTakeOff(curr_char)
    local SupplyCosts = 0;
    local army = curr_char:cqi()

    LogSupply("SupplyAdmiralFleetReadyToTakeOff(curr_char)","Remove naval effect bundles for: "..army)
    RemoveBundle(army, naval_effect_bundles)
    LogSupply("SupplyAdmiralFleetReadyToTakeOff(curr_char)","add Navy_in_port"..army)

    if curr_char:faction():culture() == "rom_Barbarian"
    then scripting.game_interface:apply_effect_bundle_to_characters_force("Navy_in_port", army,-1)
    else scripting.game_interface:apply_effect_bundle_to_characters_force("CIV_Navy_in_port", army,-1)
    SupplyCosts = 2;
    return SupplyCosts;
    end;
    end;


    but you kept this part of the script which, without the function above, will probably make your script "useless" (since you're saying that "SupplyCosts = something that does not exists")

    local SupplyCosts = 0;
    if curr_char:has_garrison_residence()
    then SupplyCosts = SupplyAdmiralFleetReadyToTakeOff(curr_char)
    return SupplyCosts;
    end;

    Can you send me the last version of your script that was working in-game?
    Otherwise I would have to check it for everything you changed. And after that check every change to see where the problems are (if I'm able to understand, well, this I can't say, I'm not a pro at all and this is the first time I check this script which is really complex).

    -----

    I've seen you've added some libraries into the "function SupplyArmySize(military_force)"
    Did you put the units' names into "supply_system_units.lua"?

    -----
    Send me the complete pack with the Db part too, I'll check if you did something wrong regarding the effect you're adding
    Hi,

    Good point, this part is obsolete Wonder how that got out of my sight...

    Code:
    local SupplyCosts = 0;
        if curr_char:has_garrison_residence() 
         then SupplyCosts = SupplyAdmiralFleetReadyToTakeOff(curr_char) 
          return SupplyCosts;
        end;
    
    I must emphasize, this .lua script that I indroduced to you works, everything in it works except the "function FleetGetsOwnBundle(naval_char, char_faction, EnemyFactionKeys)". I have very carefully implemented and tested all the other added/modified parts in there with lots of trials and errors, but with lots of time and effort (and testing) I managed to make it work.

    "function FleetGetsOwnBundle(naval_char, char_faction, EnemyFactionKeys)" does not break the script. True is that this supply script is very delicate, it is very easy to break if you don't know what you're doing. my addon (FleetGetsOwnBundle) just does not trgigger anything so the problem must lay on the functions syntax given that theres no other reference to other functions that "EnemyFactionKeys"

    I'm now out of town so I can post you the whole pack on weekend maybe. If you want to test this particular function you can add it in the vanilla supply_system.lua, because it should work as individual addon ? You cannot test the whole .lua script because it needs other parts to function and yes this "function SupplyArmySize(military_force)" is taken care of, it works with the other addons to other tables
    Last edited by MrTimbe68; May 23, 2019 at 01:25 AM.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •