Results 1 to 6 of 6

Thread: linking a faction's money to King's traits

Hybrid View

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

    Default linking a faction's money to King's traits

    Hi There,

    I wonder if anyone can help? I'm no expert in scripting, so I'd need very basic guidance.

    Basically, what I'd like to do is this:

    I'd like to make it so that a faction's financial fortunes are tied to its King's traits. In other words - bad king, bad finances; good king, good finances.

    One way of doing this might be to add/subtract money depending on a faction leader's authority rating. For example:

    Authority = 0, faction loses 1500 per turn
    Authority = 1, faction loses 1000 per turn
    Authority = 2, faction loses 500 per turn
    Authority = 3, faction loses/gains nothing
    Authority = 4, faction gains 500 per turn

    And so on, in jumps of 500, right up to Authority = 10.

    But how would I script this in the campaign script?

    Also, I'd want this to affect both human and AI factions.

    If someone could help - perhaps by giving a sample script for one faction, which I could then copy for the rest, then that would be ideal - because all I have here is an idea - I don't actually know much about scripting.

    Many thanks in advance for replies.

  2. #2
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default Re: linking a faction's money to King's traits

    Try that
    Code:
    	monitor_event CharacterTurnEnd
    		and Trait Factionleader = 1
    		and Trait GoodFinances = 1
    		and FactionType france
    
    		console_command add_money france, 2000
    
    	end_monitor
    Last edited by FactionHeir; 07-10-2008 at 19:37.
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

  3. #3

    Default Re: linking a faction's money to King's traits

    you should be able to link it directly to the atribute ;
    Code:
    	monitor_event FactionTurnEnd FactionType france
    		
    		if FactionLeaderAttribute Influence < 1
    			console_command add_money france, -1500
    		end_if
    
    		if FactionLeaderAttribute Influence = 1
    			console_command add_money france, -1000
    		end_if
    
    
    	end_monitor
    Make sure not to 'terminate_monitor' or it will only fire once.
    I have not tried the 'FactionLeaderAttribute' yet, but it's in the docudemon and should work.

  4. #4

    Default Re: linking a faction's money to King's traits

    Hi FactionHeir and CavalryCmdr,

    Many thanks indeed for these quick replies. I'll try both sample scripts and see where it leads. Just one question, though: if I want this to script to affect both human player and the AI, will I have to include FactionIs local/not FactionIsLocal? Or will FactionType cover it?

    Again, many thanks - help much appreciated.

  5. #5

    Default Re: linking a faction's money to King's traits

    FactionType affects both human and AI the same. Only if you wanted to change the effects for the AI, would you need to add 'and not FactionIsLocal'

  6. #6

    Default Re: linking a faction's money to King's traits

    Many thanks indeed for this. Yes, I see, that makes perfect sense. I have no programming or scripting experience, so needed some help with this. Once again, many thanks for your help and prompt reply - much appreciated.

    Quote Originally Posted by CavalryCmdr View Post
    FactionType affects both human and AI the same. Only if you wanted to change the effects for the AI, would you need to add 'and not FactionIsLocal'

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