# PredictionInput
# Description
A structure used to configure and set skill prediction parameters, including various properties of the skill, used to calculate the optimal casting position.
# How to Use
// Create prediction input parameters
PredictionInput input;
input.Unit = target; // Target hero
input.Delay = 0.25f; // Skill cast delay
input.Speed = 1600.f; // Skill projectile speed
input.Radius = 60.f; // Skill width/radius
input.Range = 1000.f; // Skill maximum range
input.Type = eSkillshotType::SkillshotLine; // Line skill
// Set the starting position (default is player position)
input.From_Set(ObjectManager::Player()->Position());
// Set whether to consider collisions
input.Collision = true;
input.CollisionObjects = { eCollisionableObjects::Minions, eCollisionableObjects::YasuoWall };
// Set whether it's an AOE skill
input.Aoe = false;
// Set whether to consider target hitbox
input.AddHitBox = true;
// Use Prediction class to perform prediction
PredictionOutput output = Prediction::GetPrediction(input);
// Check prediction result hit chance
if (output.Hitchance >= eHitChance::High)
{
// Cast skill at the predicted position
ObjectManager::Player()->CastSpell(eSpellSlot::Q, output.CastPosition());
}
# Properties
Property | Type | Description |
---|---|---|
Aoe | bool | Whether it's an AOE skill |
Collision | bool | Whether to consider collisions |
CollisionObjects | std::vector<eCollisionableObjects> | Types of objects for collision detection |
Delay | float | Skill cast delay (seconds) |
Radius | float | Skill effect radius |
Range | float | Skill maximum range |
Speed | float | Skill projectile speed |
Type | eSkillshotType | Skill type (line, circular, cone) |
Unit | AIBaseClient* | Target unit for prediction |
AddHitBox | bool | Whether to consider the target's hitbox |
# Methods
Method | Return Type | Description |
---|---|---|
From() | Vector | Get the skill cast starting position |
From_Set(Vector const& value) | void | Set the skill cast starting position |
RangeCheckFrom() | Vector | Get the range check starting position |
RangeCheckFrom_Set(Vector const& value) | void | Set the range check starting position |
RealRadius() | float | Get the actual radius considering target hitbox |