• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Dummy Policy method broken by last patch?

Vicevirtuoso

The Modetta Man
Joined
May 14, 2013
Messages
775
Location
The Wreckage, Brother
Previously, this method was suitable for adding dummy policies without increasing the culture cost of new policies:

Code:
pPlayer:SetNumFreePolicies(1)
pPlayer:SetNumFreePolicies(0)
pPlayer:SetHasPolicy(iPolicy, true)

However, it appears that in the newest patch, this method will cause the cost of social policies to never rise. Simply setting the player to have the policy alone will cause the player's cost of future social policies to increase. So it looks like we're going to have to find a roundabout method of re-implementing dummy policies.

Does anyone have any ideas? I was thinking of this really clunky method, but it's obviously not ideal:

  • SetNumFreePolicies(1)
  • SetHasPolicy(iPolicy, true)
  • (Loop through the game's normal policies and find one the player doesn't have, but can adopt, and won't give them something like a free unit. For argument, we'll call that policy's ID iTestPolicy)
  • Network.SendUpdatePolicies(iTestPolicy, (true if it is a policy branch opener, false if not), true)
  • SetHasPolicy(iTestPolicy, false)

The only other alternative I can think of is to give dummy policies their own policy branches and whatnot, but I'm scared that'll allow AIs to pick them. I'm going to be doing some more testing, but any suggestions are welcome.
 
Which is odd, as there is nothing in the XyzNumFreePolicies() or SetHasPolicy() C++ methods that has changed between 3.144 and 3.276
 
Hmm, I think the problem in my case may have been caused by the fact that my script called for the policy to also be removed in certain cases. It seems that it's necessary to add the two SetNumFreePolicies() even if you're removing a policy. After doing so, there don't appear to be any more issues.

Testing my other mods which simply "set it and forget it" showed no odd behavior either. Guess I can call this a false alarm?
 
Back
Top Bottom