[R&F] Easier way to assign a modifier to each AI player?

Shifted

Chieftain
Joined
Apr 11, 2016
Messages
12
In the mod I'm working on, I need to give each AI player a TraitModifier that changes city yields by a different amount for each of them. The way I'm thinking of doing it is through iterating over the players on a LUA script and inserting into the database a new Trait, TraitModifier, and Modifier for each player, which would allow me to give each player a unique yield amount later on based on some calculations on each turn.

Was just wondering if anyone knows of an easier way to do something like this? To be clear the desired result is that we can assign, say, Player 1 with 5 extra yield, Player 2 with 7 extra, Player 3 with 14, etc. These values are calculated as the game progresses on a LUA script, and since I don't know the amount of players until the game starts, I don't think it's something that can be done beforehand in an SQL file I'd think, unless there's a way to access the specific modifier instance attached to a leader and alter it?
 
Last edited:
Ahhh that sucks, I thought I had seen a DB.Query() with updates in it somewhere. Thanks!
 
To do this you probably have to give the AI a dummy building in their capitals. A huge pain to be honest. The inability to add Modifiers directly through Lua instead of by proxy with a Building is a big hole in mod support IMO.
 
Top Bottom