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

TurretTurnSpeedModifier trait seems to be needed #17497

Open
MlemandPurrs opened this issue Dec 23, 2019 · 1 comment
Open

TurretTurnSpeedModifier trait seems to be needed #17497

MlemandPurrs opened this issue Dec 23, 2019 · 1 comment
Labels

Comments

@MlemandPurrs
Copy link

To modify the turn rate of an turret based on conditions have to create two seperate Turreted blocks, This causes an unwanted issue where facing of the turret will change to that of currently active Turret's whenever the change occurs. As there does not seem to be an way of aligning the two seperate Turret entities to use the same facing an new trait seems to be required for this.

related as im still trying to do the: "I wanted to make it so that gun turret turns slower when low on power."
#17373
had to modify as such for an workaround for the graphic issue with gun turret, this time turret changes facing each time transition to and from lowpower, as there are two seperate Turreted's with conditional one active when the other isnt.

	Buildable:
		BuildPaletteOrder: 4
		Prerequisites: weap, ~structures.allies, ~!player.italy, ~techlevel.medium
	Tooltip:
		Name: Gun Turret
	Valued:
		Cost: 700
	DetectCloaked:
		Range: 3c0
		RequiresCondition: !disabled && !lowpower && !build-incomplete
	Turreted@normal:
		Turret: default-turret
		TurnSpeed: 12
		InitialFacing: 224
		RequiresCondition: !lowpower
		PauseOnCondition: lowpower
	Turreted@lowpower:
		Turret: lowpower-turret
		TurnSpeed: 6
		InitialFacing: 224
		RequiresCondition: lowpower
		PauseOnCondition: !lowpower
	-Armament:
	Armament@default:
		Name: defaultarm
		Turret: default-turret
		Weapon: TurretGun
		LocalOffset: 512,0,112
		MuzzleSequence: muzzle
		PauseOnCondition: disabled
		RequiresCondition: !lowpower
	Armament@lowpower:
		Name: lowpowerarm
		Turret: lowpower-turret
		Weapon: TurretGun
		LocalOffset: 512,0,112
		MuzzleSequence: muzzle
		PauseOnCondition: disabled
		RequiresCondition: lowpower
	AttackTurreted:
		Armaments: defaultarm, lowpowerarm
		Turrets: default-turret, lowpower-turret
		PauseOnCondition: disabled
		RequiresCondition: !build-incomplete
	GrantConditionOnPowerState@LOWPOWER:
		Condition: lowpower
		ValidPowerStates: Low, Critical
	-SpawnActorsOnSell:
	-WithEmbeddedTurretSpriteBody:
	WithSpriteBody:
	GrantConditionOnDamageState:
		Condition:	damaged
	WithSpriteTurret@NORMAL:
		Sequence: turret-normal
		Turret: default-turret
		RequiresCondition: !build-incomplete && !damaged && !lowpower
	WithSpriteTurret@NORMALLOWPOWER:
		Sequence: turret-normal
		Turret: lowpower-turret
		RequiresCondition: !build-incomplete && !damaged && lowpower
	WithSpriteTurret@DAMAGED:
		Sequence: turret-damaged
		Turret: default-turret
		RequiresCondition: !build-incomplete && damaged && !lowpower
	WithSpriteTurret@DAMAGEDLOWPOWER:
		Sequence: turret-damaged
		Turret: lowpower-turret
		RequiresCondition: !build-incomplete && damaged && lowpower
	RenderSprites: 
		Image: gun2
@GraionDilach
Copy link
Contributor

Hackish workaround already doable in AS:

Use GrantPeriodicCondition to grant a condition for every second frame when it's on low power which pauses the single Turreted trait. Since pausing prevents turning, you end up with almost the same result, just with less smooth visuals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants