Forums Gallery LOGIN |REGISTER

Community Archive is read-only - Here you can view content recorded up until February 2017. To join the latest discussions visit our new forums


melee\ranged attack on custom AI[SOLVED]

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


 

User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 23.10.2012, 02:32

As usually thank you faith!I'll try to use it without add a weapon bone in my max scene setup for now and changing the value in original fists; if all works I ll create a new weapon..or if it's possibile I simple duplicate the existing fists renaming it fists1 only for my char..I ll let you know!!Thank you!
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 23.10.2012, 04:20

Hi faith, sorry and thank you but I'm hopeless..something doesnt work for me...This is my animgraph with melee_attack state selected and the signal;
agraph.jpg
agraph2.jpg
in the second image there are changes made to my fists.xml(I did 4 change, 2 in melee and 2 in punch).
fists.jpg
I made 2attempt one with cover2st behavior and one with skeleton_hydralisk custom behavior(both with only fists in AI equipment) but the result is the same; my custom runs toward of me and kill me without melee animation;
P.S: only in custom behavior, If I watch with particular attention, there is a little moment before he attack me that seems he move just a little both hands(like the start of my melee animation) but maybe is only a transition or a tic..or maybe some allucination :-(
This message is always in console and this too(compared one time). I know I m asking you a lot but I ve no more ideas...sorry for this..thank you...
[Warning] CWeapon::SetCurrentFireMode - Requested fire mode, 'Burst', not found for weapon 'Fists063'
[Warning] Item owner 'Skeleton_hydralisk1' doesn't have third-person item attachment point 'right_item_attachment'!
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 23.10.2012, 12:55

Everything looks good to me. Try the attached file for your weapon. Don't worry about that error, it will still work.
Attachments
Claw.xml
(5.45 KiB) Downloaded 55 times
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 23.10.2012, 15:22

Hi faith tank you for the attached, I copy it in weapons folder and I ve a new weapon in my AI equipment; I select custom behavior and only claw in AI equipment but still the melee_animation doesnt work...lower weapon damage allows me to see that there is something strange before lua switches from approach to attack, it seems like he would use melee animation but he doesnt..I dont know if it's rilevant but my anim is 40frames longer..is maybe too long for this?

I know you had same message problem(burst error) but it disappears with your weapon..the messages I see now are

console.jpg

Can the reason of problem is that I have not a weapon_bone linked to my char in 3d studio max?

Thank you very much!
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 24.10.2012, 00:56

What is on line 27 of your attack behavior?

Hmmm, I don't think the bone is the issue.

Do a 'ag_debug YourAIsName' and see if it hits the state in the animation graph which calls your animation.
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 24.10.2012, 04:02

Hi faith...this is a pic of my Skeleton_hydraliskAttack.lua;
attacklua.jpg
And this is the ag_debug, I dont know if it's big enought to you see it too but you’ve hit the nail on the head!
agdebug.jpg
In "past states" I see both idle and melee attack; I cant be able to screenshot in the right moment but in the line "Signal:[2] none" when my char attacks compares for a nanosecond a green message: "melee attack".

So, and correct me if I'm wrong, the weapons calls the animation correctly, the animation begins but doesnt finish.....what do you think...can be an animation problem?it works correctly in Char editor and Anim graph....

Thank you another time!
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 24.10.2012, 12:52

Delete line 27 and uncheck "Can be Hurried" in your animation graph.
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 24.10.2012, 19:44

Hi feith thank you!I ll try istantly when arrive at home and I ll let you know!!:-)
Last edited by pamy88 on 24.10.2012, 23:58, edited 1 time in total.
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 24.10.2012, 23:36

Hi feith I did what you said, delete line 27 then uncheck "can be hurried" and it seems to play a little bit more of animation, so I ve tried with other options, check\uncheck "dont interrupt animation earlier" and the other below, growing up scale animation and finally I did reach the complete animation(maybe anim was too long for a attack)..so..I think this problem is solved!!Thank you so much! :))
I know that I m asking too much, but I know too that I'll have regrets if I let this opportunity escape :baby: , so the question is:

-There is a chance to modify something to make my char attacks other entities(different faction) and not only the player when I switch in game?

Thank you!
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 25.10.2012, 00:55

Great to hear! :)

Play around with the factions. If you set other characters to the Player or Assassin faction they'll fight.
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 25.10.2012, 02:44

Hi!!thank you but unfortunately I did that attempt yet...I ve tried with a grunt and a custom but regardless combination of faction(player\assassins, assassins\player, grunt\player etc) the result is the same: when I press AI\Physics button the grunt attacks the custom but the custom doesnt. The unbelievable thing is that the custom ignores grunt's attack and runs toward of me(but I m not in game, I didnt switch) ?(
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 25.10.2012, 12:33

You're using the same behavior selection tree for both right?
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 25.10.2012, 14:31

No, the grunt has cover2st, my custom char(custom model and custom AI) has the custom behavior, but the problem doesnt seem to be in grunt..the problem is the custom char that wont attack the grunt!tank you
User avatar faith113
Regular Dev
Regular Dev
 
Posts: 513
Member since: 22.04.2012, 15:00
Likes: 52

Re: melee\ranged attack on custom AI

Postby faith113 » 25.10.2012, 20:38

Hmm, I would think if your character was an assasin and the grunt was something else it would attack...might be something with the AI scripts, hard to say.

In your goalpipes file try changing all instances of "player" to "atttarget".
User avatar pamy88
Intern Dev
Intern Dev
 
Posts: 148
Member since: 18.07.2012, 00:10
Likes: 0

Re: melee\ranged attack on custom AI

Postby pamy88 » 25.10.2012, 21:37

Hi feith thank you!btw my goalpipe is:
<GoalPipes>   
   <GoalPipe name="skeleton_hydralisk_idle">
      <Locate name="player"/>
   </GoalPipe>
   <GoalPipe name="skeleton_hydralisk_seek">
      <Locate name="player" blocking="false"/>
      <Script code="entity.Behavior:AnalyzeSituation(entity);"/>
   </GoalPipe>
   <GoalPipe name="skeleton_hydralisk_approach">
      <Locate name="player" blocking="false"/>
      <AcqTarget name="player" blocking="false"/>
      <Speed id="Run" blocking="true"/>
      <Stick blocking="true" distance="2.3" AlignBeforeMove="true" UseLastOp="true" LookAtLastOp="true"/>
      <Script code="entity.Behavior:AnalyzeSituation(entity);"/>
   </GoalPipe>
   <GoalPipe name="skeleton_hydralisk_attack">
      <Locate name="player" blocking="false"/>
      <AcqTarget name="player" blocking="false"/>
      <FireCmd mode="MeleeForced" useLastOp="true" timeout="1.5" blocking="true"/>
      <FireCmd mode="Off" blocking="false"/>
      <Approach time="0.25" UseLastOp="true" LookAtLastOp="true" blocking="true"/>
    <Script code="entity.Behavior:AnalyzeSituation(entity);"/>
   </GoalPipe>
</GoalPipes>

I m sure you re right as usually; I ll try to change all "player" with what you said and I ll let you know!thank you so much!!