Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateLinearProjectile: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
No edit summary |
||
Line 6: | Line 6: | ||
''' int CreateLinearProjectile(handle '' | ''' int CreateLinearProjectile(handle ''InfoTable'') ''' | ||
''Creates a linear projectile and returns the projectile ID'' | ''Creates a linear projectile and returns the projectile ID'' | ||
Table Inputs: Ability, Source, vSpawnOrigin, vVelocity, vAcceleration, fDistance, fStartRadius, fEndRadius, bHasFrontalCone, iUnitTargetTeam, iUnitTargetType, iUnitTargetFlags, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bVisibleToEnemies, bIgnoreSource,fExpireTime, fMaxSpeed | |||
;Example | |||
<source lang="lua"> | |||
--Creates a projectile that will travel 2000 units | |||
function fire_arrow(args) | |||
local caster = args.caster | |||
--A Liner Projectile must have a table with projectile info | |||
local info = | |||
{ | |||
Ability = args.ability, | |||
EffectName = args.EffectName, | |||
vSpawnOrigin = caster:GetAbsOrigin(), | |||
fDistance = 2000, | |||
fStartRadius = 64, | |||
fEndRadius = 64, | |||
Source = caster, | |||
bHasFrontalCone = false, | |||
bReplaceExisting = false, | |||
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY, | |||
iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_NONE, | |||
iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, | |||
fExpireTime = GameRules:GetGameTime() + 10.0, | |||
bDeleteOnHit = true, | |||
vVelocity = caster:GetForwardVector() * 1800, | |||
bProvidesVision = true, | |||
iVisionRadius = 1000, | |||
iVisionTeamNumber = caster:GetTeamNumber() | |||
} | |||
PrintTable(info) | |||
projectile = ProjectileManager:CreateLinearProjectile(info) | |||
--print (projectile) | |||
end | |||
</source> | |||
== Parameters == | == Parameters == | ||
Line 19: | Line 51: | ||
|- | |- | ||
| handle | | handle | ||
| | | InfoTable | ||
| No Description Set | | No Description Set | ||
|} | |} |
Revision as of 23:38, 17 August 2014

Function Description
int CreateLinearProjectile(handle InfoTable)
Creates a linear projectile and returns the projectile ID
Table Inputs: Ability, Source, vSpawnOrigin, vVelocity, vAcceleration, fDistance, fStartRadius, fEndRadius, bHasFrontalCone, iUnitTargetTeam, iUnitTargetType, iUnitTargetFlags, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bVisibleToEnemies, bIgnoreSource,fExpireTime, fMaxSpeed
- Example
--Creates a projectile that will travel 2000 units
function fire_arrow(args)
local caster = args.caster
--A Liner Projectile must have a table with projectile info
local info =
{
Ability = args.ability,
EffectName = args.EffectName,
vSpawnOrigin = caster:GetAbsOrigin(),
fDistance = 2000,
fStartRadius = 64,
fEndRadius = 64,
Source = caster,
bHasFrontalCone = false,
bReplaceExisting = false,
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_NONE,
iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
fExpireTime = GameRules:GetGameTime() + 10.0,
bDeleteOnHit = true,
vVelocity = caster:GetForwardVector() * 1800,
bProvidesVision = true,
iVisionRadius = 1000,
iVisionTeamNumber = caster:GetTeamNumber()
}
PrintTable(info)
projectile = ProjectileManager:CreateLinearProjectile(info)
--print (projectile)
end
Parameters
Type | Name | Description |
---|---|---|
handle | InfoTable | No Description Set |
Returns
int - No Description Set