Where the "Fail Quest if a rival completes first" conditions at? [Solved by workaround]

BlitzCon

Chieftain
Joined
Oct 25, 2014
Messages
20
Hi.
Apparently my quick/newbie question was too advanced to be answered, so I risk it and ask here:

I attempted to create a new Quest. Nothing too hard, just mostly copy-pasting and editing existing quests.
And everything worked. Well, all but one thing:

The quest does not fail if a rival completes it first.

So I tried to look where that condition lies in the files, and, to my great confusion, I failed to find that condition from any quest. Despite the fact that I know that most quests fail when a rival fulfills the condition of Building Units/Buildings first. Hell, most of the Quests do not even have an expire python check at all!

So, my not-so-apparently-quick question would be: in which file and where the "fail if rival first" conditions are so that I can copy->paste->edit one for my quest?


Some may notice that this got posted elsewhere already. Those places were unintentional, I have no idea how this thread could possibly get to wrong forum repeatedly.
 
Well, went around the issue by recreating the condition as an expire check, like this:

def expireSpymaster1(argsList):
iEvent = argsList[0]
kTriggeredData = argsList[1]
iSpy = CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_SPY')
iSpiesRequired = gc.getWorldInfo(gc.getMap().getWorldSize()).getDefaultPlayers()
for iPlayer in range(gc.getMAX_CIV_PLAYERS()):
loopPlayer = gc.getPlayer(iPlayer)
if loopPlayer.isAlive() and iPlayer != kTriggeredData.ePlayer:
if loopPlayer.getUnitClassCount(iSpy) > (iSpiesRequired - 1):
return true

return false


This worked just fine.
Though I still would like to know where the original Quests have that specific condition saved.
 
It looks to me like quest failure is done in concert between the quest event and the completion events. A quest requires 2 triggers: beginning the quest and completing the quest, and 1+X events: beginning the quest and X outcomes for the quest.

The beginning event (not its trigger) needs to have <bQuest> set to 1. The trigger for the completion events needs to have <bGlobal> set to 1 and the beginning event as a <PrereqEvents>. The outcome events need to have <bQuest> set to 0, <bGlobal> set to 1, and a <ClearEvents> set to clear the beginning event.

The combination of <bGlobal> on the completion trigger and <bGlobal> and <ClearEvents> on the outcome events is what causes everyone else to fail the quest. <bGlobal> on the completion trigger means anyone can do the quest once the original event has happened. <bGlobal> on the outcome event means that once that event happens, it clears the original quest-beginning event for everyone, so no one else can complete it. That causes the failure.

I would check all of those areas, and if you are still having trouble, post your XML for the events.
 
The beginning event (not its trigger) needs to have <bQuest> set to 1. The trigger for the completion events needs to have <bGlobal> set to 1 and the beginning event as a <PrereqEvents>. The outcome events need to have <bQuest> set to 0, <bGlobal> set to 1, and a <ClearEvents> set to clear the beginning event.

The combination of <bGlobal> on the completion trigger and <bGlobal> and <ClearEvents> on the outcome events is what causes everyone else to fail the quest. <bGlobal> on the completion trigger means anyone can do the quest once the original event has happened. <bGlobal> on the outcome event means that once that event happens, it clears the original quest-beginning event for everyone, so no one else can complete it. That causes the failure.

Thanks for this, I´ll have to try that.
 
Back
Top Bottom