setOwnedByAll: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 5 users not shown)
Line 3: Line 3:
|version=1.4.2.0
|version=1.4.2.0
|description=
|description=
Allows you to set or unset the ownedByAll value of the token.
Allows changing the '''ownedByAll''' value of a token.


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setOwnedByAll(value)
setOwnedByAll(owned)
</source>
<source lang="mtmacro" line>
setOwnedByAll(owned, id)
setOwnedByAll(owned, id)
</source>
setOwnedByAll(owned, id, mapRef)
</syntaxhighlight>
'''Parameter'''
'''Parameter'''
{{param|owned|The value of the setting to set, {{code|true}}({{code|1}}) or {{code|false}}({{code|0}}).}}
{{param|owned|The value of the setting to set, {{true}} or {{false}}.}}
{{param|id|The token {{code|id}} of the token which has its [[Owned by All]] status set, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|id|The token {{code|id}} of the token which has its [[Introduction_to_Tokens#Ownership|Owned by All]] status set, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapRef|The Name or ID of the map to find the token.  Defaults to the current map.}}
 


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: setOwnedByAll(1)]
[h: setOwnedByAll(1)]
[h: setOwnedByAll(0, "Dragon")]
[h: setOwnedByAll(0, "Dragon")]
</source>
</syntaxhighlight>


|also=
|also=
[[getOwners|getOwners()]],  
{{func|getOwners}}, {{func|isOwner}}, {{func|isOwnedByAll}}
[[isOwner|isOwner()]],
[[isOwnedByAll|isOwnedByAll()]]


|changes=
{{change|1.5.4|Added {{code|mapname}} parameter option.}}
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Latest revision as of 23:59, 14 March 2023

setOwnedByAll() Function

Introduced in version 1.4.2.0
Allows changing the ownedByAll value of a token.

Usage

setOwnedByAll(owned)
setOwnedByAll(owned, id)
setOwnedByAll(owned, id, mapRef)

Parameter

  • owned - The value of the setting to set, true(1) or false(0).
  • id - The token id of the token which has its Owned by All status set, defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

  • mapRef - The Name or ID of the map to find the token. Defaults to the current map.

Example

[h: setOwnedByAll(1)]
[h: setOwnedByAll(0, "Dragon")]

See Also

Version Changes

  • 1.5.4 - Added mapname parameter option.