Engineer Husk Salvage

Information and discussion for custom maps and mods.
Post Reply
User avatar
Smitty
Posts: 191
Joined: Mon Sep 26, 2016 1:33 am
Location: Oklahoma

Engineer Husk Salvage

Post by Smitty » Sun Jan 15, 2017 2:42 am

I’ve been looking to test ways to add more functionality to the engineer and have recently been taking a stab at giving engineers the ability to salvage a husk for credits.

The optimal way, I believe, would be to use the Engi’s ExternalCapture ability along with CashTrickler. However, because the mechanic uses Capture to restore husks, I can’t find a way to implement the engi capture without resurrecting the destroyed vehicle.

Is there a way to either:
a) Use the Capture and ExternalCapture traits in a way they can work independently from each other or
b) A different method for restoring husks with mechanics other than capture?

Here’s what I’ve been rolling with so far:

Code: Select all

	^Husk:
		ExternalCapturableBar:
		ExternalCapturable:
			AllowAllies: true
			ConsumeActor: true
			CaptureCompleteTime: 5
        
	1TNK.Husk:
		CashTrickler:
			CaptureAmount: 350
			Amount: 0
			Period: 10000	
            
	2TNK.Husk:
		CashTrickler:
			CaptureAmount: 425
			Amount: 0
			Period: 10000              
			
	3TNK.Husk:
		CashTrickler:
			CaptureAmount: 625
			Amount: 0
			Period: 10000                
			
	4TNK.Husk:
		CashTrickler:
			CaptureAmount: 1000
			Amount: 0
			Period: 10000                 
			
	HARV.FullHusk:
		CashTrickler:
			CaptureAmount: 550
			Amount: 0
			Period: 10000                   
	
	HARV.EmptyHusk:
		CashTrickler:
			CaptureAmount: 550
			Amount: 0
			Period: 10000               
			
	MCV.Husk:
		CashTrickler:
			CaptureAmount: 1250
			Amount: 0
			Period: 10000
			
	MGG.Husk:
		CashTrickler:
			CaptureAmount: 600
			Amount: 0
			Period: 10000              
			
	E6:
		ExternalCaptures:
			Type: building, ^Husk
Aesthetically there are a couple of minor issues. The CashTrickler wants to show ticks even when the value is set to 0. I’ve limited it to only tick once by making the interval absurdly long.
Also, I can’t seem to get the ExternalCapturableBar to show.

Matt
Posts: 1021
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Sun Jan 15, 2017 8:21 am

You can try https://github.com/OpenRA/OpenRA/wiki/T ... ateforcash but that is not really what you want.

The existing traits aren't flexible enough for your idea. You need to touch the source code to get this to work.

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

Post by Graion Dilach » Sun Jan 15, 2017 1:26 pm

Nah, it's completely possible to do this without engine changes - it's just a bit complex though.

Give Engineers a weapon which can target and destroy these husks only with a custom damagetype.
Add a SpawnActorOnDeath to all husks with an OwnerType of Killer using this engineer-weapon-only damagetype and set CashTrickler on these spawned actors to give the amount you want. You can use negative SelfHealing to kill these spawned actors afterwards.
If you want the Engineers being used only once for this, then the best option to give these spawned actors an AttackFrontal trait with FacingTolerance of 255 and a weapon which can only attack Engineers (Targetable is your friend) and set it up so that the husk will attack and kill the Engineer in retrospect (the other option of firing a GravityBomb along with the transformer will break SpawnActorOnDeath because the Engi will likely die before it could get the husk transformed)

EDIT: Meh. scrap AttackFrontal. An invisible turret is the way to go. Tesla Tank is IIRC set it up like that.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

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

Post by MustaphaTR » Sun Jan 15, 2017 1:49 pm

There is an AttackOmni tag for attacking anyway and it is what tesla tank uses.

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

Post by Graion Dilach » Sun Jan 15, 2017 6:37 pm

You're wrong - it uses AttackTurreted with an invisible turret, see https://github.com/OpenRA/OpenRA/pull/9 ... f-44858120 why. You can check it in your yamls even.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
Smitty
Posts: 191
Joined: Mon Sep 26, 2016 1:33 am
Location: Oklahoma

Post by Smitty » Wed Jan 18, 2017 2:52 am

Thanks Graion,
Frame took a crack at your weapon suggestion and came up with a working solution.
http://resource.openra.net/maps/18384/
It looks a bit cumbersome but it’ll let us playtest the husk salvage idea.

Post Reply