Results 1 to 6 of 6

Thread: Technical questions on scripting

  1. #1
    EBII PM Member JMRC's Avatar
    Join Date
    Nov 2006
    Location
    Lisboa, Portugal
    Posts
    7,930

    Default Technical questions on scripting

    Hi.

    This weekend I was trying to implement a new feature into EBBS and also change my current money assistance code to reduce the number of monitor_event rules.

    However, it didn't work, so I would like your help to understand what I'm doing wrong here:

    1. The feature was: when a (named character) general with Despoiler Trait devastates an enemy tile, the general's faction receives some money.

    Note: I use the docudemon files as source for the programming rules.

    So I started by this code:
    Code:
    monitor_event GeneralDevastatesTile FactionType seleucid
       and Trait Despoiler > 0
       and AgentType = named character
          console_command add_money seleucid, 500
    end_monitor
    Apparently, it didn't work. Or maybe my concept of "devastating tile" is not correct.


    2. Right now, I have the following type of code to implement the money assistance:
    Code:
    ;monitor_event 1
    monitor_event FactionTurnStart FactionType seleucid
       and not FactionIsLocal
       and I_TurnNumber < 100
       and Treasury > 10000
       and Treasury < 20001
           console_command add_money seleucid, 10000
    end_monitor
    
    ;monitor_event 2
    monitor_event FactionTurnStart FactionType seleucid
       and not FactionIsLocal
       and I_TurnNumber < 100
       and Treasury < 10001
           console_command add_money seleucid, 20000
    end_monitor
    Now I would like to join it in a single monitor_event. I want to do this because I think that when the monitor_event 2 occurs and the Treasury goes into the range of the monitor_event 1, this last event is triggered, effectively giving 30000 to the faction instead of the intended 20000. Note: I'm not sure of this behavior, but it explains some distortion that I have in the money assistance. I tried to change to the code below, so that the event is only triggered once per turn:

    Code:
    monitor_event FactionTurnStart FactionType seleucid
       and not FactionIsLocal
       and I_TurnNumber < 100
           if Treasury > 10000 and Treasury < 20001
                console_command add_money seleucid, 10000
           end_if
           if Treasury < 10001
                console_command add_money seleucid, 20000
           end_if
    end_monitor
    However, this did not work because the Treasury trigger is outside the monitor_event condition. Can someone give me some help with this?

    Thanks in advance.



    "Death Smiles at Us All,all a Man Can Do Is Smile Back."
    Maximvs Decimvs Meridivs, Commander of the Armies of the North, General of the Felix Legions, Iberian Gladiator.

  2. #2
    Asia ton Barbaron mapper Member Pharnakes's Avatar
    Join Date
    Feb 2007
    Location
    The Kingdom of Fife
    Posts
    1,768

    Smile Re: Technical questions on scripting

    I think try deleting the agent type = named caharcter, I don't know if it wil improve matters but it certinately won't do any harm, as its not nessecary anyway, as only a general can get the despoiler trait.


    2. I'm almost certain this is unessescary provided you make sure the 10000 script is above the 20000 script, beacuse the computer reads down the file and don't think it reads it more than once per turn.
    Last edited by Pharnakes; 06-11-2007 at 11:21.
    Asia ton Barbaron The new eastern mod for eb!

    Laziest member of the team My red balloons, as red as the blood of he who mentioned Galatians.
    Roma Victor!

    Yous ee gishes?

  3. #3
    EBII PM Member JMRC's Avatar
    Join Date
    Nov 2006
    Location
    Lisboa, Portugal
    Posts
    7,930

    Default Re: Technical questions on scripting

    Thanks. The previous problem is solved.

    Now I have another problem using the GeneralDevastatesTile event to give more money to the looting faction, using the following code, but it doesn't work.

    Code:
     
    monitor_event GeneralDevastatesTile FactionType seleucid
       and SettlementBuildingExists >= farms
     console_command add_money seleucid, 100
    end_monitor
    Seems like this event does not accept the SettlementBuildingExists trigger, although the docudemon file say otherwise.

    Can someone give me a hint?



    "Death Smiles at Us All,all a Man Can Do Is Smile Back."
    Maximvs Decimvs Meridivs, Commander of the Armies of the North, General of the Felix Legions, Iberian Gladiator.

  4. #4
    EBII Mod Leader Member Foot's Avatar
    Join Date
    Apr 2005
    Location
    Brighton, East Sussex, England (GMT)
    Posts
    10,736

    Default Re: Technical questions on scripting

    You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

    Foot
    EBII Mod Leader
    Hayasdan Faction Co-ordinator


  5. #5
    EBII PM Member JMRC's Avatar
    Join Date
    Nov 2006
    Location
    Lisboa, Portugal
    Posts
    7,930

    Default Re: Technical questions on scripting

    Quote Originally Posted by Foot
    You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

    Foot
    Thanks Foot. I did try to do that, but it seems the GeneralDevastatesTile event simply doesn't recognize the SettlementBuildingExists trigger. If this is so, then it is a bug in the docudemon files because apparently this event doesn't export the Settlement.

    It's a bit frustrating...



    "Death Smiles at Us All,all a Man Can Do Is Smile Back."
    Maximvs Decimvs Meridivs, Commander of the Armies of the North, General of the Felix Legions, Iberian Gladiator.

  6. #6
    EB Traitor Member BozosLiveHere's Avatar
    Join Date
    Jan 2006
    Location
    Uqbar, Tl÷n
    Posts
    3,662

    Default Re: Technical questions on scripting

    Quote Originally Posted by Foot
    You cannot have >= with SettlementBuildingExists. You will need to put in "and" statements for all levels of farm you want to use.

    Foot
    This is not true. The problem in your code is that AFAIK SettlementBuildingExists can only work if the general is actually inside a settlement, something that just can't happen if he's pillaging a tile.

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