Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithEmbeddedTurretSpriteBody: fetching the first Turreted: and ignores the rest #17373

Open
MlemandPurrs opened this issue Nov 21, 2019 · 1 comment
Labels

Comments

@MlemandPurrs
Copy link

@MlemandPurrs MlemandPurrs commented Nov 21, 2019

I wanted to make it so that gun turret turns slower when low on power. As in the Traits code of WithEmbeddedTurretSpriteBody: is this comment 'Turret artwork is baked into the sprite, so only the first turret makes sense.', thought might workaround that by giving second Turreted: block also Turret: primary. That doesnt work since it cannot be pointed to use which turret. Its fetching the first Turreted and ignores the rest, even if i give the second Turreted block Turret: primary its ignored.

Cannot simply give multiple AttackTurreted: to one actor, even with RequiresCondition and PauseOnCondition setup such that ensures only one will be active at an time, for as then will get:
Exception of type System.InvalidOperationException: Actor gun has multiple traits of type OpenRA.Mods.Common.Traits.AttackBase.

GUN:
	Buildable:
		BuildPaletteOrder: 6
	DetectCloaked:
		Range: 3c0
		RequiresCondition: !disabled && !lowpower && !build-incomplete
	Turreted:
		InitialFacing: 224
		RequiresCondition: !lowpower
		PauseOnCondition: lowpower
	Turreted@lowpower:
		Turret: primary
		TurnSpeed: 6
		InitialFacing: 224
		RequiresCondition: lowpower
		PauseOnCondition: !lowpower
	Armament:
		PauseOnCondition: disabled
	AttackTurreted:
		PauseOnCondition: disabled
	GrantConditionOnPowerState@LOWPOWER:
		Condition: lowpower
		ValidPowerStates: Low, Critical
@matjaeck

This comment has been minimized.

Copy link
Contributor

@matjaeck matjaeck commented Nov 21, 2019

I wanted to make it so that gun turret turns slower when low on power.

People helped me to set up conditional turn speed for a map mod some time ago: https://gist.github.com/matjaeck/483510708508b3baf43a24ed0d6af4ad#file-rules-yaml-L175 (not updated since then).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.