Use: Difference between revisions
Jump to navigation
Jump to search
m (added e key info) |
m (make the middle two methods into one, since it's not a very significant difference between the two) |
||
Line 1: | Line 1: | ||
All entities have a '''Use''' [[input]], though many do nothing in response to it. There are | All entities have a '''Use''' [[input]], though many do nothing in response to it. There are three methods to invoke it: | ||
# A player looking at the entity and | # A player looking at the entity and using the <code>+use</code> console command (this is normally done by pressing the '''e''' key) | ||
# An entity | # An entity [[output]] that specifies the <code>Use</code> input, or not specifying any input. | ||
# Directly calling the C++ function | |||
# | |||
Use typically performs the action players most expect when interacting with the entity (e.g. opening/closing a door, picking up a physics object). | Use typically performs the action players most expect when interacting with the entity (e.g. opening/closing a door, picking up a physics object). | ||
== Programming == | ==Programming== | ||
Although there is always a Use input, the actual Use function of an entity starts null. It can be assigned at any time with <code>SetUse( void *SomeFunc([[CBaseEntity]] *pActivator, CBaseEntity *pCaller, USE_TYPE useType, [[float]] value) )</code>. | Although there is always a Use input, the actual Use function of an entity starts null. It can be assigned at any time with <code>SetUse( void *SomeFunc([[CBaseEntity]] *pActivator, CBaseEntity *pCaller, USE_TYPE useType, [[float]] value) )</code>. | ||
It doesn't appear possible to specify <code>USE_TYPE</code> or <code>value</code> through the I/O system. | It doesn't appear possible to specify <code>USE_TYPE</code> or <code>value</code> through the I/O system. | ||
[[Category:Level Design]] | [[Category:Level Design]] | ||
[[Category:Programming]] | [[Category:Programming]] |
Revision as of 17:30, 28 May 2018
All entities have a Use input, though many do nothing in response to it. There are three methods to invoke it:
- A player looking at the entity and using the
+use
console command (this is normally done by pressing the e key) - An entity output that specifies the
Use
input, or not specifying any input. - Directly calling the C++ function
Use typically performs the action players most expect when interacting with the entity (e.g. opening/closing a door, picking up a physics object).
Programming
Although there is always a Use input, the actual Use function of an entity starts null. It can be assigned at any time with SetUse( void *SomeFunc(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) )
.
It doesn't appear possible to specify USE_TYPE
or value
through the I/O system.