Skip to content

policy: RPG Quest Giver "Prerequisites" Guard #10

@akarlaraytu

Description

@akarlaraytu

📝 Context

In an open-world RPG, an NPC (Quest Giver) should not offer a high-level quest to a beginner player. Additionally, some quests require a specific reputation level or the completion of a previous quest chain.

🎯 The Goal

Define a policy that blocks the "GRANT_QUEST" action if the player does not meet the requirements.

Variables you can use:

  • action (String): "GRANT_QUEST", "GREET", "TRADE".
  • player_level (Integer): The current level of the player (1-60).
  • reputation_score (Integer): How much the faction likes the player (0-100).
  • has_completed_intro (Boolean): Has the player finished the tutorial?

Requirements:

  1. BLOCK "GRANT_QUEST" if player_level is less than 15. (Level Gate)
  2. BLOCK "GRANT_QUEST" if reputation_score is less than 50. (Reputation Gate)
  3. BLOCK "GRANT_QUEST" if has_completed_intro is "FALSE". (Progression Gate)
  4. ALLOW "GREET" and "TRADE" actions freely.

📚 Resources

✅ Definition of Done

  • Submit a PR with: examples/community/rpg_quest_guard.csl
  • Verify that a Level 10 player cannot receive the quest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GameAIFor Gaming Applicationsgood first issueGood for newcomerspolicyWriting CSL policies for business use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions