• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Method to test valid ranged target without unit?

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Hard to condense sensible question in thread title.

Basically, I want to test whether one plot is a potential ranged target for another plot, assuming a ranged unit without indirect fire. The complication is I want to do this before placing the ranged unit, so I can't do the test on a unit object.

Does anyone know if there is a reasonable way to do this? The code will run in Lua, although I can mod dll to expose new Lua method if it helps.
 
The code to determine if a unit can range strike at another plot, after removing all the checks for being a ranged unit, there being a target unit in the target plot, being at war with the target unit, etc, etc, boils down to

Code:
pFromPlot:CanSeePlot(pToPlot, iMyTeam, iMaxRange, -1)
 
Thanks! I missed that one for some reason...

... and that reason is the Firaxis Spaghetti Code Monster :eek:

1942245185_120007_340_xlarge.jpeg
 
Back
Top Bottom