How to Update a Custom Task Script from V2 to V3?

Vexitron

New member
Hi. I had a programmer help me 2 years ago to get Zombies to Attack the player in Opsive (V2). I am on my own now, and a bit unfamiliar with the correct method for updating Opsive V2 to V3 custom Tasks (scripts).

Would anyone be able to tell me how to update this? I tried to apply it to an Agent in DeathMatch (I set up via DeathMatch Agent setup), then I customized a V3 Death Match Agent (Zombie) to use a customized/slightly updated version of the 'Solo' Behavior Tree - by replacing the 'Attack' Task with this custom 'Zombie Attack' Task (script) - which worked before in V2, but doesn't appear to be working in V3.

How to get poor Zombie to attack (it animates, walks to the player, just does not attack, plus it also does not do damage via melee)?

Again, I figure out stuff on my own, but this one has not been solved, and more time than I would like to admit. Your help would be most appreciated:

using UnityEngine;
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;
using Opsive.UltimateCharacterController.Character;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
public class ZombieAttack : Action
{
public SharedGameObject target;
private UltimateCharacterLocomotion characterLocomotion;
public override void OnStart()
{
base.OnStart();
characterLocomotion = GetComponent<UltimateCharacterLocomotion>();
}
public override TaskStatus OnUpdate()
{
if (characterLocomotion != null)
{
var useAbility = characterLocomotion.GetAbility<Use>();
if (useAbility != null)
{
characterLocomotion.TryStartAbility(useAbility);
return TaskStatus.Success;
}
}
return TaskStatus.Failure;
}
}
 

Attachments

  • ZOMBIE-Behavior.png
    ZOMBIE-Behavior.png
    120.1 KB · Views: 1
  • No-ATTACKY-from-Zombie.jpg
    No-ATTACKY-from-Zombie.jpg
    97.9 KB · Views: 1
Btw - Attached/here is the original Tasks and ZombieBehavior. I Tried remaking this in V3 from scratch, but with that one, the Zombie just stands Idle, and doesn't even go to the 3 WayPoints...
Thanks in Advance.
 

Attachments

  • ORIGINAL-ZOM-BEHAVIOR.png
    ORIGINAL-ZOM-BEHAVIOR.png
    59.6 KB · Views: 1
FYI - Seems It might be working - I am reading the errors,and it is saying a lot of messages about the Agent is not on a NavMesh - I did create a NavMesh, but seems its not noticing the one I made - its a big mesh covering an island, and not near 0,0,0 much, so those could be the issue... will keep investigating; and will post any progress, again.
 
Make sure you follow this page for updating a version 2 character:


Please use [ code ] tags when posting code. With that said, what you posted is the same in version 3 as it was in version 2.
 
Ok, will check that out!
Thank you so much for your valuable time.
Ok, noted about the [ code ] tags.

It may be something with the NavMesh, so I will try to create a new one, not based on the terrain. Fingers Crossed.
 
Top