跳到主要内容

Dynamic Variables update

· 阅读需 2 分钟
Gabber235
TypeWriter Maintainer

Hey reader! After weeks of development, I'm thrilled to introduce Dynamic Variables - a system that lets your content adapt during gameplay.

What are Dynamic Variables

Before, all fields on an entry needed to be filled in with valid values during configuration time. With Dynamic variables, fields can now be substituted with runtime values.

To give you some inspiration of what you can now do:

  • Have cinematics in the world the player is in, instead of in a fixed world. Which is useful for playing cinematics in generated dungeons.
  • Have the skin of a NPC be determined from a placeholder. For making leaderboard NPCs.
  • Having the strength of a potion effect be the value of a fact. For "upgradable skills."
  • Making launch pads shoot the player in the direction where they are looking.

Placeholder Parameters

Sometimes you want to know different details of an entry. Like the time it last got updated. The remaining time until the fact resets. Entries now support parameterized placeholders for more detailed information:

%typewriter_<entry id>:remaining:10%     // Items left to collect
%typewriter_<entry id>:time:expires:relative% // Time until daily quest is active

New Entries

  • Entity types: ArmorStand, EnderDragon, Parrot, Wolf, BlockDisplay
  • CalculatedFact for complex expressions
  • WeightedRandomTriggerGate for probability-based triggers
  • World and potion effect audience filters

Breaking Changes

  • Extension developers: PlaceholderEntry API updated
  • Random...DialogueEntry deprecated (use RandomVariable instead)