keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

Variable for total creatures left in pool without considering attraction requirements

Open lokrok opened this issue 1 year ago • 5 comments

There doesn't seem to be any way to determine the amount of creatures left in the creature pool for a player. This would be useful for map-making, especially in my case where I would like a player to lose if they have no creatures in their dungeon or in their pool (with DEAD_CREATURES_RETURN_TO_POOL(0)). It would also be nice if this had separate variables for Evil and Good creatures: TOTAL_CREATURES_IN_POOL, EVIL_CREATURES_IN_POOL, GOOD_CREATURES_IN_POOL.

lokrok avatar Dec 26 '24 15:12 lokrok

IF_AVAILABLE(PLAYER0,TOTAL_CREATURES

Loobinex avatar Dec 26 '24 15:12 Loobinex

IF_AVAILABLE(PLAYER0,TOTAL_CREATURES

I've tried this but it doesn't seem to work. Regardless of the amount of creatures in the pool, it seems to always return 0 which results in this section of the script killing the player.

IF_AVAILABLE(PLAYER0,TOTAL_CREATURES == 0)
	IF(PLAYER0,TOTAL_CREATURES == 0)
		SET_HEART_HEALTH(PLAYER0,0)
	ENDIF
ENDIF

lokrok avatar Dec 26 '24 15:12 lokrok

Try it within a timer, IF_AVAILABLE also considers attraction requirements.

Loobinex avatar Dec 27 '24 01:12 Loobinex

Try it within a timer, IF_AVAILABLE also considers attraction requirements.

Makes sense, but this also means that if the player doesn't have a room for a creature in the pool, it won't count towards the available variable. This isn't something I want to test for.

lokrok avatar Dec 27 '24 01:12 lokrok

Mh, pool is shared between all players, it's more work than it sounds to have this variable. 🤔

walt253 avatar Dec 27 '24 12:12 walt253