Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: An Intermediate Guide to Scripting

    If that is a direct copy&paste from your script then this line is part of the problem:
    Code:
    monitor_event FactionTurnStart EgyptFactionType Numidia
    Then, there are the if lines in the first monitor.
    Code:
     monitor_event FactionTurnStart FactionType Egypt
    and FactionIsLocal
    and FactionHasAllies
    
    if DiplomaticStanceFromFaction pontus >= Hostile
    DiplomaticStanceFromFaction requires exported parametres from a monitor, so it will no work if it is not tied to the monitor with ands. You'll have to split the monitor in two. This is how the other monitor should begin:
    Code:
    monitor_event FactionTurnStart FactionType Egypt
    and FactionIsLocal
    and FactionHasAllies
    and DiplomaticStanceFromFaction pontus >= Hostile
    As a rule of thumb, if a condition doesn't start with I_ it requires to be used as an event monitor condition.

  2. #2

    Default Re: An Intermediate Guide to Scripting

    Thanks a lot! It works now!
    Another question. What is the proper command to give money to other fraction?
    add_money <amount> <fraction name> not works.

  3. #3

    Default Re: An Intermediate Guide to Scripting

    From what other people have posted, you need a comma in there:

    console_command add_money faction, how_much
    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

  4. #4

    Default Re: An Intermediate Guide to Scripting

    Quote Originally Posted by Epistolary Richard
    From what other people have posted, you need a comma in there:

    console_command add_money faction, how_much
    Thanks, it seems to be working.

  5. #5

    Default Re: An Intermediate Guide to Scripting

    HI!

    I want to use move_character command , but I don't know how to calculate x,y koordinates of a position on campaign map. Is there a tool or method to do this?

  6. #6
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: An Intermediate Guide to Scripting

    Bring up the console on campaign map, place cursor over desired tile and type show_cursorstat, then press enter :)

  7. #7

    Default Re: An Intermediate Guide to Scripting

    If I use spawn and move command to not local faction with monitor_event, hothing happaned:

    script
    monitor_event FactionTurnStart FactionType romans_julii
    and not FactionIsLocal
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 180, y 5
    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
    console_command move_character Flavius Julius 170, 5
    campaign_wait 1
    console_command move_character Flavius Julius 160, 15
    end_monitor
    end_script


    If I use it to not local faction without monitor_event spawn work, but no moves

    If I use it to local faction spawn works, move works too.

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