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

Thread: delete

Hybrid View

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

    Default delete

    no longer interested in participating
    Last edited by RubiconDecision; November 13, 2011 at 04:09 PM.

  2. #2
    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: Does the AI seem to take advantage of scripted events?

    Scripted events in the campaign script:
    It all depends how the script is written. And it is not that someone makes use of it - it gets given (forcefully most of the time) to whoever has been specified. When it comes to yes\no events the AI can get a random change for the event to fire as 'yes'.

    Money script for the AI:
    Welcome to the search for the holy grail of scripting. To put it bluntly - you could give the AI 30.000 a round and he would still go bankrupt, the balancing is extremely difficult.

    Effects for ancillaries:
    There is a limited number of effects that can be used, unfortunately the explanation for my list is in German, but you might be able to use as a guideline.

    Code:
    LineOfSight   Sichtlinie (erhöht den   Feinderkennungsradius)       
    LocalPopularity   Beliebtheit (verbessert die öffentliche Ordnung)       
    Looting   % Bonus auf Beutegeld       
    Loyalty   Loyalität       
    Magic   Magie (Hexe)       
    Mining   % Bonus auf Minenerträge       
    MovementPoints   Bewegungspunkte (reduziert die Entfernung, die Armeen marschieren können)   1= 5% NavalCommand   Kommando auf See (Admiral)       
    PersonalSecurity   persönliche Sicherheit (erhöht die Wahrscheinlichkeit, einen Anschlag   frühzeitig zu bemerken und zu vereiteln)       
    Piety   Frömmigkeit       
    PublicSecurity   öffentliche Sicherheit (erhöht die Wahrscheinlichkeit, feindliche Agenten   zu entdecken und zu ergreifen)       
    Purity   Reinheit (Priest)       
    Sabotage   Sabotage (Attentaeter)       
    SiegeAttack   Kommando beim Angriff von Mauern       
    SiegeDefence   Kommando bei der Verteidigung von Mauern       
    SiegeEngineering   Baupunkte (erforderlich für den Bau von Belagerungsausrüstung)50=50   Punkte       Squalor   Verschmutzung (erhöht öffentliche Ordnung und Bevölkerungswachstum)       
    Subterfuge   Agententalent (Spion\Spion)       
    TaxCollection   % Bonus auf Steuereinnahmen       
    Trading   % Bonus auf alle Handelserträge       
    TrainingAgents   % Nachlass auf Kosten der Agentenausbildung 1=5%       
    TrainingUnits   % Nachlass auf Kosten der Einheitenausbildung  1=5%       
    TroopMorale   Kampfgeist für alle Truppen auf dem Schlachtfeld       
    Unorthodoxy   Unorthodoxheit (Priest)       
    Unrest   Unruhe (hat negative Auswirkungen auf die öffentliche Ordnung)       
    Violence   Gewalt (??)










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

    Default Re: Does the AI seem to take advantage of scripted events?

    Quote Originally Posted by RubiconDecision View Post
    But Taiji your code:
    monitor_event CharacterTurnEnd CharacterIsLocal
    ...this only fires for the Human player. I want it to fire for all players.
    Then you make the script 30 times bigger (assuming 30 factions) so it can cause problems for your AI... Your AI really needs more problems?

    Plus technically that would make it an 'AI money script', but in reverse since it tries to bankrupt the AI. I would have thought perhaps that would make it seem even worse to you.

    Quote Originally Posted by RubiconDecision View Post
    I've thought about an inflation script to deal with that. I saw that once, maybe in Deus Lo Vult?
    Yes, Repman wrote a script for inflation which multiplies the effects of the costs scripts depending on the faction's treasury level.
    Last edited by Taiji; January 26, 2011 at 03:21 PM.

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

    Default Re: Does the AI seem to take advantage of scripted events?

    RubiconDecision, interesting idea

    If I understand correctly then you'll have to do it in campaign_script.txt because you can't use script commands in EDCT or EDA.

    For unique ancillaries this would do:

    monitor_event FactionTurnEnd FactionIsLocal
    and FactionwideAncillaryExists blah
    add_money -500
    end_monitor

    Or for non-unique this:

    monitor_event CharacterTurnEnd CharacterIsLocal
    and AgentType family
    and HasAncType blah
    add_money -500
    end_monitor

    You might want to track these extra costs for the player though, money cheats aren't registered on the financial scroll. Probably best to use traits to track and represent it, or you can use popup events tied to a gui function. Hah or even just list the cost in the description for the ancillary, got a bit ahead of myself there...
    Last edited by Taiji; January 26, 2011 at 12:32 PM.

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

    Default Re: Does the AI seem to take advantage of scripted events?

    If you're determined to do it then you could do it like this:

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    add_money -50
    end_monitor

    BTW it's no surprise that settlement mechanics strongly affects a settlement's financial output.
    Last edited by Taiji; January 26, 2011 at 04:54 PM.

  6. #6

    Default Re: Does the AI seem to take advantage of scripted events?

    The problem with the AI always going bankrupt is upkeep. The AI has no concept of upkeep to begin with and adding a script to increase upkeep will just make the problem worse. Best results would be to add in a check for human player and adjust upkeep there, for AI simply a single cost or free would be best.

  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: Does the AI seem to take advantage of scripted events?

    Quote Originally Posted by Taiji View Post
    If you're determined to do it then you could do it like this:

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    add_money -50
    end_monitor

    BTW it's no surprise that settlement mechanics strongly affects a settlement's financial output.

    Just to confirm: does add_money work in this way? I thought it required a faction entry.










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

    Default Re: Does the AI seem to take advantage of scripted events?

    Yes it works that way.

  9. #9
    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: Does the AI seem to take advantage of scripted events?

    Thanks










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

    Default Re: Does the AI seem to take advantage of scripted events?

    Pleasure

  11. #11
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Does the AI seem to take advantage of scripted events?

    Q: could we use:

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    if CharFactionType england
    add_money england -50
    end_if

    if CharFactionType france
    add_money france 100
    end_if

    end_monitor

    can we even test to see if a char is part of a faction that is AI controlled?

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    and CharFactionType england
    and IsFactionAIControlled
    add_money england -50

    end_monitor

  12. #12
    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: Does the AI seem to take advantage of scripted events?

    CharacterTurnEnd exports all these: nc_character_record, character_record, faction, region_id, character_type, settlement" - so it should be OK.










  13. #13
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Does the AI seem to take advantage of scripted events?

    Cheers Gig - opens up some interesting possibilities.

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

    Default Re: Does the AI seem to take advantage of scripted events?

    It wouldn't work the way you have scripted it, Rozanov. Exports are not available in if statements. You need to find other 'I_' conditions, or make separate scripts.
    Last edited by Taiji; February 27, 2011 at 10:44 AM.

  15. #15
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Does the AI seem to take advantage of scripted events?

    Thanks for pointing that out Taiji.

    (my understanding of exporting things in this context is minimal - and that's probably an overstatement)

    so these would work?

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    CharFactionType england

    add_money england -50

    end_monitor

    plus

    monitor_event CharacterTurnEnd HasAncType academic_advisor
    CharFactionType france

    add_money france 50

    end_monitor

    ---------------------------
    monitor_event CharacterTurnEnd HasAncType academic_advisor
    and I_IsFactionAIControlled england
    and CharFactionType england

    add_money england -50

    end_monitor

    ---------------------------------------

    Has anyone done a simple guide to how "exports" things works in coding?
    And how to know when to use:

    and I_IsFactionAIControlled england

    and when to use

    and IsFactionAIControlled england

    for example?

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

    Default Re: Does the AI seem to take advantage of scripted events?

    Quote Originally Posted by Rozanov View Post
    Has anyone done a simple guide to how "exports" things works in coding?
    And how to know when to use:

    and I_IsFactionAIControlled england

    and when to use

    and IsFactionAIControlled england

    for example?
    I just did, there's nothing more to it.

    Quote Originally Posted by Taiji View Post
    It wouldn't work the way you have scripted it, Rozanov. Exports are not available in if statements. You need to find other 'I_' conditions, or make separate scripts.
    In bold is the entire simple guide. You can use 'I_' conditions anywhere but you have to use them in if statements, it's really that simple.

    If you are testing your ideas before asking questions then you can have the joy (plus other benefits) of discovering this stuff for yourself. The error message will tell you that the condition does not have the export it needs, it's obvious from there.

    BTW it's going to be a lot faster to test the script and read the log, rather than post here and wait for a response. And especially when that response comes from someone who doesn't know and is also not bothering to test, as so often happens.
    Last edited by Taiji; February 28, 2011 at 04:31 AM.

  17. #17
    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: Does the AI seem to take advantage of scripted events?

    ... and is also not bothering to test, as so often happens
    Zing. If I had looked close enough I should have noticed the if statement. My bad.
    Last edited by Gigantus; February 28, 2011 at 04:07 AM.










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

    Default Re: Does the AI seem to take advantage of scripted events?

    Well yes, but I was talking more generally. The main point being that asking questions here is often an obstacle to learning when testing is so quick and easy to do (put script in campaign_script, see script failed to load, check log, learn lesson.). Also personally I am far more likely to retain the important information if I test things. And of course information retained allows for better planning, creates opportunity for good ideas, etc.

    I didn't mean to passive-aggressively single you out, Gigantus. Apologees if it came across that way. I think we're all inclined to offer our best guess, and you did show you were guessing by putting 'should', so you can't be blamed for anything IMO.
    Last edited by Taiji; February 28, 2011 at 04:33 AM.

  19. #19
    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: Does the AI seem to take advantage of scripted events?

    No offense taken, no apologies necessary. And you hit the nail on the head - testing and learning from the log is the way to go (that's how I got into it about a year ago). And taking some time to look through the docu demons gives some ideas as well. Not to forget the tutorials here.










  20. #20
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Does the AI seem to take advantage of scripted events?

    Interesting points Taiji, although as someone who can spend an entire evening trying to get something very simple to work, the idea it it easier and quicker to put in a script and test isn't always true.

    Although I have learned things through that method, questions such as the difference between I_ statements and others isn't likely to emerge quickly from trial and error.
    (And the docudemon entries are identical for I_IsFactionAIControlled and IsFactionAIControlled)

    Whereas a simple heuristic: use I_ statement if inside an if / end_if condition loop is one I (and anyone else reading this) can grasp.

    Thank you though for explaining it simply, it is sometimes what people need.

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
  •