Level of ability as identifier - bad idea?

LordTalbot

New Member
Reaction score
0
Hi,
for my TD I'm doing the following:
upload_2017-2-4_12-34-16.png

However when I add an ability to a unit and set it's level, I will always get a lag THE FIRST TIME THE EVENT HAPPENS. So actually I have a few triggers that work in a similiar way and have the same problem.

Do you know the problem? The thing is, actually the trigger is very useful to have some sort of an ID for the unit, I can't use custom value as it is used already and I can't use flying height as I'm also targeting flying units.

Refering to this trigger i'm checking in other events if a unit has the given ability and do actions depending on the level of that ability. I could directly add the unit to a unit group, but then - how do I solve the problem with the needed additional ID?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Sounds like you need to pre-load your data at the start of the game. The "lag" is because the data of the skill needs to be loaded into the game the first time it is used. Just have a trigger run at map initialization which adds the ability to a dummy unit and then remove that dummy unit. The skill will then be loaded during the loading screen of the map.
 

jonas

You can change this now in User CP.
Reaction score
64
What happens when your werbar is ordered to attack a unit, but the attack is cancelled (after the animation starts playing,but before the damage point is reached) and no damage is dealt?
 

LordTalbot

New Member
Reaction score
0
Sorry, I didn't see your message until now. When the werebears attack is canceled before the damage is dealt, the trigger will strike anyway.
But that is no problem as it should barely happen, and is not much of a problem when it does.

How would you solve it? For using an event that looks out for unit HP loss I would have to store each unit in variable I think
 

jonas

You can change this now in User CP.
Reaction score
64
Only create the trigger when the unit is attacked. Might be difficult in GUI.

The other option is to delay the action; listen for orders with a second trigger and a global variable; and only perform the action if there has been no new order for the unit between the attack and the damage point of the attack animation. You'll probably need to use a stack of tuples (unit attacker, boolean changedOrders).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top