Page 1 of 1

-- Merchant Submarine ?

Posted: Mon Dec 10, 2018 7:40 pm
by operating
Robotron or anybody that has knowledge about this event:

OK, here's what I am understanding: I believe that this type of submarine can supply land units of all types. The script does not expressly say that, however "Merchant Submarine" sounds eerily close to "Merchant Fleet". Can anybody tell myself and others if there is any advantage to having the Merchant Submarine Event other than it's increased defense rating. In all my MP and SP games I have never seen this event. I do see USA mentioned in this event it maybe a USA event only, or could it apply to other factions?



-- Merchant Submarine
function MerchantSubmarine(unit, hex)
if GetEvent("MerchantSubmarine") == 0 then
if unit.faction.alliance.id == 2 and unit.prototype.name == "submarine" then
local usa = game:GetFactionById(10)
if usa.alliance.id ~= 1 then
local hexes = game.map:GetHexesInRange(hex, 1)
for _, adjacent in pairs(hexes) do
if adjacent.construction ~= nil and adjacent.construction.type == Construction.TYPE_PORT and adjacent.construction.city.hex.originalFaction.id == 10 and HasUnitTech(unit, "submarine_cruiser") then
SetEvent("MerchantSubmarine", game.turn, adjacent, unit.faction.alliance)
unit.faction:ConsumeProductionPoints(-30)
if usa.alliance.id == 0 then
ChangeFactionAlignment(usa, unit.faction.alliance, 2)
end
if unit.faction.alliance.id == playerAlliance.id then
ui.resourcesPanel:Refresh()
end
end
end
end
end
end
end

Re: -- Merchant Submarine ?

Posted: Tue Dec 11, 2018 12:34 am
by Robotron
If USA is still neutral and a CP submarine reaches an USA port the CP nation owning that submarine will gain 30 production points and USA alignment will shift 2 points in favor of CP.

Re: -- Merchant Submarine ?

Posted: Tue Dec 11, 2018 3:44 am
by operating
Robotron wrote:
Tue Dec 11, 2018 12:34 am
If USA is still neutral and a CP submarine reaches an USA port the CP nation owning that submarine will gain 30 production points and USA alignment will shift 2 points in favor of CP.
Thanks Robotron for your time.. :wink:

This event seems to specify having a submarine cruiser vs just any submarine to accomplish this event, or any submarine will do providing that faction has the submarine cruiser tech, which Is that correct? Also does it have to be "in" the port, or adjacient to a port? It's a weird event for it takes a gazillion turns to reach the submarine cruiser tech if ever in most matches. I gather if the USA and CP are at war this event can not happen, correct?

Thanks

Re: -- Merchant Submarine ?

Posted: Tue Dec 11, 2018 11:04 am
by Robotron
The submarine must have been equipped with the submarine cruiser tech. Being adjacent to a port is enough.
USA not having joined the Entente is a prerequisite, meaning that, if theoretically USA had joined CP, the event would still trigger. :P