Jump to content

Attempting to create an advanced custom ability


funnyhalo1

Recommended Posts

Howdy Folks,

 

Been trying to figure out how to make this ability function. Essentially the goal is to have your unit move to within one block towards an aggressor who manages to hit them with a ranged or melee attack.

 

The ultimate goal is to get this unit to be attacked, run towards the unit who attacked it after it finishes spending it's action, and then have the unit with the custom ability run towards it and smash it.

 

 

  Reveal hidden contents

As of right now, all this does is make the unit roar in reaction to any nearby enemies...and kill them on the spot, without moving. Kind of funny to send this unit in the middle of a map during test and to watch everything die instantly...but as you may guess, this is not the end goal. =P. (I did make a video, which I may post adventually, which shows the unit killing and ragdolling the dead units towards her.)
If someone could look at this code, and give suggestions, I'll attempt to do them. Thanks regardless!
Link to comment
Share on other sites

I've looked over this, but not yet in a really detailed manner. Part of the issue sounds like a problem with the VisualizationFn, which is used to actually view stuff on screen.

 

There was a pre-release version of the game where the pistol 'Faceoff' didn't yet have an associate animation/visualization function, with the same result. The game would simply pause for a bit until the visualization timed out, then all the units would take damage.

Link to comment
Share on other sites

Thanks, I'll talk to my team members about this. Any more guidance or suggestions are greatly appreciated.

 

 

Edit: I took a look at the function based off the ranger Uc and the line of code you mentioned, but not the ability faceoff. (It might have a different name). I found what you referenced. I also found it the specific lines in our mod where it is in the template of the particular uc we are using.

 

 

What I don't get what is we are doing wrong. Are we using an incorrect animation? Or an invalid one?

 

 

  Reveal hidden contents

Edited by funnyhalo1
Link to comment
Share on other sites

I don't think a TypicalAbility_BuildVisualization is going for such a custom ability. The TypicalAbility handles common stuff like triggering FF_Fire animations on weapon items and the like, not running and attacking a unit.

 

A decent example is in the OfficerPack, the FallBack ability. It has a custom visualization :

Template.BuildVisualizationFn = FallBack_BuildVisualization; 

The FallBack ability is an activate-able ability used by the officer on another unit, which makes the targeted make an immediate AI-controlled defensive move (typically toward cover).

 

In our case, the visualization is just what's happening on the officer, which triggers the 'HL_SignalEncourage' animation with :

PlayAnimationAction = X2Action_PlayAnimation(class'X2Action_PlayAnimation'.static.AddToVisualizationTrack(BuildTrack, context));
PlayAnimationAction.Params.AnimName = 'HL_SignalEncourage';
PlayAnimationAction.bFinishAnimationWait = true;

What happens on the unit (including animations) is handled via X2Effect_FallBack with a special invocation into the BehaviorTree code :

// Kick off panic behavior tree.
FallBackBehaviorTree = 'FallBackRoot';

// Delayed behavior tree kick-off.  Points must be added and game state submitted before the behavior tree can 
// update, since it requires the ability cache to be refreshed with the new action points.
UnitState.AutoRunBehaviorTree(FallBackBehaviorTree, 1, `XCOMHISTORY.GetCurrentHistoryIndex() + 1, true);

I'm not sure if it will help, but it might give you some clues in the right direction :)

Link to comment
Share on other sites

Amineri,

 

Thanks for the response. I'll be perfectly honest thought, still learning. I get mostly what you are trying to say, and IF (and that's a big IF) I am, would looking at the x2effect_panicked.uc lead me in the right direction? It has everything I need, except for removing the panic effect and running in the opposite directions. AS far as I can read the code (which is not much, but I am getting there) it already removes control of the unit and gives it to the ai, granting it action points and forcing it to move away and hunker down/or attack.

 

Do you think I'm on the right track? If anyone else has any suggestions, I'm open. Thanks again for the response.

Link to comment
Share on other sites

  • 2 weeks later...

Loaded up your addtions (as we discussed on steam) along with the correct fly over's and skill tree, but now Game crashes in debug mode upon attempt of mission. Thanks for your help on this, but I can't still figure out what's causing the issue. If anyone has any idea's, feel free to post. The project builds fine, and so does the mod, however, upon attempting to launch the skyranger and enter the screen to select your soldiers, it crashes. And I can't fathom as to why, as Swinka's solution shouldn't have changed selecting something on the skyranger. The game works fine otherwise. I just can't launch missions. >.>

 

If anyone else has idea's, I'm open to them. My crash log is below in spoilers, and I can't seem to make heads or tails of it, especially since it's refrencing mods that I don't have activated, (I'm also launching from mod buddy in debug mode.)

 

 

 

 

  Reveal hidden contents

 

Edited by funnyhalo1
Link to comment
Share on other sites

Thanks again Swinka for the assistance! I've run into a new problem though. With the Generosity of DerBK and his team, he allowed us to use The Fire breathing berserker, and include it as an ability in it's skill tree. Unfortuntatly, I've run into a road block. The few times me and Sernik managed to get the ability to actually show up in game, it had no ammo. So we (serniK)fixed that. And everything seemed to work fine...except when the ability triggers, it doesn't sweep the entire area with fire, like it should. Any fix we make makes the ability unusable, or the project unabuildable. If anyone is interested in taking a look at the project file and helping, the advice would be appreciated. Send me a message via pm, or make a request here.

 

Example below of how the mod should work, in derBK's mod, a Better Advent.

https://www.youtube.com/watch?v=Qd75XbyMoX0

 

How it's working in our mod....

https://www.youtube.com/watch?v=L76EbC3luC0

 

 

Any advice would be greatly appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...