Level of ability as identifier - bad idea?

Discussion in 'World Editor Help' started by LordTalbot, Feb 4, 2017.

  1. LordTalbot

    LordTalbot New Member

    Ratings:
    +0 / 0 / -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?
     
  2. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    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.
     
    • Like Like x 1
  3. LordTalbot

    LordTalbot New Member

    Ratings:
    +0 / 0 / -0
    works perfectly fine now, thanks a lot! I wasn't aware of that feature :)
     
  4. jonas

    jonas Member

    Ratings:
    +41 / 4 / -0
    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?
     
  5. LordTalbot

    LordTalbot New Member

    Ratings:
    +0 / 0 / -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
     
  6. jonas

    jonas Member

    Ratings:
    +41 / 4 / -0
    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).
     

Share This Page