• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Is this going to do what I want it to do?

Status
Not open for further replies.
Level 12
Joined
Dec 13, 2008
Messages
1,049
Hello. I asked for trigger help awhile ago and someone said he would help me. He made the trigger but i was confused on it. I went away for 2 days, got my hip muscle torn, etc, came back and he decided that I wasted his time and wasnt going to help me anymore...:angry:
So, what I am asking someone to do is to tell me if these triggers will do what I want them to do. If not, can some1 please modify them for me?

1. I want a trigger where when a building (lumber site, mining site, outpost or base of operations) is at or below 50 health, the player control is transferred to the attacking player.

2. Next, depending on how many gold/lumber sites someone has, you receive x amount of gold per 30 sec. I.E. you have 5 mining sites, 2 lumber sites which means you get 7g per 30 sec.

3. Next, I have buildings called outposts (generalized names) such as crossroads. These buildings normally give 1g per 30 sec unless there is a lumber site or mining site within 1250yds of the outpost.

4. Next, there are buildings called base of operations (generalized names) such as Dalaran. These buildings give 15g per 30 sec no matter what, and also, depending on the building, give attack/armor upgrades. For example, if you capture Dalaran, all of your ranged units have 1/1 upgrade to their attack/armor. If you lose a building, you lose that specific upgrade.

5. Finally, I need a trigger where it tells you how many of each stuff you have, and how much gold income you are receiving from it. I.E. if you have 3 mining sites, 5 lumber sites, 2 outposts, Dalaran and the Icecrown citadel, it will say 'You control 8 income sites, 2 outposts, Dalaran and Icecrown for a total of 40g per 30 sec'

Here are the triggers the guy made for me:

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Out[1] = Crossroads 0221 <gen>
  • Untitled Trigger 002
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Life of (Attacked unit)) Less than or equal to 50.00
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacked unit)) Equal to Lumber Site (Income)
          • (Unit-type of (Attacked unit)) Equal to Mining Site (Income)
    • Actions
      • Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
      • Unit - Set life of (Triggering unit) to 500.00
  • Untitled Trigger 003
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Lumber Site (Income)) and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Owner of (Picked unit)) Current gold
  • Untitled Trigger 004
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Mining Site (Income)) and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Owner of (Picked unit)) Current gold
  • Untitled Trigger 005
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 1250.00 of (Position of Out[1])) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of Out[1])
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Lumber Site (Income)
            • Then - Actions
              • Player - Add 1 to (Owner of (Picked unit)) Current gold
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Mining Site (Income)
                • Then - Actions
                  • Player - Add 1 to (Owner of (Picked unit)) Current gold
                • Else - Actions
            • Else - Actions
THANK YOU TO WHOEVER HELPS ME WITH THIS PROBLEM

+Rep and credits to whoever solves it
 
Level 4
Joined
May 4, 2008
Messages
113
Triggers 2, 3 and 4 leak unit groups each. Other than that I see no problems.

For trigger 4, is it supposed to give you one gold for each mining/lumber site in range, or only give gold if there AREN'T any mining/lumber sites in range?

And for question #4, I see no trigger involving that. Do you need us to make one for you? (for the operation bases)

Unable to answer question #5, sorry. I could tell you how to make it display:
"You control x number of mining sites, y number of lumber sites, z number of outposts and b number of operation sites" but not specifically list "dalaran and icecrown" at the end. If you can live with that, I'll make you the trigger, but if you want the specifics you'll have to find someone else.

To solve unit group leaks:
Code:
Set Temp_Group = What you want the "pick every unit" action to pick (so if you wanted to pick all "units within 512 range of (triggering unit)" then that is what you would set this variable to)
Pick every unit in Temp_Group and do <your actions>
Custom Script: call DestroyGroup (udg_Temp_Group)

Hope that helps. I strongly, strongly, strongly suggest you go search up a tutorial on leaks. You can't make effective maps without knowing how to fix them.
 
Level 9
Joined
Jun 7, 2008
Messages
440
i have a couple questions.
1. Are these Capturable buildings built before game is played(ie during mapmaking process)? Or do players have to individually build them during gameplay?
2. How many players do you have for the map?
3. Did you want everything to be paid at the same time? For instance Your outposts pay 15 gold and the mining cities to payout at the exact same time?
4. Are these "Base of Operations" Localised? Meaning are there more than one for each player(s)?
5. (This isn't a question) What you need to do is to look up the tutorial on variables, becuase in order to do part number 5, your going to need them.
 
Level 6
Joined
Sep 5, 2007
Messages
264
You have to do the "Base of Operations" upgrades as abilities... upgrades can't be removed once obtained, ever. What you could do is to create two "spellbooks", one with a passive damage bonus, and one with a passive armor bonus.

Then, when you do your "Base of Operations" check, you check to see if you should give the spellbook(s) to your units, when you do, you need to disable the "spellbook" for the player you're giving it to (then the ability button for the spellbook won't show up).

