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

Carryable: ignores Conditions under specific circumstances #17316

Open
Inq8 opened this issue Nov 8, 2019 · 2 comments
Labels
Bug

Comments

@Inq8
Copy link
Contributor

@Inq8 Inq8 commented Nov 8, 2019

When a unit has WithSpriteBody: & WithFacingSpriteBody: , alongside GrantConditionOnDeploy: & Carryable:

The Carryable: trait ignores any conditions given to the unit & defaults to WithSpriteBody over WithFacingSpriteBody.

Easy repo:

  1. Add the following to any vehicle in RA, I used MRJ & added RequiresCondition: deployed to the spinner.
	GrantCondition@AlwaysActive:
		Condition: alwaysactive
	WithFacingSpriteBody:
		RequiresCondition: undeployed
		Name: bodymove
	WithSpriteBody@deployed:
		Sequence: idle
		RequiresCondition: !undeployed && alwaysactive
	Carryable:
		LocalOffset: 0,0,200
	GrantConditionOnDeploy:
		DeployedCondition: deployed
		UndeployedCondition: undeployed
		Facing: 0
		AllowedTerrainTypes: Clear, Road, Rough
		UndeployOnMove: true
		UndeployOnPickup: true
  1. Add the Carryall trait to the Transport heli:
	Carryall:
		BeforeLoadDelay: 10
		BeforeUnloadDelay: 15
		LocalOffset: 0, 0, -128
		AllowDropOff: True

This will result in:
magicmrj

This is because alwaysactive is not granted to the unit when it is picked up.

If you delete:

GrantCondition@AlwaysActive:
		Condition: alwaysactive

It will be the same, except this time it will render WithSpriteBody@deployed: & not WithFacingSpriteBody:, because undeployed has not been granted.

@Inq8

This comment has been minimized.

Copy link
Contributor Author

@Inq8 Inq8 commented Nov 8, 2019

Additionally, If you reverse the conditions in the repo example above & use the deployed condition, it will break GrantConditionOnDeploy:

	WithSpriteBody@deployed:
		Sequence: idle-static
		Name: bodydeployed
		RequiresCondition: deployed && real-actor
	WithFacingSpriteBody:
		RequiresCondition: !deployed
	GrantConditionOnDeploy:
		DeployedCondition: deployed
		UndeployedCondition: undeployed
		Facing: 165
		AllowedTerrainTypes: Clear, Road, Rough
		DeploySounds: placbldg.aud
		UndeploySounds: clicky1.aud
		UndeployOnMove: true
		UndeployOnPickup: true

The unit turns and trys to deploy but gets stuck and becomes unable to move & unable to deploy or undeploy.

@abcdefg30 abcdefg30 added the Bug label Nov 8, 2019
@pchote

This comment has been minimized.

Copy link
Member

@pchote pchote commented Nov 8, 2019

This is a consequence of ActorPreviews still not supporting condition states. The cargo will render whatever is active when all conditions are false. Take a look at the TS Juggernaut for a workaround that defines a real-actor condition that is always active for real actors (and always false for carried actors) that can be used to toggle the traits you want.

See also #16098.

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.