User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 30

Thread: How to switch weapons by pressing a button

  1. #1
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to switch weapons by pressing a button

    im working on a game where i want the characters to switch between a melee weapon and gun by pressing a button or key. is this possible?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    Hm... perhaps use alterable values

    Eg.

    Key pressed -> add one to value

    Value = x -> Change weapon to _______ //where x is an increasing value

    Value > = m -> set value to 0 //where m is the number of weapons you want, so this event cycles it back to the beginning


  3. #3
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    thanks! i'll give that a shot. something else i forgot to add to the question: for the weapon switch i will have separate animations eg. idle walking running etc. would it be easier to possibly make another active object and then somehow link the 2 with a specific key press? thanks again for the tip :grin:

  4. #4
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    i may be on to something here. i've tried creating 2 active objects, one for melee, one for the gun and it seems that if i run this event:

    "Upon pressing "C" - "Create", "Create Object" - "active weapon", then run "destroy" on my previous active, then that works. im getting ready to try to see if i cant do the opposite and possibly switch between the 2

  5. #5
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    Awesome! not EXACTLY what i wanted but it works! lol i just assigned and equip button and unequip button. now to test and see if i can assign specific animations between the 2

  6. #6
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    new can of worms! lol i can make the animation change to run when i press left or right but he doesnt move.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    Hm, did you check to see if the animation running loops and all that? And did you try restoring animation speed when you change the animation?

    Or is the player not moving but the animation is working?

  8. #8
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    well there are a few things going on man. i was able to make the animations change depending on the key press like it usually does but the active object doesnt move. im using a sensor object to link my sprites to and i noticed that there wasnt anything that linked my new sprite to the sensor object. now im trying to figure out how to make that work right. its a little on the bug-ish side that way. you can press the key to equip and have an army of gunmen! lol it just clones the idle stance

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    Uh I don't know what's going on. Maybe somebody else could give it a try?

  10. #10
    No Products Registered

    Join Date
    Oct 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to switch weapons by pressing a button

    Quote Originally Posted by Warmachine
    Awesome! not EXACTLY what i wanted but it works! lol i just assigned and equip button and unequip button. now to test and see if i can assign specific animations between the 2
    -Upon pressing SPACEBAR toggle internal flag 0
    -If internal flag 0 is on > Set weapon to melee
    -If internal flag 0 is off > Set weapon to gun

    This technique will work for a one-button switch between weapons. If you want you can do it this way, it's up to you. Also note that the "internal flag" comes from an active object. Good luck!

    -Variant

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Pressing a button twice
    By Bench in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th April 2010, 04:15 AM
  2. Bad Example of Switching Weapons
    By variant in forum File Archive
    Replies: 0
    Last Post: 26th January 2010, 02:16 AM
  3. Switch Button Widgets
    By Atom in forum Widgets
    Replies: 2
    Last Post: 8th November 2008, 02:58 PM
  4. Holding one button and pressing another
    By aeroshock in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th September 2008, 03:42 AM
  5. Confirmation to quit after pressing close button
    By McPhisto in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th December 2007, 12:46 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
  •