Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateLinearProjectile: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Dota_Lebot push: Updated Page)
m (clean up, added deadend tag)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Dead end|date=January 2024}}
{{Note | This page is automatically generated.  Any changes may be overwritten}}
{{Note | This page is automatically generated.  Any changes may be overwritten}}
[[Category:Dota2Function]]
[[Category:ProjectileManager]]


== Function Description ==
== Function Description ==


''' int CreateLinearProjectile(table ''infoTable'') '''


''' int CreateLinearProjectile(handle ''a'') '''
''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()
}
projectile = ProjectileManager:CreateLinearProjectile(info)
end
</source>
== Parameters ==
== Parameters ==
{| class="standard-table" style="width: 50%;"
{| class="standard-table" style="width: 50%;"
Line 18: Line 47:
! Description
! Description
|-
|-
| handle
| table
| a
| infoTable
| No Description Set
| No Description Set
|}
|}
Line 25: Line 54:
== Returns ==
== Returns ==


''int'' - No Description Set
''int'' - projectile id
 
[[Category:Dota2Function]]
[[Category:ProjectileManager]]

Latest revision as of 10:00, 21 January 2024

Dead End - Icon.png
This article has no Wikipedia icon links to other VDC articles. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
Note.pngNote: This page is automatically generated. Any changes may be overwritten

Function Description

int CreateLinearProjectile(table 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()
	}
	projectile = ProjectileManager:CreateLinearProjectile(info)
end

Parameters

Type Name Description
table infoTable No Description Set

Returns

int - projectile id