Codebase question regarding force move

I dove into the codebase and can not figure out how units knew when they were being force moved.

Information and discussion for custom maps and mods.
Post Reply
LeonardMT
Posts: 19
Joined: Tue Jan 12, 2021 2:38 am

Codebase question regarding force move

Post by LeonardMT »

I dove into the codebase awhile back to try to implement https://github.com/OpenRA/OpenRA/issues/19093 a feature that I desperately want but for the life of me I can't figure out how units know when they are being force moved.

User avatar
Punsho
Posts: 118
Joined: Wed Jul 18, 2018 2:56 pm
Location: Lithuania

Re: Codebase question regarding force move

Post by Punsho »

LeonardMT wrote:
Mon Dec 05, 2022 11:31 pm
I dove into the codebase awhile back to try to implement https://github.com/OpenRA/OpenRA/issues/19093 a feature that I desperately want but for the life of me I can't figure out how units know when they are being force moved.
If you'd like to contribute to OpenRA you'll find https://discord.openra.net/ to be the best place to communicate with the active devs

LeonardMT
Posts: 19
Joined: Tue Jan 12, 2021 2:38 am

Re: Codebase question regarding force move

Post by LeonardMT »

I'm willing to be on irc but whenever I join no one seems to be there. I think I've somewhat figured it out with

Code: Select all

if (modifiers.HasModifier(TargetModifiers.ForceMove))
but learning about permanent injury I don't think it would be the best idea to add it to TakeCover.cs instead I think adding something like GrantConditionOnForceMove.

Code: Select all

^Soldier:
	Inherits: ^Infantry
	UpdatesPlayerStatistics:
	MustBeDestroyed:
	ProximityCaptor:
		Types: Infantry
	TakeCover:
		RequiresCondition: !forcemoved
		DamageModifiers:
			Prone50Percent: 100
		DamageTriggers: TriggerProne
		Duration: 50
	WithInfantryBody:
		IdleSequences: idle1,idle2
		StandSequences: stand,stand2
	AttackFrontal:
		FacingTolerance: 0
	GrantConditionOnForceMove:
		Condition: forcemoved

Post Reply