Results 1 to 10 of 10

Thread: disable_ui - does it actually work?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default disable_ui - does it actually work?

    I have been trying to disable the withdraw and auto resolve button in the prebattle scroll button to no avail.
    Success has been in flashing the fight button, which means that I got the name of the ui element right, but no luck with disabling the button

    Works:

    Code:
    declare_counter hist_schlacht
    monitor_event ScrollOpened ScrollOpened prebattle_scroll
        if I_CompareCounter hist_schlacht = 1
            campaign_wait 1
            disable_cursor
            ui_flash_start prebattle_fight_button
            campaign_wait 3
            select_ui_element prebattle_fight_button
            simulate_mouse_click lclick_down
            simulate_mouse_click lclick_up
        end_if
            enable_cursor
            set_counter hist_schlacht 0
    
    end_monitor
    Doesn't work (buttons still enabled):

    Code:
    declare_counter hist_schlacht
    monitor_event ScrollOpened ScrollOpened prebattle_scroll
        if I_CompareCounter hist_schlacht = 1
            campaign_wait 1
            disable_cursor
            disable_ui prebattle_withdraw_button
            disable_ui prebattle_auto_resolve_button
        end_if
            set_counter hist_schlacht 0
    
    end_monitor
    I haven't bothered to make a monitor with enable_ui because of it. And those other two buttons don't want to flash either. If I put the prebattle_fight_button in the second monitor and use disable_ui with it, then it doesn't work either, hence my remark: does 'disable_ui' actually work?
    Last edited by Gigantus; October 16, 2011 at 02:00 AM.










  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: disable_ui - does it actually work?

    I tried and failed to do the same thing, needing to force the player to fight the battle.

    In the end I gave up and auto-clicked the fight button on the player's behalf. I guess that is what you're doing too, in that first one.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: disable_ui - does it actually work?

    That's what I ended up with: disable cursor, click fight button via script. It's a pity because I wanted to give the player the option to right click the opponent to find out his army composition.










  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: disable_ui - does it actually work?

    This is a thread I had on the matter but I don't think that it contains anything helpful. Hmm, apparently I was trying to force autoresolve, not fight.

    I wonder if the other two buttons could be disabled by other means. e.g. Remove all movement points to prevent Withdraw (does that work?) and temporarily disable autoresolve globally (is that possible?).
    Last edited by Withwnar; October 16, 2011 at 07:31 AM.

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: disable_ui - does it actually work?

    autoresolve isn't a problem = restrict_autoresolve true (cross fingers that one works).
    Those zero movement points can be done as well via trait, best a hidden one in case someone checks the general's details. In this case it is for historical battles on the strategic map where I spawn the armies and then use engage_armies. That command (engage_armies) doesn't seem to need any movement points anyhow as the two armies can be at opposing ends of the map (looks weird to see only one general going through the animation).

    I will give it a try.

    Edit: restrict_autoresolve doesn't work either, drat.
    Last edited by Gigantus; October 16, 2011 at 08:11 AM.










  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: disable_ui - does it actually work?

    "console_command mp {character} -1" works too, if the traits don't.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: disable_ui - does it actually work?

    Seeing that restrict_autoresolve doesn't work either makes following up on the withdrawal issue impractical.

    Thanks for all your input, I will have to stick to the forced selection combined with disabling the cursor (at least that is working).










  8. #8
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: disable_ui - does it actually work?

    Quote Originally Posted by Gigantus View Post
    restrict_autoresolve doesn't work either
    Dang. Another dead end. The Gods of Total War can be fickle.

  9. #9
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: disable_ui - does it actually work?

    Sorry for necroposting this, but if a soloution is still needed, well here's one:
    you really can't disable the buttons -don't know why- but you can force the autoclick:

    ;---- forcing player to fight/withdraw/autoresolve
    Code:
    monitor_event	ScrollOpened	ScrollOpened	prebattle_scroll
    log	always ;just for testing
    disable_cursor
    generate_random_counter	pbs	1	3	;to show randomness
    campaign_wait	1
    if	I_EventCounter	pbs	=	1
    ui_flash_start	prebattle_fight_button
    campaign_wait	1	;could be longer to let the player take a longer look at the prebattle_scroll
    select_ui_element	prebattle_fight_button
    simulate_mouse_click	lclick_down
    select_ui_element	prebattle_fight_button
    simulate_mouse_click	lclick_up
    end_if
    if	I_EventCounter	pbs	=	2
    ui_flash_start	prebattle_auto_resolve_button
    campaign_wait	1
    select_ui_element	prebattle_auto_resolve_button
    simulate_mouse_click	lclick_down
    select_ui_element	prebattle_auto_resolve_button
    simulate_mouse_click	lclick_up
    end_if
    if	I_EventCounter	pbs	=	3
    ui_flash_start	prebattle_withdraw_button
    campaign_wait	1
    select_ui_element	prebattle_withdraw_button
    simulate_mouse_click	lclick_down
    select_ui_element	prebattle_withdraw_button
    simulate_mouse_click	lclick_up
    end_if
    enable_cursor
    end_monitor


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: disable_ui - does it actually work?

    Thanks, that is a nice variety to my initial forcing of the fight.










Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •