Is there a way to dynamically forbid or allow targets ?

Everything about mods can be found here.

Moderator: Morax

Is there a way to dynamically forbid or allow targets ?

Postby Franck83 » 05 Jun 2017, 18:47

Hi all,

I wanna do a special power that allows my unit to not be targeted for some kind others units for a limited time.

I found the unit:SetDoNotTarget(true) method, but it desactivate targetting for all opponents with no distinction. But i want to do counter units. The weapon:SetValidTargetsForCurrentLayer() is only valuable for layers categories (ground, air, water, sub...). The weapon:SetTargetingPriorities() only controls priorities but not the targettng tracking itself.

Somebody has some experience to restrict targeting on some units only ? Or some idea ?
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Is there a way to dynamically forbid or allow targets ?

Postby nine2 » 05 Jun 2017, 23:04

Domino made a mod where you can mark enemy units as different firing priorities.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Is there a way to dynamically forbid or allow targets ?

Postby Exotic_Retard » 05 Jun 2017, 23:10

as a workaround if you modify the target priorities and put the target unit bpid category at the bottom, then disable and enable the weapon it should work (tm)

ofc it will work for a type of unit and not a specific unit.

you can also order a weapon to UnitWeapon:SetTarget(entity) and set it to not the thing you are firing at if it has your ability turned on.

which is likely what you want. or something.
User avatar
Exotic_Retard
Contributor
 
Posts: 1470
Joined: 21 Mar 2013, 22:51
Has liked: 557 times
Been liked: 626 times
FAF User Name: Exotic_Retard

Re: Is there a way to dynamically forbid or allow targets ?

Postby Franck83 » 05 Jun 2017, 23:47

Thanks anni and exo for our answers.

Anni : i remember resin smoker talked about, i saw it in a video. It add selected units in the target priority stack. I will try to find it.

Exo : yes, it may work partially. I put my bpid category at the top, reset the weapon. But If my unit is alone, it will still be hit since there are no more higher targets. But at this time, i can weapon block the opponent.
But i have a problem since my special power is linked to a class added to my unit (Sync.BaseClass property). Any bpid category unit can be promoted to this power.

My question : is it possible that the target priorities system allows to give unit id, not only bpid categories to the priority target stack ?
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest