• 🏆 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] Quest trigger

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2009
Messages
49
I know the basics of the quest triggers, i just can't figure out how on some RPGS and stuff that when you right click or w/e on a computer's unit that has a giant yellow ! on the top of it, it will give you a quest and do the quest and when you come back click him again and it will finish quest and give you xp/gold

how can this be done?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
First create the exclamation mark and save it to a variable.

  • Untitled Trigger 038
    • Events
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the overhead of Paladin 0142 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Set Temp_Effect_Array[0] = (Last created special effect)
Then use this trigger for getting the quest:

  • Quest Give
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set Temp_Loc_1 = (Position of (Triggering unit))
      • Set Temp_Group_1 = (Units within 512.00 of Temp_Loc_1 matching (((Matching unit) is A Hero) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group_1) Greater than 0
        • Then - Actions
          • Quest - Create a Optional quest titled asgasgf with the description adfAFD, using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Quest - Enable (Last created quest)
          • Quest - Mark (Last created quest) as Discovered
          • Quest - Flash the quest dialog button
          • Quest - Display to (All players) the Quest Discovered message: drhdfh
          • Special Effect - Destroy Temp_Effect_Array[0]
          • Trigger - Turn on Quest Coplete <gen>
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
When the quest giver is selected, it checks if there are heroes near it. It sets up quest requirments and stuff, and removes the exclamation mark.

Then you do the quest, like kills some baddies. You could detect when everything is killed and then create the exclamation mark again.

  • Quest Complete
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set Temp_Loc_1 = (Position of (Triggering unit))
      • Set Temp_Group_1 = (Units within 512.00 of Temp_Loc_1 matching (((Matching unit) is A Hero) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group_1) Greater than 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Quest - Mark (Last created quest) as Completed
          • Quest - Display to (All players) the Quest Completed message: fcjcjh
          • Special Effect - Destroy Temp_Effect_Array[0]
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
And this copletes the quest. BTW, don't use "last created quest", save the quest into a variable. You could use "unit enters region" instead of selecting the quest giver.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a region at the quest giver, then use "unit enters region" event.

I'm sure you can find leaderboard tutorials in the tutorials section.

You can create a boolean, "quest x discovered", and then do IF/THEN/ELSE thingy where you check the boolean. Copy the stuff in the Quest Give trigger to THEN branch, and the stuff in Quest Complete to ELSE branch. Use "quest x discovered" equal to false in IF.
 
Last edited:
Level 4
Joined
Sep 25, 2009
Messages
49
Ughhh okay. I just can't figure out how you got "(Number of units in Temp_Group_1) Greater than 0" I can't find a Number of units shit in the conditions :(
 
Level 4
Joined
Sep 25, 2009
Messages
49
Are the custom scripts required for this trigger, cause im getting about 5 errors when i try to save from the custom scripts.....

edit: i removed the custom scripts, and when i selected my hero, and went to the guy he has no ! mark on him and as soon as i got near him the quest started, i wanted it when you had to click him or w/e then the quest would start.
 
Level 4
Joined
Sep 25, 2009
Messages
49
I copyed and paste off of your trigger, But anyways here it is.

  • Create quest
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set temp_loc_1 = (Position of (Triggering unit))
      • Set temp_group_1 = (Units within 512.00 of (Center of (Playable map area)) matching (((Triggering unit) is A Hero) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in temp_group_1) Greater than 0
        • Then - Actions
          • Cinematic - Turn cinematic mode On for (All players)
          • Cinematic - Disable user control for (All players)
          • Cinematic - Clear the screen of text messages for (All players)
          • Unit - Create 2 footman for Player 11 (Dark Green) at (Center of (Playable map area)) facing Default building facing degrees
          • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Apply Camera 001 <gen> for Player 1 (Red) over 2.00 seconds
          • Wait 2.00 seconds
          • Cinematic - Send transmission to (All players) from (Last created unit) named Mountain King: Play No sound and display Come on men! We mus.... Modify duration: Add 2.00 seconds and Wait
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • Unit Group - Order (Units in (Playable map area)) to Attack-Move To (Player 1 (Red) start location)
          • Wait 0.50 seconds
          • Quest - Create a Optional quest titled Dwarve's Troubles with the description The Mountain King a..., using icon path ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
          • Quest - Mark (Last created quest) as Discovered
          • Quest - Flash the quest dialog button
          • Wait 0.01 seconds
          • Cinematic - Turn cinematic mode Off for (All players)
          • Cinematic - Enable user control for (All players)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_Temp_Group_1)
          • Custom script: call RemoveLocation(udg_Temp_Loc_1)
and also how do i make it so that players have to click the unit insted of getting near him...?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You might want to change the condition to unit comparison, "(triggering unit) equal to *quest giver*"

That unit type comparison was not such a good idea, sorry about that.

Custom scripts are case-sensitive. Use capital letters in variable names if you are using them in custom script. There's a difference between

temp_loc and Temp_Loc
 
Level 4
Joined
Sep 25, 2009
Messages
49
Alright done, but now there is still no ! over the head of the quest giver, and the quest doesn't work anymore if i click on him or go near him :( My quest give trigger is:

  • Create quest
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to Mountain King 0016 <gen>
    • Actions
      • Set temp_loc_1 = (Position of (Triggering unit))
      • Set temp_group_1 = (Units within 512.00 of (Center of (Playable map area)) matching (((Triggering unit) is A Hero) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in temp_group_1) Greater than 0
        • Then - Actions
          • Cinematic - Turn cinematic mode On for (All players)
          • Cinematic - Disable user control for (All players)
          • Cinematic - Clear the screen of text messages for (All players)
          • Unit - Create 2 footman for Player 11 (Dark Green) at (Center of (Playable map area)) facing Default building facing degrees
          • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
          • Camera - Apply Camera 001 <gen> for Player 1 (Red) over 2.00 seconds
          • Wait 2.00 seconds
          • Cinematic - Send transmission to (All players) from (Last created unit) named Mountain King: Play No sound and display Come on men! We mus.... Modify duration: Add 2.00 seconds and Wait
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • Unit Group - Order (Units in (Playable map area)) to Attack-Move To (Player 1 (Red) start location)
          • Wait 0.50 seconds
          • Quest - Create a Optional quest titled Dwarve's Troubles with the description The Mountain King a..., using icon path ReplaceableTextures\CommandButtons\BTNHeroMountainKing.blp
          • Quest - Mark (Last created quest) as Discovered
          • Quest - Flash the quest dialog button
          • Wait 0.01 seconds
          • Cinematic - Turn cinematic mode Off for (All players)
          • Cinematic - Enable user control for (All players)
        • Else - Actions
          • Custom script: call DestroyGroup(udg_temp_group_1)
          • Custom script: call RemoveLocation(udg_temp_loc_1)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Set temp_group_1 = (Units within 512.00 of (Center of (Playable map area)) matching (((Triggering unit) is A Hero) Equal to True))
->

  • Set temp_group_1 = (Units within 512.00 of (temp_loc_1) matching (((Matching unit) is A Hero) Equal to True) and ((Matching unit) Not equal to (Triggering unit))

  • Untitled Trigger 038
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the overhead of Paladin 0142 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Set Temp_Effect_Array[0] = (Last created special effect)
^Creates the exclamation mark.
 
Level 4
Joined
Sep 25, 2009
Messages
49
Woot it works exactly how i wanted it, thank you man!

now just to find a better way of doing the hero selections on the other thread >< and how to add models xD
 
Level 4
Joined
Sep 25, 2009
Messages
49
Well...it works fine other then the fact that someone across the map can make the destroy effect happen. but it doesn't accept the quest, how do i make it so the person has to be IN RANGE for the special effect to be destroyed?
 
Status
Not open for further replies.
Top