DLL - Lua API requests

Lots of requests, I'll look at them soon enough. I didn't test those additions, JFD, so test them and let me know if they work (they may also need some LUA to show the yield changes – if so, I can expose them to lua).

Well, the LocalHappiness table definitely works, but not the LocalYieldChanges table - tried it with Food and Culture.
 
I used IGE to add the two buildings that interacted with each other to a city that otherwise only had the Palace, so there was definitely no change. I retested this morning just in case with the other yields, and still nothing, so yeah, 100% no-go.
 
Hm, the github link doesn't seem to work for me, but I wanted to ask if it was possible to allow negative modifiers from buildings - i.e. from the Policy_BuildingClassYieldModifiers table. The Policy_YieldModifiers table allows negative modifiers, but that table is added from the CP (hopefully other tables added by CP allow negative values as well), whereas the BuildingClassYieldModifiers table is a vanilla one, and so I expect is frustratingly hardcoded to ignore negative modifiers.

EDIT: Link started working, so added to the Issues tab. Assuming I did it as requested (never used Github before), I'll make future requests exclusive to there.
 
I will do some more testing of the damage adjusting promotions soon. In the meantime, any chance we could get:

pPlayer:GetIntrigueForCity(iPlayer, iCityID)

iPlayer being the ID of an enemy player to pPlayer, and iCityID being the ID of one of their Cities. Basically, instantly triggers a piece of Intrigue for a City like a Spy was stationed there. Intrigue being messages such as "Ramesses II is constructing Leaning Tower of Pisa in Thebes", "Shaka is plotting against Harald Bluetooth", etc. Ideally, its use would not require the presence of a Spy in the City.
 
I will do some more testing of the damage adjusting promotions soon. In the meantime, any chance we could get:

pPlayer:GetIntrigueForCity(iPlayer, iCityID)

iPlayer being the ID of an enemy player to pPlayer, and iCityID being the ID of one of their Cities. Basically, instantly triggers a piece of Intrigue for a City like a Spy was stationed there. Intrigue being messages such as "Ramesses II is constructing Leaning Tower of Pisa in Thebes", "Shaka is plotting against Harald Bluetooth", etc. Ideally, its use would not require the presence of a Spy in the City.

This can be done with just the cityid, as I can get the owner from the city value. Keep in mind that the spy mechanic of better/worse intrigue won't apply here, as there is no spy to weigh against.

G
 
Can we add a "Duration" field to UnitPromotions? The idea is that Duration represents a number of turns a Unit has a Promotion before it is automatically removed. For example, Duration 3 will cause the promotion to be automatically removed upon the beginning of the fourth turn of the unit's owner. Ideally, this would apply to promotions granted via pUnit:SetHasPromotion() as well as by other, "normal"
means.


Gazebo, did you ever get this added in? I try to keep up with the patch notes when I can, but I haven't seen it.

If you haven't, don't worry too much about it; I've been thinking about getting into the DLL side of things and might look into contributing to this myself.
 
Gazebo, did you ever get this added in? I try to keep up with the patch notes when I can, but I haven't seen it.

If you haven't, don't worry too much about it; I've been thinking about getting into the DLL side of things and might look into contributing to this myself.

Not yet - I didn't see it (when in doubt, feel free to PM me). I can help you with the DLL stuff, or I can try and do this. Either way.
G
 
If it's not too much trouble, I'd like to see if you can get it added in a patch sometime soon. I know you're quite busy, but I'm also trying to update several of my own mods and thus won't have time to get into the new land of DLL modding anytime soon.

Thanks in advance!
 
Player: DoForceDeFPact(otherPlayerID) doesn't appear to work; the method doesn't appear to exist. Maybe it was never implemented fully, or there's some setting I'm missing (though other methods on the OP work)
 
Player: DoForceDeFPact(otherPlayerID) doesn't appear to work; the method doesn't appear to exist. Maybe it was never implemented fully, or there's some setting I'm missing (though other methods on the OP work)

I've checked the function, the code is there, and theoretically functional, however it differs from all other extensions by virtue of being a void. I've reconfigured it to function like a standard lua hook, so it should work now.

G
 
I've checked the function, the code is there, and theoretically functional, however it differs from all other extensions by virtue of being a void. I've reconfigured it to function like a standard lua hook, so it should work now.

G

Using the latest CP DLL (7-12v2), trying to call the method still tells me that it doesn't exist:

Code:
attempt to call method 'DoForceDeFPact' (a nil value)
 
Hello :)

Do you think it would be possible to have some plot:GetNearest......() functions?

The first need I have would be a Plot:GetNearestCity() but it would be interesting to have a more generic function like Plot:GetNearest(CONSTANT_NEARESTTYPE_ASKED)
 
Hello :)

Do you think it would be possible to have some plot:GetNearest......() functions?

The first need I have would be a Plot:GetNearestCity() but it would be interesting to have a more generic function like Plot:GetNearest(CONSTANT_NEARESTTYPE_ASKED)

You can do that with Lua:
Code:
function FindNearestCity(pPlot, pPlayer)
	local iShortestDistance = 99999
	local pNearestCity = nil
	for pCity in pPlayer:Cities() do
		local iDist = Map.PlotDistance(pCity:GetX(), pCity:GetY(), pPlot:GetX(), pPlot:GetY())
		if (iDist < iShortestDistance) then
			iShortestDistance = iDist
			pNearestCity = pCity
		end
	end
	return pNearestCity
end

This code in particular searches for a City from a specific player, but you can (with a simple loop) easily make it search for any city.
 
Back
Top Bottom