Results 1 to 10 of 10

Thread: EDB multiple requirements question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default EDB multiple requirements question

    Hi all,
    I'm trying to make the recruitment of a particular unit from a building be era specific. I want the unit to be recruitable after event A has fired, but only during the time until event B fires, not thereafter. In the capability section for the building in question, I wrote
    Code:
    recruit_pool "Flying Lobsters"  1   0.5   1  0  requires factions { spacelobsters } and event_counter A 1 and event_counter B 0
    The first event fired and I was able to recruit my unit, but after event B had come and gone, I still could recruit it, so the second AND condition was ignored. I'm I doing something wrong? Any ideas on how I could make it work?

  2. #2

    Default Re: EDB multiple requirements question

    Make a single event counter in the CS and link it with 2 sets of turns. When turn A set counter to 1 and when Turn B set counter 0(terminate). Initial counter 0.

  3. #3

    Default Re: EDB multiple requirements question

    Brilliant! And easy. Thanks.

  4. #4

  5. #5

    Default Re: EDB multiple requirements question

    I don't know anything about scripting, really, so the best I can come up with is this.
    Code:
    monitor_event I_Turnnumber 2
    set_event_counter EventA 1
    terminate_monitor
    end_monitor 
    
    monitor_event I_Turnnumber 4
    set_event_counter EventA 0
    terminate_monitor
    end_monitor
    But I guess it's not how to do it, since you said I should make a single event counter. So, which is the right way to do it?

    Just to be clear: I want the effects to be global, not limited to the player.

    Thanks.

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

    Default Re: EDB multiple requirements question

    Code:
    declare_counter EventA
    
    monitor_event PreFactionTurnStart FactionIsLocal 
    and I_TurnNumber 2
    set_event_counter EventA 1
    terminate_monitor
    end_monitor 
    
    monitor_event FactionTurnEnd FactionType slave
    and I_Turnnumber 4
    set_event_counter EventA 0
    terminate_monitor
    end_monitor
    I think that should do it if you want the recruitment capability to appear on the second turn, and then end at the end of the fourth.
    Last edited by Taiji; August 09, 2010 at 03:29 PM.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: EDB multiple requirements question

    I think the EDB doesn't read the zero in the event condition. You would have to use 'and not event_counter B 1'










  8. #8

    Default

    Oh, both a lesson in scripting and a way to make my original idea work. Great stuff!

    Quote Originally Posted by Gigantus View Post
    I think the EDB doesn't read the zero in the event condition. You would have to use 'and not event_counter B 1'
    I just tried this out and it works like a charm. In the EDB I gave castles the capability of recruiting mailed knights between two of the early events (after A and not after B), and it worked as intended. After event A had fired, the knights appeared in the recruitment list, but after event B they disappeared again.

    Thanks a bunch for the assistance, gentlemen!

    Quote Originally Posted by Ishan View Post
    @No_Pants_On
    Your script is wrong. why? Coz in the first line u have added turn number which is a condition not an event so try to keep this in my mind hence forth bro.
    Thanks, that's good to know. I'd better read a scripting tutorial before I try scripting again. To keep from embarassing myself.
    Last edited by Gigantus; August 10, 2010 at 05:12 AM.

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

    Default Re: EDB multiple requirements question

    Quote Originally Posted by No_Pants_On View Post
    Thanks, that's good to know. I'd better read a scripting tutorial before I try scripting again. To keep from embarassing myself.
    I don't see anything to get embarassed about really. Your script at least communicated pretty precisely what you wanted to script.

    Plus I think there's plenty of people around here that enjoy helping with scripting

    Personally I don't think I've read a tutorial, I don't remember any, I've just looked at existing scripts and then looked at docudemons to examine how the script works. And vice versa I suppose, since when you're looking at a working script it gives a good idea of what the docudemons must mean.

  10. #10

    Default Re: EDB multiple requirements question

    @Gigantus
    You are right it doesn't takes 0 in account, not works though. For using it we have to create 2 triggers separately in the CS.
    @No_Pants_On
    Your script is wrong. why? Coz in the first line u have added turn number which is a condition not an event so try to keep this in my mind hence forth bro.
    Last edited by Ishan; August 10, 2010 at 03:47 AM.

Posting Permissions

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