throw
Function
This command makes a throwobject throw itself at another entity at the velocity and gravity ratio specified in the command arguments. The thrown object will inflict damage to the entity it's thrown at when it hits it.
Syntax
|
$<object_name> throw $<object_name> <velocity> $<target_entity> <gravity_ratio>
|
Notes & examples
|
Here's a breakdown of the command arguments:
|
$<object_name>:
<velocity>:
$<target_entity>:
<gravity_ratio>:
|
targetname of the throwobject.
speed at which the model will be thrown.
targetname of the entity at which the throwobject will thrown.
gravity pull on the thrown object. This determines how fast it will fall when thrown. Values are from 0.0 to 1.0: 0.0 is no gravity and 1.0 is normal gravity.
|
|
Here's an example on how to use this command:
Let's say you insert a func_throwobject in a map. Set the "model" key to "chair.def" and the "targetname" key to "chair1". You now have a office chair model that can be thrown at another entity. If you want to make it throw itself at the player, just use the command:
$chair1 throw $chair1 30 *1 1
The chair model will be thrown at the player (entity *1) at a speed of 30 and normal gravity.
Note: A throwobject can also be thrown at another entity after it has been picked up by an actor with the pickup command or the attach Entity command. The object is thrown just the same as if it wasn't attached.
|