How to make a town capture finish a quest.

Users who are viewing this thread

Berserker Pride

Grandmaster Knight
Hey all,

I'm trying to make the capture of Curaw end a quest. So I used this conditions block.
[trp_kingdom_1_lord,"start",[(eq,"p_town_11","$g_talk_troop_faction",)],"You have won the day I can hardly believe it. Know that you have saved Swadia from certain defeat.","close_window",[
  (script_end_quest,"qst_capture_curaw"),
  (troop_add_gold,"trp_player",100000),
  (assign, "$g_force_peace_faction_1", "fac_kingdom_1"),
  (assign, "$g_force_peace_faction_2", "fac_kingdom_2")]], 
Now I'm having trouble finding anything that will recognize that the player has captured the town for swadia. I've also tried ",[(eq,"p_town_11","fac_kingdom_1",)] as well as "[(eq,""$g_center_taken_by_player_faction","p_town_11",)]
Does anyone know the correct identifier to finish a quest by capturing it for a faction? O also all three of those methods compiled fine it just didn't end the quest when I captured curaw and then talked to the king. It would just defalt to a check_quest_active dialogue line located below it.  So yea this line is the topmost one.

P.S. Im not sure if assigning the  "$g_force_peace_faction_1" will work either I haven't got the quest to end yet
 
uhm I'm talking from memory here but if you go through the mnu_town I think there's a bit there that checks when a battle is won, it might be in the mnu_siege or something similar tho.

It executes some code after a town/castle has been captured. You could run your finish quest code from there and it should work fine. Alternatively, you can call the dialog from there and use the operations block like you're doing now
 
Ok I got her figured now.  I kinda fluked out but I found the perfect line of code to use and just modified it a bit.
[(store_faction_of_party, ":center_faction", "p_town_11"),
          (eq, ":center_faction", "fac_kingdom_1"),(neg|check_quest_finished)]
So now this code in the conditions block of dialogue checks what faction town 11 is and when it is "fac_kingdom_1" the quest is finished.(assign, "$g_force_peace_faction_1", "fac_kingdom_1"),
  (assign, "$g_force_peace_faction_2", "fac_kingdom_2") seems to work fine as well within 72 hours kingdom 1 and 2 declare peace. I've got it set up so the kingdoms will never be at peace in the scripts unless this is called.  I hope this helps anyone else as well.
 
Back
Top Bottom