User Tag List

Results 1 to 6 of 6

Thread: Melee wepons

  1. #1
    No Products Registered

    Join Date
    Jul 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Melee wepons

    I am just about as much of a noob to games factory 2 as you can get and I cant figure out how to do melee attacks what so ever. I want to use a charactor from the library and it already has an attack animation but I don't know how to play the animation when I hit a key. I think I can figure out how to make it kill/damage an enemy but I dont know how to just make the charactor use the wepon at all.

  2. #2
    No Products Registered

    Join Date
    Nov 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RabidRabitt View Post
    I am just about as much of a noob to games factory 2 as you can get and I cant figure out how to do melee attacks what so ever. I want to use a charactor from the library and it already has an attack animation but I don't know how to play the animation when I hit a key. I think I can figure out how to make it kill/damage an enemy but I dont know how to just make the charactor use the wepon at all.
    Hello,

    If you are using a character from the library, I think the best way to this is to create an invisible object (as a hitbox), and when you attack, it checks if the enemy is in the hitbox (in range) and then destroys him. This is the most popular method in most 2D game engines, as far as I'm aware. For future reference, if you were to create your own character, you could just make the weapon and active object, but this is still a viable method.

    So what we want to do is make an invisible rectangular box, make it follow the player everywhere, and make it so when the player presses the attack key (I'll make it Enter for now, of course you can change this later) then it checks to see if an enemy is in the box, and if one is, destroy it.

    First, make an active object, color it in, and make it the size of the range of the characters melee attack. Name it "Detector." Double click on it and make sure the hotspots (the eye tool and the one right next to it that looks like a star) are in the center. Do this with your character too. Then put these events:

    +Always
    +Player is facing a direction [RIGHT]
    -Detector: Select position...

    Then a box will appear on the play area. Make sure you check "relative to"
    Then click on your character, and tweak the X and Y coordinates at the top to position it in front of the player (where he will attack).

    +Always
    +Player is facing a direction [LEFT]
    -Detector: Select position...

    Do the same thing as before, except this time make it face the other way, so when the player is walking left, it sticks out to the left side of him.

    If your player is facing you when he stops moving, add this:
    +Always
    +Player is stopped
    -Detector: Select position...

    Same thing one last time, but now position it right in the middle of the character.

    Now just two easy events:
    +Upon pressing Enter
    -Change animation sequence to Attacking.

    If your player has an attacking animation built in, this will make it play whenever the player presses enter. If not, you'll have to make one, or use a different character.

    Now, put an enemy in the playfield.

    +Detector is overlapping Enemy
    +Player animation Attacking is playing
    -Enemy: Destroy

    This will kill the enemy when he is attacked.

    Test it out! The detector should follow the player wherever he walks, and then the enemy is inside the detector while the player is attacking, he will die.

    Final step:
    Click on the Detector in the play area, and in the properties tab, uncheck "visible at start".

    Here's an example:
    http://www.mediafire.com/?2znw88qflixnayp

    In the example is everything I just explained.

  3. #3
    No Products Registered

    Join Date
    Jul 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sp. Thx for the help but this is not what I was asking exactly. All I would like to know is how to play the animation that the charactor im using has for attacking with a melee wepon. For example if you have a player/charector launch an object and there is a launching animation for the charactor than it will play that animation but I dont know how to play an animation like that for a melee attack.

  4. #4
    No Products Registered

    Join Date
    Nov 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand correctly, then the event I wrote:

    +Upon pressing Enter
    -Change animation sequence to Attacking.

    Should work. If you want it to actually kill things/do damage, though, then you will have to use the method I wrote before.

  5. #5
    No Products Registered

    Join Date
    Jul 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx sp. It worked.

  6. #6
    No Products Registered

    Join Date
    Nov 2012
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem, glad I could help!

Similar Threads

  1. Melee Attacks
    By Carbon_KO in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 12th February 2013, 08:13 PM
  2. Help with making melee weapons
    By Gamemaker10 in forum The Games Factory 2 - Technical Support
    Replies: 14
    Last Post: 16th January 2011, 05:36 PM
  3. Enemy AI and Wepons
    By Beginier in forum File Archive
    Replies: 21
    Last Post: 15th June 2009, 06:13 PM
  4. melee combat
    By jonboy7039 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th July 2008, 10:15 PM
  5. Melee attack question
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th June 2008, 12:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •