This topic contains 34 replies, has 5 voices, and was last updated by  darkeccho 1 week, 5 days ago.

Viewing 15 posts - 1 through 15 (of 35 total)
  • Author
    Posts
  • #36243

    redhawk
    Participant

    Alright, so I think someone already asked somewhere in a prior post. I’m playing around with the Darkness Warlord, got him to see me and attack, but now I need to send/receive damage. What are you using to send/receive damage?

    I thought I would go ahead and post this question while I’m also digging through the DarknessWarlordPrefab. For UFPS, it basically sends damage typically through a collider hit…something like hit.collider.SendMessageUpwards or just SendMessage(…..). They expose the DamageMethodName as a public String to allow for easy change to make it work with other systems easier. Their Default string is set to “Damage”, so it would send a Float damage amount…(“Damage”,DamageFloatAmount,dontrequirereceiver….

    So what script handles receiving/sending damage on the RAIN side?

    #36246

    redhawk
    Participant

    I found it. Just digging around in it now. I can kill it with a Mace but not bullets yet…hmmm

    #36247

    redhawk
    Participant

    Looks like your DamageMessage is a bit complex making it a bit more difficult to simply send over a float value. I will dig around more soon. Too bad you guys don’t own a copy of UFPS.

    #36253

    prime
    Keymaster

    Yes, our damage message is more complex than a simple float value. It’s more useful to have information like who delivered the damage, where it hit you, etc. It is pretty easy to add those parameters to the damage sending code (even if you leave the values empty).

    #36265

    redhawk
    Participant

    I see. I wonder if there is a way then to create a “go-between” or alternate script to take the data and convert it to what Rain is looking for. UFPS can also send source, but the format is more of a UFPS-Type instead of a gameobject. Plus the bullets don’t seem to trigger a response. Would be nice to just drag on an additional script that works as a go-between.

    I’m going to continue to toy around with this over the next few days.

    #36267

    prime
    Keymaster

    Please post your findings back here. We don’t mind taking suggestions for how the damage system works. Our initial pass with the first 3 Sentio Characters was intended to be a fairly generic, easy to adapt to approach. As you and others begin to try to adapt it, we can take the feedback and improve the setup. If you or we end up creating adapters to match other systems (like ufps) then we can post the adapters in a common location where everyone can find them.

    #36401

    QUEdotCOM
    Participant

    @redhawk
    I’m with you for the “go-between” script.

    By the way, can you share your work around for the maze using UFPS?

    Cheers,
    EM @ KING.NET

    #37626

    redhawk
    Participant

    So, I’ve come up with two scripts for Go-Between, but I’m not able to figure out how to get the InGame red warnings to go away. The scripts work, but I personally would rather not have the in game messages.

    This goes on the UFPS Player

    using UnityEngine;
    using System.Collections;
    //Below are all the RAIN references
    using RAIN.Core;  
    using RAIN.Serialization;
    using RAIN.Entities;
    using RAIN.Entities.Aspects;
    using Sentio.CreaturePack;
    //RedHawk - Put this on UFPS Player highest level
    //RedHawk - Keeping all my UFPS scripts in this namespace to make it easier to find
    namespace UFPS
    {
    	public class UFPSDmgRcvrSENTIO : MonoBehaviour
    	{
    		vp_FPPlayerDamageHandler m_Player=null;
    		vp_FPPlayerEventHandler FPPlayer=null;
    		void Start()
    		{
    			m_Player = this.GetComponent<vp_FPPlayerDamageHandler>();
    			FPPlayer = this.GetComponent<vp_FPPlayerEventHandler>();
    		}
    		public void Damage (DamageMessage aDamageMessage)
    		{
    			//m_Player.Damage (aDamageMessage.damageAmount);
    			Transform hitSource=aDamageMessage.damageGiver.transform;
    			float hitAmount=aDamageMessage.damageAmount;
    			m_Player.Damage(new vp_DamageInfo(hitAmount,hitSource,vp_DamageInfo.DamageType.Impact));
    			FPPlayer.HUDDamageFlash.Send(new vp_DamageInfo(hitAmount,hitSource,vp_DamageInfo.DamageType.Impact));
    		}
    	}
    }

    This goes on the Root of the Darkness Warlord

    using UnityEngine;
    using System.Collections;
    //Below are all the RAIN references
    using RAIN.Core;  
    using RAIN.Serialization;
    using RAIN.Entities;
    using RAIN.Entities.Aspects;
    using Sentio.CreaturePack;
    using Sentio.DarknessWarlord;
    //RedHawk - Put This on Sentio Character
    //RedHawk - Keeping all my UFPS scripts in this namespace to make it easier to find
    namespace UFPS
    {
    	public class UFPSAIDmgSenderSENTIO : MonoBehaviour 
    	{
    		DamageMessage myDmg=null;
    		AIDamageReceiver myAIRcvr=null;
    		void Start()
    		{
    			myAIRcvr=this.GetComponent<AIDamageReceiver>();
    		}
    		public virtual void Damage(vp_DamageInfo theDamage)
    		{
    			myDmg = new DamageMessage() {damageGiver = theDamage.Source.gameObject, damageAmount = theDamage.Damage };
    			myAIRcvr.Damage(myDmg);
    //			Debug.Log("The Damage is "+theDamage.Damage);
    		}
    	}
    }
    #37820

    darkeccho
    Participant

    Did this ever work for you? I tried out the scripts you provided but edited it slightly for the necromancer but i get a bunch of errors for the damage receiver script

    • This reply was modified 1 month ago by  darkeccho.
    #37830

    redhawk
    Participant

    Like I said, you will get errors in game. The scripts work, but you will get errors. I’m waiting for the RivalTheory team to help resolve the issues. I’ve contacted them directly, but have not had a resolution yet. The goal is to have them provide UFPS scripts or a resolution that works with UFPS. Otherwise, you have to change their scripts directly, which is the least ideal solution.

    #37834

    darkeccho
    Participant

    Actually the image I showed was of compilation errors, the script doesn’t work since it won’t let me hit play or even place the scripts on an object. Which is why I asked, it may be due to using Unity5 but not sure, thanks for responding.

    • This reply was modified 1 month ago by  darkeccho.
    #37836

    redhawk
    Participant

    I don’t have the necromancer but it’s strange that it would be set up differently.

    #37837

    redhawk
    Participant

    Also this is on Unity 5 with UFPS version 1.5, so if you are using prior UFPS version, it will error out.

    #37838

    darkeccho
    Participant

    I see that makes sense, let me try updating to 1.5 and see if that fixes the errors, thanks for the tip.

    #37839

    redhawk
    Participant

    Notice too that I am “using Sentio.DarknessWarlord;” which might also cause you issues.

Viewing 15 posts - 1 through 15 (of 35 total)

You must be logged in to reply to this topic.