Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Member paullus's Avatar
    Join Date
    Aug 2005
    Location
    always in places where its HOT
    Posts
    11,904

    Default Re: An Intermediate Guide to Scripting

    ER,

    Sorry I was unclear. I meant to say "besieging a neutral city." Unless I'm missing something (certainly a possibility), I don't think those conditions would work with a city you do not own. Is there anything else I could try?

    Thanks much.
    "The mere statement of fact, though it may excite our interest, is of no benefit to us, but when the knowledge of the cause is added, then the study of history becomes fruitful." -Polybios


  2. #2

    Default Re: An Intermediate Guide to Scripting

    As it was said there is no easy way to check for siege.
    The only way is to detect enemy army near a settlement.
    You can do this for any faction holding city and any faction standing next to the city.
    Proximity alert should be set to 2 titles. If you set it to 1 it wont be triggered if enemy attacks from any of city corners.

  3. #3
    Member Member paullus's Avatar
    Join Date
    Aug 2005
    Location
    always in places where its HOT
    Posts
    11,904

    Default Re: An Intermediate Guide to Scripting

    Oh ok, I guess I misunderstood. Thanks.
    "The mere statement of fact, though it may excite our interest, is of no benefit to us, but when the knowledge of the cause is added, then the study of history becomes fruitful." -Polybios


  4. #4

    Default Re: An Intermediate Guide to Scripting

    I don't understand, I'm using Malrubius' code:

    Code:
    monitor_event CharacterTurnStart FactionType empire_west
          and Trait AgeTraitLevel1 = 1
             ; do some stuff
         
    end_monitor
    To do something to the character when a turn starts, but nothing happens. Here's the full code:

    Code:
    	console_command give_trait "Gaius Fabricius" GoodCommander 2
    	campaign_wait 2
    	console_command add_money 1000
    	campaign_wait 2
    
    	monitor_event CharacterTurnStart FactionType empire_west
    		and Trait GoodCommander = 2
    
    		; do stuff
    
    	end_monitor
    I start the campaign, press F1 and run the script, the Trait is added, I press Next Turn expecting some stuff to happen to the char based on that trait, but nothing happens... Help?

    PS: ER, would you like me to use the other thread referencing this one from now on?
    Last edited by SigniferOne; 03-10-2006 at 05:00.

  5. #5

    Default Re: An Intermediate Guide to Scripting

    Is that the full script? Do you have 'script' at the beginning? end_script at the end? Do you have a loop so that the script is still running the next turn?

    If you have all that try getting rid of the campaign_wait commands.
    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

  6. #6

    Default Re: An Intermediate Guide to Scripting

    Do you have a loop so that the script is still running the next turn?
    Maybe that's my problem. I was under the assumption that if a script was launched, that it will persist throughout the entire game session, including all the monitors. Is that right, or do I have to have some sort of loop to keep the script persisting through the turns?

    All of the action that I want to happen above is inside the monitor, which I thought will persist though turn 2, even though loaded at turn 1 (assuming the game wasn't reloaded).
    Last edited by SigniferOne; 03-11-2006 at 02:56.

  7. #7

    Default Re: An Intermediate Guide to Scripting

    Have a look at the first script in the first post, there's your basic background script with a while loop. You need a while loop at the bottom otherwise the script will terminate immediately.
    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

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