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

Income/per unit

Status
Not open for further replies.
Level 4
Joined
Jan 22, 2009
Messages
62
How can i make income per unit and this unit can be upgrade

AND a leaderboard that shows how many of each type of unit YOU have

such as in vampirism beast with the gold mines :) but i'm doing a modern warfare map so i'm doing it with banks :)


EDIT: out of subject WHOS WATCHIN SUPERBOWL :D
 
Last edited:
Level 7
Joined
Oct 14, 2008
Messages
340
Well, do a periodic check for how many units a player has of a certain type..
event: every X seconds
action: count how many units of Y type a player has and give him gold based on that number.

As for the leaderboard, look up tutorials on how to manage leaderboards/multiboards, there's plenty of information on this site already to answer your questions, you just have to find it instead of expecting it to be handed to you.

leaderboard tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/leaderboards-6981/

multiboard tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/multiboards-6402/

and i'm sure there's more.
 
Level 8
Joined
Jan 8, 2010
Messages
493
yeah, creating triggers for a unit when it is made or dies is better than making a periodic check. you can use the unit events
Unit - A Unit Sells A Unit
Unit - A Unit Finishes Training

to check when a unit is made.

Then use a variable to check how many units are there. something like:
  • Check Unit Made
    • Events
      • Unit - A unit Finishes training a unit
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Trained unit)) Equal to Footman
        • Then - Actions
          • Set CostFootman = (CostFootman + 1)
        • Else - Actions
that way you can use the periodic check for gold addition only. it might give slow computers (like mine :p) a hard time when you make a periodic check and then there's too many things to do in that check.
 
Last edited:
Level 4
Joined
Jan 22, 2009
Messages
62
Well, do a periodic check for how many units a player has of a certain type..
event: every X seconds
action: count how many units of Y type a player has and give him gold based on that number.

As for the leaderboard, look up tutorials on how to manage leaderboards/multiboards, there's plenty of information on this site already to answer your questions, you just have to find it instead of expecting it to be handed to you.

leaderboard tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/leaderboards-6981/

multiboard tutorial:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/multiboards-6402/

and i'm sure there's more.

Yea only one prob wit tutorials......I NEVER GET ANY OF DEM....i tried learning jass like dat didnt have a clue of what was going on.
Anyways i used to know how to do da leaderboard...with variables and sutff but um....i forgot 100% >,<

And as for the suggestions i'll check them later when i have time :) thanks
 
Level 7
Joined
Oct 14, 2008
Messages
340
How can you not understand tutorials?
I believe the only way a tutorial wouldn't make sense is if you didn't read everything, or if it's a bad tutorial, but the hive is full of plenty of great tutorials, they are there for a reason.
 
Level 9
Joined
Mar 10, 2005
Messages
326
How can i make income per unit and this unit can be upgrade

AND a leaderboard that shows how many of each type of unit YOU have

such as in vampirism beast with the gold mines :) but i'm doing a modern warfare map so i'm doing it with banks :)


EDIT: out of subject WHOS WATCHIN SUPERBOWL :D

For a working bank you need the following:

Set a few integer array variables first with Integer A functions:

Bank Income (1-12) initial value= (bank count) x (bank value)
Bank Count (1-12) intial value=0
Bank Value (1-12) intial value = 5 g for example


Then you need 3 triggers:
BANK COUNT
~~~~~~~~~~~~~~
Event: A player builds a bank

Set Bank Count (player number of triggering player)= Bank Count (player number of triggering player)+1

BANK UPGRADE
~~~~~~~~~~~~~~~~~~~
Event: A player researches an upgrade
Condition: Upgrading unit is a bank equal to true
Action: Set Bank Value (player number of triggering player) = Bank Value (player number of triggering player) +5


Bank Dies
~~~~~~~~~~~~~~~~~~~~
Event: A unit dies
Condition: unit type of triggering unit is a bank equal to true
Action: Set bank count (player number of trigger player)= bank count (player number of trigger player)-1

Bank Income:
~~~~~~~~~~~~~~~~`
Event: Every X seconds of game time
Action: For Integers 1-12
Loop

Add bank value (player (integer A)) to player current gold.



If you want it on a multiboard, download Senkin's example multiboard here and adjust variables:

http://www.thehelper.net/forums/showthread.php?t=23952&p=178548

By default it keeps track of player kills and deaths but you can easily add another column for # of markets. I can help you with it if you send me a copy of ur latest map.

Sorry for not having the actual screenshot....typing it on a comp without the world editor.
 
Status
Not open for further replies.
Top