How to PrepareUnitOrders for vectored abilities, like Gyro's calldown?

Zed03

New member
Jun 1, 2024
13
6
3
Hi, I reviewed
  1. https://docs.minority.gg/guide/classes/player.html#prepareunitorders
    • Unrelated note: These docs are very outdated but still sort of useful
  2. melonity.d.ts in https://cdn.minority.gg/devkit2.zip
    • Unrelated note: This is mostly up-to-date but has errors, like enums are not correctly exported as flags
... and was not able to find a way to PrepareUnitOrders for vectored abilities.

Could someone please detail how to do this?

  1. It feels like the `PrepareUnitOrders*` functions needs an extra parameter to specify the direction vector, in a addition to the target vector.
  2. Or, the direction vector needs to be added to `PreparedOrder` structure.

Melonity combo scrips are using vectored abilities correctly (like Marci & Muerta), so the Melonity engine supports it, so I hope its just a matter of missing docs.
 

Prota

Administrator
Staff member
Nov 15, 2022
506
45
28
Hi, I reviewed
  1. https://docs.minority.gg/guide/classes/player.html#prepareunitorders
    • Unrelated note: These docs are very outdated but still sort of useful
  2. melonity.d.ts in https://cdn.minority.gg/devkit2.zip
    • Unrelated note: This is mostly up-to-date but has errors, like enums are not correctly exported as flags
... and was not able to find a way to PrepareUnitOrders for vectored abilities.

Could someone please detail how to do this?

  1. It feels like the `PrepareUnitOrders*` functions needs an extra parameter to specify the direction vector, in a addition to the target vector.
  2. Or, the direction vector needs to be added to `PreparedOrder` structure.

Melonity combo scrips are using vectored abilities correctly (like Marci & Muerta), so the Melonity engine supports it, so I hope its just a matter of missing docs.
Greetings , We're not updating dosc at the moment and unfortunately there is no one else who could help you out since devs are not willing to put effort in fixing docs.
 

Zed03

New member
Jun 1, 2024
13
6
3
Thanks for the fast reply prota.

Could you ask the devs for the fully qualified function name that is responsible for vector targetting, and I'll take it from there?

All they need to say is "Player.PrepareUnitOrdersVectored" or "Internal.VectoredOrderHelperFunc", etc, i'll reverse engineer it from there.
 

Prota

Administrator
Staff member
Nov 15, 2022
506
45
28
Thanks for the fast reply prota.

Could you ask the devs for the fully qualified function name that is responsible for vector targetting, and I'll take it from there?

All they need to say is "Player.PrepareUnitOrdersVectored" or "Internal.VectoredOrderHelperFunc", etc, i'll reverse engineer it from there.
let localHero = EntitySystem.GetLocalHero();

let localPlayer = EntitySystem.GetLocalPlayer();

let q = localHero?.GetAbilityByIndex(0);

let w = localHero?.GetAbilityByIndex(1);

if (!localHero || !localPlayer || !q || !w)

return;

// pango case

if (Input.IsKeyDownOnce(Enum.ButtonCode.KEY_SPACE, false))

{

// what position we want attack

localPlayer.PrepareUnitOrders(Enum.UnitOrder.DOTA_UNIT_ORDER_VECTOR_TARGET_POSITION, null, Input.GetWorldCursorPos(), q,

Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, localHero);

// what position we want jump

localPlayer.PrepareUnitOrders(Enum.UnitOrder.DOTA_UNIT_ORDER_CAST_POSITION, null, localHero.GetAbsOrigin(), q,

Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, localHero);

}

// marci case

if (Input.IsKeyDownOnce(Enum.ButtonCode.KEY_1, false))

{

let target = EntitySystem.GetHeroesList().find((hero) =>

{

if (!localHero)

return false;

return hero != localHero && hero.IsSameTeam(localHero) && hero.IsAlive();

});

if (target)

{

// what position we want jump

localPlayer.PrepareUnitOrders(Enum.UnitOrder.DOTA_UNIT_ORDER_VECTOR_TARGET_POSITION, null, Input.GetWorldCursorPos(), w,

Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, localHero);

// which hero to jump from

print(target.GetIndex());

localPlayer.PrepareUnitOrders(Enum.UnitOrder.DOTA_UNIT_ORDER_CAST_TARGET, target, null, w,

Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, localHero);

}

}