News Forums RAIN Sample Projects, How To, and Code Sample Project: RAIN Attack Harness

This topic contains 16 replies, has 9 voices, and was last updated by  Crimson_Flare 1 year, 3 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #9113

    Jester
    Keymaster

    Hello Community!

    Here is a sample project we get a lot of requests for. “How do I make my AI NOT attack in a straight line?”. To achieve this we use an Attack Harness which limits the amount of AI that can attack you at one time. No two AI can be in the same position at the same time and the AI picks the closest available position to attack even if the player is moving.

    Play around with the distances and the amount of AI positions. If you have any questions, let us know!

    Share this thread for others to download!

    RAIN Attack Harness

    Best,
    Jester

    EDIT: A new version of the Attack Harness has been uploaded. Click on the link above to download it.

    • This topic was modified 2 years, 9 months ago by  Jester.
    #9205

    sundayhd
    Participant

    Thanks!!

    #9207

    kodmistrz
    Participant

    Great work! Thanks Unfortunately I have a little issue. Enemies are trying move outside the NavMesh but they can’t… Example on screen: http://s22.postimg.org/41w9ewlvl/issue.jpg

    Please help me.

    Regards,
    Patrick

    #9208

    kodmistrz
    Participant

    Another one:

    #9242

    deleaiye
    Participant

    Jester I hate to be a bother but I have been trying to convert the scripts in the sample to unityscript and wonder if me replacing “out int attackslot” in the method “OccupyClosestAttackSlot” in class “AttackHarness” with just “attackSlot: int” will break anything.

    #9258

    prime
    Keymaster

    @kodmistrz - we’ll be posting a new version later today with a small change that will correctly release attack slots when off the mesh.

    @deleaiye - I’m not a unityscript expert. Maybe someone else here knows how to use out params in unity script?

    #9275

    CodersExpo
    Participant

    If you define your function in JS/US, it cannot utilize ByRef parameters. However, if your function is defined in C#, you can call it from JS/US with Out parameters that are ByRef.

    #9282

    Jester
    Keymaster

    A new version has been posted, please click on the original link above to download version 2

    #9332

    CodersExpo
    Participant

    Very cool! Nice work on this guys. Works awesome even as you drag pillar (enemy) around it all updates.

    #9378

    Jester
    Keymaster

    Thanks CodersExpo! Let us know any feedback you have.

    Best,
    Jester

    #9393

    deleaiye
    Participant

    I just realised that I can use both C# and unityscript scripts in the behaviour tree. Which means I don’t need to convert the scripts to unityscript.That’s awesome.

    #9397

    redhawk
    Participant

    Lucky. I can’t use Playmaker in the behaviour tree. I still have to do the C# scripting.

    #9678

    kodmistrz
    Participant

    I have a little issue with this sample project. My AIs have problem with collision each other. Sometimes when they enter collision, they start flying in the air…

    Example on the screen:

    Please help me.

    #9783

    Jester
    Keymaster

    kodmistrz,

    Are you using a character controller? If so maybe the step offset is allowing them to walk over each other. Maybe add some colliders specific to AI to AI collisions to keep them from walking on each other. Try that and see if that helps!

    Best,
    Jester

    #9808

    kodmistrz
    Participant

    Hi Jester,
    I’m using capsule collider as in sample project. I have many issuses. I attached video: http://www.youtube.com/watch?v=YAuKrVXWVco You can see it. Thank you for your reply.

    Regards,
    Patrick

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

You must be logged in to reply to this topic.