Class UnlockWaypointAction
ECA action for a waypoint's interaction: discovers the waypoint for the interacting character. Server only.
[Serializable]
public class UnlockWaypointAction : BaseAction, IAction, IAbortableAction
- Inheritance
-
UnlockWaypointAction
- Implements
- Inherited Members
Remarks
Abortable, and meant to be authored with StopChainOnFailure set: it reports failure when the waypoint was already discovered, so an achievement increment placed after it in the trigger counts each waypoint once per character rather than once per click.
When the waypoint is already discovered it instead asks the owner's client to open the world map on it (OpenMapWhenAlreadyUnlocked), so the object stays useful after discovery — walk up to a waypoint, click it, pick where to go.
Persistence and the owner notification are not done here. They are the server's answer to OnWaypointUnlocked, which this raises through the controller, so a waypoint granted by a quest reward is persisted and announced by the same code as one found on foot.
Fields
OpenMapWhenAlreadyUnlocked
[Tooltip("When the waypoint is already discovered, ask the owner's client to open the world map on it.")]
public bool OpenMapWhenAlreadyUnlocked
Field Value
Methods
Execute(ICharacter, EventData)
Executes the action. Must be implemented by derived classes.
public override void Execute(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action.
eventDataEventDataEvent data for the action.
TryExecute(ICharacter, EventData)
Attempts to perform the action. Returns false to signal that the action could not be performed (e.g. preconditions failed) so callers can short-circuit chains.
public bool TryExecute(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action.
eventDataEventDataEvent data for the action.
Returns
- bool
True on success; false when the action could not be performed.