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:58 am]
Symmetry -- Reindeer breeding 2 is not EUD and errors when I try to upload
[12:26 am]
Moose -- Symmetry
Symmetry shouted: yeah uploading for me has been a 50/50 toss up here lately
certain EUD maps segfault the map parser, :farty: ignore me the last time I complain at him. :crybaby:
[05:18 pm]
NudeRaider -- NimoStar
NimoStar shouted: isn't that only for maps?
yes
[2026-11-18. : 3:34 am]
Symmetry -- yeah uploading for me has been a 50/50 toss up here lately
[2026-11-17. : 7:55 pm]
NimoStar -- isn't that only for maps?
[2026-11-17. : 5:52 pm]
NudeRaider -- use scmscx.com
[2026-11-17. : 4:39 pm]
NimoStar -- While I can download, uploading is another story (771 kb file)
[2026-11-17. : 10:58 am]
UndeadStar -- Members Online: UndeadStar, EwanDalrymple090, CedrikPaquette881, ThierryCloutier864, RussellWalker308, RoisinMcCann053, GrahamEllery106, DeirdreMcCloskey160 <= good thing they only watch and don't all post
[2026-11-15. : 7:59 pm]
Symmetry -- but I seem to be downloading things fine
[2026-11-15. : 7:59 pm]
Symmetry -- the DLDB here is kinda sketch
Please log in to shout.


Members Online: Oh_Man, MarritVellinga146