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

need help with quest system

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2009
Messages
49
well i got bored and made a quest system, but i cannot for the love of god figure out how to do a feature on it, which would be how to count the number of times a unit of xxx has died. so like you accept the quest, go out and kill 5 necromancers, how can i make the system count up how many you have killed?

here are my triggers, probably alot of bugs ;D

Quest mark (makes the ! mark ontop of unit)

  • Quest mark
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the overhead of Pandaren Brewmaster 0051 <gen> using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Set Quest_One_Mark[1] = (Last created special effect)
Quest 1 accept

  • Quest one accept
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Pandaren Brewmaster 0051 <gen>
      • (Owner of (Triggering unit)) Equal to (Random player from (All allies of Player 1 (Red)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of Pandaren Brewmaster 0051 <gen>)) Less than or equal to 10.00
        • Then - Actions
          • Special Effect - Destroy Quest_One_Mark[1]
          • Quest - Create a Optional quest titled Test quest one with the description Kill 5 necromancers, using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Set Quest_1 = (Last created quest)
          • Quest - Flash the quest dialog button
          • Trigger - Turn on Quest One KillCount <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
Quest 1 count killed necros (This is where i need help with)

  • Quest One KillCount
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Necromancer
    • Actions
      • Set Quest_One_Necrokillcount = (Quest_One_Necrokillcount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • -------if necros killed = to 5(need help here)--------
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of Pandaren Brewmaster 0051 <gen> using Objects\RandomObject\RandomObject.mdl
          • Set Quest_One_Mark[1] = (Last created special effect)
          • Trigger - Turn on Quest one return <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
Quest One Return

  • Quest one return
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Pandaren Brewmaster 0051 <gen>
      • (Owner of (Triggering unit)) Equal to (Random player from (All allies of Player 1 (Red)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of Pandaren Brewmaster 0051 <gen>)) Less than or equal to 10.00
        • Then - Actions
          • Player - Add 50 to (Triggering player) Current gold
          • Hero - Add 500 experience to (Triggering unit), Hide level-up graphics
          • Quest - Mark Quest_1 as Completed
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • (Owner of (Triggering unit)) Equal to (Random player from (All allies of Player 1 (Red)))
You coul change that to "belongs to an ally of player", it's under boolean.

A distance of 10 really really small. When in World Editor, enable grid, small. Those tiny squares are 32x32. You should set the distance to something like 256.

Read a tutorial about leaks, "Things that leak" is the thread.
 
Level 4
Joined
Sep 25, 2009
Messages
49
fixed both your comments, and i know about the leaks i just haven't finished the system yet, so why fix the leaks with a non-working system :)

and i still need help with the main problem...

edit: nevermind, i figured it out =), but any suggestions on how to make the system better is welcome!
 
Last edited:
Level 4
Joined
Sep 25, 2009
Messages
49
Well...The first quest i figured it out and it works without any bugs, but im trying a quest where you have to turn in an item and i cannot figure out how to get it working, it has somthing to do with the unit has an item of xxxx condition, not sure how to fix it =\ since the tut i saw on that does it the same way but it works...

  • Quest two accept
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Dark Wizard 0070 <gen>
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of Dark Wizard 0070 <gen>)) Less than or equal to 256.00
        • Then - Actions
          • Special Effect - Destroy Quest_One_Mark[2]
          • Quest - Create a Optional quest titled Scroll of Darkness with the description Find the Scroll of ..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Set Quest_1[2] = (Last created quest)
          • Quest - Flash the quest dialog button
          • Quest - Display to (All players) the Quest Discovered message: Quest "Scroll of Da...
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Quest two item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has Scroll of Darkness 0059 <gen>) Equal to True
    • Actions
      • Special Effect - Create a special effect attached to the overhead of Dark Wizard 0070 <gen> using Objects\RandomObject\RandomObject.mdl
      • Set Quest_One_Mark[2] = (Last created special effect)
  • Quest two return
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Target unit of issued order) Equal to Dark Wizard 0070 <gen>
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of Dark Wizard 0070 <gen>)) Less than or equal to 256.00
          • ((Triggering unit) has Scroll of Darkness 0059 <gen>) Equal to True
        • Then - Actions
          • Item - Remove Scroll of Darkness 0059 <gen>
          • Special Effect - Destroy Quest_One_Mark[2]
          • Player - Add 69 to (Triggering player) Current gold
          • Hero - Add 125 experience to (Triggering unit), Show level-up graphics
          • Quest - Mark Quest_1[2] as Completed
          • Quest - Display to (All players) the Quest Completed message: Quest "Scroll of Da...
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 4
Joined
Sep 25, 2009
Messages
49
Takes too much time to learn, which i don't really have. If i ever get some extra time ill learn a little and put w/e i learn into my map, like a loading message in JASS or w\e but for now i don't care =p, Anywho i still need help with quest 2.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
It was an easy transition for me. I just converted my GUI codes and looked at how they changed. If you want to make it even easier, install JNGP and it puts it in a format much more readable.

What part of quest 2 doesn't work? Try adding in a test message at the beginning of your trigger (outside the if/then) to see if it is launching to begin with.
 
Level 4
Joined
Sep 25, 2009
Messages
49
It's being held up at the triggering unit is holding an item of xxx ><

((Triggering unit) has Scroll of Darkness 0059 <gen>) Equal to True
 
Status
Not open for further replies.
Top