KeysAs explained the typical operation an item does is to send a message to the player, but it could send messages to other objects, for example a switch.
Switches are objects that can be in one of 3 states: opened, closed and locked.
To open a switch a "open" message must be send to it, to close a "close" message, to unlock an "unlock" message.
A locked switch, of course, cannot be opened, unless it is unlocked. A typicasl example of a locked switch are locked doors.
An itemObject, with the right GameMachine, could send an "Unlock" message to a locked switch followed by an "open" message to open it.
In this case the itemObject is working just as a key.
But there is a problem:
Simply sending the message is not sufficient because the player must be in front of the switch to unlock, otherwise the "key" itemObject shouldn't work.
This is why, in order to turn an itemObject into a key we need, in addition to a specific GameMachine, to set the TargetObject parameter (see ItemObject).
In summary, to create a key you need:
Auto use keys
In certain games, where action is a predominant feature, it results frustrating to open the inventory, select a key from the item slots and then press the use command to use them.
One solution is to use the item handling system and equip the key when there is a high probability to use it in the immediate future, but this is not ideal in certain games.
In EasyGamePack it is possible to enable auto usage of items when they work as keys.
To enable this feature you must:
|