Spells Triggering Events

Lplate

Esus (Allegedly)
Joined
Feb 8, 2011
Messages
578
Location
Ireland
Hi,

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?

thanks
 
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.
 
Hi,

I found the information I was looking for at http://forums.civfanatics.com/showthread.php?t=309293 in a post by EmperorFool.

Spoiler :

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.

Spoiler :

iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_RELOCATE')
triggerData = pPlayer.initTriggeredData(iEvent, True, pCity.getID(), pCity.getX(), pCity.getY(), iPlayer, -1, -1, -1, -1, -1)


thanks as always for taking the time to try and explain python to a noob
 
Back
Top Bottom