• 🏆 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!

trigger fixing help

Status
Not open for further replies.
Level 3
Joined
Apr 5, 2013
Messages
30
I made a quest trigger
  • The basic spys must di
    • Events
      • Unit - |cffffcc00Basic Questgiver Skypper|r 0023 <gen> Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to The basic spys must die!
        • Then - Actions
          • Game - Display to (All players) the text: The basic spys must...
          • Set Player = (Owner of (Buying unit))
          • Quest - Create a Required quest titled The basic spys must... with the description I need you to kill ..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Quest - Disable (Last created quest)
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Quest - Enable (Last created quest)
          • Custom script: endif
          • Trigger - Turn on Kill Counter <gen>
        • Else - Actions
and when I get the quest my kill count trigger doesnt show me when I kill someone
  • Kill Counter
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Rifleman 0022 <gen>
    • Actions
      • Set RiflemenCounter = (RiflemenCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 1
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 1/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 2
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 2/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 3
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 3/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 4
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 4/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 5
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 5/5
          • Quest - Mark Quest as Completed
          • Quest - Change the description of Quest to They wont be a prob...
          • Quest - Create a quest requirement for Quest with the description Return back to Basi...
          • Set QuestReq2 = (Last created quest requirement)
          • Quest - Flash the quest dialog button
          • Trigger - Turn off (This trigger)
        • Else - Actions
help please help me fix these triggers
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
It won't work because
  • Or - Any (Conditions) are true
  • Conditions
  • (Triggering unit) Equal to Rifleman 0022 <gen>
shows only 1 specific unit. You will either need to list all units that will add a kill credit for the quest or use "unit type of (Triggering unit) equal to Rifleman" condition.

It may also not show because in your initial trigger you create a quest and refer to it as "last created quest", then in your kill trigger you refer to it as "QuestReq1". Unless you set that in different trigger, QuestReq1 will return null.
At 5/5 kills you start refering to it as "Quest" instead.

Also, I didn't try this, but when I saw your kill credit trigger, I immediately thought about how to improve it.

#1
In your first trigger you use "GetLocalPlayer()" so I assume it is multiplayer game. Can more than 1 player do this quest at a time? Then you will need to keep each players kill credit, right now you would be able to check only 1 player (or 1 player could do the quest for all other players who have the quest active at that time)

#2
Why don't you create a Quest Requirement for the quest?

#3
Won't this be more efficient?
  • Triggers
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
    • Actions
      • Set RiflemanCounter = (RiflemanCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemanCounter Greater than or equal to 1
          • RiflemanCounter Less than or equal to 4
          • (ThatQuest is completed) Equal to False
        • Then - Actions
          • Quest - Change the description of ThatQuest to (Riflemen slain + ((String(RiflemanCounter)) + /5))
        • Else - Actions
          • Quest - Change the description of ThatQuest to (Riflemen slain + ((String(RiflemanCounter)) + /5))
          • -------- do all the stuff you want 5/5 requirement to do (complete quest, etc.) --------
You save the number of killed riflemen into integer variable, then check if it is between 1 and 4 and if it is, you change the description into "integer/5" - thus if 4 are killed you get 4/5.
And finally, since this trigger fires by killing Rifleman, you will never have 0 Rifleman killed once you kill one. So if you kill a Rifleman and the kill credit is not between 1 and 4, then it obviously will be 5 (then you mark quest as completed, so it won't fire again as if 5 rifleman are killed if you kill 6th or more riffleman)
 
Level 7
Joined
Jan 22, 2013
Messages
293
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Rifleman

^^^^ That's your solution to the entire fix.
vvvvv That's your problem
Conditions

  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Triggering unit) Equal to Rifleman 0022 <gen>

If you didn't add all of the units for the contions, it will not detect them all, it could be that you just forgot to set all five of them.

My primary guess is that you did forget or did not know because you have it said from Conditions > If any

Meaning you had it set up for multiple pre-set units. Enjoy the Fix solutions.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
I guess Im late, the problem as other said is this trigger:

  • (Triggering unit) Equal to Rifleman 0022 <gen>
because Rifleman 0022 refers only to one unit.... and if you kill other Rifleman, it wil not work I suggest using the Unit types for they refer on a on classification of unit:

  • (Unit-type of (Triggering unit)) Equal to Rifleman
If you are having difficulties on what to use, Triggering Unit or Dying Unit. I suggest Triggering Unit because it is more faster than Dying Unit.


Sorry if I am late... :(
 
Level 7
Joined
Jan 22, 2013
Messages
293
I guess Im late, the problem as other said is this trigger:

  • (Triggering unit) Equal to Rifleman 0022 <gen>
because Rifleman 0022 refers only to one unit.... and if you kill other Rifleman, it wil not work I suggest using the Unit types for they refer on a on classification of unit:

  • (Unit-type of (Triggering unit)) Equal to Rifleman
If you are having difficulties on what to use, Triggering Unit or Dying Unit. I suggest Triggering Unit because it is more faster than Dying Unit.


Sorry if I am late... :(

Your beyond late, look at the dates on the posts. Nearly 10 days dude lol.
 
Level 3
Joined
Apr 5, 2013
Messages
30
  • The basic spys must di
    • Events
      • Unit - |cffffcc00Basic Questgiver Skypper|r 0023 <gen> Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to The basic spys must die!
        • Then - Actions
          • Game - Display to (All players) the text: The basic spys must...
          • Set Player = (Owner of (Buying unit))
          • Quest - Create a Required quest titled The basic spys must... with the description I need you to kill ..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Quest - Disable (Last created quest)
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Quest - Enable (Last created quest)
          • Custom script: endif
          • Trigger - Turn on Kill Counter <gen>
        • Else - Actions
thats my quest
  • Kill Counter
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
    • Actions
      • Set RiflemenCounter = (RiflemenCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 1
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 1/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 2
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 2/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 3
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 3/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 4
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 4/5
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 5
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 5/5
          • Quest - Mark Quest as Completed
          • Quest - Change the description of Quest to They wont be a prob...
          • Quest - Create a quest requirement for Quest with the description Return back to Basi...
          • Set QuestReq2 = (Last created quest requirement)
          • Quest - Flash the quest dialog button
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
this is a lot more efficient

also this quest is not MPI
  • Kill Counter
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rifleman
    • Actions
      • Set RiflemenCounter = (RiflemenCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RiflemenCounter Equal to 5
        • Then - Actions
          • Quest - Change the description of QuestReq1 to Riflemen slain 5/5
          • Quest - Mark Quest as Completed
          • Quest - Change the description of Quest to They wont be a prob...
          • Quest - Create a quest requirement for Quest with the description Return back to Basi...
          • Set QuestReq2 = (Last created quest requirement)
          • Quest - Flash the quest dialog button
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Quest - Change the description of QuestReq1 to (Riflemen slain = + ((String(RiflemenCounter)) + /5))
 
Status
Not open for further replies.
Top