News Forums RAIN Code Snips UFPS Integration with Sentio Character

This topic contains 0 replies, has 1 voice, and was last updated by  prime 1 year, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #37914

    prime
    Keymaster

    Changes needed to integrate the Darkness Warlord character with UFPS:

    Make this change to DamageOnCollision.cs:

    //            DamageMessage tDamage = new DamageMessage() { damageGiver = tGiver, damageAmount = DamageAmount };
    //            aOtherCollider.gameObject.SendMessageUpwards("Damage", tDamage, SendMessageOptions.DontRequireReceiver);
                vp_DamageInfo tDamage = new vp_DamageInfo(DamageAmount, tGiver.transform, tGiver.transform, vp_DamageInfo.DamageType.Impact);
                aOtherCollider.gameObject.SendMessageUpwards("Damage", tDamage, SendMessageOptions.DontRequireReceiver);

    Add this to DamageMessageReceiver.cs

    public virtual void Damage(vp_DamageInfo aDamageMessage)
            {
                CurrentDamage += aDamageMessage.Damage;
            }

    Add this to AIDamageReceiver.cs

    public override void Damage(vp_DamageInfo aDamageMessage)
            {
                base.Damage(aDamageMessage);
                if ((HealthElement != null) && (aDamageMessage.Damage > 0))
                {
                    if ((aDamageMessage.OriginalSource != null) && (aDamageMessage.OriginalSource.IsChildOf(HealthElement.AI.Body.transform)))
                        return;
                    object tEnemy = HealthElement.AI.WorkingMemory.GetItem<object>("currentEnemy");
                    if (tEnemy == null)
                    {
                        HealthElement.AI.WorkingMemory.SetItem<CreatureAspect>("currentEnemy", FindAliveCreatureAspect(aDamageMessage.OriginalSource.gameObject));
                    }
                }
            }
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.