New method speculation thread

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
There are a bunch of new methods in G&K and some don't have an immediately obvious function. I thought it might be useful to put these out in their own thread. Please feel free to contribute to the speculation or (even better) tell us what these do. I'll start off with the first new player method:

player:AddTemporaryDominanceZone(x, y)

It appears only in the Fall of Rome Scenario. I've shown it in context in the spoiler below. There are multiple analogous functions that only differ in the city name and x,y coordinates. Basically, you see a bunch of Vandal units spawning near the city. And then the method is run for the Vandal player.
Spoiler :
Code:
function AddVandalAttackOnMistra()
	local unit;
	local iSpawnX = 45;
	local iSpawnY = 16;
	for iPlayer = 1, 7, 1 do
		if (IsHun(iPlayer)) then
		elseif (IsCelt(iPlayer)) then
		elseif (IsFrank(iPlayer)) then
		elseif (IsGoth(iPlayer)) then
		elseif (IsVandal(iPlayer)) then
			local pPlayer = Players[iPlayer];
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_CARTHAGINIAN_QUINQUEREME"], iSpawnX, iSpawnY);
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_CARTHAGINIAN_QUINQUEREME"], iSpawnX, iSpawnY);
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_CARTHAGINIAN_QUINQUEREME"], iSpawnX, iSpawnY);
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_CARTHAGINIAN_QUINQUEREME"], iSpawnX, iSpawnY);
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_CARTHAGINIAN_QUINQUEREME"], iSpawnX, iSpawnY);
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_VANDAL_AXEMAN"], iSpawnX, iSpawnY);
			unit:SetEmbarked(true);			
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_VANDAL_AXEMAN"], iSpawnX, iSpawnY);
			unit:SetEmbarked(true);			
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			unit = pPlayer:InitUnit(GameInfoTypes["UNIT_VANDAL_AXEMAN"], iSpawnX, iSpawnY);
			unit:SetEmbarked(true);			
			unit:JumpToNearestValidPlot();
			unit:SetDeployFromOperationTurn(1);
			Players[iPlayer]:AddTemporaryDominanceZone (49, 18);
		end
	end
end
Is it telling the AI to stick around and harass this area for a while?

Is it giving the Vandal units some sort of bonus?

(Might be helpful to know if 49, 18 is the exact coordinate of the city, but I haven't checked.)

I haven't played the scenario so I might be missing something obvious.
 
it's also used in the 1066 scenario and at least another one pre-G&K (The Korean one).

it's used to set a target for the units initialized with the 'set deploy from operation turn' function, but I didn't know if it can be used more than once, I tried it in my Stalingrad scenario for the WWII mod without clear change in AI behavior...
 
I've been trying out the temp dominance zone....I see absolutely no benefit or change in ai for the newly spawned units.

On another note, I've been trying to spawn major Civ units in hostile major Civ territory, but they always bounce to their nearest owned tile(s), even if they are at permanent war. Something like this...
Code:
iUnitID = GameInfoTypes["UNIT_MUSKETMAN"];
unit = pRebel:InitUnit(iUnitID, iX, iY, UNITAI_ATTACK);
unit:JumpToNearestValidPlot();
unit:SetDeployFromOperationTurn(1);


This same issue never crops up for barb spawns. Is there a way to do this?
 
JumpToNearestValidPlot() doesn't consider hostile territory as "a valid plot".
 
Back
Top Bottom