Difference between revisions of "ATTR"
m (define attributes) |
(recategorize) |
||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | '''ATTR''' is a [[CAOS]] command and function used to change or output the attributes (characteristics) of an [[agent]]. Each attribute is set by a particular number - the final ATTR number is the sum of those attributes. Whenever ATTR changes, the [[engine]] checks that the agent is in a valid position in the world.[https://web.archive.org/web/20050312122959/http://www.freewebs.com/alimaggs/creaturesdev/cdn/c3/knowledgebase/c3_errors.html] | |
− | == | + | ==Usage== |
− | |||
− | + | ===Command=== | |
− | + | Syntax: ''ATTR binary_flags(int)'' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | Sets the attributes of the current [[TARG]] to those specified by the bitmap ''binary_flags''. This should be the sum of all the relevant attribute flags from the list below. <br /><br /> | ||
+ | The attributes in Creatures 1 are:<br /> | ||
+ | '''1''' - Can be picked up by creatures.<br /> | ||
+ | '''2''' - Can be picked up by the hand.<br /> | ||
+ | '''4''' - Can be activated using the hand.<br /> | ||
+ | '''8''' - Carries other objects or creatures (only for use in vehicles).<br /> | ||
+ | '''16''' - Creatures can't see it.<br /> | ||
+ | '''32''' - Floating on screen<br /> | ||
+ | '''64''' - Limits movement to current room (wallbound)<br /> | ||
+ | '''128''' - Movement limited by ground surface (groundbound)<br /> | ||
+ | NOTE: 128 and 64 cannot be combined. <br /> | ||
+ | <br /> | ||
+ | The attributes in Creatures 3 are:<br /> | ||
+ | '''1''' - Can be picked up by other agents.<br /> | ||
+ | '''2''' - Can be picked up by the hand.<br /> | ||
+ | '''4''' - Can be activated using the hand.<br /> | ||
+ | '''8''' - Vehicle only: Will automatically hold agents dropped into its cabin.<br /> | ||
+ | '''16''' - Creatures can't see it. (From the CAOS docs: ''<nowiki>'...applies to ESEE and STAR on creatures, as well as internal creature code.'</nowiki>'')<br /> | ||
+ | '''32''' - Stays in one position relative to the screen, position is set with [[FLTO]]. [[FREL]] can be used to make it stay in one position relative to another agent.<br /> | ||
+ | '''64''' - Collides with the walls between rooms depending on its [[PERM]].<br /> | ||
+ | '''128''' - The agent is affected by gravity, air resistance and friction, these are set by [[ACCG]], [[AERO]] and [[FRIC]]. Agents without this flag only move when thrown.<br /> | ||
+ | '''256''' - The agent, and its contents if it's a vehicle, cannot be seen on cameras or on images created with [[SNAP]].<br /> | ||
+ | '''512''' - Vehicle only: Creatures can only see and interact with agents in the cabin if this flag is used. | ||
− | == | + | ===Function=== |
− | Syntax: | + | Syntax: ''ATTR'' |
− | + | Returns the ATTR bitmap of TARG, as detailed above. | |
− | |||
==Examples== | ==Examples== | ||
− | + | Make [[HOTS]] mouse-carryable, and make it suffer collisions and physics: | |
<pre> | <pre> | ||
− | TARG HOTS ATTR 194 | + | TARG HOTS |
+ | ATTR 194 | ||
</pre> | </pre> | ||
+ | Send the attribute bitmap of HOTS to the output stream: | ||
+ | <pre> | ||
+ | TARG HOTS | ||
+ | OUTV ATTR | ||
+ | </pre> | ||
− | + | Prevent any agents from suffering physics: | |
+ | <pre> | ||
+ | ENUM 0 0 0 | ||
+ | SETV va00 ATTR | ||
+ | ANDV va00 128 | ||
+ | DOIF va00 eq 128 | ||
+ | SETV va00 ATTR | ||
+ | SUBV va00 128 | ||
+ | ATTR va00 | ||
+ | ENDI | ||
+ | NEXT | ||
+ | </pre> | ||
+ | ==See also== | ||
+ | *[[BHVR]] for Creature permissions | ||
+ | *The bitwise operators [[ANDV]], [[ORRV]], [[NOTV]] | ||
+ | |||
+ | ==External links== | ||
+ | *[http://songua.com/creatures/caosapps/ CAOS APPS] - online ATTR calculator for C3/DS. | ||
+ | *[http://web.archive.org/web/20050312123240/http://www.freewebs.com/alimaggs/creaturesdev/cdn/c3/knowledgebase/c3_agentprop.html Agent Properties] - an in-depth explanation of each C3/DS attribute at an archive of the [[CDN]]. | ||
− | |||
− | |||
− | |||
− | |||
[[category:C3 CAOS Commands]] | [[category:C3 CAOS Commands]] | ||
+ | [[Category:C1 CAOS Commands]] |
Revision as of 23:40, 15 March 2018
ATTR is a CAOS command and function used to change or output the attributes (characteristics) of an agent. Each attribute is set by a particular number - the final ATTR number is the sum of those attributes. Whenever ATTR changes, the engine checks that the agent is in a valid position in the world.[1]
Usage
Command
Syntax: ATTR binary_flags(int)
Sets the attributes of the current TARG to those specified by the bitmap binary_flags. This should be the sum of all the relevant attribute flags from the list below.
The attributes in Creatures 1 are:
1 - Can be picked up by creatures.
2 - Can be picked up by the hand.
4 - Can be activated using the hand.
8 - Carries other objects or creatures (only for use in vehicles).
16 - Creatures can't see it.
32 - Floating on screen
64 - Limits movement to current room (wallbound)
128 - Movement limited by ground surface (groundbound)
NOTE: 128 and 64 cannot be combined.
The attributes in Creatures 3 are:
1 - Can be picked up by other agents.
2 - Can be picked up by the hand.
4 - Can be activated using the hand.
8 - Vehicle only: Will automatically hold agents dropped into its cabin.
16 - Creatures can't see it. (From the CAOS docs: '...applies to ESEE and STAR on creatures, as well as internal creature code.')
32 - Stays in one position relative to the screen, position is set with FLTO. FREL can be used to make it stay in one position relative to another agent.
64 - Collides with the walls between rooms depending on its PERM.
128 - The agent is affected by gravity, air resistance and friction, these are set by ACCG, AERO and FRIC. Agents without this flag only move when thrown.
256 - The agent, and its contents if it's a vehicle, cannot be seen on cameras or on images created with SNAP.
512 - Vehicle only: Creatures can only see and interact with agents in the cabin if this flag is used.
Function
Syntax: ATTR
Returns the ATTR bitmap of TARG, as detailed above.
Examples
Make HOTS mouse-carryable, and make it suffer collisions and physics:
TARG HOTS ATTR 194
Send the attribute bitmap of HOTS to the output stream:
TARG HOTS OUTV ATTR
Prevent any agents from suffering physics:
ENUM 0 0 0 SETV va00 ATTR ANDV va00 128 DOIF va00 eq 128 SETV va00 ATTR SUBV va00 128 ATTR va00 ENDI NEXT
See also
External links
- CAOS APPS - online ATTR calculator for C3/DS.
- Agent Properties - an in-depth explanation of each C3/DS attribute at an archive of the CDN.