WHoward's Pick 'N' Mix Mods

Joined
Jun 2, 2015
Messages
915
Location
Santos, Brazil
I am sorry? Shouldn't it be using the icon below instead of the Great Engineer's? It's clearly not what's show in the screenshot you provided.

(Please note you can only get it to look like this if you spawn the unit before Industrial era, in the right era it looks just like your image).
Tested with your DLL, issue persists. Also, just noticed I said Great Merchant instead of Great Engineer - damn people with brown suits and hats, y'all look the same to me! Sorry about that, still, the error is there.
 

joeandraw

Chieftain
Joined
Apr 20, 2016
Messages
10
hey,i use DLL - Various Mod Components - 34 Civs for YNAEMP,it replace community patch and i cant get it work with most of JFD mod,is there any compability mod?
 

dilophosaur

Prince
Joined
Dec 9, 2013
Messages
511
No. Some JFD's civs require CP to work, but not VMC :)
 

dilophosaur

Prince
Joined
Dec 9, 2013
Messages
511
Yes, it is different. Maybe because of the .dll :p
 

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,601
Location
Near Portsmouth, UK

Serp

King
Joined
Apr 1, 2015
Messages
650

Serp

King
Joined
Apr 1, 2015
Messages
650
okay thanks, I think this means V3 is enough.. although I don't know how it was before.
But since I will use the latest DLL I think I don't need to know how it was before :D
Ah... now I see what you ment.. you completly removed the previous AI-Smart Mod from DLL ?!
You should add a note at your picknmix website, that this mod only works until version 84.

Was it really necessary to remove it?
Because a friend of mine recently complaint about AI is lousy at Emperor but unbeatable at Immortal in my modpack. Since the only AI changing thing is the AI-Smart mod the plan now was to let him try AI-SmartV3, and if this is not better, use AI-Smart with only military tactic changes active....
But that plan is not possible without the choosable parts of Smart-AI mod =/
 

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,601
Location
Near Portsmouth, UK
Feel free to rewrite it if you have a better approach and/or the time to do it.
 

Serp

King
Joined
Apr 1, 2015
Messages
650
Feel free to rewrite it if you have a better approach and/or the time to do it.
I already did, is not that difficult (maybe there is also a better way)... but it is really important, because every move with a recon unit lags for half a second wich is not good.

I also thought about removing database and lowering the constant values to minimize loading losses, so no database is needed...


But I guess the following is something you could add (changes bold, new spaces seems to be messed up...):
Spoiler :
Code:
--
-- Scouting XP cache helpers
--

local modDB = Modding.OpenSaveData() -- using database causes a small lag everytime a recon discovers a tile first... we use databse only to not loose scoutingXP when loading a savegame...
local cachedScoutingXp = {}
[B]local updateneeded = 0[/B]

function GetKey(iPlayer, iUnit)
	return string.format("SCOUTING_XP_%i_%i", iPlayer, iUnit)
end

function GetScoutingXp(iPlayer, iUnit)
	if (cachedScoutingXp[iPlayer] == nil) then
		cachedScoutingXp[iPlayer] = {}
	end
	
	if (cachedScoutingXp[iPlayer][iUnit] == nil) then
		cachedScoutingXp[iPlayer][iUnit] = (modDB.GetValue(GetKey(iPlayer, iUnit)) or 0)
	end
	
	return cachedScoutingXp[iPlayer][iUnit]
end

function SetScoutingXp(iPlayer, iUnit, iXp, bCommit)
	cachedScoutingXp[iPlayer][iUnit] = iXp
	
	if (bCommit [B]and updateneeded==1[/B]) then
		-- Calls to modDB are expensive,
		-- so we save them all up to the movement onto the tile
		-- as opposed to when every tile is revealed
		modDB.SetValue(GetKey(iPlayer, iUnit), iXp)
                [B]updateneeded = 0[/B]
	end
end

function ChangeScoutingXp(iPlayer, iUnit, iXp)
        [B]updateneeded = 1[/B]
	SetScoutingXp(iPlayer, iUnit, GetScoutingXp(iPlayer, iUnit) + iXp, false)
end

function UpdateScoutingXp(iPlayer, iUnit)
	local iScoutingXp = GetScoutingXp(iPlayer, iUnit)
	
	if (iScoutingXp >= iScoutingXpAccumulated) then
		local pUnit = Players[iPlayer]:GetUnitByID(iUnit)
		local iRealXp = math.floor(iScoutingXp / iScoutingXpDivisor)
		
		pUnit:ChangeExperience(math.max(0, math.min(iRealXp, iScoutingXpLimit - pUnit:GetExperience())))
		
		if (pUnit:GetExperience() >= iScoutingXpLimit) then
			pUnit:SetHasPromotion(iXpForScoutingPromotion, false)
			iScoutingXp = 0
		else
			iScoutingXp = iScoutingXp - (iRealXp * iScoutingXpDivisor)
		end
                [B]updateneeded = 1[/B]
	end
    SetScoutingXp(iPlayer, iUnit, iScoutingXp, true)
end

function OnUnitSetXY(iPlayer, iUnit, iX, iY)
	if (iPlayer >= 0 and iPlayer <= iMaxMajor) then
		if (Players[iPlayer]:GetUnitByID(iUnit):IsHasPromotion(iXpForScoutingPromotion)) then
			UpdateScoutingXp(iPlayer, iUnit)
		end
	end
end
GameEvents.UnitSetXY.Add(OnUnitSetXY)

