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.
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
Please log in to shout.


Members Online: jun3hong, Zergy, Ultraviolet