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

From Valve Developer Community
Jump to navigation Jump to search
(Dota_Lebot push: Updated Page)
m (clean up, added deadend tag)
 
(6 intermediate revisions by 4 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 ==


 
''' void CreateTrackingProjectile(handle ''handle_1'') '''
''' void CreateTrackingProjectile(handle ''a'') '''


''Creates a tracking projectile
''Creates a tracking projectile


Table Inputs: Ability, Source, Target, EffectName, iMoveSpeed, vSourceLoc, iSourceAttachment, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bDodgeable, bIsAttack, bVisibleToEnemies, bReplaceExisting, flExpireTime''
Table Inputs: Ability, Source, Target, EffectName, iMoveSpeed, vSourceLoc, iSourceAttachment, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bDodgeable, bIsAttack, bVisibleToEnemies, bReplaceExisting, flExpireTime''


;Example
;Example
Line 20: Line 17:
local caster = PlayerResource:GetPlayer(0):GetAssignedHero()
local caster = PlayerResource:GetPlayer(0):GetAssignedHero()
local target = PlayerResource:GetPlayer(1):GetAssignedHero()
local target = PlayerResource:GetPlayer(1):GetAssignedHero()


local info =  
local info =  
Line 28: Line 24:
Ability = caster:GetAbilityByIndex(0),
Ability = caster:GetAbilityByIndex(0),
EffectName = "some_particle_effect",
EffectName = "some_particle_effect",
vSpawnOrigin = caster:GetAbsOrigin(),
        iMoveSpeed = 400,
fDistance = 2000,
vSourceLoc= caster:GetAbsOrigin(),               -- Optional (HOW)
fStartRadius = 64,
bDrawsOnMinimap = false,                         -- Optional
fEndRadius = 64,
        bDodgeable = true,                               -- Optional
bHasFrontalCone = false,
        bIsAttack = false,                               -- Optional
bReplaceExisting = false,
        bVisibleToEnemies = true,                         -- Optional
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
        bReplaceExisting = false,                         -- Optional
iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_NONE,
        flExpireTime = GameRules:GetGameTime() + 10,     -- Optional but recommended
iUnitTargetType = DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
bProvidesVision = true,                           -- Optional
fExpireTime = GameRules:GetGameTime() + 10.0,
iVisionRadius = 400,                             -- Optional
bDeleteOnHit = true,
iVisionTeamNumber = caster:GetTeamNumber()       -- Optional
vVelocity = caster:GetForwardVector() * 1800,
bProvidesVision = true,
iVisionRadius = 1000,
iVisionTeamNumber = caster:GetTeamNumber()
}
}
projectile = ProjectileManager:CreateLinearProjectile(info)
projectile = ProjectileManager:CreateTrackingProjectile(info)


</source>
</source>
== Parameters ==
== Parameters ==
{| class="standard-table" style="width: 50%;"
{| class="standard-table" style="width: 50%;"
Line 54: Line 47:
|-
|-
| handle
| handle
| a
| handle_1
| No Description Set
| No Description Set
|}
|}
[[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

void CreateTrackingProjectile(handle handle_1)

Creates a tracking projectile

Table Inputs: Ability, Source, Target, EffectName, iMoveSpeed, vSourceLoc, iSourceAttachment, bProvidesVision, iVisionTeamNumber, iVisionRadius, bDrawsOnMinimap, bDodgeable, bIsAttack, bVisibleToEnemies, bReplaceExisting, flExpireTime

Example
--Create a tracking projectile from player 1 that follows player 2

local caster = PlayerResource:GetPlayer(0):GetAssignedHero()
local target = PlayerResource:GetPlayer(1):GetAssignedHero()

local info = 
{
	Target = target,
	Source = caster,
	Ability = caster:GetAbilityByIndex(0),	
	EffectName = "some_particle_effect",
        iMoveSpeed = 400,
	vSourceLoc= caster:GetAbsOrigin(),                -- Optional (HOW)
	bDrawsOnMinimap = false,                          -- Optional
        bDodgeable = true,                                -- Optional
        bIsAttack = false,                                -- Optional
        bVisibleToEnemies = true,                         -- Optional
        bReplaceExisting = false,                         -- Optional
        flExpireTime = GameRules:GetGameTime() + 10,      -- Optional but recommended
	bProvidesVision = true,                           -- Optional
	iVisionRadius = 400,                              -- Optional
	iVisionTeamNumber = caster:GetTeamNumber()        -- Optional
}
projectile = ProjectileManager:CreateTrackingProjectile(info)

Parameters

Type Name Description
handle handle_1 No Description Set