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.
[06:39 pm]
Vrael -- 6000 apm near perfect focus fire is yikes
[06:38 pm]
Vrael -- paralyze was metaphorically speaking, paralyzed
[06:38 pm]
Vrael -- wasnt even that really, they 6000 apm just made the terran army so much more value/$ that the extra economy didnt matter
[01:58 pm]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
they basically lost most of their army in one big battle and didn't have the time and production to leverage the economic advantage and come back from that blow.
[01:55 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: https://youtu.be/1vsTqNwHquE omg guys it's happening. ITS HAPPENING. EVERONY STAY CALM. STAY F:wob::wob:CKING CALM!
not sure why you are so hyped, when basically the same happened 7 years ago with AlphaStar on SC2.
[01:53 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
[10:59 am]
NimoStar -- "Sick" is the appropriate word for the disease that AI is foisting upon our society. Repent, ye sinners!
[06:32 am]
Ultraviolet -- that was pretty sick lol
[02:55 am]
Oh_Man -- 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
[02:42 am]
Symmetry -- 'twas only a matter of time
Please log in to shout.


Members Online: Vrael