Trusted Macro: Difference between revisions
(New page: Trusted macros are macros that meet any of the following criteria. * Typed in by GM. * Button clicked by GM. * Macro called by [macro(): ] ...) |
m (Taustin moved page trusted Macro to Trusted Macro without leaving a redirect) |
||
(14 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
Trusted | {{Languages|Trusted Macro}} | ||
A Trusted Macro is a macro that fits certain criteria, allowing it access to [[:Category:Macro Function|functions]] and [[:Category:Roll Option|roll options]] that are protected from normal use. Moving a Trusted Macro onto a player owned-token will keep this status, so they may run it (see [[Managing Macros in Panels]]). | |||
[[:Category:Macro Function|Functions]] and [[:Category:Roll Option|roll options]] that require a Trusted Macro will have the following note on their article: | |||
{{TrustedFunction}} | |||
Some parameters are only usable within a Trusted Macro, they will have the following note on their description: | |||
{{TrustedParameter}} | |||
Using trusted macros can, for example, allow gamemasters to set up macros on [[Token | In order for a macro to be trusted it must adhere to three requirements. '''If a macro is typed into the chat window, and not attached to a macro button, the only requirement is that the GM is the person who typed the macro.''' | ||
===First Requirement=== | |||
A trusted macro must not be editable by players. Allowing players to edit trusted macros is tantamount to making all of their macros trusted. To make it so players cannot edit a macro, you must uncheck the Allow Players to Edit Macro checkbox on the Options tab of the macro window. This setting defaults to being checked, allowing players access to edit any macro. As of 1.3b54 the default can be changed in the Preferences. | |||
[[Image:Macro_Options.png|frame|center|View of the Macro Options tab.]] | |||
===Second Requirement=== | |||
A trusted macro must not call another macro that is not trusted, any such call will cause the originating macro be considered an untrusted macro. | |||
===Third Requirement=== | |||
After satisfying the first and second requirements, the third requirement can be satisfied in two ways: | |||
* Clicking the macro button as a GM. | |||
* Placing the macro on a [[Library Token|library token]] and having a player call it using a [[:Category:Roll Option|roll option]] or [[macroLink|macro link]]. | |||
===Why trusted macros?=== | |||
Using trusted macros can, for example, allow gamemasters to set up macros on [[Library Token|library tokens]] that can be called by players, but edited only by GMs, and which can access functions that players would not normally be able to access. Such macros can use trusted-only options or functions (such as the [[token (roll option)|[token():]]] roll option or the [[switchToken|switchToken()]] function) to modify or read values from NPC tokens that players do not own. | |||
==A macro is trusted when ...== | |||
* Anything the GM types into the input box is trusted | |||
* Anything a non GM types into the input box is not trusted. | |||
* Any auto execute macro that is non player editable is trusted. | |||
* Any auto execute macro that is player editable is not trusted. | |||
* Any non auto execute macro gets copied into the input box to be edited, so results in one of the first two rules | |||
''quoted Craig([http://forums.rptools.net/memberlist.php?mode=viewprofile&u=1338])'' | |||
Let's test macros under certain combinations of macro location, player or gm, auto-execution and if it is player-editable or not. The test was performed using {{func|isTrusted}} and the campaign macro was "applied to token". | |||
{| class="wikitable" border="1" | |||
! Macro location !! clicked by !! auto-execute !! player-editable !! is trusted | |||
|- bgcolor=white | |||
| campaign || GM || • || • || ✓ | |||
|- bgcolor=white | |||
| campaign || GM || • || - || ✓ | |||
|- bgcolor=white | |||
| campaign || GM || - || • || ✓ | |||
|- bgcolor=white | |||
| campaign || GM || - || - || ✓ | |||
|- bgcolor=lightgrey | |||
| lib:token || GM || • || • || - | |||
|- bgcolor= lightgrey | |||
| lib:token || GM || • || - || ✓ | |||
|- bgcolor= lightgrey | |||
| lib:token || GM || - || • || ✓ | |||
|- bgcolor= lightgrey | |||
| lib:token || GM || - || - || ✓ | |||
|- | |||
| pc token || GM || • || • || - | |||
|- | |||
| pc token || GM || • || - || ✓ | |||
|- | |||
| pc token || GM || - || • || ✓ | |||
|- | |||
| pc token || GM || - || - || ✓ | |||
|- bgcolor= lightgrey | |||
| campaign || player || • || • * || ✓ | |||
|- bgcolor= lightgrey | |||
| campaign || player || • || - || ✓ | |||
|- bgcolor= lightgrey | |||
| campaign || player || - || • || - | |||
|- bgcolor= lightgrey | |||
| campaign || player || - || - || - | |||
|- | |||
| pc token || player || • || • || - | |||
|- | |||
| pc token || player || • || - || ✓ | |||
|- | |||
| pc token || player || - || • || - | |||
|- | |||
| pc token || player || - || - || - | |||
|} | |||
''*: This is actually not editable by the player since its a campaign macro.'' | |||
[[Category:Macro]] | |||
{{Languages|Trusted Macro}} |
Latest revision as of 23:59, 3 May 2023
A Trusted Macro is a macro that fits certain criteria, allowing it access to functions and roll options that are protected from normal use. Moving a Trusted Macro onto a player owned-token will keep this status, so they may run it (see Managing Macros in Panels).
Functions and roll options that require a Trusted Macro will have the following note on their article:
Note: This function can only be used in a Trusted Macro
Some parameters are only usable within a Trusted Macro, they will have the following note on their description:
Note: This parameter can only be used in a Trusted Macro.
In order for a macro to be trusted it must adhere to three requirements. If a macro is typed into the chat window, and not attached to a macro button, the only requirement is that the GM is the person who typed the macro.
First Requirement
A trusted macro must not be editable by players. Allowing players to edit trusted macros is tantamount to making all of their macros trusted. To make it so players cannot edit a macro, you must uncheck the Allow Players to Edit Macro checkbox on the Options tab of the macro window. This setting defaults to being checked, allowing players access to edit any macro. As of 1.3b54 the default can be changed in the Preferences.
Second Requirement
A trusted macro must not call another macro that is not trusted, any such call will cause the originating macro be considered an untrusted macro.
Third Requirement
After satisfying the first and second requirements, the third requirement can be satisfied in two ways:
- Clicking the macro button as a GM.
- Placing the macro on a library token and having a player call it using a roll option or macro link.
Why trusted macros?
Using trusted macros can, for example, allow gamemasters to set up macros on library tokens that can be called by players, but edited only by GMs, and which can access functions that players would not normally be able to access. Such macros can use trusted-only options or functions (such as the [token():] roll option or the switchToken() function) to modify or read values from NPC tokens that players do not own.
A macro is trusted when ...
* Anything the GM types into the input box is trusted
* Anything a non GM types into the input box is not trusted.
* Any auto execute macro that is non player editable is trusted.
* Any auto execute macro that is player editable is not trusted.
* Any non auto execute macro gets copied into the input box to be edited, so results in one of the first two rules
quoted Craig([1])
Let's test macros under certain combinations of macro location, player or gm, auto-execution and if it is player-editable or not. The test was performed using isTrusted() and the campaign macro was "applied to token".
Macro location | clicked by | auto-execute | player-editable | is trusted |
---|---|---|---|---|
campaign | GM | • | • | ✓ |
campaign | GM | • | - | ✓ |
campaign | GM | - | • | ✓ |
campaign | GM | - | - | ✓ |
lib:token | GM | • | • | - |
lib:token | GM | • | - | ✓ |
lib:token | GM | - | • | ✓ |
lib:token | GM | - | - | ✓ |
pc token | GM | • | • | - |
pc token | GM | • | - | ✓ |
pc token | GM | - | • | ✓ |
pc token | GM | - | - | ✓ |
campaign | player | • | • * | ✓ |
campaign | player | • | - | ✓ |
campaign | player | - | • | - |
campaign | player | - | - | - |
pc token | player | • | • | - |
pc token | player | • | - | ✓ |
pc token | player | - | • | - |
pc token | player | - | - | - |
*: This is actually not editable by the player since its a campaign macro.