Labels in battle

Thread: Labels in battle

  1. Erken said:

    Default Labels in battle

    I have noticed that the unit labels are not working for the non automated reinforcements. Slightly delay the labeling can resolve this: the units just need to be present, at least as cards (even transparent).

    This is not a problem currently, but i imagine it's better to know it.
     
  2. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    Sorry, I'm not entirely clear what you're saying. Do you mean the mouseover text, or do you mean the labels used by the battle scripts?
     
  3. Erken said:

    Default Re: Labels in battle

    The labels in the battle script. I mentioned the cards as their apparition seems to coincide with the possibility to label the units concerned. Nothing to do with mouseover text.
     
  4. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    z3n is intrigued - could you demonstrate how it could be done?
     
  5. Erken said:

    Default Re: Labels in battle

    Ok. First a simple way to highlight the problem:
    Code: [View]
    monitor_event BattleConflictPhaseCommenced
        battle_wait 3
        unit_group_set_morale Allies routing
    end_monitor
    The result in game:



    Only the main army is fleeing, and no matter whether the units of the reinforcement are in or out of the battlefield, they won't be affected.

    Next, if you had a battle_wait 1 to the script, in this way:
    Code: [View]
    monitor_conditions I_BattleStarted
        inc_counter deploy_check 1
            if I_CompareCounter deploy_check = 1
                battle_wait 1
                log always Battle Started
                set_counter start_battle 1
            end_if
    end_monitor
    Then it works for the two armies:



    So, in conclusion, the units of a non automated army cannot be labeled before a point in time (which seems to be more or less synchronized with the apparition of their cards).

    I hope this is more clear with pictures and scripts than with my terrible english
     
  6. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    From what little knowledge I have of the battle script, that looks pretty significant to me, good find.

    I'll pass it along to z3n and see what he makes of it.
     
  7. betto said:

    Default Re: Labels in battle

    IS possible to force a rout if the general dies or set all units into ai control ? would be wonderful for roleplaying with romans.
     
  8. Erken said:

    Default Re: Labels in battle

    Yes, i had a script like this (without a real AI): if the general was killed, the ui and the cursor were disabled, and the units then either fled or fought. But it was in a background script as the performance of monitor_conditions is drastically reduced in a campaign script (which does not allow to make an efficient loop). Otherwise of course it's possible to repeat an attack order for each unit at regular intervals with a long script (which could be too short...).

    Force them to flee, or on the contrary prevent them to do it in certain conditions, is easier. That's what i was working on when i have noticed this thing with the labels.
     
  9. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    Should there be a battle_wait 1 after every if I_CompareCounter deploy_check = 1?
     
  10. Erken said:

    Default Re: Labels in battle

    No, only one, where i have added it.
     
  11. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    Is there nowhere else in the script that could benefit from a wait? In the reinforcements section, perhaps?
     
  12. Erken said:

    Default Re: Labels in battle

    There is no similar problem for the AI reinforcements if that's your question. Moreover, this different parts of the script are not connected. And as far as i can see, the battle_wait doesn't affect the good functioning of the rest: labels are working, groups too, experience bonus same thing, and the units should also be released without difficulty.

    Furthermore, the automated reinforcements (player and AI) are not even labeled, so i see no reason to add a wait somewhere, unless you think to something in particular?
     
  13. QuintusSertorius's Avatar

    QuintusSertorius said:

    Default Re: Labels in battle

    OK, z3n has added them to our battle script, thanks for finding that.