Skip to content

Custom ability target styles v2#918

Merged
robojumper merged 3 commits into
X2CommunityCore:masterfrom
robojumper:763-custom-target-styles
Feb 7, 2021
Merged

Custom ability target styles v2#918
robojumper merged 3 commits into
X2CommunityCore:masterfrom
robojumper:763-custom-target-styles

Conversation

@robojumper

Copy link
Copy Markdown
Member

Fixes #763, resubmission of #762.

@robojumper

Copy link
Copy Markdown
Member Author

I personally have no use for this, but #762 in limbo bothered me, cc @Xymanek. #762 says LWotC needs this in some form, cc @pledbrook.

@robojumper robojumper added the ready-to-review A pull request is ready to be reviewed label Oct 29, 2020
Comment thread X2WOTCCommunityHighlander/Src/XComGame/Classes/XComGameState_Ability_CH.uc Outdated
if (AvailableCode != 'AA_Success')
return AvailableCode;

Targets.Sort(SortAvailableTargets);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use CH_MAKE_QUICKSORT from #809 since this is so performance critical?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs profiling. My intuition is that anything but .Sort() will worsen performance. How many available targets do we expect? Note that #809 currently already cuts off at 15 elements to use InsertionSort.

@pledbrook

Copy link
Copy Markdown
Contributor

I take it this has nothing to do with targeting methods?

@pledbrook

Copy link
Copy Markdown
Contributor

LWOTC has a X2AbilityMultiTarget_Cone_LWFlamethrower class that is a custom, UC targeting style. It seems to work as it is. Should I change something to start making use of this change?

@robojumper

Copy link
Copy Markdown
Member Author

I take it this has nothing to do with targeting methods?

For cursor-targeted abilities, the multi-target style builds the multi targets for the cursor target created by the targeting method. For everything else, the target style builds the initial target list, the multi-target style builds the multi-targets for every target, and the targeting method only selects a particular target.

@robojumper

robojumper commented Nov 5, 2020

Copy link
Copy Markdown
Member Author

X2AbilityMultiTarget_Cone_LWFlamethrower should work as is already and doesn't benefit from any change in this PR since it's cursor-targeted. If I were to suggest a change, it's this TODO:

https://github.com/long-war-2/lwotc/blob/db7ff997a5882cb4950a07861026f8e90317bd24/LongWarOfTheChosen/Src/LW_Overhaul/Classes/X2AbilityMultiTarget_Cone_LWFlamethrower.uc#L78-L83

UpdateParameters basically modifies the template, so it's a bit of a hack.

@Iridar

Iridar commented Nov 11, 2020

Copy link
Copy Markdown
Contributor

Wait, so it's all done and ready? Just needs a review? Imma get into that soon as I have time.

@Iridar Iridar self-requested a review November 11, 2020 08:28

@pledbrook pledbrook left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, it looks fine to me. I think it just requires some testing to ensure it doesn't break anything. Could use it for the next LWOTC release so that it does get some level of playtesting.

@Iridar Iridar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this a while ago, but forgot to report in. It works perfectly fine and is sufficient to do what I wanted to do, which is to make a version of Faceoff that can target variable number of targets based on pistol's current ammo.

@robojumper robojumper added this to the 1.22.0 milestone Feb 7, 2021
@robojumper robojumper merged commit a30d8e7 into X2CommunityCore:master Feb 7, 2021
@robojumper robojumper deleted the 763-custom-target-styles branch February 7, 2021 19:45
@Iridar Iridar removed the ready-to-review A pull request is ready to be reviewed label Apr 20, 2021
Iridar added a commit that referenced this pull request Jun 20, 2021
Issues #1019 and #918 - Fix AllTargetStylesNative() detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement framework for custom multi targeting styles

4 participants