Skip to content

Controlling the Effect Menu ​

Effects that cannot work right now should not be for sale. The game can change what the menu offers at any time.

There are two independent switches per effect:

  • Visible - whether the effect is listed at all. Hide effects that do not apply to the current part of the game.
  • Sellable - whether a listed effect can be bought. Disable effects that are temporarily impossible, such as during a cutscene.

By ID ​

gdscript
CrowdControl.hide_effects(["bomb", "damageplayer"])
CrowdControl.show_effects(["bomb", "damageplayer"])

CrowdControl.disable_effects(["bomb"], "Not during boss fights")
CrowdControl.enable_effects(["bomb"])

CrowdControl.disable_all_effects("Cutscene")
CrowdControl.enable_all_effects()
CrowdControl.hide_all_effects()
CrowdControl.show_all_effects()

The optional second argument is a message explaining the change. Each call sends one report covering all the IDs, so prefer these over changing effects one by one.

Per Effect ​

gdscript
var bomb := CrowdControl.get_effect("bomb")
bomb.visible = false
bomb.sellable = false

Outside of a Session ​

Changes made while no session is running are remembered and sent along when the next session starts. You can therefore set up the menu before calling start_session(), and viewers never see the wrong state.

get_effect() and the functions above work once connect_to_crowd_control() has been called.

Conflicts ​

List the IDs of effects that cannot run at the same time in the conflicts property of an effect. While one of them is running as a timed effect, a request for the other is refunded.

For example, give lowgravity the conflict highgravity, and highgravity the conflict lowgravity.

Next Step ​

Continue with Game Events & Metadata.