Results 1 to 30 of 82

Thread: alpaca's Script-O-Rama

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    Yep I was planning to go through these again to see what I can incorporate here.
    Would be cool if you could explain a bit about the scripts you mentioned so I can copy&paste them into one of my above posts as examples, or about the call_shortcut as a concept (that was actually one I had planned but I am not at all averse to somebody else doing the work )

  2. #2

    Default Re: alpaca's Script-O-Rama

    I think it's the create_unit command that doesn't work if you leave out the comma after the unit name.
    It's not a map.

  3. #3
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    Quote Originally Posted by nikolai1962
    I think it's the create_unit command that doesn't work if you leave out the comma after the unit name.
    As I said earlier, it's a freaking working example

    @lordyu:
    Code:
            monitor_event EventCounter EventCounterType mongols_invasion_warn 1
    
            and EventCounter > 0 
    
    Should be
    
    monitor_event EventCounter EventCounterType mongols_invasion_warn 
            and EventCounter > 0

  4. #4

    Default Re: alpaca's Script-O-Rama

    As I said earlier, it's a freaking working example
    yes but there's two ways to spawn units, spawn_army and create_unit. create_unit needs the comma.
    It's not a map.

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    Quote Originally Posted by nikolai1962
    yes but there's two ways to spawn units, spawn_army and create_unit. create_unit needs the comma.
    Ah my apologies, I didn't read your post correctly

  6. #6

    Default Re: alpaca's Script-O-Rama

    lordyu, the actual problem in your code (aside from the "1" typo in the event handler) is that you use == in your if statements. You need to use =. The error log was helpful in tracing down that one.

  7. #7
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: alpaca's Script-O-Rama

    In my experience you can use == as a logic token, it's the same as =
    The original campaign script uses ==, too

  8. #8

    Default Re: alpaca's Script-O-Rama

    Quote Originally Posted by alpaca
    Yep I was planning to go through these again to see what I can incorporate here.
    Would be cool if you could explain a bit about the scripts you mentioned so I can copy&paste them into one of my above posts as examples, or about the call_shortcut as a concept (that was actually one I had planned but I am not at all averse to somebody else doing the work )
    Sure, no problem. I'll do it in a little bit, when I get everything straightened out over here.

  9. #9

    Default Re: alpaca's Script-O-Rama

    PHP Code:
    Campaign script
    ;
    script
            
    ; ---------------------
            ; 
    counters
            
            declare_counter Opened_Faction_Overview_Scroll
            declare_counter Opened_Settlement_Scroll
            declare_counter mongols_Volograd
            declare_counter mongols_Ani
            declare_counter mongols_Baghdad
            declare_counter timurids_Volograd
            declare_counter timurids_Ani
            declare_counter timurids_Baghdad
            
            
            
    ; ---------------------
            ; 
    start up

            freeze_faction_ai aztecs

            restrict_strat_radar false

            
    ;----------------------
            ; 
    monitors

            
    ;-- Mongols invasions --
        
    monitor_event EventCounter EventCounterType mongols_invasion_warn 1

            
    and EventCounter 0
            
    ADD SCOUTING INVASION
            add_events
                event    counter    mongols_invasion
                date    4 8
           end_add_events
            
    if I_EventCounter mongols_invasion_warn == 2
                terminate_monitor
            end_if
        end_monitor

        monitor_event EventCounter EventCounterType mongols_invasion
            
    and EventCounter 0
            
    if I_EventCounter mongols_invasion == 1
                add_events
            
    ;;; SCOUTING INVASION
                    events    emergent_faction    mongols
                    date    0
    ;                 region     Ani_Province
                    region    Volograd_Province
                    region     Baghdad_Province
                    movie    event
    /mongols_invade.bik
                    
    ;ADD MONGOL INVASION 1
                    events    counter    mongols_invasion
                    date    2
                end_add_events 
    is there anything wrong with this script. The mongols will not appear and i keep getting CTD.
    i traced the problem to this
    00:50:00.781 [game.script.exec] [trace] exec <if> at line 42 in Europa/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    00:50:00.781 [game.script.exec] [trace] exec <add_events> at line 44 in Europa/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    00:50:01.546 [system.rpt] [error] Medieval 2: Total War encountered an unspecified error and will now exit.

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