User Tag List

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

Thread: Switching Weapons Hit Snag

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Switching Weapons Hit Snag

    Hey all,

    I hit a snag. I am making a top down 360 degree shooter. I want to use the brackets to switch the weapon, and in turn it switches the players bullet to match. I have it partially working but it seems to be a slight bit broken at the same time. There are 11 weapons so there are at least 11 different animations all synced. Yet something just is off and it is only partially functioning. If anyone could take the time to talk to me in real time and help me understand how to fix this, I would very much appreciate it.

    Here is my mfa. https://www.dropbox.com/s/31389cxo33...toids.mfa?dl=0

    Basically the problem is, I want to use the brackets [ ] to switch the weapon and bullet emitted, but the brackets seem to jump randomly and not correspond to the counter.

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    There are a few things wrong here, but the main problem is that you're trying to use counters to display the current weapon, which is why it isn't matching up to the selection.

    I used a single active object to both display and determine the current/max amount of guns. I changed the gun count from 1-based (i.e first gun is 1, last is 11) to 0-based (first gun is 0, last gun is 10). This is so it matches up with the animation editor, which even though it says it's 1-based, is actually 0-based when referred to

    1) you can change the weapon count from the WEAPON SELECT object's alterable values tab now
    2) edit the numbered animations of the WEAPON SELECT object to add new guns
    3) since you have "original" animations for your bullets, I condensed the bullet switching to a single event instead of 11. I used the expression 12 + current weapon, this is because the first "original" animation is number 12, so adding our 0-based current weapon value will select the correct bullet animation
    4) you didn't have "loop" checked on most of your bullet animations, causing them to look funky
    5) your bullets weren't rotated to the angle of the gun
    6) I didn't add this, but you should destroy your bullets when they are a certain distance away from the player or out of frame, to avoid slowing your game down.

    https://www.dropbox.com/s/16id4n9c07...ids_2.mfa?dl=0

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much. This is closer to what I intended. This is alot of good work I really appreciate it. It still doesent match up fully though, how do I change the bullet animation for a selected weapon now?

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    During gameplay or in the editor? In the editor you just edit your bullet object (player fire) animations like you did before.

    If you meant how to add new bullet animations or guns, the single event at initialize bullets will take care of any newly added gun/bullet types automatically. The process would go like this:

    1) increase max weapons count in WEAPON SELECT
    2) add animation frame to WEAPON SELECT
    3) add new animation sequence for PLAYER FIRE

    and the new weapon will be selectable

  5. #5
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you that does work. Thank you again for all your hard work! I appreciate it. There is one other thing. In my other game I was able to sync counters to a specfic weapon. Thus when you pick up certain ammo the counter goes up, when you fire it goes down. However I do not know how to prevent the player from firing when the counter hits 0. I know I can set the counter to not read less then 0, but how do I inhibit the firing action until they switch weapons and or find more ammo for the currently selected weapon?

  6. #6
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Alright. I really appreciate your help. I think it is really awesome what you did and I will be using this. However, now I am a bit confused on how to setup the ammo types. As when I had the separate shooting events, I could tie each one to their respective counter. Since we have condensed things I am unsure how to set that back. Each weapon drains a certain type of ammo and a certain amount. I do not know how to apply these values in our condensed INITIALIZATION of bullets.

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    646
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    TTP,

    I added 2 new active objects, called Weapon Ammo and Weapon Drain. I didn't name all their values, just a few for the example but you can go through and finish naming the rest however you want. I also edited the shooting event you had at line 12 to support firing only when there is ammo in the current gun, and it also drains proper amount of ammo from the current weapon's ammo supply. I made it so you couldn't fire the weapon if it didn't have enough ammo stored as it drains, but you can change this by making the added condition under the firing event:

    current weapon( "WEAPON SELECT" ) >= AltValN( "weapon ammo drain", current weapon( "WEAPON SELECT" ) )

    to

    current weapon( "WEAPON SELECT" ) > 0

    then it will shoot as long as you have any ammo at all stored, even if your shot drain is more than is left.


    This system works by getting an "alterable value by index" of the two new actives, ammo count and ammo drain. It uses "current weapon" value of WEAPON SELECT to determine the index, since the first alterable value of an active (alterable value A) is index 0. To add another ammo count/drain for another gun, you just add a new alterable value to both of these new active object's values tabs and the shooting event takes care of things automatically. I love to find ways to make things as "quick and automated" as possible when making things for my own games

    https://www.dropbox.com/s/qourehl968...ids_3.mfa?dl=0

    If you need to display the current gun's ammo count on-screen, you can use an "always" event that sets a counter to this:

    AltValN( "weapon ammo", current weapon( "WEAPON SELECT" ) )

  8. #8
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What is the best way to deal with weapon attributes?

    I like how you condensed everything, but now I am unsure how to individually manipulate each bullet for different values.

    As in each weapon has its own damage rating, consumption of ammo & ammo type, effects when shot. For example grenades will bounce before exploding, a rocket would explode on contact, a pistol certainly would not cause an explosion on its own etc.

    PS: also still trying to inhibit fire

  9. #9
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Alright I played with this a little. Again thank you. Do you have STEAM or Discord? Facebook? I have many more questions and it might be easier then to keep uploading it here. I have a design document i was writing to go along with this to.

    I am trying to display the current ammo count with the always & counter combination.

    I am trying to set it so it some weapons share ammunition type. Im not sure if I got it quite right if you dont mind taking another look.

    Ideally,,,,,

    Pistol and Machine Gun use bullets, Pistol consumes 1, Machine Gun consumes 5
    Shotguns use shellls, 2 per shot
    Flame Thrower uses 1 per second
    Grenades use 1 grenade, MIRV uses 5 Grenades
    Rocket Launchers use 1 Rocket
    Blaster Pistol, Rifle, Disruptor all use Cells
    TTP Rocket Launcher uses both cells and rockets


    https://www.dropbox.com/s/31389cxo33...toids.mfa?dl=0

  10. #10
    Clicker Fusion 2.5 (Steam)

    Join Date
    Oct 2017
    Posts
    22
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    new issue sigh lol

    Alright, I now have added a basic HUD to this. One problem I have is some weapons are intended to draw from the same pool. Though the fire inhibitor works, the drain only drains for the weapon fired.

    I tried to fix this by adding the shared values together as in

    PISTOL PICKUP )+25 to PISTOL +25 to MACHINE GUN (because they both use bullets)
    MACHINE GUN PICK UP +75 to pistol +75 to MACHINE GUN

    but now the issue is pistol will drain when its fired but it will not subtract from the MACHINE GUN


    Not sure how to fix this.



    https://www.dropbox.com/s/m3mq6oxvls...ids_5.mfa?dl=0

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to use different weapons?
    By TurtleLord in forum Fusion 2.5
    Replies: 4
    Last Post: 14th May 2015, 10:53 PM
  2. Bad Example of Switching Weapons
    By variant in forum File Archive
    Replies: 0
    Last Post: 26th January 2010, 03:16 AM
  3. Switching Weapons Found On Ground
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th June 2008, 03:55 PM
  4. Cycling through weapons?
    By JoshHarris in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th January 2008, 08:03 PM
  5. How to deal with different weapons
    By Pancra in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2006, 09:49 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
  •