Skip to main content

dev_set_flag_handler

Function dev_set_flag_handler 

Source
pub fn dev_set_flag_handler(
    world: &mut AmbleWorld,
    view: &mut View,
    flag_name: &str,
)
Expand description

Sets a simple boolean flag on the player (DEV_MODE only).

This development command creates or sets a simple flag that represents a boolean condition or completed state. Simple flags are either present (true) or absent (false) and are commonly used for unlock conditions, story progression markers, or achievement tracking.

§Parameters

  • world - Mutable reference to the game world containing the player
  • view - Mutable reference to the player’s view for feedback messages
  • flag_name - Name identifier for the simple flag to set

§Behavior

  • Creates a simple (non-sequence) flag with the specified name
  • Adds flag to player’s flag collection (replacing any existing flag with same name)
  • Displays success message confirming flag was set
  • All flag setting is logged at warn level for audit trail

§Use Cases

  • Unlocking areas or content that requires specific flags
  • Testing trigger conditions that depend on flag states
  • Simulating completed story events or achievements