Kill city

Mike4Life

Chieftain
Joined
May 15, 2012
Messages
9
In a mod I'm working on, there's a function that has multiple actions in it, one of which is to destroy a city at a fixed coordinate. When I run the mod, all other code of the function works well except the code to destroy the city.
This is the code I have:
local plot = Map.GetPlot( 65, 43 );
local city = plot:GetPlotCity();
city:Kill();
What am I doing wrong?
 
Are you getting the right plot ?
 
Yeah. I checked the plot of city that's to be razed in world builder. Plus I have a separate script that spawns a unit in the same spot and that one works correctly.
 
The city you are trying to destroy is neither a Capitol nor a City-State is it?
 
pCity:Kill() almost certainly doesn't do what you think it does - it is called as part of the capture of a city and deletes defending units, breaks trade routes, puts out the fires from the attacks, etc

Try pPlayer: Disband(pCity) instead
 
Back
Top Bottom