Results 1 to 9 of 9

Thread: what is wrong with this ui_elements script?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: what is wrong with this ui_elements script?

    About I_ScrollOpened - there is no such condition in the .exe.

    It's probably just grabbing whatever value is on the top of the stack, which is probably non-zero so it evaluates to true. Then, doing set_counter scroll 0 probably pushes the 0 on stack and the while loop exits...

    Try changing it to "while EarthIsFlat". If it still works, it's a pretty good indication that's what's going on.
    RTR VII Developer

  2. #2
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: what is wrong with this ui_elements script?

    Ugh - you're right FlatEarth has same effect - basically it works to disable the button if the initial condition is met - but then stays disabled for rest of game whilst script is loaded... that's possibly ok for me as all i really want is if you're Greeks you can't exterminate but does mean other conditions to re-enable extermination wouldn't work.

    tried:
    Code:
    declare_counter scroll
    set_counter scroll 0
    
    monitor_event ScrollOpened ScrollOpened loot_settlement_scroll
       set_counter scroll 1
    end_monitor
    
    
    monitor_conditions I_LocalFaction greek_cities
       if I_CompareCounter scroll = 1
    	while I_CompareCounter scroll = 1
    	disable_ui loot_settlement_extermintate_button
    	end_while
       terminate_monitor
       end_if
    end_monitor
    
    monitor_event ScrollClosed ScrollClosed  loot_settlement_scroll
       set_counter scroll 0
    end_monitor
    which looks more like it should be valid code - first occupation works fine, then you'd think terminate_monitor would return you to normal after it switched off but next sieges resulted in exterminate and occupy buttons being disabled, which is kind of weird and not useful..

    Code:
    declare_counter scroll
    set_counter scroll 0
    
    monitor_event ScrollOpened ScrollOpened loot_settlement_scroll
       set_counter scroll 1
    end_monitor
    
    
    monitor_conditions I_LocalFaction greek_cities
       if I_CompareCounter scroll = 1
    	while TrueCondition
          	set_counter scroll 0
    	disable_ui loot_settlement_extermintate_button
    	end_while
       end_if
    end_monitor
    is reduced down version of what its really doing (am not sure the set_counter to 0 is actually turning off though) attempts to move the reset to a scroll closed condition just result in the occupy and exterminate buttons being disabled as above
    Not used mods before? Looking for something small and fun?!
    Download the:

  3. #3
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: what is wrong with this ui_elements script?

    have finally got this to behave with what I think is a valid condition (not just ConditionTrue) - anyway it will now switch on and off according to setting of scroll counter if required

    Code:
    declare_counter scroll
    set_counter scroll 0
    
    ;;use this version to apply to all settlements
    ;monitor_event ScrollOpened ScrollOpened loot_settlement_scroll
    ;   set_counter scroll 1
    ;end_monitor
    
    ;use this version for named settlement
    monitor_event GeneralCaptureSettlement FactionType greek_cities
       and SettlementName Athens
       set_counter scroll 1
    end_monitor
    
    monitor_conditions I_LocalFaction greek_cities
       if I_CompareCounter scroll = 1
    	while I_CompareCounter scroll = 1
    	disable_ui loot_settlement_extermintate_button
    	end_while
       end_if
    end_monitor
    
    monitor_event ButtonPressed ButtonPressed loot_settlement_occupy_button
    	enable_entire_ui
       	set_counter scroll 0
    end_monitor
    
    monitor_event ButtonPressed ButtonPressed loot_settlement_enslave_button
    	enable_entire_ui
       	set_counter scroll 0
    end_monitor
    it needs enable_entire_ui when either of the available loot buttons is pressed to get it to switch off properly - trying to use ScrollClosed or enable_ui loot_settlement_extermintate_button doesn't work but above seems to
    Not used mods before? Looking for something small and fun?!
    Download the:

  4. #4

    Default Re: what is wrong with this ui_elements script?

    I'm at work, so I can't test my ideas right now, but it may be possible to simplify this a little.

    edit: Sorry, didn't get to try this yesterday. Was busy moving RTR:FOE to a new Subversion repository.
    Last edited by HouseOfHam; 05-01-2009 at 17:26.
    RTR VII Developer

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO