• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Interest trigger in a TD

Status
Not open for further replies.

Renka

R

Renka

Since I got such great advice last time I came on here I figured I might as well do it again.

This time I am working on a TD map, and I want an Interest system (pretty much like the one in Element TD). I've run into some problems though.

Since I am dealing with percentages (2.5% or 5%, I haven't decided yet) I get decimal numbers, but Warcraft rounds all of these down which is a problem. I've been looking for a way to assure that it rounds all the numbers up, but I've had little success.

Also, it'd be great if I could get the number apear over the head of the builder like a bounty (as we've all seen in said Element TD), but predictably I've had even more troubles with this detail.
 
First of, interest. You get a certain percentage of your current gold as a bonus every X coupld of seconds.

The second thing is having the interest represented visually by the same bounty text you get when you kill creeps (+X in yellow over the builder in this case).
 
This is for 3 levels of interest and 3 players and it gives interest every 60 sec.
  • Interest
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Player - Set (Player((Integer A))) Current gold to (((Player((Integer A))) Current gold) x (Integer(Interest_players[(Integer A)])))
  • Create Interest Text
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads (String(Interest_players[(Integer A)])) above Builders[(Integer A)] with Z offset 0.00, using font size 9.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Show Interest_FloatingText[(Integer A)] for (All players)
      • Trigger - Turn on Move Interest Text <gen>
  • Add Interest
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Interest
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set Interest_players[(Player number of (Owner of (Triggering unit)))] = (Interest_players[(Player number of (Owner of (Triggering unit)))] + 0.50)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 2
        • Then - Actions
          • Set Interest_players[(Player number of (Owner of (Triggering unit)))] = (Interest_players[(Player number of (Owner of (Triggering unit)))] + 1.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 3
        • Then - Actions
          • Set Interest_players[(Player number of (Owner of (Triggering unit)))] = (Interest_players[(Player number of (Owner of (Triggering unit)))] + 1.50)
        • Else - Actions
      • Unit - Set level of (Ability being cast) for (Triggering unit) to ((Level of (Ability being cast) for (Triggering unit)) + 1)
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Builders[1] = Builder 0000 <gen>
      • Set Builders[2] = Builder 0001 <gen>
      • Set Builders[3] = Builder 0002 <gen>
 
That was the problem ???
LoL explore some in triggers
ZOMG HOW TO TURN ON THE COMPUTER ???????
(or how to create unit with triggers ? :P)
 
Status
Not open for further replies.
Back
Top