Need Basic Poison Effect

diggoran

New Member
Reaction score
3
I'm trying to make my first fully functional TD and I'm having a hard time with my Poison Tower. So far my coding is as such:
<> If a unit is attacked by Poison Tower then add this unit to a unit array
<> If a unit is in the unit array, subtract 10 hp every 0.5 seconds.
I'll copy over the actual code later.
 

diggoran

New Member
Reaction score
3
That's the ability I'm using now, unfortunately, it does little damage and I cant modify it cause I only have ROC. :( I need a trigger-based way around this.
 

diggoran

New Member
Reaction score
3
I was considering that. I feel it can be done with triggers but mine dont seem to work at all. Let me dig out that code for you.

Code:
Add to Poisoned Red
     Events
          Unit - A unit owned by Player 1 (Red) Is attacked
     Conditions
          (Unit-type of (Attacking Unit)) Eqaul to Poison Tower
     Actions
          Seleciton - Select (Triggering Unit)
          Set Poisoned(NumberPoisoned) = (Units currently selected by Player 1 (Red))
          Set NumberPoisoned = (NumberPoisoned + 1)

Code:
Poison Effect
     Events
          Time - Every 0.50 seconds of game time
     Conditions
     Actions
          For each (Integer A) from 0 to (NumberPoisoned), do (Unit Group - Pick every uint in Poisoned[(Integer A)] and do (Unit - Set life of (Picked Unit) to ((Picked Unit) - 10.00)))

2 Variables used:
Variable Name -- Variable Type ----- Initial Value
NumberPoisoned -- Integer ------------ 0
Poisoned --------- Unit Group Array --- (None)

Also, I don't like how while playing it selects the attacked unit and it keeps you from building new towers or buying new creeps. Almost certain selection is not best.

BTW I'm in America and after exchange, I'd need about 35 euros.
 

hell_knight

Playing WoW
Reaction score
126
just buy tft for gods sake

it will save you SO MUCH trouble

dont use a unit array add to unit group.
pick every in unit group deal damage and in the first trigger add a wait then remove from unit group.
 

diggoran

New Member
Reaction score
3
just buy tft for gods sake

it will save you SO MUCH trouble
Please don't tell me how to spend my money. :(

Thanks for your reccomendations, though. I didn't realize I was using a unit group array; would a plain unit group variable work better? (I want to put the effected units into a common group and do damage repeatedly for a set time to all of them.)
 

Slapshot136

Divide et impera
Reaction score
471
why not save red's original selection, then do what you do there (i still dont see the point of it.. but w/e works i guess) and then select the original units back?

or, something like periodically pick every unit with the poison buff and make them take X damage?
 

diggoran

New Member
Reaction score
3
something like periodically pick every unit with the poison buff and make them take X damage?
That sounds like a good idea. :rolleyes: Can you show me an example of a trigger recognizing if a unit has a buff and then take action?

BTW this tower upgrades from a 10 second poison, to 20 sec, to 30. It needs to be changeable in how long to effect the unit. :eek:

Great idea though; it sounds do-able! :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top