[Behavior] jj_Weapon

  • Not working brings error

  • Cool. I'll have to try this out.

  • Im making a 2d shooter like Metal Slug, i can set up the plugin rigth, everything works fine when im facing right, but when i face left im having trouble setting the bullet angle.

    Normaly if i werent using the plugin i would set the angle when the bullet is created depending on if the player is mirrored or not, but how do you handle this with the jjWeapon plugin? I tried the same method but all my bullets get mirrored =S

  • What are the codes for the controls?

  • A small request: make it possible to change to x y offset for bullets so there'd be no need to set weapon's origin point or create a special box for jj_weapon.

    EDIT: Whoopsy daisy,forgot to look at properties, looked into events instead! Btw is it possible to change image point for bullets via events?

    EDIT2: Having problem with single shots. If I set up single shots, gun still auto fires.Had to make a workaround like

    on mouse click - make a shoot.

  • Plz Help !!!

    How Can I Add Bullets To The Stock From The Event Sheet ????

    I Can't Seem To Find It

    OK,I Can Add Bullets To The Clip But Not The Stock

    Any Idea ?????

  • Hello, I found you have a missing feature in your behavior. It doesn't trigger 'On Created' event.

    I guess it is for performance, but you should enable it as an optional feature for guns with certain special bullets.

    Here is a snippet to trigger the event:

    var inst = this.runtime.spawnInstance(this.bullet_instance, this.inst.layer.index, image_point, this.inst.angle);
    this.runtime.trigger(Object.getPrototypeOf(inst.type.plugin).cnds.OnCreated, inst);
    [/code:3tupnp22]
    
    Just replace the line 231 with the above two lines.
    
    Making this feature optional is simple, thought.
    
    Thanks for this amazing behavior
  • JeyDotC

    Hi, i noticed that developer doesn't want to support this behaviour, could you add new features like changing 'User control' by events?

  • I think you are right. I'll create a Github repository for my custom behaviors. A weapon plugin based on jj_Weapon will be my first one.

    JeyDotC

    Hi, i noticed that developer doesn't want to support this behaviour, could you add new features like changing 'User control' by events?

  • Hi aznmonkeyboy zchggf and sachos345

    I solved some of your issues in this modified version of jj_weapon. Here are the new things:

    • Support for multiple instances of the same weapon. In the original version it didn’t pick the right instance when shooting, so all bullets came from the same weapon
    • It triggers the On Created event after spawning bullets.
    • Added support to modify the stock size from event sheets.

    https://github.com/JeyDotC/JeyDotc-C2-E ... /releases/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Is there a tutorial on how to use this? Like an inventory System Or Something like

    (Top Down)

    I have 3 Weapons in game.

    The player starts out with one weapon. and then when the player collects the second weapon, the player can scroll between the 2 weapons. then the player picks up the third weapon and now the player can scroll between all 3.

    Anyway to do something like that with this plugin?

  • Hi datiel12, I also tried to do that some time ago, after some experimentation, I figured out how to do that with some arrays and a single weapon object type with several animations.

    You can find a full example of that buying my game template <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> (https://www.scirra.com/store/royalty-fr ... plate-2942).

    But I'll give you some tips here:

    • Have just one weapon object type. With its jj_Weapon behavior.
    • Make it have an animation for each weapon kind.
    • Have a bi-dimensional array with the statistics of all weapons. Where first axis is the weapon index and second axis are weapons values. Like this: |0:Animation|1:Shoot interval|2:Clip size|3:Stock size|4:Clip|5:Stock|6:Reload time 0 | Pistol | 300| 12| 128| 0| 0| 1800 1 | Magnum | 400| 6| 30| 0| 0| 4000 .... [/code:1mc0rdsy]
    • Have a second uni-dimensional array with the weapons the player has. It shall contain just the weapon indexes. It will be empty at the beginning.
    • Give the player a CurrentWeapon instance variable.
    • Have a function for each weapon type which sole purpose is to set the Bullet instance for the weapon.

    Those are the ingredients, I'll be giving the recipe in a next post (I have to go to my job now).

    Hope this help you point to the right direction <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Is there a tutorial on how to use this? Like an inventory System Or Something like

    (Top Down)

    I have 3 Weapons in game.

    The player starts out with one weapon. and then when the player collects the second weapon, the player can scroll between the 2 weapons. then the player picks up the third weapon and now the player can scroll between all 3.

    Anyway to do something like that with this plugin?

  • Hi datiel12, I also tried to do that some time ago, after some experimentation, I figured out how to do that with some arrays and a single weapon object type with several animations.

    You can find a full example of that buying my game template <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> (https://www.scirra.com/store/royalty-fr ... plate-2942).

    But I'll give you some tips here:

    • Have just one weapon object type. With its jj_Weapon behavior.
    • Make it have an animation for each weapon kind.
    • Have a bi-dimensional array with the statistics of all weapons. Where first axis is the weapon index and second axis are weapons values. Like this: |0:Animation|1:Shoot interval|2:Clip size|3:Stock size|4:Clip|5:Stock|6:Reload time 0 | Pistol | 300| 12| 128| 0| 0| 1800 1 | Magnum | 400| 6| 30| 0| 0| 4000 .... [/code:21kfaysc]
    • Have a second uni-dimensional array with the weapons the player has. It shall contain just the weapon indexes. It will be empty at the beginning.
    • Give the player a CurrentWeapon instance variable.
    • Have a function for each weapon type which sole purpose is to set the Bullet instance for the weapon.

    Those are the ingredients, I'll be giving the recipe in a next post (I have to go to my job now).

    Hope this help you point to the right direction <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    > Is there a tutorial on how to use this? Like an inventory System Or Something like

    >

    > (Top Down)

    >

    > I have 3 Weapons in game.

    >

    > The player starts out with one weapon. and then when the player collects the second weapon, the player can scroll between the 2 weapons. then the player picks up the third weapon and now the player can scroll between all 3.

    >

    > Anyway to do something like that with this plugin?

    >

    Hey, Thanks man! just wating for that second recipe of yours <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • JeyDotC can you reupload the this modded behavior please ?

  • JeyDotC can you reupload the this modded behavior please ?

    Sure, here it is: https://github.com/JeyDotC/JeyDotc-C2-E ... /releases/

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)