• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Triggers, Quest: Kill 10 Footman

Status
Not open for further replies.
Level 3
Joined
Aug 27, 2019
Messages
44
Hi again. This time I need some help with basic trigger. I would like create simple quest with objective "Kill 10 Footman" for example.

What is easiest way to make quest like this? If possible with information about remaining targets. Like "9/10 Footman killed".

Post a working trigger from your own maps if possible.
 
Is that a not repeatable quest in singleplayer? Then one can use the built in quest-system to display them inside quest menu.
Which could look like that:
  • Create FootMen Quest
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Quest - Create a Required quest titled Footmen with the description Guldan Orders: Show..., using icon path ReplaceableTextures\CommandButtons\BTNFootman.blp
      • Set Quest_FootMen = (Last created quest)
      • Quest - Create a quest requirement for Quest_FootMen with the description Kills 0/10
      • Set Quest_FootMen_Req = (Last created quest requirement)
  • Footmen Killed
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
    • Actions
      • Quest - Change the description of Quest_FootMen_Req to ((Kills + (String((Execution count of (This trigger))))) + /10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Execution count of (This trigger)) Equal to 10
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Quest - Mark Quest_FootMen_Req as Completed
          • Quest - Mark Quest_FootMen as Completed
        • Else - Actions
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
You could also use an integer to count how many footmen have been killed to update the quest.
  • Quest Footmen
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set FootmenKilled = (FootmenKilled + 1)
      • If (FootmenKilled Equal to 1) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 2) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 3) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 4) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 5) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 6) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 8) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 9) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
      • If (FootmenKilled Equal to 10) then do (Trigger - Run Quest Footmen Update Message <gen> (checking conditions)) else do (Do nothing)
  • Quest Footmen Update Message
    • Events
    • Conditions
    • Actions
      • -------- 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FootmenKilled Equal to 1
        • Then - Actions
          • Quest - Change the description of FootmenQuestReq to Kill 10 Footmen (1 out of 10)
          • Quest - Display to (All players) the Quest Update message: Kill 10 Footman (1 out of 10)
        • Else - Actions
      • -------- 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FootmenKilled Equal to 2
        • Then - Actions
          • Quest - Change the description of FootmenQuestReq to Kill 10 Footmen (2 out of 10)
          • Quest - Display to (All players) the Quest Update message: Kill 10 Footman (2 out of 10)
        • Else - Actions
      • -------- 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FootmenKilled Equal to 3
        • Then - Actions
          • Quest - Change the description of FootmenQuestReq to Kill 10 Footmen (3 out of 10)
          • Quest - Display to (All players) the Quest Update message: Kill 10 Footman (3 out of 10)
        • Else - Actions
      • -------- 4 --------
      • -------- 5 --------
      • -------- 6 --------
 
Level 13
Joined
Nov 4, 2006
Messages
1,239
@Warseeker or you could use the "Concatenate String" function and directly use the integer to update, looks more or less like this then:

  • Quest Footmen
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set FootmenKilled = (FootmenKilled + 1)
      • Quest - Change the description of FootmenQuestReq to Kill 10 Footmen (Integer(FootmenKilled) out of 10)
      • Quest - Display to (All players) the Quest Update message: Kill 10 Footman (Integer(Footmenkilled) out of 10)
you may also want to add a condition on who exactly the footman belonged to or who killed it
 
Level 3
Joined
Aug 27, 2019
Messages
44
I still have a problem with this trigger. What I have at the moment:

  • Create quest
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set I_RequiredKillsMilitia = 4
      • Quest - Create a Required quest titled Kill Militia with the description Complete all main q..., using icon path ReplaceableTextures\CommandButtons\BTNMilitia.blp
      • Set Q_Militia = (Last created quest)
      • Quest - Create a quest requirement for Q_Militia with the description Kill 50 enemy Milit...
      • Set QR_Militia = (Last created quest requirement)
      • Quest - Display to (All players) the Quest Discovered message: |cffffcc00MAIN QUES...
  • Enemy Militia dies
    • Events
      • Unit - A unit owned by Player 6 (Orange) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Militia
      • (Unit-type of (Triggering unit)) Equal to Militia
    • Actions
      • Set I_RequiredKillsMilitia = (I_RequiredKillsMilitia - 1)
      • If (I_RequiredKillsMilitia Equal to 0) then do (Trigger - Run Victory <gen> (checking conditions)) else do (Do nothing)
I believe there is something wrong with my trigger and integers are not updating as they should. It is also possible that there is something wrong with Events / Conditions combination.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
I still have a problem with this trigger. What I have at the moment:

  • Create quest
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set I_RequiredKillsMilitia = 4
      • Quest - Create a Required quest titled Kill Militia with the description Complete all main q..., using icon path ReplaceableTextures\CommandButtons\BTNMilitia.blp
      • Set Q_Militia = (Last created quest)
      • Quest - Create a quest requirement for Q_Militia with the description Kill 50 enemy Milit...
      • Set QR_Militia = (Last created quest requirement)
      • Quest - Display to (All players) the Quest Discovered message: |cffffcc00MAIN QUES...
  • Enemy Militia dies
    • Events
      • Unit - A unit owned by Player 6 (Orange) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Militia
      • (Unit-type of (Triggering unit)) Equal to Militia
    • Actions
      • Set I_RequiredKillsMilitia = (I_RequiredKillsMilitia - 1)
      • If (I_RequiredKillsMilitia Equal to 0) then do (Trigger - Run Victory <gen> (checking conditions)) else do (Do nothing)
I believe there is something wrong with my trigger and integers are not updating as they should. It is also possible that there is something wrong with Events / Conditions combination.
I don't see anything wrong with your trigger. It must be something else that is causing the problem.
 
Level 3
Joined
Aug 27, 2019
Messages
44
I just found the solution. The trigger does not understand "Militia" as dying unit. When Militia dies it is actually "Peasant". No idea what is reason behind this.

SOLVED
 
Status
Not open for further replies.
Top