Effect from policy to wonder?

Would it be possible

No. At least, not directly. XML stubs aren't transferrable like that. Just because something can be done in one XML table in no way implies it can be done through another.

That being said, the ones you're worried about are some of the simpler effects and CAN be handled through Lua. At the end of each turn, look at each empire's Happiness and boost research accordingly, or look at its culture output and do the same. It's not difficult at all, once you get the hang of Lua coding.

The catch is, as always, the AI won't actually understand what's going on. In this case it's not too crippling, because the AI won't really change whether or not it builds culture buildings or stays happy based on those policies, so it wouldn't change anything about the wonder effects. But if you're trying to transfer any of the more complex policies over, then it'd be a different story, and a few of them just won't transfer at all (like, any that add Happiness).
 
Aah. So I couldn't make a wonder that adds '10% culture while the empire is happy'?

Sure you could. What I was trying to say is that you'd make a building that has no effect. Then, in Lua, you'd make an end-of-turn event that loops over players, loops over each player's cities, checks to see if that city has this wonder, and if so, get that player's Happiness. If it's positive, then get the culture per turn and award an additional 10%. It'd work just fine, at least mechanically.

The problem is that the AI would have no clue that building that wonder leads to that effect. It would build the Wonder, based purely on the Flavor ratings, and would then get the effect without knowing why.
To illustrate, consider the following three effects:
1> +10% culture
2> +10% culture when happiness is positive
3> +10% culture when the player has more than 1000 gold in the bank

The AI literally can't tell these apart; all it can be told, through the Flavors system is "this wonder is good for culture". #1 it can handle just fine, obviously. #2 it technically doesn't handle well, but since the AI already prioritizes keeping happiness above 0, it's not really a problem. But #3 would be a problem, because the AI is not currently built to save up money, and there's no easy way to make it do so.
It's possible that the existing XML stubs (like the ones in the policies you're asking about) are tied into the logic a bit more directly, to where the AI CAN be told to account for these conditionals. But Lua-based logics definitely can't.
 
Back
Top Bottom