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

Help with 2 basic quests

Status
Not open for further replies.
Level 2
Joined
Apr 22, 2020
Messages
8
Hey guys been trying my best to get these two types of quests to work ive looked at a bunch of tutorials but still struggling, first post on these forums after a ton of lurking haha

so im trying to set up 2 things

1st im trying to create a time limit to creating a hero where if the hero isnt made by X the game is over

2nd im trying to make it so that once killing a set of specific units already in the map the game is won , this one ive had issue with getting it so you have to beat all the units and not just one

any help would be very appreciated as ive embarrisingly been sturggling with this for 3 days lol
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
For #1 it depends on how you Create a hero. Is it trained from an altar? Do you change ownership of an existing unit? Do you move a wisp onto a circle of power to claim the hero? There's all sorts of ways to create a hero. Then from there we need to know: Is the map multiplayer? Do you want each player to have this time limit? How many heroes can a player have?

Important details aside, the basic idea here would be to have a trigger that uses an Elapsed Time Event or Timer Event (whichever is easier for you). Once it expires, so let's say once 180.00 seconds has elapsed, you check to see if each player has a hero. This can be done using the Pick Every Player function.
Something like this:
  • Events:
  • Elapsed game time is 180.00 seconds
  • Actions:
  • /// I don't have the editor open so I'm writing these actions from memory which is why they look weird ///
  • Pick every player in All players (u may want to add some matching conditions to filter out computers or create a new player group that contains all users)
  • If Number of units owned by Picked player matching (Matching unit is a Hero Equal to True) Equal to 0 then Defeat Picked player

For #2 you can use a Unit Group variable. Open the Trigger Editor and then press Control + D to open the Variable Editor. Once open, create a new Variable with the type Unit Group and name it something fitting. You'll want to then add the set of specific units to the Unit Group. This can be done using a new trigger that runs while the map is loading:
  • Events:
  • Map initialization
  • Actions:
  • Unit - Add Unit1 to YourUnitGroup
  • Unit - Add Unit2 to YourUnitGroup
  • Unit - Add Unit3 to YourUnitGroup
  • etc...

So now we're tracking all of these units inside of our Unit Group. Next step is to keep track of when one of these units dies in a new trigger:

  • Events:
  • Unit - A unit dies
  • Conditions:
  • (Triggering unit) is in YourUnitGroup Equal to True
  • Actions:
  • Remove (Triggering unit) from YourUnitGroup
  • /// I don't have the editor open so I'm just going off memory for this next action ///
  • If Number of units in YourUnitGroup Equal to 0 then do actions...
  • /// Put your Actions for what should happen when all of the units are killed in the above If Then Else statement ///

So whenever a unit that is contained in YourUnitGroup dies, remove it from the group and then check to see if the group is empty. If it is empty then you win the game.

If you're confused about the above triggers then I suggest searching Hive for posts about Unit Groups, Pick Every Player, and If Then Else statements.

Sorry for the lazy triggers, hopefully this all makes enough sense.
 
Last edited:
Level 2
Joined
Apr 22, 2020
Messages
8
hey there , sorry to bug ya but while i got the first trigger to work in the game, I cannot select any units or other wise interact with the game and im unsure how to proceed , the hero is made in a altar

this is the trigger as is ,
1621748002133.png
 
Last edited:
Level 2
Joined
Apr 22, 2020
Messages
8
well with the Map Initialization after 100 seconds the game ends with a defeat with the small problem of not being able to click anything lol

without it , nothing happens

pic for reference incase im missing something basic, the other trigger is just to limit the hero to 1 which works fine , got rid of my other triggers thatwere working incase they were somehow interfering

1621760129398.png
 
Level 27
Joined
May 18, 2018
Messages
397
well with the Map Initialization after 100 seconds the game ends with a defeat with the small problem of not being able to click anything lol

without it , nothing happens

pic for reference incase im missing something basic, the other trigger is just to limit the hero to 1 which works fine , got rid of my other triggers thatwere working incase they were somehow interfering

View attachment 380079
That's strange. I'm not in the editor at this moment so I can't try it, but I don't see anything that could cause problems.

Try Uncle's solution anyway:
  • Events
    • Time - Elapsed game time is 30.00 seconds
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • If - Conditions
        • (Number of living HERO units owned by (Picked Player)) Equal to 0
      • Then - Actions
        • Game - Defeat (Picked Player) with the message: Defeat!
 
Level 2
Joined
Apr 22, 2020
Messages
8
i really do apologize but i cannot seem to get the right trigger options to get the same as the picture you sent this is the closest i get

but thank you for trying to help

1621765021510.png
 
Status
Not open for further replies.
Top