Page 2 of 4 FirstFirst 1234 LastLast
Results 31 to 60 of 102

Thread: A Beginner's Guide to Scripting & Scripting "How To"s

  1. #31

    Default How to: spawn an army

    How to: Spawn an Army
    Code:
    script
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
    unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
    unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
    unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
    end
    end_script
    If you are playing as the Julii this will create an army banner with the relevant captain/family member as you define. Most of the syntax is the same as in descr_strat, however the missing clue was the positioning of the commas after the unit names as discovered here

    Family members who are spawned, however, do not appear to join that faction's family tree.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  2. #32
    Ja mata, TosaInu Forum Administrator edyzmedieval's Avatar
    Join Date
    May 2005
    Location
    Fortress of the Mountains
    Posts
    10,839

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Excellent guide Richard. Thanks for gathering all the info!
    Ja mata, TosaInu. You will forever be remembered.

    Proud

    Been to: :

    Swords Made of Letters - 1938. The war is looming - and Alexandre Reythier does not have much time left to protect his country.

  3. #33

    Default Re: How to: spawn an army

    Quote Originally Posted by Epistolary Richard
    How to: Spawn an Army
    Code:
    script
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
    unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
    unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
    unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
    end
    end_script
    If you are playing as the Julii this will create an army banner with the relevant captain/family member as you define. Most of the syntax is the same as in descr_strat, however the missing clue was the positioning of the commas after the unit names as discovered here

    Family members who are spawned, however, do not appear to join that faction's family tree.
    Do you know if this can be randomized like the Marian Reforms? How would you set the date for the event if possible?
    PatWest the 'Intermediate Level Modder'

  4. #34

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    im trying to spawn an army but im lost what must i change in the advice thread for the spawn army not the mo money. im a noob modder

  5. #35
    is not a senior Member Meneldil's Avatar
    Join Date
    Aug 2004
    Location
    France
    Posts
    3,074

    Default Re : A Beginner's Guide to Scripting & Scripting "How To"s

    Hum, another issue there. I'm trying to make a simple campaing map perfect spy script.

    I edited export descr advice (both in the data and bi/data)
    ;------------------------------------------
    AdviceThread Help_Campaign_Keyboard_Shortcuts_Scroll_Thread
    GameArea Campaign

    Item Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01
    Uninhibitable
    Verbosity 0
    Threshold 1
    Attitude Normal
    Presentation Default
    Title Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Title
    Script scripts\show_me\spy.txt
    Text Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Text1
    I added the spy.txt file in the correct folder (in fact, since I wasn't sure where to put it, I made a spy.txt for data/scripts/show_me/ and one for bi/data/scripts/show_me/

    The campaign works fine, but if I press F1 and click on the advice button ('?'), the advisor appears, but the game freezes.
    Any idea about what's going on ?

  6. #36
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    @Meneldil

    I think that your problem is in the script. Something similar happened also to me when there were errors in the script.
    It would be better if you post it here, or look for the help of the "scripting Gods".

  7. #37
    is not a senior Member Meneldil's Avatar
    Join Date
    Aug 2004
    Location
    France
    Posts
    3,074

    Default Re : A Beginner's Guide to Scripting & Scripting "How To"s

    Well, I don't think so actually.
    With BI, the shortcut advisor apparently doesn't work (there are commas that prevent the script from working) : if you click on the advice button, nothing will happen.
    I deleted the commas, both before the trigger and before the advisor thread, and I did not add any script. I launched the campaign, and clicked on '?' in the shortcut panel, and the game stopped aswell.

    Edit : Oddly, the script will work with another advisor help request command.
    Last edited by Meneldil; 12-06-2005 at 22:35.

  8. #38

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    I have a little (though annoying problem) regaring this script. Maybe I did it wrong way but here it goes.

    In my Imperator mod, I added the spawn army script to make Phyrrus army reappeared in summer 275 BC. I edited base on the 4TPY script. Everything goes fine, the years came and the army 'arrived' and I had another great but difficult battle with the Greeks when I thought that Phyrrus has finally been banished from Italy.

    The problem came after the event has passed. Everytime I restarted the game, after save and reloading, everytime I started the 4TPY script the army reappears , even when the Greek Cities has been eliminated. Didn't cause CTD or anything, and the game can goes on with no problem at all (except the battle with Phyrrus with his elephant army again... )

    Do note however, this only happened 'after' restarting the game If reload a save game from already on going game this 'bug' wont appear. What I always did is reload again and the spawn thing didn't appear anymore.

    I'm at lost....
    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.

  9. #39

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Are you using a background script or an event script?

    Post the bits of your scripting files relevant to this event and we'll have a look.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  10. #40

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    script

    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

    if spawn_armyA = 0

    spawn_army
    faction greek_cities
    character Pyrrhus of Epirus, named character, command 3, influence 1, management 1, subterfuge 0, age 38, , x 112, y 67
    unit greek general's guard cavalry exp 1 armour 0 weapon_lvl 0
    unit epirote pikemen exp 2 armour 0 weapon_lvl 0
    unit epirote pikemen exp 1 armour 0 weapon_lvl 0
    unit greek medium cavalry exp 0 armour 0 weapon_lvl 0
    unit greek hoplite exp 2 armour 0 weapon_lvl 0
    unit greek hoplite exp 1 armour 0 weapon_lvl 0
    unit greek hoplite exp 2 armour 0 weapon_lvl 0
    unit greek hoplite exp 1 armour 0 weapon_lvl 0
    unit greek hoplite militia exp 0 armour 1 weapon_lvl 0
    unit greek hoplite militia exp 0 armour 1 weapon_lvl 0
    unit aor greece thessalian cavalry exp 1 armour 0 weapon_lvl 0
    unit merc rhodian slingers exp 1 armour 0 weapon_lvl 0
    unit merc cretan archers exp 1 armour 0 weapon_lvl 0
    unit merc elephants exp 1 armour 0 weapon_lvl 0
    unit greek hoplite militia exp 0 armour 1 weapon_lvl 0
    unit merc rhodian slingers exp 1 armour 0 weapon_lvl 0
    unit merc cretan archers exp 1 armour 0 weapon_lvl 0
    set_counter spawn_armyA 1
    end_if

    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType carthage
    and I_TurnNumber > 138

    if spawn_armyB = 0

    spawn_army
    faction carthage
    character Himilcar Barca, general, command 5, influence 5, management 0, subterfuge 3, age 40, x 96, y 47
    unit carthaginian general's cavalry exp 1 armour 0 weapon_lvl 0
    unit carthaginian sacred band infantry exp 3 armour 1 weapon_lvl 1
    unit carthaginian sacred band infantry exp 3 armour 1 weapon_lvl 1
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit libyan spearmen exp 2 armour 1 weapon_lvl 1
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit aor spain infantry exp 2 armour 1 weapon_lvl 1
    unit aor spain infantry exp 1 armour 0 weapon_lvl 0
    unit aor spain infantry exp 1 armour 0 weapon_lvl 0
    unit aor spain infantry exp 1 armour 0 weapon_lvl 0
    unit aor spain infantry exp 1 armour 0 weapon_lvl 0
    unit merc balearic slingers exp 2 armour 0 weapon_lvl 0
    unit merc balearic slingers exp 2 armour 0 weapon_lvl 0
    unit aor spain cavalry exp 2 armour 0 weapon_lvl 0
    unit aor spain cavalry exp 2 armour 0 weapon_lvl 0
    unit merc numidian cavalry exp 2 armour 0 weapon_lvl 0
    unit merc numidian cavalry exp 2 armour 0 weapon_lvl 0
    unit carthaginian elephant forest exp 0 armour 0 weapon_lvl 0
    unit carthaginian elephant forest exp 0 armour 0 weapon_lvl 0
    set_counter spawn_armyB 1
    end_if

    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType gauls
    and I_TurnNumber > 177

    if spawn_armyC = 0

    spawn_army
    faction gauls
    character Dumnorix of Bibrax, general, command 5, influence 0, management 0, subterfuge 0, age 20, , x 89, y 91
    unit barb chieftain cavalry gaul exp 1 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 0 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 1 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 0 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 1 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 0 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 1 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 0 armour 0 weapon_lvl 0
    unit barb infantry gaul exp 1 armour 0 weapon_lvl 0
    unit barb peltast gaul exp 1 armour 0 weapon_lvl 0
    unit barb peltast gaul exp 1 armour 0 weapon_lvl 0
    unit gaul gothic hev inf exp 3 armour 0 weapon_lvl 0
    unit gaul gothic hev inf exp 3 armour 0 weapon_lvl 0
    unit gaul gothic hev inf exp 3 armour 0 weapon_lvl 0
    unit barb cavalry gaul exp 3 armour 0 weapon_lvl 0
    unit barb cavalry gaul exp 3 armour 0 weapon_lvl 0
    unit barb cavalry gaul exp 3 armour 0 weapon_lvl 0
    set_counter spawn_armyC 1
    end_if

    terminate_monitor
    end_monitor

    monitor_event FactionTurnStart FactionType carthage
    and I_TurnNumber > 249

    if spawn_armyD = 0

    spawn_army
    faction carthage
    character Hannibal Barca, general, command 6, influence 5, management 0, subterfuge 3, age 40, x 89, y 91
    unit carthaginian general's cavalry exp 1 armour 0 weapon_lvl 0
    unit carthaginian sacred band infantry exp 3 armour 1 weapon_lvl 1
    unit carthaginian sacred band infantry exp 3 armour 1 weapon_lvl 1
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit libyan spearmen exp 2 armour 1 weapon_lvl 1
    unit libyan spearmen exp 1 armour 0 weapon_lvl 0
    unit aor spain infantry exp 2 armour 1 weapon_lvl 1
    unit aor spain infantry exp 1 armour 1 weapon_lvl 0
    unit aor spain infantry exp 1 armour 1 weapon_lvl 0
    unit aor spain infantry exp 1 armour 1 weapon_lvl 0
    unit aor spain infantry exp 1 armour 1 weapon_lvl 0
    unit merc balearic slingers exp 2 armour 1 weapon_lvl 1
    unit merc balearic slingers exp 2 armour 1 weapon_lvl 1
    unit aor spain cavalry exp 2 armour 0 weapon_lvl 0
    unit aor spain cavalry exp 2 armour 0 weapon_lvl 0
    unit merc numidian cavalry exp 2 armour 1 weapon_lvl 1
    unit merc numidian cavalry exp 2 armour 1 weapon_lvl 1
    unit merc numidian cavalry exp 2 armour 1 weapon_lvl 1
    unit carthaginian elephant forest exp 1 armour 0 weapon_lvl 0
    set_counter spawn_armyD 1
    end_if

    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;; 4 TPY ;;;;;;;;;;;;;;;;

    console_command date -280
    console_command season summer
    declare_counter Season_Year_Turn0_Thread
    while I_TurnNumber = 0
    monitor_conditions I_CompareCounter Season_Year_Turn0_Thread = 0
    if I_CompareCounter Season_Year_Turn0_Thread = 0
    advance_advice_thread Season_Year_Turn0_Thread
    inc_counter Season_Year_Turn0_Thread 1
    end_if
    end_monitor
    suspend_unscripted_advice true
    end_while

    console_command date -280
    console_command season summer
    declare_counter Season_Year_Turn1_Thread
    while I_TurnNumber = 1
    monitor_conditions I_CompareCounter Season_Year_Turn1_Thread = 0
    if I_CompareCounter Season_Year_Turn1_Thread = 0
    advance_advice_thread Season_Year_Turn1_Thread
    inc_counter Season_Year_Turn1_Thread 1
    end_if
    end_monitor
    suspend_unscripted_advice true
    end_while
    Back to my earlier question, I think I solved the first part Phyrrus (no respawned second time) , but the rest keeps respawning.. everytime I reload the game (restart the game). But if then I hit ESC , reload again, start the 4TPY script and it's gone.

    Note: I mod it base on the 4TPY script by Marcus Camillus (from RTR.org)
    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.

  11. #41
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by LestaT
    Back to my earlier question, I think I solved the first part Phyrrus (no respawned second time) , but the rest keeps respawning.. everytime I reload the game (restart the game). But if then I hit ESC , reload again, start the 4TPY script and it's gone.
    This is because you cannot launch a second time a script if you don't exit the game. When you reload without restarting, the script simply doesn't launch (at least this happened to me).

  12. #42

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    That could be. It's just that I think the first spawn army script is correct, so they only spwan once in 275BC.

    But I'm not sure about the rest of the script. Maybe somebody can help me correct it.
    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.

  13. #43
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Post Re: A Beginner's Guide to Scripting & Scripting "How To"s

    LestaT,

    I don't know much about scripting, though I'm trying to learn about it. I am a software engineer though, and I see some problems with your script based purely on programming principles.


    Code:
    ;;;;;;;; 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
    You've declared a counter named spawn_army but you don't use it. You actually use spawn_armyA, spawn_armyB, spawn_armyC, and spawn_armyD, but you haven't declared them as counters.

    I'm pretty sure that the counter values are only preserved while your script is being executed, so they ought to be assigned a value before they are used. Your script only does this if I_TurnNumber = 0.

    It also doesn't look to me like you need any of your counters. I'd suggest you get rid of everything you posted in red and change

    Code:
    ;;;;;;;; spawn_army ;;;;;;
    monitor_event FactionTurnStart FactionType greek_cities
    and I_TurnNumber > 21
    to

    Code:
    ;;;;;;;; spawn_army ;;;;;;
    monitor_event FactionTurnStart FactionType greek_cities
    and I_TurnNumber = 21
    You should do likewise for your other spawns.

    Shouldn't your Gauls show up about 10 years later for Telamon in 225 BC?
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



  14. #44
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    There are several mistakes in the script. The correct syntax will depend on your idea about the events:
    - Do you want the spawning armies to appear in a specific date or only from a given year (in a randomly chosen date)?
    - Do you want the armies to spawn only once in game?
    - Do you want the armies to spawn at the same time?

    Just to test the syntax, you can prepare a short script that would allow one army to spawn in one early date (let's say turn number 2).

    Several advices:
    - You must declare all the counters used along the script: declare_counter spawn_armyA, etc.
    - If the army must appear when the counter is zero, you must use the command: I_CompareCounter spawn_armyA = 0 (see the docudemon files).
    Put it as part of the monitor_event
    - Once the army appears, you must change the counter, either setting the value or increasing one unit: set_counter spawn_armyA 1

    In any case, if the army is going to appear only once in a given date, forget the counter and set just the turn number.
    If the armies appear in different turns (with a given order), you can use only one counter, and put in the event the different values (for army A, I_CompareCounter spawn_armyA = 0; for army B, I_CompareCounter spawn_armyA = 1; etc).

    Good luck with the script.

  15. #45

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    - Do you want the spawning armies to appear in a specific date or only from a given year (in a randomly chosen date)?
    - Do you want the armies to spawn only once in game?
    - Do you want the armies to spawn at the same time?
    To these questions , my idea is to spawn the army only once at a specific date, for instance the first Greek army (Phyrrus) on summer 275 BC. I've restested my script (without editing from the frist spawn (in 275) to the second (in 246) and it works both times. The only this is if I save the game and reload. The second spawn (hamilcar in Sicily) keeps respawning every time I load the game and so the third one (Gaul) in 236 ..(not quite sure the date , but something like that.. )

    Just to test the syntax, you can prepare a short script that would allow one army to spawn in one early date (let's say turn number 2).

    Several advices:
    - You must declare all the counters used along the script: declare_counter spawn_armyA, etc.
    - If the army must appear when the counter is zero, you must use the command: I_CompareCounter spawn_armyA = 0 (see the docudemon files).
    Put it as part of the monitor_event
    - Once the army appears, you must change the counter, either setting the value or increasing one unit: set_counter spawn_armyA 1
    Actually I tried to read the docudemon file .. but coun't make any sense of it. Might be because of my poor command of English or my zero knowledge about codes / pc scripts etc..

    In any case, if the army is going to appear only once in a given date, forget the counter and set just the turn number.
    If the armies appear in different turns (with a given order), you can use only one counter, and put in the event the different values (for army A, I_CompareCounter spawn_armyA = 0; for army B, I_CompareCounter spawn_armyA = 1; etc).
    Guess this is what I'm gonna do. Thanks for the advice and I'm gonna see how it works. Just a quick question, will the script take any effect in middel of campaign ? Or will have to restart a new one ?
    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.

  16. #46
    Honorary Argentinian Senior Member Gyroball Champion, Karts Champion Caius's Avatar
    Join Date
    Aug 2006
    Location
    I live in my home, don't you?
    Posts
    8,114

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    ok.

    I explain what im trying to do.I am making a autosave script for RTW 1.5.Yes, there is a feature of autosave, but it is damaged or something that makes a CTD when you click the end turn.
    So, I believe if I create a autosave script, this script will fix the problem.
    Now, How can I create a script of end turn?




    Names, secret names
    But never in my favour
    But when all is said and done
    It's you I love

  17. #47
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Do you see the problem you mention with Autosave in an un-modded game? Autosave (or a manual save) will crash if you've made a mistake character names. I suspect this or some other mod-related change is your real problem.
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



  18. #48
    Honorary Argentinian Senior Member Gyroball Champion, Karts Champion Caius's Avatar
    Join Date
    Aug 2006
    Location
    I live in my home, don't you?
    Posts
    8,114

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Atilius
    Do you see the problem you mention with Autosave in an un-modded game? Autosave (or a manual save) will crash if you've made a mistake character names. I suspect this or some other mod-related change is your real problem.
    It is the imperial campaign un-modded.
    I'm not the only who haves the same problem




    Names, secret names
    But never in my favour
    But when all is said and done
    It's you I love

  19. #49

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    tried using the example script for mo_money but that particular section of the txt seems to be disabled in patch 1.5. Tried using the advice thread for the settlements list again no joy.

    I'm trying to get force_diplomacy to work so I can play around with that in the early game if anyone has any help they could give I'd love to click their 'show me how' button.


  20. #50
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Post Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Parenti's Child
    tried using the example script for mo_money but that particular section of the txt seems to be disabled in patch 1.5.
    Just copied and pasted the mo_money code snippet into an existing script of mine and it worked as expected in 1.5. I'd guess you have a problem in the triggering mechanism. The "show me how" button on the advisor should be dark (un-ghosted) until you click it. Is this what you see?
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



  21. #51

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    that's the problem. For some reason the request advice button in the shortcuts screen doesn't even bring up the advisor.

  22. #52

    Default Re : A Beginner's Guide to Scripting & Scripting "How To"s

    Hello I never mod before but I already can switch side for historical battle; Can you help me with that : How do I make the opposite side (AI) wait for the ennemy (me) .the AI rushes all the time and is not supposed to do so, so the battle turn crazy. I don't know the script and where (which folder) it goes;
    many thanks

  23. #53

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Atilius
    The "show me how" button on the advisor should be dark (un-ghosted) until you click it. Is this what you see?
    Please explain "Dark" and "Ghosted/Un-Ghosted", and how this corresponds to 'greyed-out' vs. 'active'.

    I (as far as I can tell) did everything correctly according to Richard's instructions. My problem is; The "Show Me How" button is greyed out and un-clickable.

    I reset the advisor in the options, as well as changing the Advice Level to 'High', but the Show Me How button is still greyed out (and now that snotty wench pops up to tell me everything she's told me once before already).

    I'm trying to do the force_diplomacy accept thing. Here's my files:

    data\export_descr_advice.txt:
    Code:
    ;------------------------------------------
    AdviceThread Help_Campaign_Keyboard_Shortcuts_Scroll_Thread
        GameArea Campaign
    
        Item Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01
            Uninhibitable
            Verbosity  0 
            Threshold  1 
            Attitude Normal
            Presentation Default
            Title Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Title
            Script scripts\show_me\forcedip.txt
            Text Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Text1
    data\scripts\show me\forcedip.txt:
    Code:
    script
    
    command_console force_diplomacy accept
    
    end_script
    Now, I added this script while in the middle of an Imperial Campaign, and I'm just wondering if that's the problem...

    On another subject;

    Where does this game hide the Targas? I've looked for them everywhere. There are data files that refer to them, but the targas themselves don't appear to exist anywhere. Like "roman_official_ancillary.tga" for example.

  24. #54
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Tombstone
    Please explain "Dark" and "Ghosted/Un-Ghosted", and how this corresponds to 'greyed-out' vs. 'active'.
    Dark, Un-Ghosted=active
    Ghosted=greyed-out

    Your export_descr_advice.txt looks OK.

    As for the script, you have

    Code:
    command_console force_diplomacy accept
    This should be

    Code:
    console_command force_diplomacy accept
    Quote Originally Posted by Tombstone
    Where does this game hide the Targas?
    You need to unpack the files in the packs folder. There's a link to Vercingetorix's xpak in this post. Usage info here.
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



  25. #55
    Ossie The 1st Member Ossie The Great's Avatar
    Join Date
    Oct 2006
    Location
    Very far away........ ( which usally is the beach )
    Posts
    829

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    hi
    can i have help please.......... i am trying to make a script which adds a building to a settlement on a specific date. please help

  26. #56
    Ossie The 1st Member Ossie The Great's Avatar
    Join Date
    Oct 2006
    Location
    Very far away........ ( which usally is the beach )
    Posts
    829

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    hi
    i am having trouble activating the script. i tried pressing f1 and clicking on the question mark but the show me button is just greyed out, the same happens if i pree esc and then question mark ...... please help
    Last edited by Ossie The Great; 02-27-2007 at 18:14.

  27. #57
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    The above tutorials did not work for me - try putting your script inside an existing script file (then deleting the old text) and using that advice thread to activate it. In other words, do not change anything but the contents of the script file you choose.
    "One of the most sophisticated Total War mods ever developed..."

  28. #58
    Speaker of Truth Senior Member Moros's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    13,446

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Okay I'm a newby when it comes to scripts but I'm trying to learn.
    When I just tried doing the simpelist of things I got a bug I can't explain.

    if not I_LocalFaction romans_senate
    console_command add_money romans_senate, 30000
    end_if
    This is the part of the script it's all about, it's the first thee lines of a campaignscript called by the descr_strat. Show_err gives this:
    error in balablabla/imperial campaign/campaign_script line 3 collumn something
    Don't understand this token: "end_if".
    Last edited by Moros; 08-01-2007 at 18:54.

  29. #59
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    The first line of a script must be "script", and you should also conclude with "end_script". Try

    Code:
    script
    if not I_LocalFaction romans_senate
        console_command add_money romans_senate, 30000
    end_if
    end_script
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



  30. #60
    Speaker of Truth Senior Member Moros's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    13,446

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Does a campaign script loaded form the Descr_strat also need script at the start? The EB one for example doesn't...
    I did have end_script though.

    EDIT:
    Same error message though.

Page 2 of 4 FirstFirst 1234 LastLast

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