Results 1 to 4 of 4

Thread: Scripting question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    axnsan's Avatar Protector Domesticus
    Join Date
    Dec 2008
    Location
    Timisoara, Romania
    Posts
    4,437

    Default Scripting question

    Hey, a question for all scripters out there -

    Is it possible to script a console command, to fire when the battle result scroll appears? Furthermore, is it possible to do so in a custom battle?

  2. #2
    jản's Avatar █ kept in suspense █
    Join Date
    Oct 2008
    Location
    Berlin / Germany
    Posts
    1,450

    Default Re: Scripting question

    ///

    what we found out so far is that:


    • there is a console command save_battle_replay. what we need
      is a script to auto save the battle replay, or at least bind it to a key


    • " ... after a battle when you open the console and write save_battle_replay,
      it's working ..."
      (user experience)

    ///

  3. #3
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Scripting question

    You can run scripts in campaign battles. It simply isn't advised because you're powerless to know which units you're giving the labels to unlike in a historical battle where you define them.

    You should be able to run a command when the battle scroll appears via the following:
    Code:
    monitor_event ScrollOpened ScrollOpened prebattle_scroll
       select_element prebattle_withdraw_button
       simulate_mouse_click lclick_down
       simulate_mouse_click lclick_up
    end_monitor
    Theoretically that would monitor when the prebattle scroll is opened, and automatically withdraw. Similar buttons on that scroll are:

    prebattle_autoresolve_button
    prebattle_withdraw_button

    I haven't done any scripts with those commands as of yet since haven't needed to, but it should work. Keep in mind that the event "ScrollOpened" only exports the triggers needed to identify it with the "ScrollOpened" condition, so you can't go adding a bunch of trigger-requiring conditions to lower down the circumstances. You can try using the I_ conditions but it's unclear exactly what it will be checking for with some of them, so it might go firing when unintended.

  4. #4
    axnsan's Avatar Protector Domesticus
    Join Date
    Dec 2008
    Location
    Timisoara, Romania
    Posts
    4,437

    Default Re: Scripting question

    I meant the battleresult scroll, which appears on the battlefield after you won/got defeated/had a draw, not the prebattle scroll

Posting Permissions

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