re: tracking units with a buff

SyrisX

New Member
Reaction score
3
I posted a similar question a few days ago and got some good information. However, I am still having a lot of problems. (I have no idea how to start) :banghead:


I need a system to track units that receive a specific buff. The system needs to keep track of this once per game day.

<example>

On day1 a Unit casts "myspell" on unit "X", and unit "X" receives buff "mybuff".
Data then needs to be stored that unit "X" received the buff, and can only be stored once per game day.

On day 2 unit "X" receives buff "mybuff" again.
The system needs to know that unit "X" had the buff 1 time previously and is being buffed for the 2nd time.
Or
On day 2 unit "X" does not receive "mybuff"
The system needs to know that the day passed without the unit having received the buff, but also needs to know that it received the buff 1 time before.

Eventually.. unit "X" having received the buff enough times (once per day) event "A" will occur.. But if unit "X" does not receive the buff as much as needed within x amount of days.. then it is removed/killed (event B)

</example>

As I am fairly new to this, I fear it is way over my head. I have spent the last few days attempting to figure out how exactly to manage this but I am failing miserably. If anyone can help me out I would greatly appreciate it. I know it is pretty complicated and would be a bit time consuming to work on this, but I still need to ask.


I'm not asking for someone to write out the entire system, but to help me figure out where to start.
 

perkeyone

something clever
Reaction score
71
two ways i would do this

way 1 would use the custom value of the unit
and it would allow it to work for individual units
(that means if each player has to get the buff on more than one unit it will still work properly)

way 2 would use an array variable of size 12
it would only work for one unit per player
(this will work if the player only controls one hero during the game or only needs the buff on one unit)

both ways use a unit group
first start with a trigger

event: generic unit event - a unit finishes the effect of an ability
condition: ability comparison - ability being cast equal to <your ability>
boolean - unit in unit group (already_buffed_today) equal to false
actions:*way1* set custom value of target of ability being cast equal to custom value +1
*way2* set var_array[player number of target of ability being cast] equal to (var_array[player number of target of ability being cast] +1)
*either way you choose you need this part* add target of ability being cast to unit group (already_buffed_today)

then in a separate trigger every game-morning remove all the units from the already_buffed_today group

then your last trigger will happen after a certain game time has elapsed it will then compare the custom value or the array value to see if it high enough then do what ever
 

SyrisX

New Member
Reaction score
3
You are beyond awesome +rep for helping a noob like myself

I didnt even know "custom values" for units existed and this has just opened a huge door for me

Now i'll need to figure out a way to keep track of units that are not buffed 2 days in a row.. which will kill them
 

perkeyone

something clever
Reaction score
71
how about another unit group?
not_buffed_yesterday

in the game-mourning trigger right before it removes all the units from already_buffed_today

make it kill anyone who is both in not_buffed_yesterday and not in already_buffed_today.

then add anyone whos is not in already_buffed_today into a group not_buffed_yesterday

so in summary
if they get buffed they go in groupABT
at the end of the day if they are not in groupABT but are in groupNBY
if they are not in groupABT they are put in groupNBY

=]
 

kingkwong92

Well-Known Member
Reaction score
25
Just use the system in the map I gave you in the first post.
The unit has the ability watered
When it has been watered it increases a level
When it hasn't you can decrease the level
When its level drops below xx then kill the unit
When its level is over yy then make it grow
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top