function OnUnitPrekill(iPlayer, iUnit, _, _, _, bDelay, _)
	if (not bDelay and GetScoutingXp(iPlayer, iUnit) ~= 0) then
                [B]updateneeded = 1[/B]
		SetScoutingXp(iPlayer, iUnit, 0, true)
	end
end
GameEvents.UnitPrekill.Add(OnUnitPrekill)


--
-- Tile reveal event handlers
--

function OnTileRevealed(iPlotX, iPlotY, iTeam, iFromTeam, bFirst, iPlayer, iUnit)
    if (bFirst and iPlayer >= 0 and iPlayer <= iMaxMajor) then
        if (Players[iPlayer]:GetUnitByID(iUnit):IsHasPromotion(iXpForScoutingPromotion)) then
			local pPlot = Map.GetPlot(iPlotX, iPlotY)
			
			-- Only land or lakes, but not NWs (as they are handled below)
			if (((not pPlot:IsWater()) or pPlot:IsLake()) and (not pPlot:IsNaturalWonder())) then
				ChangeScoutingXp(iPlayer, iUnit, iScoutingXpForTile)
			end
		end
	end
end
GameEvents.TileRevealed.Add(OnTileRevealed)

function OnNaturalWonderDiscovered(iTeam, iFeature, iX, iY, bFirst, iPlayer, iUnit)
	if (bFirst and iPlayer >= 0 and iPlayer <= iMaxMajor) then
		if (Players[iPlayer]:GetUnitByID(iUnit):IsHasPromotion(iXpForScoutingPromotion)) then
			ChangeScoutingXp(iPlayer, iUnit, iScoutingXpForNW)
		end
	end
end
GameEvents.NaturalWonderDiscovered.Add(OnNaturalWonderDiscovered)
 

tomoscar

Chieftain
Joined
Feb 11, 2008
Messages
5
Thanks for these mods. A comment to the tunnel mod: If a unit ends in a tunnel, it is hurt similar to a helicopter that ends on a mountain. This causes caravans who uses a tunnel to get killed. Since yo have no control of a caravan's movement, it would be nice if ending in a tunnel was safe.
 

kekec

Chieftain
Joined
Nov 24, 2015
Messages
2
whoward, I hope you still look at this thread:

First of all - thanks for all the sweet mods!
Second: I've encountered a problem when using your DLL, I hope you can help me fix it.
I'm using a mod that has unique promotions and I've noticed that when your DLL is enabled the <HPHealedIfDestroyEnemy> promotion doesn't work. Even the in-game PROMOTION_PARTIAL_HEAL_IF_DESTROY_ENEMY stops working and only when your DLL is enabled. I've tried looking into your lua and sql files and I haven't seen anything that would disable it.

Perhaps you have an idea why this would be happening?

Thanks in advance.
 

Serp

King
Joined
Apr 1, 2015
Messages
650
Hi whoward,
in case you come back some time, here is a bugreport for two of your picknmixmods:
Global - 3 Units Per City (v 1) + Units - Population + Enemy captures razing city = Crash

I don't know exactly when a population unit is spawned (before or after AIs turn), but the endresult of the turn is (if you disable stacking), that a population unit owned by me is spawned next to the just captured AI city. The city belongs to the AI, so I don't fully understand, why the population now belongs to me.
One way to fix it (more a workaround) would be to change in UnitsPopulation.lua the line to init the population unit from:
local pUnit = pPlayer:InitUnit(iPopulationType, iX, iY)
to:
local pUnit = pPlayer:InitUnit(iPopulationType, iX+x, iY+y)
so any coordinates that are NOT the just captured city.

A more professional way would be of course to fix the dll for stacking mod.
I can imagine that the stacking mod is crashing, cause the game is trying to place a population unit owned by me, on an enemy city.
At least fix it that way, that this won't lead to a crash.
And maybe fix population mod, so the population that spawned do belong to the AI and not to me, if he just capture the city.

edit:
Beside the crash from stacking mod (which needs fix just in case something similar happens because of other reasons), I think it is the SetPopulation Event which is used in the population mod. It is fired when the city gets captured. But in this cause it should not spawn a population.

edit2:
The workaround I use now, is to check if on the cityplot are units from another player we are in war with. If yes, do not spawn population, cause it is likey that the city was captured.
 
Last edited:

beetle

Deity
GOTM Staff
Joined
Mar 19, 2004
Messages
6,314
Location
Frederick, MD
EDIT: Never mind! I had loaded but not actually enable the mode. When it is active, there is a nice big “< Start Position >” in the middle top of the screen — it is hard to miss! Very nice!

How does one use “Rotate Start Positions”? I seem to have it loaded correctly, but it looks like the usual start and I am not finding any options other than to move my starting Settler and Warrior. The menus look the same, and I do not see any UI buttons other than the usual ones. OTOH, I do not know know what I am looking for, and Civ5 is rather infamous for having clickable targets that do not look like active UI components. Is there a keystroke. I am on Mac, if that makes a difference.

Also, if I pass on a choice, will it cycle back around?
Yes!

Sorry to ask a question that I am sure has asked before. I did trying using the forum search function, but I guess I was not clever enough. Thanks!
 
Last edited:

Kobjante

Chieftain
Joined
Mar 28, 2016
Messages
37
Hii! I love the herdsman unit! I really would like to see a unit that could "steal" plantations resources from one place to another. Something like a planter. Besides, can you update the prospector to BNW version? I can't find mineral or strategic resources with the prospector? Many thanks for reading me.
 
Top Bottom