Staredit Network > Forums > Modding Assistance > Topic: attack only mechanical
attack only mechanical
Aug 5 2019, 8:06 pm
By: Lagi  

Aug 5 2019, 8:06 pm Lagi Post #1



I try to make unit target only Mechanical units in PY and DatEdit. I set with or without "flying" +- "ground". Still the unit attacking all targets. "mechanical" parameter just appear to not work.

what i do wrong?



None.

Aug 6 2019, 6:08 pm Voyager7456 Post #2

Responsible for my own happiness? I can't even be responsible for my own breakfast

The targeting flags don't affect how units' target selection. Units will always try to attack ground units if they have a ground weapon and air units if they have an air weapon.

Those flags determine 1) if a spell can target a unit of that type (if the order has the "use weapons.dat targeting" flag set) and 2) if the weapon will deal damage to that type of unit.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Aug 31 2019, 4:25 pm Lagi Post #3



i try this, dont work:

//devourer only mechanical attack

if(unit->id == UnitId::ZergDevourer && (unit->mainOrderId == OrderId::AttackMove || unit->mainOrderId == OrderId::AttackUnit)){

CUnit* orderTarget = unit->orderTarget.unit;

if(orderTarget && orderTarget->id == (units_dat::BaseProperty[orderTarget->id] & UnitProperty::Mechanical)){
unit->orderToIdle();}
}

//end devourer only mechanical attack




None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:59 am]
NudeRaider -- IlyaSnopchenko
IlyaSnopchenko shouted: NudeRaider is that why there's rather little activity here?
Maybe a little, but it was pretty barren before as well. At least now the site doesn't break down non-stop.
[10:56 pm]
RdeRenato -- x2
[10:41 pm]
lil-Inferno -- ya
[09:33 pm]
IlyaSnopchenko -- NudeRaider
NudeRaider shouted: yeah who needs minerals? Everone is on discord anyway
is that why there's rather little activity here?
[08:01 pm]
NudeRaider -- yeah who needs minerals? Everone is on discord anyway
[02:52 pm]
Vrael -- who needs minerals I got minerals I got minerals for the low low price of only 2 minerals per mineral who needs minerals
[02:49 pm]
Voyager7456 -- I'm down like 2000 minerals lmao
[02:42 pm]
Suicidal Insanity -- It feels like the boxes just barelz break even in the long term
[01:31 pm]
MTiger156 -- I got a 0 again. Back to being a #BrokeBoi
[2020-8-04. : 9:57 am]
UndeadStar -- I just opened my 1st box, 40 minerals :wob:
Please log in to shout.


Members Online: Roy, MTiger156, jjf28, jun3hong