|
Post by jrackley on Mar 15, 2017 21:19:32 GMT
Edit by Invector: Official Emerald AI v2.0 Integration > [HERE]
If anyone is interested or wants to know, I have Emerald AI working with Invector melee 2.0c at the moment, Animals are able to apply damage to player and vise versa. The only thing I have left to figure out at the moment is how to check that the player is blocking(unable to block animal attacks ATM). Once I get that worked out I will post how I got them to work together(Hopefully not too hacky, LOL!). Step 1 - Open up the Emerald_Animal_AI.cs file and somewhere around line 2993 you will see currentAnimal.SendMessage(SendMessageForPlayerDamage, attackDamage);comment that out and add the following underneath of it... //Bridge for Invector Tpc Melee Combat (Allows for Animals to apply damage to Invector player) var playerInput = currentAnimal.GetComponent<vMeleeCombatInput> (); var _damage = new Damage(attackDamage);
_damage.sender = currentAnimal.transform; _damage.hitPosition = currentAnimal.transform.position;
if (!playerInput.blockInput.GetButton ()) { currentAnimal.GetComponent<vCharacter>().TakeDamage (_damage, true); }
Step 2 - Open up vMeleeAttackObject.cs and find the method ApplyDamage around line 123. After the if statement and before the else if add the following... // Bridge to Apply Damage to Emerald AI Animals with Weapons if (other.gameObject.GetComponent<Emerald_Animal_AI>()) { other.gameObject.GetComponent<Emerald_Animal_AI>().Damage((int)_damage.value); } Also in the Emerald_Animal_AI.cs do not forget to add " using Invector" to the top. Please do not hesitate to show me any better way to do this, but this is a working integration(my first!!!) hope you enjoy. Also thank you to @invector for the help on getting the damage to apply when I was stuck!
|
|
|
Post by jrackley on Mar 15, 2017 22:32:29 GMT
Okay I think I have the blocking working now, running some tests and then I will post how I integrated for anyone interested. Please take into account that I am not the best coder and some of you guys may be able to clean it up some hopefully? (At least it is a working base to go with) Anyhow I will post again very soon with the code changes.
|
|
|
Post by tharindu on Mar 16, 2017 10:14:36 GMT
Okay I think I have the blocking working now, running some tests and then I will post how I integrated for anyone interested. Please take into account that I am not the best coder and some of you guys may be able to clean it up some hopefully? (At least it is a working base to go with) Anyhow I will post again very soon with the code changes. If you could post a video I would more than appreciate. I am torn between Emerald and ICE and a tutorial as this could help me decide what to purchase.
|
|
|
Post by jrackley on Mar 16, 2017 12:06:26 GMT
I have both myself, and I will say that while ICE has a lot more features to offer, Emerald is way easier to use for sure. I will get a vid up hopefully this afternoon sometime for you, I need do purchase some animal sounds today. As far as integration goes as well I found emerald to be a little easier, although I didn't really try to integrate ICE very hard, mostly just hacked it together and then decided to use Emerald instead. You can do a lot of really complex AI with ICE, but if you just need some solid basic animal AI then emerald is great.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 16, 2017 13:30:00 GMT
Im interested in this as well, been thinking about getting emerald AI, wonder how it would work with Invector.
|
|
|
Post by jrackley on Mar 16, 2017 14:38:17 GMT
Okay gonna sit down and add these sounds real quick and then post a short video and give the details on how to implement for everyone. Give me about an hour or so.
|
|
|
Post by jrackley on Mar 16, 2017 15:51:31 GMT
Okay video is uploading and will post as soon as it is done, but in the mean time here is how I was able to integrate Emerald and Invector to work together. Please feel free to use and suggest any better ways that you may come up with, again I am not the best coder, but you learn by doing and letting others show you improvements that can be made!
|
|
|
Post by jrackley on Mar 16, 2017 16:09:33 GMT
Here is a sample vid. Please keep in mind that the bears are pretty much all default settings and I didn't really tweak them for attack speeds and what not. Also this has Chronicmans quest system being used in it as well to show them working together.
|
|
|
Post by TheGreatMP on Apr 5, 2017 13:13:29 GMT
Hey there i was wondering if you figured out how to damage the player while he is blocking? thanks in advance
|
|
|
Post by TheGreatMP on Apr 5, 2017 16:05:54 GMT
I've also managed to figure out the damage while the player is blocking but i cant access the UI and activate the sounds when you block an attack. any help?
|
|
|
Post by jrackley on Apr 5, 2017 16:42:04 GMT
I've also managed to figure out the damage while the player is blocking but i cant access the UI and activate the sounds when you block an attack. any help? Honestly I never checked that part of it. I will look into it today when I get some time and see what I can do.
|
|
|
Post by thegreatmp on Apr 7, 2017 12:44:17 GMT
Any luck trying to access it?
|
|
|
Post by kevios on Jul 2, 2017 22:17:31 GMT
hello i have a problem with the integration... i do exact all what you write, but i get this faildure:
NullReferenceException: Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs(3298,50): error CS0246: The type or namespace name `vMeleeCombatInput' could not be found. Are you missing `Invector.CharacterController' using directive?
And this Error: Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs(3304,9): error CS0103: The name `playerInput' does not exist in the current context
when i comment this out from you integration: if (!playerInput.blockInput.GetButton ())
AND var playerInput = currentAnimal.GetComponent<vMeleeCombatInput> ();
i get no error but when a animal attak me i get no damage and when i attak a animal he get no damage too.... And in the Console in unity it come this:
NullReferenceException: Object reference not set to an instance of an object Emerald_Animal_AI+<AttackDelay>c__Iterator1.MoveNext () (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:3306) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
what i doing false can you help me maybe pls? anything must be wrong and i dont find the faildure... :(
|
|
|
Post by jrackley on Jul 3, 2017 1:28:26 GMT
hello i have a problem with the integration... i do exact all what you write, but i get this faildure: NullReferenceException: Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs(3298,50): error CS0246: The type or namespace name `vMeleeCombatInput' could not be found. Are you missing `Invector.CharacterController' using directive? And this Error: Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs(3304,9): error CS0103: The name `playerInput' does not exist in the current context when i comment this out from you integration: if (!playerInput.blockInput.GetButton ()) AND var playerInput = currentAnimal.GetComponent<vMeleeCombatInput> (); i get no error but when a animal attak me i get no damage and when i attak a animal he get no damage too.... And in the Console in unity it come this: NullReferenceException: Object reference not set to an instance of an object Emerald_Animal_AI+<AttackDelay>c__Iterator1.MoveNext () (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:3306) UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17) what i doing false can you help me maybe pls? anything must be wrong and i dont find the faildure... :( Give me a few and I will update the code above to go with the newest version of Invector, the above was for an earlier version
|
|
|
Post by kevios on Jul 3, 2017 14:52:23 GMT
oh ok thank you very very much this would be perfect *-*
|
|