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

"Build X Buildings"-Quest

Status
Not open for further replies.
Level 1
Joined
Nov 30, 2008
Messages
3
I've lately been trying to recreate a small misson or two from WC2, and while I'm very satisfied with the way the maps turned out, I'm having some problems with the Quests!

I've combined the two first missons of the Orc Campaign, meaning that the first Quest would be to construct 4 farms and a barracks, much like one of the early Human Missons in WC3. Anyhow.

I've made an Integer Variable named "Farm", and made the following trigger:

Event:
Unit - A unit enters Map (I've made a region covering the whole map)

Conditions:
Unit-Type of triggering unit equal to Pig-Farm

Action:
Set Farms = (Farms + 1)

Now, this part works nicely. Once I've constructed 4 farms, the Quest is complete. First off, is there an easier way to do this?

The problem, however, is in the Quest.
How should I go forward to make the computer keep count of the amount of farms? And how do I get the quest and objective-complete things to display properly when done? So far I've managed to make the objectives show up at the Quest Screen, but it refuses to look like the ingame quests, and the objectives wont mark as completed like they do ingame.

An easy-to-grasp explanation of how I should go forward to pull this off properly (or even better, if somebody would make the correct trigger(s) and post it, provided it's not all that advanced) would be greatly appreciated! :)
 
Level 5
Joined
Jan 3, 2008
Messages
164
If I got you right, then there is what you need:
  • Melee Initialization
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructed structure)) Equal to Farm
        • Then - Actions
          • Set Farm_count = ((Farm_count + 1) + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructed structure)) Equal to Barracks
        • Then - Actions
          • Set Barracks_count = (Barracks_count + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Barracks_count Equal to 1
          • Farm_count Equal to 4
        • Then - Actions
          • Quest - Mark (Last created quest requirement) as Completed
          • Quest - Mark (Last created quest) as Completed
        • Else - Actions
          • Do nothing
Barracks_count - Variable(integer)
Farm_count - Variable(integer)

You will have to create the quest conditions/creation of the quest and such yourself in another trigger, but you could insert the prize for completing the quest into the last "Then - Actions" bit. You will also need to store the quest when you create it in a variable, and then change "Last created quest" to the quest variable.

I hope that has helped you somehow, Im sure there are other ways to do it, but I don't have time to cover that.
 
Status
Not open for further replies.
Top