Landmark
A class in Root.Township, Alta.Map.
A point of interest that can appear on a map once a player is aware of it or has discovered it. Server side; registers itself with LandmarkManager after spawning and is saved with its icons and state.
- Listed in World, chunks and saving
- Inherits or implements
NetworkEntityBehaviour,ISavable<LandmarkSaveData>,ISavableSave<LandmarkSaveData>,ISavableSaveBase - Derived types
LandmarkSaveData,MovingLandmark
Constructors
| Member | What it is |
|---|---|
Landmark() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
protected bool isKeptAfterUnload | Whether the landmark stays registered (and keeps its saved index) while its chunk is unloaded. |
6 private and internal fields
| Member | What it is |
|---|---|
private LandmarkIcon awareIcon | Backing field for AwareIcon, the icon shown once a player knows of the landmark. Saved with the landmark. |
private DiscoveryState defaultState | Backing field for DefaultState. Defaults to Aware; Discovered makes DiscoverFor do nothing. |
private LandmarkIcon discoveredIcon | Backing field for DiscoveredIcon, the icon shown once a player has discovered the landmark. Saved. |
private GameAchievement findAction | Achievement the server completes for a player when they discover this landmark. |
private bool isMasked | Backing field for IsMasked. Defaults to true. Saved with the landmark. |
private Map map | Backing field for Map, the map this landmark belongs to. Saved with the landmark. |
Properties
| Member | What it is |
|---|---|
LandmarkIcon AwareIcon { get; set; } | Icon shown while a player is only aware of the landmark. Setting it resyncs the landmark. |
DiscoveryState DefaultState { get; } | Discovery state every player starts with for this landmark. |
LandmarkIcon DiscoveredIcon { get; set; } | Icon shown once a player has discovered the landmark. Setting it resyncs the landmark. |
uint Index { get; protected set; } | The index LandmarkManager gave this landmark, or 0 when not registered. |
bool IsMasked { get; } | Whether map boards draw this marker below the map's mask layer (probably hidden by unrevealed areas) instead of on top. |
Map Map { get; } | Which map this landmark belongs to. |
Vector2 Position { get; } | The landmark's XZ position as a Vector2. |
Methods
| Member | What it is |
|---|---|
void AwareFor(IPlayer player) | Makes the landmark known (but not discovered) for a player. Only does anything when the default state is None. |
virtual void CustomizeIcon(MarkerInfo info, Player target) | Hook to change the marker info for a specific player before it is sent. Does nothing by default. |
void Deregister() | Removes the landmark from LandmarkManager and clears its Index. |
void DiscoverFor(IPlayer player) | Marks the landmark discovered for a player, registering first if needed. On the server it also completes the find achievement. |
void ForceSync() | Asks LandmarkManager to resend this landmark to players. |
override void Initialize() | Server: registers the landmark on the next frame and hooks deregistering on destroy. |
void SetIcons(LandmarkIcon aware, LandmarkIcon discovered) | Sets both icons at once and resyncs. |
protected virtual void Destroyed(NetworkEntity entity, bool isUnload) | Deregisters the landmark when its entity is destroyed (not when it is only unloaded). |
protected virtual void Register() | Registers with LandmarkManager and stores the index, unless the entity is being destroyed. |
2 private and internal methods
| Member | What it is |
|---|---|
private void AwareForLocal() | Editor context-menu helper: calls AwareFor for the local Player.Current. |
private void DiscoverForLocal() | Editor context-menu helper: calls DiscoverFor for the local Player.Current. |
Used in
Members of other types that take, return or hold a Landmark:
LandmarkDiscoverZone.landmark, LandmarkManager.AwareFor, LandmarkManager.Deregister, LandmarkManager.DiscoverFor, LandmarkManager.ForceSync, LandmarkManager.Register, ServerLandmarkManager.AwareFor, ServerLandmarkManager.Deregister, ServerLandmarkManager.DiscoverFor, ServerLandmarkManager.ForceSync, ServerLandmarkManager.Register.