Make tank shoot at inf with mg

Information and discussion for custom maps and mods.
Post Reply
pointbreak

Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

User avatar
MustaphaTR
Posts: 203
Joined: Mon Aug 04, 2014 6:38 am
Location: Kastamonu, Turkey

Re: Make tank shoot at inf with mg

Post by MustaphaTR »

Target vaildity is defined at the weapon itself, not on unit's Armament trait.

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

abcdefg30
Posts: 664
Joined: Mon Aug 18, 2014 6:00 pm

Re: Make tank shoot at inf with mg

Post by abcdefg30 »

"Vehicles: vehicles.yaml" won't work, the game doesn't expect a "Vehicles" category. Try putting those changes in the "Rules" section,
i.e. "Rules: vehicles.yaml" (in case you haven't defined other rules yet).

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

abcdefg30
Posts: 664
Joined: Mon Aug 18, 2014 6:00 pm

Re: Make tank shoot at inf with mg

Post by abcdefg30 »

pointbreak wrote:
Mon Jul 23, 2018 2:23 pm
EDIT: Cannon only on structures and vehicles works, but at inf it still shoots with both. Hm. I'm using ValidTargets and InvalidTargets.. the latter doesn't seem to work?
Do you mind sharing your yaml here as well?
Maybe those examples are helpful:
The 120mm cannons of mammoth tanks don't shoot infantry: https://github.com/OpenRA/OpenRA/blob/8 ... s.yaml#L72
The sniper can only shoot infantry (and the ground): https://github.com/OpenRA/OpenRA/blob/d ... er.yaml#L3

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:58 am, edited 1 time in total.

pointbreak

Re: Make tank shoot at inf with mg

Post by pointbreak »

.
Last edited by pointbreak on Sun Apr 20, 2025 10:57 am, edited 1 time in total.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Re: Make tank shoot at inf with mg

Post by Graion Dilach »

That yaml looks correct to me, so I'm not certain what goes wrong. IIRc we haven't shipped the OpenRA.Utility ra --resolved-rules/--resolved-weapons though in the last release (does worth a check though) which would help debugging here a lot. You coulda inherit the actual weapons anyway and just override InvalidTargets, allowing you to just go

Code: Select all

M1CarbineTANK:
	Inherits: M1Carbine
	InvalidTargets: Air, Vehicle, Structure

Post Reply