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

From Valve Developer Community
Jump to navigation Jump to search
(The example was for linear projectile)
Line 28: Line 28:
Ability = caster:GetAbilityByIndex(0),
Ability = caster:GetAbilityByIndex(0),
EffectName = "some_particle_effect",
EffectName = "some_particle_effect",
vSourceLoc= caster:GetAbsOrigin(),
vSourceLoc= caster:GetAbsOrigin(),               -- Optional (HOW)
bDrawsOnMinimap = false,  
bDrawsOnMinimap = false,                         -- Optional
         bDodgeable = true,
         bDodgeable = true,                               -- Optional
         bIsAttack = false,  
         bIsAttack = false,                               -- Optional
         bVisibleToEnemies = true,
         bVisibleToEnemies = true,                         -- Optional
         bReplaceExisting = false,
         bReplaceExisting = false,                         -- Optional
         flExpireTime = GameRules:GetGameTime() + 10,
         flExpireTime = GameRules:GetGameTime() + 10,     -- Optional but recommended
bProvidesVision = true,
bProvidesVision = true,                           -- Optional
iVisionRadius = 400,
iVisionRadius = 400,                             -- Optional
iVisionTeamNumber = caster:GetTeamNumber()
iVisionTeamNumber = caster:GetTeamNumber()       -- Optional
}
}
projectile = ProjectileManager:CreateTrackingProjectile(info)
projectile = ProjectileManager:CreateTrackingProjectile(info)


</source>
</source>
== Parameters ==
== Parameters ==
{| class="standard-table" style="width: 50%;"
{| class="standard-table" style="width: 50%;"

Revision as of 23:41, 4 December 2015

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",
	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