User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Enemy

  1. #1


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enemy

    In a rpg game, I want the enemy to hit me if I get too close and subtract 1 from lives, When I am close to the enemy it hits me once then I have to walk away then back to get hit again. How can I make him attack every 2 seconds?

    And how can I make it have a certain value of HP like 5 and my character hits 1-3 damage on a hit?

    How can I do that damage?

  2. #2
    No Products Registered

    Join Date
    Mar 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    I have no fancy ways, but I can try help :P

    If you have an animation when the enemy are too far away to attack, and one when he attacks, you could make an event like:

    Every 2 second
    + Player is in range (your event for when the player is in range)

    = Change animation sequence of Enemy to "Attack"

    Also add another event that says when your Enemy is playing Attack animation, and he is on the last frame, set it back to not attack so that in 2 seconds after his attack, he will attack again.


    About your damaging event, I would use the Alterable Values. On your enemy, make a new alterable value and call it HP. Then set this value to 5, or whatever HP of enemy you desire. Make a new event that says
    "HP" of Enemy is Lower or Equal 0
    = Destroy Enemy

    And then you need an attack event. Maybe you could make a Counter object that will fix your value. Try something like:
    Player pressing Fire 1
    + Player is Overlapping Enemy

    = Set Counter to random(2)+1
    = Substract Counter Value from "HP" of Enemy


    This will result in a very basic and new beginner way You should also add some direction events aswell so that your player actually faces your enemy when he attacks etc.

  3. #3


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    Quote Originally Posted by FlinkGigitty
    Every 2 second
    + Player is in range (your event for when the player is in range)

    = Change animation sequence of Enemy to "Attack"
    Where do I find "Player is in range"?


    And how can I set counter to random?

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    By "Player is in range" he means you have to use your own system for detecting if they player is in range. There is no condition for this.


    To set a counter to a random value you need to use the Random() expression. It will generate a random number between 0 and 1 less than the number you give it, eg Random(5) generates a number between 0 and 4. You can get it from the Special Obejct in the expression editor.
    Working as fast as I can on Fusion 3

  5. #5


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    How do I do = Substract Counter Value from "HP" of Enemy?

    Thanks for the help

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    That was a typo, he meant "subtract" and not "substract"
    Working as fast as I can on Fusion 3

  7. #7


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    Well, can't find it..

  8. #8


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    Found it.
    Now there's another problem.
    I can hold space which I use for attack and I hit all the time, so if I hold it for half a second it dies because It always subtract from that counter. How can I make the character only able to hit every 2 seconds?

  9. #9
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    Under the condition "Repeat while space key held" add the condition "Restrict actions for 2 seconds". It can be found under the Special Object -> Limit Conditions -> Restrict Actions
    Working as fast as I can on Fusion 3

  10. #10


    Join Date
    Jul 2010
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Enemy

    I have the HP value set to 10 when I hit it says 1 or 2 since tha's my damage, but he only dies after two hits anyway.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Strange thing: If Enemy Alterable Value A = Enemy Alterable Value B
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 26th March 2012, 05:29 PM
  2. Enemy AI
    By Lucien in forum Multimedia Fusion 2 - Technical Support
    Replies: 44
    Last Post: 17th February 2012, 06:02 AM
  3. Enemy Help Please!
    By Gate001 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th June 2010, 01:54 AM
  4. Enemy HP
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd January 2010, 08:09 PM

Posting Permissions

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