Results 1 to 30 of 42

Thread: Can I use a script to end the turn?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Can I use a script to end the turn?

    Sorry, I can't help you.

    Even I don't understand why the game changes the turn simply by changing the faction controlled.

    I wonder if the factions involved in this system of changes make any movement and when.

  2. #2
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    Quote Originally Posted by Monkwarrior
    I wonder if the factions involved in this system of changes make any movement and when.
    They do. The script wouldn't have much point otherwise.

    I wrote a couple of drafts to try and explain why it works, but they all got a bit cumbersome. Briefly, there's an order in which factions take their turns, and it loops. What happens in this mod is:

    1. The AI plays for any faction that isn't you until it's your turn.
    2. The script waits until it's your turn, and then makes "you" into someone else who is later in the turn sequence.
    3. The AI plays for any faction that isn't you until it's your turn.

    Rinse, lather, repeat. Every faction has "its turn" played by the AI. The only weakness is that if someone does something to your faction when it's not your faction's turn and you have to respond... well, you're still in charge of the faction and you have to respond.

    I've more or less finished dealing with this weakness, though. The script now autoresolves battles and dismisses diplomacy windows.

  3. #3
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    Incidentally, I did a whole bunch of experiments with the -ai command line. I think what makes it weird is that a game started under -ai can't load any scripts.

  4. #4
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Can I use a script to end the turn?

    nor can you continue a game after starting it with the -ai command, you can after taking some actions, but you cant just press the turnbutton after disabling the AI again, or at least I couldnt after freezing the AI using the "halt_ai (optional; faction)" as the players turn would end but the AI never actually started its turn ....


    G

  5. #5
    Member Member mrtwisties's Avatar
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    235

    Default Re: Can I use a script to end the turn?

    If you use "console_command control faction" rather than halt_ai, the ai seems to keep playing turns for all of the other factions.

    I've been trying to figure out whether the -ai switch turns off something that can be turned on again, so far as getting scripts running again goes. No progress yet.

  6. #6

    Default Re: Can I use a script to end the turn?

    Incidentally, I did a whole bunch of experiments with the -ai command line. I think what makes it weird is that a game started under -ai can't load any scripts.
    I can confirm that you can use a background_script with the -ai command if you launch it automatically using the Campaign script. You know:

    advance_advice_thread Background_Script_Thread no_dismiss
    wait 1
    select_ui_element advisor_portrait_button
    simulate_mouse_click lclick_up
    So then, you can use the script to halt the game the turn you want to control any faction using the command:
    "console_command control faction"

    I posted it in a similar thread of this forum when I discovered it, I'm sorry I have not read this topic before to explain it here.
    I have been using this way to debug my scripts and the campaign balance for long time now, with great results.

    BTW, as Red Spot always says, I can also confirm that you don't need to use the combo with "simulate_mouse_click lclick_down", just needed the click_up.
    Last edited by Bardo; 12-03-2007 at 11:52.

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

    Default Re: Can I use a script to end the turn?

    mrtwisties, apologies if I've slightly lost track of where you've got to with this.

    Does your version give you an autosave you can re-load do you know?

    I'm running testing at the moment with script automatically launched from campaign script and then also triggering ER's year jump script to go on 200 turns (BI mod), that works fine for balance issues, but I'm getting occassional CTD about 140 turns in which is probably script generated unfortunately. It autosaves whilst on year jump but save doesn't seem to know who you are so crashes if trying to re-load. I could really do with being able to re-load before CTD as never manage to be watching campaign at right point to see what problem area is otherwise. (watching campaign prevents CTD occuring, it just happens as soon as you get distracted! )
    Not used mods before? Looking for something small and fun?!
    Download the:

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