Results 1 to 6 of 6

Thread: Questions on script and "sacking"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Questions on script and "sacking"

    thats because when you reload a game, the 4TPY script actually runs the entire script up to the point where the turn number is correct.

    To avoid this problem put

    if I_TurnNumber = 0
    Enter script here
    end_if

    That way it will only happen on that turn and not afterwards

  2. #2

    Default Re: Questions on script and "sacking"

    So, is that means I have to delete all end_if after the spawn army script except spawn_armyD ?

    Anyway another advice I recieve is to delete part in bold and change
    the and I_TurnNumber > 21 to
    I_TurnNumber = 21
    as below. Is there any differences ? I tested this one first, and the army didn't spawn again (already spawn on the exact date) when I reload the game. However I didn't test the game before it spawn to see if the script works.

    Thanks for the advice Myrddraal

    while I_TurnNumber < 1840
    select_ui_element advisor_dismiss_button
    simulate_mouse_click lclick_down
    simulate_mouse_click lclick_up

    suspend_unscripted_advice true


    ;;;;;;;; spawn_army ;;;;;;
    declare_counter spawn_army

    if I_TurnNumber = 0
    set_counter spawn_armyA 0
    set_counter spawn_armyB 0
    set_counter spawn_armyC 0
    set_counter spawn_armyD 0
    end_if

    ;;;;;;;; spawn_army ;;;;;;
    monitor_event FactionTurnStart FactionType greek_cities
    and I_TurnNumber > 21
    Say: O unbelievers, I serve not what you serve, nor do you serve what I serve, nor shall I serve what you are serving, nor shall you be serving what I serve.
    To you your religion, and to me my religion.

  3. #3

    Default Re: Questions on script and "sacking"

    I_TurnNumber = 21 is what you want.
    This peace of script:
    Code:
    monitor_event FactionTurnStart FactionType greek_cities
    and I_TurnNumber = TURN_NUMBER
    will ensure that inside of this monitor will be executed only on turn equal to TURN_NUMBER and only at the begining of greek turns.
    It will be executed only once.

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