As for the rest of it could be done within a single "unit-pick". Just do a radius pick whenever you come across an "outpost" unit, if there is a "resource" building too close, then don't count the "outpost".
With the other buildings, just create an integer array variable, adding the amount of gold for each picked unit (if any) to the variable using "Player Number of Owning Player" as the index. After your "unit pick" is done, loop through the array, using a for-loop, adding the gold, and reseting the value back to 0 (for the next time round).
You could create addition arrays for each object type (for the "Player has X amount of outposts, etc."), and display the information before reseting the variables, and use the gold variable for "Player receiving X gold per <amount of seconds>". I'd suggest saying gold amount per minute, not per 30 seconds, it looks neater... still do the loop per 30 seconds, but just double the amount displayed, IE: "10 gold per minute", instead of "5 gold per 30 seconds".

I'll be back on in about 8hrs, I need sleep (it's 3:50am here), but I'll try to do some triggers for you. I'll do them in JASS though. If I get them done, I'll post the map (then you can just copy and paste the triggers over). :thumbs_up:
 
Level 12
Joined
Dec 13, 2008
Messages
1,049
This message is to Lord BoNes, crueIIintentions and ZiggyMcJoney

Map/Map Info is at bottom of this post!!!!

i have a couple questions.
1. Are these Capturable buildings built before game is played(ie during mapmaking process)? Or do players have to individually build them during gameplay?
2. How many players do you have for the map?
3. Did you want everything to be paid at the same time? For instance Your outposts pay 15 gold and the mining cities to payout at the exact same time?
4. Are these "Base of Operations" Localised? Meaning are there more than one for each player(s)?
5. (This isn't a question) What you need to do is to look up the tutorial on variables, becuase in order to do part number 5, your going to need them.

Triggers 2, 3 and 4 leak unit groups each. Other than that I see no problems.

For trigger 4, is it supposed to give you one gold for each mining/lumber site in range, or only give gold if there AREN'T any mining/lumber sites in range?

And for question #4, I see no trigger involving that. Do you need us to make one for you? (for the operation bases)

Unable to answer question #5, sorry. I could tell you how to make it display:
"You control x number of mining sites, y number of lumber sites, z number of outposts and b number of operation sites" but not specifically list "dalaran and icecrown" at the end. If you can live with that, I'll make you the trigger, but if you want the specifics you'll have to find someone else.

To solve unit group leaks:
Code:
Set Temp_Group = What you want the "pick every unit" action to pick (so if you wanted to pick all "units within 512 range of (triggering unit)" then that is what you would set this variable to)
Pick every unit in Temp_Group and do <your actions>
Custom Script: call DestroyGroup (udg_Temp_Group)

Hope that helps. I strongly, strongly, strongly suggest you go search up a tutorial on leaks. You can't make effective maps without knowing how to fix them.

I will anwer both of you guys

@cruelintentions-
1. yes, when you start the game (game intialization), the capturable buildings are already in place
2. 12
3. yes, i want everything to be paid at the same time
4. When you start, you only have one. However, you can capture additional Base of Operatins (there are 12 because of 12 players)
5. i will do that

@ziggymcjoney-
1. ok, i want the outposts to NORMALLY give 1g/30 sec (that is without ANY lumber or mining sites within 1250yds). HOWEVER, if you control a lumber or mining site (the # of sites doesnt matter), the gold value will change from 1g/30s to 3g/30s (kindave like a city is more prosperous with fisheries and bakeries in/around in in RL)
2. yes, a trigger for that would be lovely
3. yes, that way is fine. i dont NEED it to specifically list the base of operations. as a matter of fact, if you owned more than 3 or 4, the message would get REALLY long, so that would be annoying. could you make that trigger for me as well?
4. Do you want me to attach my map? it is not completed yet, but all of the things required for these triggers are in the map (if you do this, could you also fix the current triggers and put them on the map, i am bad with triggers and it would take me forever to transfer the triggers from the map the guy helped me with to my current one without the triggers)


THANKS TO YOU BOTH ima give you both +rep for now

EDIT:
@Lord BoNes

oh, if you are going to make those triggers, awesome! wait, so are the upgrades going to be removeable or not? i just came up with an idea of a stackable aura, so when you dont control the building, you obviously dont have the aura.

@Everyone

Since you guys want to do some of the same triggers, which one of you wants to do it? cuz i dont want 3 trigger maps and then have to choose one, lols
Also, i am going to attach my map in a sec. I would much rather have the triggers be done to the map so that way i dont have to copy or paste anything and you can directly do the stuff to the buildings that need triggering.....THANKS
+Rep to Lord BoNes for his willingness to help

Ok, here is some of the info you will need for the triggers

1. There are actually 15 base of operations- Icecrown Citadel, Ruins of Azjol-Nerub, Naxxramas, Heart of Azjol-Nerub, Black Citadel, Hellfire Citadel, Dalaran, Temple of the Silver Hand, Thunder Bluff, Orgrimmar, Astranaar, The World Tree, The Twisting Nether, The Twisting Nether and The Pit
2. All of the mining sites/lumber sites are on there
3. outposts are everything else besides the base of operations and the mining/lumber sites
4. Finally, the map is not completed in any way shape or form. so dont comment on units or heroes or random crap like that.
5. so yea, here is the map so you can directly do the triggers to the map...THANKS!!
 

Attachments

  • Scourging of Azeroth Remade!.w3x
    2.3 MB · Views: 66
Last edited:
Status
Not open for further replies.
Top