• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Please help me with my tag trigger

Status
Not open for further replies.
Level 4
Joined
Feb 9, 2008
Messages
33
hello guys, im quite new to hiveworkshop but ive been looking for a trigger for a very long time.

For everyone who has played tree tag, island of frogs or any other tag map, theres always a system of income which is made by a trigger im guessing.
I still cant work out a trigger to make it so...welll i want a trigger like

e.g. Add X amount of gold to player income if structure is alive, increase X amount of gold per copy of that structure

if anyone could give me a really set out and clear instructions as to how to set up an income system exactly like the one in tree tag or island of frogs III i would love it

thanks a million guys:smile::infl_thumbs_up:
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
  • Income Trigger
    • Events
      • Time - Every <Income Interval> Seconds of Game Time
    • Conditions
      • -------- if you want any conditions, go ahead. I doubt you will --------
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick Every Unit in (Units of Type <Income Structure>) And do Actions
        • Loop - Actions
          • Player - Add <Income amount> to (Owner of (Picked Unit)) Current Gold
 
Level 4
Joined
Feb 9, 2008
Messages
33
thanks a lot for the trigger picture but i still dont really understand it....maybe u could lay it out a lil bit more for me? like e.g build a struture and name it resource storage or something and then do a variable

cuz i have no idea where to get all that stuff in the trigger

thanks again
 
income interval is an integer (or real) variable, also Income amount is an integer (or real) variable,

in an initialization trigger, you would set everyones Income amount variable to the same, so that everyone has the same amount of income, also set income interval there too.

then, when some unit builds an income tower and finishes a building event, then you can set the income amount variable of that player to the income amount +(however much income this building will give) and when a building dies (dying unit = income tower) then set income amount variable of that player to income amount - (the amount that income building gave you)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
income interval is an integer (or real) variable
Not a variable, just a number (constant) :p

also Income amount is an integer (or real) variable,
Probably a constant, again.

and <Income Structure> is the house unit.

The raw functions are...

The event: Time - Periodic Event
The custom script action: Custom Script
The unit group: Unit Group - Pick Every Unit In Unit Group And Do Multiple Actions
The gold adder: Player - Add Property
 
Level 4
Joined
Feb 9, 2008
Messages
33
hmmmm this trigger seems really complicated especially cuz its got variables....thanks again tho people but im still lost, if u could gimme a layout of instrcutions starting from making the building which is simple and make ur own as an example then like say make a variable that does blah blah blah and explain variables a bit cuz i have barely a clue on how they work, if u could do that, man u dont know how much that would help me :) ill put ur name in my map hehee +rep
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Giving money
  • Untitled Trigger 001
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Player - Add Income[(Integer A)] to (Player((Integer A))) Current gold
Initializating money
  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Income[(Integer A)] = 5
Increasing money
  • Untitled Trigger 003
    • 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 Income[(Player number of (Owner of (Constructed structure)))] = (Income[(Player number of (Owner of (Constructed structure)))] + 2)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Constructed structure)) Equal to Altar of Kings
            • Then - Actions
              • Set Income[(Player number of (Owner of (Constructed structure)))] = (Income[(Player number of (Owner of (Constructed structure)))] + 4)
            • Else - Actions
Decreasing money
  • Untitled Trigger 004
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • 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 Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 2)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Constructed structure)) Equal to Altar of Kings
            • Then - Actions
              • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 4)
            • Else - Actions
 
Level 4
Joined
Feb 9, 2008
Messages
33
well....like its really hard for me to explain to be honest....well this is wat confuses me i dont know how to work/create/edit variables and i dont know how to set them up or create income structures/triggers...really its all bout the variables and all the complicated references to which the triggers refer to in the trigger u made...
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
hmmmm this trigger seems really complicated especially cuz its got variables....thanks again tho people but im still lost, if u could gimme a layout of instrcutions starting from making the building which is simple and make ur own as an example then like say make a variable that does blah blah blah and explain variables a bit cuz i have barely a clue on how they work, if u could do that, man u dont know how much that would help me :) ill put ur name in my map hehee +rep


The trigger itself I already wrote, now since you seem to really need a big explenation...

Making a building is done through the Object Manager, you could either edit a existing building or create a Custom building (which is a unit and thus I would refer to it as a unit from now on) by right clicking on any unit and click on the "New Custom Unit..." button.
Now I wouldn't explain every button in the object manager since you can just look at their names and see what they do.

About variables - variables are just things you can store a value in, and later on refer to that value using the variable's name.
For example, a unit variable stores inside it a unit value, for example, Tiggering Unit, and later on you can refer to the Triggering Unit with the variable you stored it in.

You will probably mostly use this variables:

  • Integers - Full numbers such as 1 , 20 , -53
  • Units - the units in warcraft 3
  • Points - locations that represent coordinates (x,y)
  • Unit Groups - what more to say ?
  • Booleans - variables that store True or False in them

To create a variable, go to the trigger editor, then click on the yellow X ontop in the menu bar.
Then simply click on the green +X to create a variable.
You will be asked to enter the name of the variable, the type of it, and then if it is arrayed or not.
Arrayes allow you simboly create diffrent "skins" of the same variable and give each its own value.

Hint: If you are making an array, just let it stay at the initial value of 1.

Now to use a variable in your triggers, you can use the "Set Variable" action to set them into a value (its the 8th action), or use them in events, conditions, and actions through the Variable bar.
When you create a action that needs a unit value for example, it will usually give you three boxes to choose that value from:

  • Preset - No unit (not very helpfull for us)
  • Variable - variable can be either a variable you set or a unit that is on the map, which you can select with the "Select Unit" button
  • Function - a unit that is based on the event of the trigger

Another thing to notice is I used loops in my trigger above.
Loops are what they sound like, things that work again and again untill you tell them to stop.
They are represented by those "For each (Integer A) from X to Y, do (Actions)".
For more explenations about loops and the usage of them with arrays (which is what I did), read this (click here) tutorial I made.
"


In the trigger I made I used the variable Income which is an integer.
 
Level 4
Joined
Feb 9, 2008
Messages
33
hmmmm i see its all really starting to register to me now, im begginning to understand the way they work...

heres what im now thinking variables are...ill try to put it the best way i can...

variables are a custom reference(reference meaning they're refering to) to the value of something to be used in a trigger used where the trigger cannot refer to your desired effect or watever because it may be an usual or complicated effect

well thats wat i think they are, just correct me if im wrong but i understand variables well enough now but im still lost on how to make the value of it... i mean like where it says array and u can tick the box to enable an array wtf is the array refering to? the amount of time? the amount of lumber?the amount of gold? the amount of certain units killed? thats the bit i dont understand, how do i change the value or watever the variable is refering to?

thanks again P.S i read ur tutorial but didnt quite understand it so i gave up on it :) +rep for ya tho
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I have MSN which you can see through the MSN icon underneath my picture.

I suggest you read the tutorial I gave you in my previous comment to know a bit more on arrays and on the usage of them with loops.

Basicly arrays are just diffren't instances of the same variable.
You can have 3 unit variables like this

Unit_Variable_One
Unit_Variable_Two
Unit_Variable_Three

Or have the same effect but with a 1 variable using 3 arrays like this

Unit_Variable[1]
Unit_Variable[2]
Unit_Variable[3]


Anyway, since I explain it in my tutorial, just go read it :p
 
Status
Not open for further replies.
Top