GetNumFriendlyUnitsOfType fail.

JFD

Kathigitarkh
Joined
Oct 19, 2010
Messages
9,132
Location
The Kingdom of New Zealand
I'm trying to find a way to check that a plot has a (specific) civilian unit on the same tile as a combat unit. I was hoping "GetNumFriendlyUnitsOfType" would achieve this, but instead it returned "instance no longer exists." What precisely does this mean? Thanks for any help.
 
iCount = pPlot:GetNumFriendlyUnitsOfType(pUnit) sets iCount to be the number of units on the plot that are the same domain and combat type as the given unit. Note that pUnit doesn't have to be on the plot.

At a guess for the error message, you didn't pass a valid unit object.
 
Back
Top Bottom