[NFP] Improvement Properties

Frinckles

Chieftain
Joined
Oct 24, 2016
Messages
3
Hi, just wondering how one would record coordinates of tiles and then have things things like explosions happen to them.

So for example, we give a Military Engineer a bouncing-betty command that essentially does nothing. The player uses it outside of their borders and the coordinates for the tile are passed to something else that handles them. How do you make a function that can keep track of multiple tiles (a table I'm guessing?) and explode when the tile is entered?

Thanks for any info.
 
Plots can be directly given properties via lua in a GameplayScript. This property persists through game saves and reloads. You first need an lua Plot Object before you can set the property for that plot, but once you have a Plot Object for a specific plot, you can set a property with a custom name and an assigned value for that property
Code:
PlotObject:SetProperty("CheeseburgerGreaseHoard", 1)
You can later check whether a given plot has been assigned that property or not
Code:
local CheeseburgerGrease = NewPlotObject:GetProperty("CheeseburgerGreaseHoard")
if (CheeseburgerGrease  ~= nil) then
     --this plot has already been given a "CheeseburgerGreaseHoard" value, do stuff
else
    --- this plot has never been given a "CheeseburgerGreaseHoard" value, do other stuff
end
You can also make SQL / XML modifiers that will react to whether or not a given plot has been assigned a given property by having a Requirement for Plot Property Matching.
 
Back
Top Bottom