Thank you very much for your detail answer!
My aim was to make unit with 2 weapons. First one — against infantry, second one — against vehicles.
Now I understand. So the trait
"ValidTargets" defines target: infantry/vehicles and so on. Not
Armament@PRIMARY and
Armament@SECONDARY, as I supposed.
I found, sardaukars weapons made this way.
As you can see in the code above (in the first message), sardaukars have 2 weapons:
M_LMG and
M_HMG.
Code: Select all
M_LMG:
...
ValidTargets: Infantry
M_HMG:
...
InvalidTargets: Infantry
--------------------------------------------------
For example troopers can have a longer range against aircraft
Very interesting example. New challenge — to make trooper, who can do it! :-)
At first sight at the code of weapons... Unit "trooper" has weapon "Bazooka".
And nothing more in the code. No restrictions (about air) here.
Code: Select all
^Rocket:
...
Warhead@3Eff: CreateEffect
Explosions: tiny_explosion
ImpactActors: false
ValidTargets: Ground, Air
It is not quit understandable here... Why do troopers not inherit air targets?
Nevermind.
I suppose I will find it later. I hope...
It's interesting to try!
I found already the trait
ValidTargets: Heal
Thank you ones more — for big and interesting answer!