How do I Reference Game Difficulty Level In Python

Chronis

Warlord
Joined
Feb 3, 2011
Messages
102
So I am trying to get the revolutions mod to scale better with game difficulty.

Currently revolutions are controlled by these three constants
revReadyFrac = .6
revInstigatorThreshold = 1000
alwaysViolentThreshold = 1700

I want to add code that will increase these constants by 5% by each difficulty level over monarch for the AI only while leaving them at their current values for the human player.

This will make the AI empires on higher difficulties more stable and thus make the game more challenging.

Sadly I am not very good with python. Any tips on how to start on this or references to other code that might be a useful place to look at for examples would be appreciated.
 
CyGame().getHandicapType()
or CyPlayer.getHandicapType()

Never tried before but one of them is your answer.
 
Thanks from what I can find it looks like CyGame().getHandicapType()
is supposed to returns a number from 0-8: 0 = beginner 8 = deity.

I replaced

revReadyFrac = .6

with

revReadyFrac = ((0.4)+(CyGame().getHandicapType()*(0.05)))

It seems to work thanks
 
Back
Top Bottom