Dota 2 Workshop Tools/Scripting/API/ProjectileManager.CreateTrackingProjectile

From Valve Developer Community
< Dota 2 Workshop Tools‎ | Scripting‎ | API
Revision as of 10:00, 21 January 2024 by Thunder4ik (talk | contribs) (clean up, added deadend tag)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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