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

gold income trigger

Status
Not open for further replies.
Level 3
Joined
Feb 28, 2009
Messages
31
hello i think this won't be hard question for any of you: atm i am making a map and when you destroy a building you get the same building at the same place but it belongs to you ( like you actually captured it ) i want to create a trigger that after you capture that building every second you get 1 gold. i tried with something like this but it doesn't work

dmtjjm.jpg


the problem is that in condition i selected a building that is on the map but during the gameplay i destroy it and that's why i don't get gold (building's name is brankovina)
 
Level 3
Joined
Jun 26, 2010
Messages
43
Use this trigger

  • Brankovina prihodi
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add 1 to (Owner of Brankovina 0006 <gen>) Current gold
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Brankovina 0006 <gen>) is dead) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
There was a request like this last month.

http://www.hiveworkshop.com/forums/...income-trigger-180596/index2.html#post1742016

That's the solution.

You'll have to edit the income to how you want it, but the base idea is there. The taking control upon death thing does work, I've tested it many times before giving it as a response to the other person's inquiry.

By the way, if you search the help zone forums, you could find this relatively easily. Just a tip for the future, :)

Good luck!
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Why do you want to make it so complicated when it is so easy?
This is what you gonna do:

1: Make a unit variable without array named "Unit".
2: Set the condition to "Unit is alive" and select the unit variable which you created.
3: Create this action "Set variable (unit) = Last Created Unit" after "Create unit (Structure which can be captured)".
4: Create a new trigger named "Init" and create the event "After 1 Second do Action" and the action "Set Variable (unit) = the structure which you already have in your map"
5: You are done!
_________________


"Give a man a fish and you feed him for a day, Teach a man to fish and you feed him, for a lifetime."
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
I'm not making it complicated. I'm simply responding with a test map that was already used and works.
 
Level 3
Joined
Feb 28, 2009
Messages
31
Test map attached
If you have any question, feel free to ask =D

first trigger that actually works. ok now if someone could tell me what to add, because i receive gold for every structure even that doesn't belong to me, i want to make it only for one building because every building gives different amount of gold.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
At post #2
If 1 of the structure is destroyed/dead, the trigger is directly turned off
What happens to ANOTHER same type building ?
The trigger is already turned off LOL

For the map, you're gonna need to add CONDITIONS over there
Choose suitable conditions that suits you dude =D
Second test map attached
Conditions used for further specification
 

Attachments

  • Structure Gold Per Second.w3x
    12.8 KB · Views: 68
Level 3
Joined
Feb 28, 2009
Messages
31
At post #2
If 1 of the structure is destroyed/dead, the trigger is directly turned off
What happens to ANOTHER same type building ?
The trigger is already turned off LOL

For the map, you're gonna need to add CONDITIONS over there
Choose suitable conditions that suits you dude =D
Second test map attached
Conditions used for further specification

first on the map, there will be only one brankovina (because it's village's name)
now defskull i have no clue about making triggers so can you make that trigger you already made but assigned to each building, so that i can change gold amount
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I used the condition there already dude
ONLY farm unit-type building will be counted
As you can see, in the map, there are 3 Town Hall, 5 Farms and 1 Heroes
If my trigger is bugged, that means the trigger will give a total amount of 9 gold per second
I used condition for Farm-type building ONLY
So it ONLY gives a total of 5 gold per second, considering I have 5 Farms, build
Just change the condition dude
To Brankovina

If you want for each building gives different amount of gold, I suggest you create a new custom unit for that
Example: Farm 1, Farm 2, Farm 3, and so on...
 
Level 3
Joined
Feb 28, 2009
Messages
31
I used the condition there already dude
ONLY farm unit-type building will be counted
As you can see, in the map, there are 3 Town Hall, 5 Farms and 1 Heroes
If my trigger is bugged, that means the trigger will give a total amount of 9 gold per second
I used condition for Farm-type building ONLY
So it ONLY gives a total of 5 gold per second, considering I have 5 Farms, build
Just change the condition dude
To Brankovina

If you want for each building gives different amount of gold, I suggest you create a new custom unit for that
Example: Farm 1, Farm 2, Farm 3, and so on...

yes it works perfectly, but can you make it give me gold after i get ownership, actually after i destroy it and new one appears

  • Brankovina
    • Events
      • Unit - Brankovina 0006 <gen> Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Brankovina
    • Actions
      • Unit - Create 1 Brankovina for Player 1 (Red) at (Position of (Triggering unit)) facing Default building facing degrees
      • Game - Display to (All players) the text: Serbian uprising ar...
i use this trigger to get new brankovina at the same place.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Change this in the Loop - Action trigger
  • Player - Add (Player number of (Picked player)) to (Owner of (Picked unit)) Current gold
Owner of Picked unit condition will check if the building is yours or not
If it's not yours, then, no adding gold for you =(
If it's yours... well, hehe =D
 
Status
Not open for further replies.
Top