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

Status
Not open for further replies.
Level 19
Joined
Sep 14, 2007
Messages
1,538
I have a quest where you need to build 3 of the same building. However I do not know how to make it work more than once, and on top of that the trigger isn't even working for one construction of the quest heres what i have so far.


  • Build Pig Farm
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
      • Set Farm = (Last created quest)
      • Quest - Enable Farm
      • Quest - Mark Farm as Discovered
  • Build Pig Farm Complete
    • Events
      • Map initialization
      • Unit - A unit owned by Player 1 (Red) Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pig Farm
    • Actions
      • Set Farm = (Last created quest)
      • Quest - Mark Farm as Completed
+rep to anyone who can help.

Thanks.
 
Level 10
Joined
Mar 31, 2009
Messages
732
Uhh... Okay. The first chunk of code creates the quest, enables it, and marks it discovered.
The second chunk fires both during map initialization, and whenever a unit finished building something. It marks the quest completed.

So, it would be created during map initialization, then instantly marked completed by the second trigger.

Can you give us a bit more information on what you want the triggers to do?
 
Level 10
Joined
Mar 31, 2009
Messages
732
  • Build Pig Farm Complete
  • Events
  • Unit - A unit owned by Player 1 (Red) Finishes construction
  • Conditions
  • (Unit-type of (Triggering unit)) Equal to Pig Farm
  • (Number of living Pig Farm units owned by Player 1 (Red)) Greater than or equal to 3
  • Actions
  • Set Farm = (Last created quest)
  • Quest - Mark Farm as Completed
  • Trigger - Turn off (This trigger)
 
Level 5
Joined
Aug 7, 2007
Messages
117
  • Build Pig Farm
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
      • Set Farm = (Last created quest)
      • Quest - Enable Farm
      • Quest - Mark Farm as Discovered
You do not need to enable or mark it discovered, since it starts in that state.

  • Build Pig Farm Complete
    • Events
      • Map initialization
      • Unit - A unit owned by Player 1 (Red) Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pig Farm
    • Actions
      • Set Farm = (Last created quest)
      • Quest - Mark Farm as Completed
I see two problems with this second trigger. The first problem is, when the event "Map initialization" runs, there is no "Triggering Unit". As such, it should not have that event because it will ALWAYS fail it's conditional check.

Second, when you do Set Farm = (Last created quest), you are setting the quest you have labled "Farm" to the last created quest, which can be anything at all. When you set it the first time, as long as you never overwrite what you set it as, the variable "Farm" would always refer to "Housing and Hunger", however, you unset that when in the second action you set farm to the last created quest. You can eliminate that line and it should work fine.

  • Build Pig Farm
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Quest - Create a Required quest titled Housing and Hunger with the description Construct three Pig..., using icon path ReplaceableTextures\CommandButtons\BTNBasicStruct.blp
      • Set Farm = (Last created quest)
You do not need to enable or mark it discovered, since it starts in that state.

  • Build Pig Farm Complete
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Pig Farm
    • Actions
      • Quest - Mark Farm as Completed
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top