Log in

View Full Version : linking a faction's money to King's traits



Javolenus
07-10-2008, 18:38
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.

FactionHeir
07-10-2008, 19:37
Try that


monitor_event CharacterTurnEnd
and Trait Factionleader = 1
and Trait GoodFinances = 1
and FactionType france

console_command add_money france, 2000

end_monitor

CavalryCmdr
07-11-2008, 00:39
you should be able to link it directly to the atribute ;

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.

Javolenus
07-11-2008, 05:27
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.

CavalryCmdr
07-12-2008, 02:42
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'

Javolenus
07-12-2008, 06:14
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.


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'