
Originally Posted by
Jake Armitage
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