Vicevirtuoso
The Modetta Man
The civ I'm working on has some code to automatically generate a Great Work when certain conditions are met. Since there are no direct means of creating Great Works, the process involves creating a dummy unit with unique names/Great Works, which, when the aforementioned conditions are met, is generated with InitUnit() and then immediately creates its Great Work.
This is the PushMission() call I'm using:
This works without a hitch for the human player, but it won't seem to fire for AI players. Is there a specific value for one of those arguments in the middle I need to set?
Also, I've read that the Game.SelectionListGameNetMessage is better for this, since it will work in multiplayer once it gets successfully implemented. But I haven't had any success making that work for either human or AI players.
Any suggestions regarding what I'm doing wrong?
This is the PushMission() call I'm using:
Code:
pGWUnit:PushMission(MissionTypes.MISSION_CREATE_GREAT_WORK, -1, -1, 0, 0, 0, 0, pGWUnit:GetPlot(), pGWUnit)
This works without a hitch for the human player, but it won't seem to fire for AI players. Is there a specific value for one of those arguments in the middle I need to set?
Also, I've read that the Game.SelectionListGameNetMessage is better for this, since it will work in multiplayer once it gets successfully implemented. But I haven't had any success making that work for either human or AI players.
Code:
Game.SelectionListGameNetMessage(GameMessageTypes.GAMEMESSAGE_PUSH_MISSION, MissionTypes.MISSION_CREATE_GREAT_WORK, pGWUnit:GetPlot():GetX(), pGWUnit:GetPlot():GetY(), 0, false, false)
Any suggestions regarding what I'm doing wrong?