Results 1 to 13 of 13

Thread: Improve faction standigs?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Improve faction standigs?

    I have an event wich can be accepted\declined.
    I want this event,if accepted, to increase the faction standings between England and Moors to a value of 0.1 if they are =< 0 and not at war, to add 0.5 to their relations if they are > 0.

    The problems are two:
    How can I test the numeric value of their relations?
    How can I add a fix value to thier relations?

    can you help me?

    Here is some piece of code:


    Code:
     
    monitor_conditions [conditions]
     if not DiplomaticStanceFromFaction venice moors = AtWar
      historic_event skull true factions { venice, }
      add_events
       event counter skull_accepted
       event counter skull_declined
      end_add_events
     end_if
    terminate_monitor
    end_monitor
    ;---------------accepts skull
    monitor_conditions I_EventCounter skull_accepted = 1
     historic_event skull_accepted false factions { venice, moors, }
     set_faction_standing moors venice 0.1       
     set_faction_standing venice moors 0.1            ->here the problem! if the faction_standings are greater, they become lower - and I want to avoid it.
    terminate_monitor
    end_monitor
    ;-----------rejects skull
    monitor_conditions I_EventCounter declined = 1
     historic_event skull_declined false factions { venice, }
    terminate_monitor
    end_monitor

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  2. #2

    Default Re: Improve faction standigs?

    sorry the code isn't coming out right for me
    Last edited by valvegas1; December 30, 2011 at 10:27 AM.

  3. #3
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Improve faction standigs?

    from docudemos:
    Code:
    Identifier:              FactionStanding
    Trigger requirements:    faction, target_faction
    Parameters:              logic token, quantity
    Sample use:              FactionStanding > 0.0
    Description:             what is the standing (relationship) of a faction towards the target faction
    Battle or Strat:         Either
    Class:                   FACTION_STANDING
    Implemented:             Yes
    Author:                  ScottL
    It wouldn work only with monitor_event FactionTurnStart or similar, not with a monitor_conditions

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  4. #4

    Default Re: Improve faction standigs?

    Quote Originally Posted by Kiliç Alì View Post
    from docudemos:
    Code:
    Identifier:              FactionStanding
    Trigger requirements:    faction, target_faction
    Parameters:              logic token, quantity
    Sample use:              FactionStanding > 0.0
    Description:             what is the standing (relationship) of a faction towards the target faction
    Battle or Strat:         Either
    Class:                   FACTION_STANDING
    Implemented:             Yes
    Author:                  ScottL
    It wouldn work only with monitor_event FactionTurnStart or similar, not with a monitor_conditions

    yeah sorry i forgot about that...I looked through and I don't see any I_ conditions to test faction standings...but, why couldn't you set it up as an event monitor?

    EDIT: nevermind that question i just remembered....sorry it's kind of early here...
    Last edited by valvegas1; December 30, 2011 at 10:45 AM.

  5. #5

    Default Re: Improve faction standigs?

    Quote Originally Posted by Kiliç Alì View Post
    I have an event wich can be accepted\declined.
    I want this event,if accepted, to increase the faction standings between England and Moors to a value of 0.1 if they are =< 0 and not at war, to add 0.5 to their relations if they are > 0.

    The problems are two:
    How can I test the numeric value of their relations?
    How can I add a fix value to thier relations?

    can you help me?

    Here is some piece of code:


    Code:
     
    monitor_conditions [conditions]
     if not DiplomaticStanceFromFaction venice moors = AtWar
      historic_event skull true factions { venice, }
      add_events
       event counter skull_accepted
       event counter skull_declined
      end_add_events
     end_if
    terminate_monitor
    end_monitor
    ;---------------accepts skull
    monitor_conditions I_EventCounter skull_accepted = 1
     historic_event skull_accepted false factions { venice, moors, }
     set_faction_standing moors venice 0.1       
     set_faction_standing venice moors 0.1            ->here the problem! if the faction_standings are greater, they become lower - and I want to avoid it.
    terminate_monitor
    end_monitor
    ;-----------rejects skull
    monitor_conditions I_EventCounter declined = 1
     historic_event skull_declined false factions { venice, }
    terminate_monitor
    end_monitor

    Try adding this to your script....
    Code:
    monitor_conditions I_EventCounter skull_accepted = 1
     and FactionStanding moors venice < 0.1 
     and FactionStanding venice moors < 0.1
     historic_event skull_accepted false factions { venice, moors, }
     set_faction_standing moors venice 0.1       
     set_faction_standing venice moors 0.1 
    terminate_monitor
    end_monitorI hope this is what your looking for...

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

    Default Re: Improve faction standigs?

    You need to check faction standings, and set up counters for them, before the skull event fires. Then when the rewards are attributed you can set faction standing as determined by your counters and have the effect of incrementing it.

  7. #7

    Icon1 Re: Improve faction standigs?

    Quote Originally Posted by Taiji View Post
    You need to check faction standings, and set up counters for them, before the skull event fires. Then when the rewards are attributed you can set faction standing as determined by your counters and have the effect of incrementing it.
    Like this:
    Spoiler Alert, click show to read: 
    Code:
    declare_counter venice_moors_standing
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.1
    		set_counter quarter 1
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.2
    		set_counter quarter 2
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.3
    		set_counter quarter 3
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.4
    		set_counter quarter 4
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.5
    		set_counter quarter 5
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.6
    		set_counter quarter 6
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.7
    		set_counter quarter 7
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.8
    		set_counter quarter 8
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.9
    		set_counter quarter 9
    	end_monitor
    
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 1.0
    		set_counter quarter 10
    	end_monitor
    Code:
    ;---------------accepts skull
    
    	monitor_conditions I_EventCounter skull_accepted = 1
    		if I_CompareCounter venice_moors_standing = 1
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 2
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 3
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 4
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 5
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 6
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 7
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 8
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 9
     		set_faction_standing venice moors ...
    	end_if
    		if I_CompareCounter venice_moors_standing = 10
     		set_faction_standing venice moors ...
    	end_if
    		historic_event skull_yes factions { venice, moors, }
    	terminate_monitor
    	end_monitor
    
    ;-----------rejects skull
    
    	monitor_conditions I_EventCounter declined = 1
     		historic_event skull_no factions { venice, }
    	terminate_monitor
    	end_monitor

  8. #8
    Kiliç Alì's Avatar Domesticus
    Artifex

    Join Date
    Feb 2011
    Location
    Italy
    Posts
    2,114

    Default Re: Improve faction standigs?

    Thanks both very much.
    It should work even if I change each monitor in the first part with a multiple if, right?
    Let's give it a try...

    EDIT obviously the counter name is not "quarter" but "venice_moors_standing"
    and since relations can be > 0.1 and < 0.2, this has to be specified aswell, but it definitely works. thanks very much men
    Last edited by Kiliç Alì; December 31, 2011 at 05:34 AM.

    Member of the Imperial House of Hader, proud client of The only and sole Ferrit

  9. #9

    Icon1 Re: Improve faction standigs?

    EDIT obviously the counter name is not "quarter" but "venice_moors_standing"
    and since relations can be > 0.1 and < 0.2, this has to be specified aswell, but it definitely works. thanks very much men
    Yes:
    Spoiler Alert, click show to read: 
    Code:
    declare_counter venice_moors_standing
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.1
    		set_counter venice_moors_standing 1
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.2
    		set_counter venice_moors_standing 2
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.3
    		set_counter venice_moors_standing 3
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.4
    		set_counter venice_moors_standing 4
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.5
    		set_counter venice_moors_standing 5
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.6
    		set_counter venice_moors_standing 6
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.7
    		set_counter venice_moors_standing 7
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.8
    		set_counter venice_moors_standing 8
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 0.9
    		set_counter venice_moors_standing 9
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and FactionType venice
    		and TargetFactionType moors
    		and FactionStanding = 1.0
    		set_counter venice_moors_standing 10
    	end_monitor

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

    Default Re: Improve faction standigs?

    OK, nice script TNZ but 3 problems:

    Use UpdateAttitude instead of PreFactionTurnStart. This is because PFTS will not export a target faction, and because unnecessary use of PFTS is evil.

    Problem 2 is that you are measuring the AI's standing with the player not the other way around, and I guess you want it the other way around...

    And problem 3 is that I think you have to use < and > with FactionStanding because it doesn't round down. If faction standing is at 0.100001 then it will not return as 0.1 or 0.2 for the purposes of the script. Hence the counter might get stuck for several rounds before registering a nice round number by chance.

    monitor_event UpdateAttitude FactionType venice
    and TargetFactionType moors
    and I_LocalFaction moors
    and FactionStanding > 0.55
    and FactionStanding < 0.651
    set_counter venice_moors_standing 6
    end_monitor

    Or something like that.

    And if something triggers the skull event then maybe that can trigger this factionstanding tracking, so it's only on when needed.
    Last edited by Taiji; December 31, 2011 at 06:06 PM.

  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Improve faction standigs?

    Quote Originally Posted by Taiji View Post
    unnecessary use of PFTS is evil
    Why is that Taiji? Something peculiar to PFTS or do you mean in general it's better to handle it in a response to the event/occurrence in question, rather than testing for it in generic turn end monitors?

  12. #12

    Default Re: Improve faction standigs?

    Taiji: You're right on all three counts. I was just wondering if you could use an event counter in the‘descr_faction_standing’ file. That way, you could avoid needing a script that detects ‘FactionStanding’ in the first place.

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

    Default Re: Improve faction standigs?

    That's a much much better idea you're suggesting, TNZ. Can just use the accepted/declined events as triggers for relation shifts.

Posting Permissions

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