• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Quest problem- Help!

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
Hello everyone!

My current project had a lot of bugs in t he past, but I have managed to fix a majority of them. But this particular trigger is the one I don't understand.

Basically it's a trigger that counts how many units of a particular unit-type the hero has killed, and when those kills reach a certain number, the hero is to be given an item and the player should be be notified with a Quest Update.

The weird thing is, when the hero has killed the sufficient number of creeps, the Quest Update text is shown but the item is neither created nor given to the hero.

Please help me fix this problem.


  • Unit Kill
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Hero = (Killing unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QuestOnBoolean[1] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Creep_Counter[1] Greater than or equal to 5) and ((Creep_Counter[2] Greater than or equal to 3) and (Creep_Counter[3] Greater than or equal to 2))
            • Then - Actions
              • Set Temp_Point = (Position of (Triggering unit))
              • Item - Create Quest Note at Temp_Point
              • Set Quest_Note = (Last created item)
              • Hero - Give Quest_Note to Hero
              • Custom script: call RemoveLocation(udg_Temp_Point)
              • Quest - Display to (All players) the Quest Completed message: Requirements met! G...
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Triggering unit)) Equal to C_Wolf
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Creep_Counter[1] Less than 4
                    • Then - Actions
                      • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
                      • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + ((String(Creep_Counter[1])) + /5))
                      • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
                    • Else - Actions
                      • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
                      • Quest - Mark Quest_Requirement[9] as Completed
                      • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + 5/5)
                      • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Triggering unit)) Equal to C_GiantWolf
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Creep_Counter[2] Less than 2
                        • Then - Actions
                          • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
                          • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + ((String(Creep_Counter[2])) + /3))
                          • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
                        • Else - Actions
                          • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
                          • Quest - Mark Quest_Requirement[10] as Completed
                          • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + 3/3)
                          • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Triggering unit)) Equal to C_ForestBear
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Creep_Counter[3] Less than 1
                            • Then - Actions
                              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
                              • Quest - Change the description of Quest_Requirement[11] to (Killed Forest Bears: + ((String(Creep_Counter[3])) + /2))
                              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
                            • Else - Actions
                              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
                              • Quest - Mark Quest_Requirement[11] as Completed
                              • Quest - Change the description of Quest_Requirement[11] to (Killed Giant Forest Wolves: + 2/2)
                              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
                        • Else - Actions
        • Else - Actions


I will give credits to those that help me, and of course some rep as appreciation =)

SOLVED!
 
Last edited:
Level 20
Joined
Apr 14, 2012
Messages
2,901
How about try setting the Last Created item into a variable.Then using your new variable for the trigger.

Okay... I edited the trigger now but it still won't work. At first though I thought there was something wrong with the first main condition but since the Quest Update is shown to the player I guess the condition isn't the problem...
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
I did that too... but still the same problem. Here's a picture:

2013-04-23%2015_52_30-Warcraft%20III.jpg


See here, at the moment the text is shown, that should be when the item is given to the killing unit. But it is not given to it... would using a JASS function make it better?
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
@Maker... I tried to create a unit at TempPoint... weird enough it didn't appear; I wonder why.

Also, after I post the map, a few things you should note:
The intro cinematic is skippable, just press ESC.

When in-game after the intro, type go to go immediately to the NPC. Once there, take the quest, click on Grade D, then select The Hunt. After which, kill the preplaced units...

The problem trigger is the one in the category The Bowman, namely the trigger named "Unit Kill"

Anyways, here is the map:
 
Last edited:
Level 30
Joined
Nov 29, 2012
Messages
6,637
Hmmm... this might sound odd but is the item set to Auto use when acquired because there is an option in WE in object editor for items that makes the item Auto Use when acquired..

And one more question:

Does your quest still says complete even you have the item? If yes, your item is set to Auto Use when acquired....
 
Level 4
Joined
Jan 27, 2010
Messages
133
This is an interesting display of what can happen in a complex map when you combine practices such as nested if's and conditionless triggers.

The QUEST FINNISHED thing doesn't run because you kill the last critter, it runs on the next dying unit (and for some reason, units are dying all the time). Thus, there is no killing unit.

