Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: add_money not working

  1. #1
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default add_money not working

    I want to check if AI will get money, so decided to use my faction and made the script:

    monitor_event PreFactionTurnStart not IsFactionAIControlled
    if I_CompareCounter turn_fid = 10 (turn_fid 10 it's my faction turn)
    and I_TurnNumber = 0
    add_money russia 10000
    end_if
    end_monitor

    But money not add, what's wrong?

  2. #2

    Default Re: add_money not working

    Try using:

    Code:
    console_command add_money russia, 10000
    You should also check to make sure your turn_fid counter is being set correctly for russia's turn. I'm also suspicious of the turn 0 condition. I don't use it myself. If the intention is for this money script to fire as soon as russia's first turn starts, then you don't need the two turn conditions at all. Just say:

    Code:
    monitor_event PreFactionTurnStart FactionType russia
    and not IsFactionAIControlled
    ...

  3. #3
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    I use GrnEyedDevil 12 turns per yer script with all features. I wanted to give money AI each year, using counter month (noy sure i completely understand, how it works) or using just I_TurnNumber condition, becouse i thought that counting begin from first turn. I decide to check will it work or no, giving money my(LocalFaction), but tried all ways, i didn't get result, i can't give money my faction. But the purpose is give AI money regularly. Can you, please, explain me, what i have to do.

  4. #4
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    625

    Default Re: add_money not working

    Increase the King's purse in the descr_strat for the factions you want to have more money ... That will give them more money every turn.

  5. #5
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    Thanks for the answer, but is there are any way to give money through some periods (if 12 turns per year, year for example)? But, i hope it will help

  6. #6

    Default Re: add_money not working

    I think you can just increase the King's purse (+10000) of the target faction, then decrease it (-10000) after 12 turns, for example, so everything only occurs in that period.

  7. #7
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    Why money not added to my faction?

    monitor_event PreFactionTurnStart FactionType russia
    and not IsFactionAIControlled
    if I_TurnNumber == 1 (or if I_CompareCounter month ==1)
    add_money russia 10000
    end_if
    end_monitor

  8. #8
    QuintusSertorius's Avatar EBII Hod Carrier
    Artifex

    Join Date
    Feb 2008
    Location
    UK
    Posts
    11,622

    Default Re: add_money not working

    It requires you to have set up event_counters which log the seasons and who's turn it is (useful for all sorts of things), but here's an example of a spring money boost in EBII:

    Code:
        monitor_event FactionTurnStart TrueCondition
            and I_EventCounter ecSpring > 0				; spring is in the air - ie after the winter recruitment glut
            and Treasury < 5000                            ; faction is low on funds
            if I_EventCounter faction_turn_f_rome > 0
                and I_IsFactionAIControlled f_rome
                add_money f_rome 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_carthage > 0
                and I_IsFactionAIControlled f_carthage
                add_money f_carthage 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_makedonia > 0
                and I_IsFactionAIControlled f_makedonia
                add_money f_makedonia 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_epeiros > 0
                and I_IsFactionAIControlled f_epeiros
                add_money f_epeiros 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_kh > 0
                and I_IsFactionAIControlled f_kh
                add_money f_kh 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_seleukid > 0
                and I_IsFactionAIControlled f_seleukid
                add_money f_seleukid 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_ptolemaioi > 0
                and I_IsFactionAIControlled f_ptolemaioi
                add_money f_ptolemaioi 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_baktria > 0
                and I_IsFactionAIControlled f_baktria
                add_money f_baktria 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_hayasdan > 0
                and I_IsFactionAIControlled f_hayasdan
                add_money f_hayasdan 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_pontos > 0
                and I_IsFactionAIControlled f_pontos
                add_money f_pontos 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_parthia > 0
                and I_IsFactionAIControlled f_parthia
                add_money f_parthia 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_aedui > 0
                and I_IsFactionAIControlled f_aedui
                add_money f_aedui 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_arverni > 0
                and I_IsFactionAIControlled f_arverni
                add_money f_arverni 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_casse > 0
                and I_IsFactionAIControlled f_casse
                add_money f_casse 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_lusotannan > 0
                and I_IsFactionAIControlled f_lusotannan
                add_money f_lusotannan 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_sweboz > 0
                and I_IsFactionAIControlled f_sweboz
                add_money f_sweboz 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_getai > 0
                and I_IsFactionAIControlled f_getai
                add_money f_getai 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_saba > 0
                and I_IsFactionAIControlled f_saba
                add_money f_saba 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_saka > 0
                and I_IsFactionAIControlled f_saka
                add_money f_saka 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_sauromatae > 0
                and I_IsFactionAIControlled f_sauromatae
                add_money f_sauromatae 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_numidia > 0
                and I_IsFactionAIControlled f_numidia
                add_money f_numidia 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_pergamon > 0
                and I_IsFactionAIControlled f_pergamon
                add_money f_pergamon 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_gandhara > 0
                and I_IsFactionAIControlled f_gandhara
                add_money f_gandhara 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_lugia > 0
                and I_IsFactionAIControlled f_lugia
                add_money f_lugia 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_bosporan > 0
                and I_IsFactionAIControlled f_bosporan
                add_money f_bosporan 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_arevaci > 0
                and I_IsFactionAIControlled f_arevaci
                add_money f_arevaci 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_boii > 0
                and I_IsFactionAIControlled f_boii
                add_money f_boii 6000        ; Bonus lump sum to encourage construction
            end_if
            if I_EventCounter faction_turn_f_nabatu > 0
                and I_IsFactionAIControlled f_nabatu
                add_money f_nabatu 6000        ; Bonus lump sum to encourage construction
            end_if
        end_monitor

  9. #9
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    I aready interested, it's medieval engine that's you can't add money your faction

  10. #10
    QuintusSertorius's Avatar EBII Hod Carrier
    Artifex

    Join Date
    Feb 2008
    Location
    UK
    Posts
    11,622

    Default Re: add_money not working

    Code:
        monitor_event PreFactionTurnStart FactionType russia
            and not I_IsFactionAIControlled russia
            if I_TurnNumber == 1 (or if I_CompareCounter month ==1)
                add_money russia 10000
            end_if
        end_monitor
    You've missed the I_ and faction (in red above).

  11. #11

    Default Re: add_money not working

    Quote Originally Posted by Danya82 View Post
    I aready interested, it's medieval engine that's you can't add money your faction
    There are absolutely no such limit.

    Use the command:
    Code:
    console_command add_money 10000
    It will add 10000 money to the player faction.

    If you're not sure whether it's the problem of monitor trigger or command, try to call a historic event. If the historic event is shown but money not added, it means that command doesn't work. If you cannot even see the historic event, it means that your trigger and conditions have some error.
    Code:
    monitor_event [whatever]
        historic_event it_works
        console_command add_money 10000
    end_monitor
    in historic_events.txt:
    Code:
    {IT_WORKS_BODY}Triggers and conditions are correct!
    {IT_WORKS_TITLE}Triggers and conditions are correct!

  12. #12

    Default Re: add_money not working

    Quote Originally Posted by QuintusSertorius View Post
    Code:
        monitor_event PreFactionTurnStart FactionType russia
            and not I_IsFactionAIControlled russia
            if I_TurnNumber == 1 (or if I_CompareCounter month ==1)
                add_money russia 10000
            end_if
        end_monitor
    You've missed the I_ and faction (in red above).
    IsFactionAIControlled is a valid event condition when the event exports the faction ID (which PreFactionTurnStart does). You don't need the I_ condition but either will work.

  13. #13
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    It's not work

  14. #14
    Lusitanio's Avatar Content Staff
    Join Date
    Jan 2018
    Location
    Portugal
    Posts
    981

    Default Re: add_money not working

    Try console_command add_money, 10000

  15. #15
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    i did

  16. #16
    QuintusSertorius's Avatar EBII Hod Carrier
    Artifex

    Join Date
    Feb 2008
    Location
    UK
    Posts
    11,622

    Default Re: add_money not working

    What does your script look like now?

  17. #17
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    I deleted it becouse i tried all ways, i don't know, may be i missing something

  18. #18
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    Someone ever tried to give money his faction. I tried (if i no mistaked) all variants - to check will it work with the AI:

    monitor_event PreFactionTurnStart FactionType russia
    and not (I_)IsFactionAIControlled russia (FactionIsLocal)
    If I_CompareCounter month ==(=) 1 (if I_TurnNumber ==(=) 1
    (console_command) add_money russia 10000
    end_if
    end_monitor

    In brackets all variants, that's i tried. So why i can't add money to my faction, where is mistake? Or it's impossible?

  19. #19
    QuintusSertorius's Avatar EBII Hod Carrier
    Artifex

    Join Date
    Feb 2008
    Location
    UK
    Posts
    11,622

    Default Re: add_money not working

    It clearly isn't "impossible" when virtually every mod has a finance script giving money to AI factions. I posted an example of something that works in my mod.

  20. #20
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    224

    Default Re: add_money not working

    I've got the working script through the GrnEyedDevil's 12 turns per year:

    monitor_event PreFactionTurnStart FactionIsLocal ; set the season for each month
    if I_CompareCounter month == 1 ;January
    if not I_IsFactionAIControlled russia
    console_command add_money russia, 20000
    end_if
    and I_CompareCounter winter_severity == 1 ; normal winter
    console_command season winter
    historic_event month_1
    end_if

    The question: will the counter month work for the AI? There are FactionIsLocal in monitor. Or i have to use historic_event month_1?.. For purpose to give AI money each year. And why not work I_TurnNumber

Page 1 of 2 12 LastLast

Posting Permissions

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