If a spell is used to trigger an event, is the caster's plot location included as the plot info in the Event? Is there any handy way to set it up that it does?
I'm not quite sure what "spells" you're referring to, but if you have a CyUnit instance you can always get the CyPlot instance its occupying with CyUnit.plot(). If you need the map tile coordinates you use CyUnit.getX() and CyUnit.getY() respectively.
You're right. I'm working on a mod based on FFH2 - trying to do it as a module for RifE. I was hoping to use the Event mechanism to create a popup allowing the player to select one of four cities (similar to the Hyborems Whisper Spell in FFH2/RifE) but I need to keep track of where the spell which triggers the event is cast from.
Are spells "cast" by units, then? Because then you would surely have a CyUnit instance corresponding to that unit. As described above, you can get the CyPlot instance from that.
EventTriggeredData
CyPlayer.initTriggeredData
(
EventTriggerTypes eEventTrigger,
bool bFire,
int iCityId,
int iPlotX,
int iPlotY,
PlayerTypes eOtherPlayer,
int iOtherPlayerCityId,
ReligionTypes eReligion,
CorporationTypes eCorporation,
int iUnitId,
BuildingTypes eBuilding
)
Based on this I specified the cityID in the triggereddata for the event and should be able to send whatever info I need when casting a spell to trigger an event.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.