This should solve your problems (the important parts are: if-clause last in trigger):
  • Unit Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • QuestOnBoolean[1] Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to C_Wolf
          • (Unit-type of (Triggering unit)) Equal to C_GiantWolf
          • (Unit-type of (Triggering unit)) Equal to C_ForestBear
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_ForestBear
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[3] Less than 1
            • Then - Actions
              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
              • Quest - Change the description of Quest_Requirement[11] to (Killed Forest Bears: + ((String(Creep_Counter[3])) + /2))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
            • Else - Actions
              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
              • Quest - Mark Quest_Requirement[11] as Completed
              • Quest - Change the description of Quest_Requirement[11] to (Killed Giant Forest Wolves: + 2/2)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_GiantWolf
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[2] Less than 2
            • Then - Actions
              • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
              • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + ((String(Creep_Counter[2])) + /3))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
            • Else - Actions
              • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
              • Quest - Mark Quest_Requirement[10] as Completed
              • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + 3/3)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_Wolf
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[1] Less than 4
            • Then - Actions
              • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
              • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + ((String(Creep_Counter[1])) + /5))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
            • Else - Actions
              • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
              • Quest - Mark Quest_Requirement[9] as Completed
              • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + 5/5)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Creep_Counter[1] Greater than or equal to 5) and ((Creep_Counter[2] Greater than or equal to 3) and (Creep_Counter[3] Greater than or equal to 2))
        • Then - Actions
          • Game - Display to (All players) for 5.00 seconds the text: (Unit name: + (Name of (Killing unit)))
          • Hero - Create Quest Note and give it to (Killing unit)
          • Quest - Display to (All players) the Quest Completed message: Requirements met! G...
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
This is an interesting display of what can happen in a complex map when you combine practices such as nested if's and conditionless triggers.

The QUEST FINNISHED thing doesn't run because you kill the last critter, it runs on the next dying unit (and for some reason, units are dying all the time). Thus, there is no killing unit.

This should solve your problems (the important parts are: if-clause last in trigger):
  • Unit Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • QuestOnBoolean[1] Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to C_Wolf
          • (Unit-type of (Triggering unit)) Equal to C_GiantWolf
          • (Unit-type of (Triggering unit)) Equal to C_ForestBear
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_ForestBear
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[3] Less than 1
            • Then - Actions
              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
              • Quest - Change the description of Quest_Requirement[11] to (Killed Forest Bears: + ((String(Creep_Counter[3])) + /2))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
            • Else - Actions
              • Set Creep_Counter[3] = (Creep_Counter[3] + 1)
              • Quest - Mark Quest_Requirement[11] as Completed
              • Quest - Change the description of Quest_Requirement[11] to (Killed Giant Forest Wolves: + 2/2)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[3])) + Forest Bear(s) !))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_GiantWolf
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[2] Less than 2
            • Then - Actions
              • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
              • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + ((String(Creep_Counter[2])) + /3))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
            • Else - Actions
              • Set Creep_Counter[2] = (Creep_Counter[2] + 1)
              • Quest - Mark Quest_Requirement[10] as Completed
              • Quest - Change the description of Quest_Requirement[10] to (Killed Giant Forest Wolves: + 3/3)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[2])) + Giant Wolf(ves)!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to C_Wolf
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Creep_Counter[1] Less than 4
            • Then - Actions
              • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
              • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + ((String(Creep_Counter[1])) + /5))
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
            • Else - Actions
              • Set Creep_Counter[1] = (Creep_Counter[1] + 1)
              • Quest - Mark Quest_Requirement[9] as Completed
              • Quest - Change the description of Quest_Requirement[9] to (Killed Forest Wolves: + 5/5)
              • Game - Display to (All players) the text: (You have killed + ((String(Creep_Counter[1])) + Wolf(ves)!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Creep_Counter[1] Greater than or equal to 5) and ((Creep_Counter[2] Greater than or equal to 3) and (Creep_Counter[3] Greater than or equal to 2))
        • Then - Actions
          • Game - Display to (All players) for 5.00 seconds the text: (Unit name: + (Name of (Killing unit)))
          • Hero - Create Quest Note and give it to (Killing unit)
          • Quest - Display to (All players) the Quest Completed message: Requirements met! G...
          • Trigger - Turn off (This trigger)
        • Else - Actions

Woah... I never considered that =)

Thanks themerion... I will try to do that as soon as possible!

UPDATE: The trigger now works thanks to themerion. This problem is now SOLVED!
 
Status
Not open for further replies.
Top