keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

New script command: PLAYER_NEUTRAL

Open mefistotelis opened this issue 10 years ago • 8 comments

Originally reported on Google Code with ID 395

In the current script it is possible to refer to creatures/rooms/traps that belong to
one of the players (PLAYER0, PLAYER1, PLAYER_GOOD), but there is no PLAYER_NEUTRAL.

This is something that could be added, and for example used to count how many unclaimed
creatures there are still on the map, or used to kill neutral creatures with the script
when a condition is met.

Reported by Loobinex on 2014-10-12 22:42:29

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

Adding neutral player to script would be confusing, as there really is no neutral player.
The neutral player implies lack of ownership.

What are the exact scenarios and commands which would benefit on adding neutral owner
as a player?

Reported by mefistotelis on 2014-12-13 09:43:02

  • Status changed: NeedInfo

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

Yes, and there is currently no way to reference the unowned creatures/rooms in the script.

IF(PLAYER_NEUTRAL,Total_Area <= 0)
   (You have claimed the entire neutral dungeon)

IF(PLAYER_NEUTRAL,Bile_Demon >= 10)
   (You can still find a neutral creature on the map. Also usefull with rooms and traps.)

KILL_CREATURE(PLAYER_NEUTRAL,Bile_Demon,Most_experienced,1)
   (You can no longer claim the neutral creature on the map)

ADD_CREATURE_TO_LEVEL(PLAYER_NEUTRAL,....)
   (Add claimable creatures depending on the script, without giving it to a player
directly)



Reported by Loobinex on 2014-12-13 10:27:54

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

To elaborate a bit:

Playing the same map multiple times is not as fun because the player knows where everything
is. He knows where the hero parties are to avoid, and where the neutral creatures and
dungeon specials are.

The mapmaker can reduce this, and increase replayability by having hero parties spawn
at a random action point. When you can spawn neutral creatures, you could also hide
the neutral creature that serves as the reward for a player.

Being able to kill a neutral creature gives the mapmaker a way of putting pressure
on the player, of rewarding swift action over turtling up.

Being able to query neutral rooms/creatures gives the mapmaker the possibility to more
accurately determine progress of the player, and act accordingly.

Reported by Loobinex on 2014-12-19 10:23:58

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

I see your point. The problem is, there is no "neutral player" nor "neutral dungeon"
in current KeeperFX. Neutral creatures are not counted, nor managed by any entity.

This makes implementation of such player quite difficult - lack of basic data structures
would lead to many inconsistencies. Also, there are many commands where using neutral
player would simply make no sense.

All commands for neutral players would need special, separate block of code to handle
it. I can see from your explanation that it is needed, but I'm not sure how to keep
consistency and clear distinction about which commands can have "extended set of player
definition" and which don't. Also, all commands regarding neutral player would be very
slow compared to other players - this could hurt the game speed even on todays machines.

This is quite complex issue to handle.

Reported by mefistotelis on 2014-12-19 20:49:00

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

I understand, and I realize it is not a matter of adding the word 'Neutral' to the script.

I'd say keep it in mind during the rewrite, there is no reason that there are 'only'
4+1 players. Datastructures are what you want them to be,... I'll ask again in 2020
;-).

Alternatively, you could add a few special commands:

IF_Neutral
KILL_Neutral_creature
Add_Neutral_creature

Reported by Loobinex on 2014-12-19 21:03:07

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

Yeah, the best way would be to just wait until everything is rewritten, and make neutral
player an existing entity.

Reported by mefistotelis on 2014-12-19 22:17:30

  • Status changed: New

mefistotelis avatar Aug 18 '15 18:08 mefistotelis

In 0.4.8 I made PLAYER_NEUTRAL available for some script commands. Adding a Neutral unit to the map is now possible for example, but commands that check against a dungeon structure won't work with it.

Loobinex avatar Aug 31 '20 23:08 Loobinex

It would be nice to have a exhaustive list of what script command are still not working with PLAYER_NEUTRAL

walt253 avatar Oct 11 '24 02:10 walt253