Related to this, from KeeperFX version 0.4.5.1610 it is now possible to use new variables: 'EVIL_CREATURES' and 'GOOD_CREATURES'.
See the wiki on how to use them.
They can be used to determine how many creatures and how many heroes there are in an army. Some examples:
Code:
REM: Get exactly 15 creatures not counting heroes.
IF(PLAYER0,EVIL_CREATURES <= 14)
NEXT_COMMAND_REUSABLE
MAX_CREATURES(PLAYER0,100)
ENDIF
IF(PLAYER0,EVIL_CREATURES >= 15)
NEXT_COMMAND_REUSABLE
MAX_CREATURES(PLAYER0,15)
ENDIF
Code:
REM: Punish player for having too many heroes
IF(PLAYER0,GOOD_CREATURES >= 5)
QUICK_INFORMATION(3,"You have to many heroes in your army, they will try to sabotage you.",1)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG1,1)
SET_TIMER(PLAYER0,TIMER1)
ENDIF
REM: Stop sabotage when hero count drops to 4.
IF(PLAYER0,GOOD_CREATURES <= 4)
NEXT_COMMAND_REUSABLE
SET_FLAG(PLAYER0,FLAG1,0)
ENDIF
REM: Kill imp every 3 minutes until player has just 4 left.
IF(PLAYER0,FLAG1 == 1)
IF(PLAYER0,TIMER1 >= 3600)
IF(PLAYER0,IMP >= 4)
NEXT_COMMAND_REUSABLE
KILL_CREATURE(PLAYER0,IMP,LEAST_EXPERIENCED,1)
SET_TIMER(PLAYER0,TIMER1)
ENDIF
ENDIF
ENDIF
When making a map you can now consider how many heroes the player has, and increase the difficulty accordingly.