Results 1 to 7 of 7

Thread: Script Question: Event appear Localy?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Script Question: Event appear Localy?

    Hi.
    It's been 9 months since my last works on scripting of Med2, and I am really really rusty. And even then, I wasnt that good.
    My question is simple. I have an event, that appears currently to everyone. What is the proper script, in order to make it appear to only one individual faction of my choice?

    To make it more clear, I want the event to occur always, but the message of the event I want to appear only to one faction. Any ideas?

    Here is how the event occurs now:

    Code:
        monitor_conditions I_TurnNumber = 0
            add_events
                event    historic scots_nearby_1
                date 0
             end_add_events
            
            terminate_monitor
        end_monitor
        
        monitor_conditions I_TurnNumber = 1
            add_events
                event    counter    scots_attack_1
                 date    0
             end_add_events
            
            terminate_monitor
        end_monitor
        
        monitor_event EventCounter EventCounterType scots_attack_1
            and EventCounter > 0
    
            if I_EventCounter scots_attack_1 == 1
    
                add_events
                    event    historic scots_attack_1
                     date 0
                    position    51, 314
                 end_add_events
                    
                spawn_army 
                    faction scotland
                    character    DavidII of Scotland, named character, age 22, x 63, y 311, family
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Script Question: Event appear Localy?

    You can use conditions like these:

    and FactionIsLocal
    and FactionType moomins
    Last edited by Taiji; July 27, 2010 at 02:25 PM.

  3. #3
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Re: Script Question: Event appear Localy?

    These conditions will determine wether the event will occur or not.
    I want the event to occur no matter what, but I want the message that pops to appear only to the faction of England.
    Last edited by =NF= Vasileios_the2nd; July 27, 2010 at 02:51 PM.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  4. #4

    Default Re: Script Question: Event appear Localy?

    when you call the event put the faction name in the call...

    historic_event scots_attack_1 england

    The above event will only show for england

    Ive never used the add_events and end_add_events. You can simply just call the event without declaring anything. I usually use other monitors, and other in game conditions, to determine when an event will fire and use an event_counter to track that. Then i use that event_counter to determine when the event will actually be called.


    This is from the docudemons;

    Identifier: historic_event
    Parameters: event type, accept/decline scroll, movie_path, factions
    Description: Triggers historic event. If accept/decline, increments a [event]_accepted or [event]_declined counter on selection.
    Sample use: historic_event stoic_philosophy true faction/stoic_philosophy.bik
    Class: HISTORIC_EVENT

    The line in bold is optional except event type. 'historic_event blah' is sufficient for an event named 'blah' to fire. You can opt to add whether it is an accept/decline event,movie event, and/or what specific factions will see the event.
    ...longbows, in skilled hands, could reach further than trebuchets...

  5. #5
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Re: Script Question: Event appear Localy?

    Unfortunatelly I am modding a med2.exe mod. I have cursed many times this decision while scripting, but can't be helped.
    I think I have figured how to do it. It's stupid, but will probably work.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  6. #6
    =NF= Vasileios_the2nd's Avatar Semisalis
    Join Date
    Sep 2008
    Location
    Athens.Greece
    Posts
    404

    Default Re: Script Question: Event appear Localy?

    Problem solved. Via complicated but stupidly easy scripting.
    I eventually used the conditions taiji said. I had forgotten how historic and non historic event calls work, my bad.
    Thank you very much.
    "Greeks dont mod like modders, modders mod like greeks." -PorkyJack
    10 new captain models (campaign map) to download

  7. #7
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Script Question: Event appear Localy?

    You're welcome

    It also occurs that I_LocalFaction could be useful, and we can 'if' statement any script where the conditions do not require some info from the event.

    If I_TurnNumber blahblah and not I_LocalFaction suchandsuch then execute event.

    So that way you can stick the trigger for the event into any event monitor as long as it has no conditions that you don't want. It would slightly reduce code, reduce monitors by at least 1, and (the reason I mention it) avoid multiple triggers firing simultaneously. If you have another monitor which could fire an event popup at the exact same time as this one, it might fail to do so.

    Anyway, just a suggestion
    Last edited by Taiji; July 27, 2010 at 07:00 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •