[NFP] Is there a Disaster Triggering function for lua now?

Windflier

Chieftain
Joined
Dec 15, 2017
Messages
39
With the new Soothsayer unit added, I was hoping there would finally be a way to trigger nature disaster however we wish, but I can't find any info about it for now. Does anyone knows yet?
 
there are functions for that since GS IIRC.
 
try the firetuner files (.lpt ?), in the debug folder
 
try the firetuner files (.lpt ?), in the debug folder
First, thanks a lot, I found this function: GameRandomEvents.ApplyEvent(kEvent), which can trigger disaster whenever I want.
Second, I would like to set a peculiar location to the disaster happend, for what I tested, I found out it's just default to random location.
There is a paramate for the input though, simply called "Location", but what I can't understand is this variable is just a integer, not a dyadic array which is supposed to be represent as X and Y. Could you figure out what this paramate is used for?
 
from the .ltp file
Code:
kEvent.Location = reactor.PlotIndex
so it's a plot index, not the coordinates.

you can get the index from a plot object
Code:
pPlot:GetIndex()

or from the x,y coordinates (and the map width)
Code:
local g_iW, g_iH = Map.GetGridSize()
local index = (y * g_iW) + x
 
Back
Top Bottom