Ammunition System & Add-on (Crafting System)

Discussion in 'JS Plugin Releases (RMMV)' started by Unconnected42, Oct 30, 2015.

  1. Black Noise

    Black Noise Veteran Veteran

    Messages:
    94
    Likes Received:
    18
    First Language:
    English
    Primarily Uses:
    RMMV
    Being able to dismantle charged ammo items and receive bullets based on how many charges are left? :D
     
  2. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    I am open to suggestions for the plug-in evolution.  :)

    However, it is probable that updates will come a bit slower now, since my hype over MV has started lowering a bit and I am also beginning to remember I also have a game or two left on Ace that I'd like to finish one day.  :guffaw:
     
    Roguedeus likes this.
  3. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    526
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    This may not be what you expected, but it reminds me of those movies where the guns never seem to run out of ammo as fast as they should... Or in my case, the the archers always seem to find arrows to shoot. ;)

    I was going to suggest the ability to assign note tags to trait objects that can grant the ammo user 'free' uses of the item. Perhaps they can have a ratio and/or a chance.

    Example: Every 5 uses 1 will be free and/or 20% chance of a free use.

    I can imagine the option being truly random, or guaranteed minimum. Such that you are guaranteed to get ONE free shot within every 5 shots. When that free shot occurs is random, but if you've gone 4 shots without a free shot, then the 5th shot will be guaranteed free... etc...

    For those that wish to have LUCK factor in, you may even allow for the player to set the chance via a formula. (Which a flag that makes is a true random, or guaranteed minimum)
     
  4. MrPurpleDreadlocks

    MrPurpleDreadlocks Veteran Veteran

    Messages:
    159
    Likes Received:
    19
    First Language:
    English
    Hello Unconnected,

    I ran into a serious bug, updating your script. Whenever I try to use a bow that is tagged with the "Ammo i Equip: c" tag for my arrows it would make my arrow (armor) disappear and not be able to be equip the arrows at all. o_O;

    here are some screenshots.

    Truthseeker (Weapon): http://i.imgur.com/mxX794l.png

    Artemis Arrow(Armor):  http://i.imgur.com/k8o2mrd.png

    Initial Equip: http://i.imgur.com/CsEoE3K.png

    After loadup, checking equips (Not there!): http://i.imgur.com/yZXj0Vl.png

    Checking inventory... (Spoiler: Not there) http://i.imgur.com/TtueECO.png

    After talking to guy to give items...: http://i.imgur.com/oLIM1Fa.png

    Trying to equip Artemis Arrow again (Still not able to appear): http://i.imgur.com/nv34lh6.png

    Also I made sure to give Aquarius the ability to equip ammo, as well as the Truthseeker having that ability innately.

    Is anyone else having this issue?
     
    Last edited by a moderator: Dec 16, 2015
  5. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    526
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Another detail I forgot to mention... The ammo free shot chance would take into consideration the type of ammo being used. It would apply only to the ammo type it notes.

    The note tag, would be for trait objects like states, classes, etc... That way an actor can use an ability that temporarily grants them ammo free shots (no ammo loss) for the next 5 actions or something.
     
  6. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    @MrPurpleDreadlocks :

    That was because your ammo cost was zero. The functions verifying armor/weapon equippability basically asked the cost to be more than zero to allow armor/weapon to be equippable, which was wrong. Try the latest update, that should correct it.

    Thanks for reporting the bug.  :)

    @Roguedeus :

    Suggestion noted.

    To sum it up, the basic idea is to have states/whatever affecting ammo consumption...  I don't know if and when I will implement it, but I will definitely give it some thought.
     
    Last edited by a moderator: Dec 16, 2015
    MrPurpleDreadlocks likes this.
  7. MrPurpleDreadlocks

    MrPurpleDreadlocks Veteran Veteran

    Messages:
    159
    Likes Received:
    19
    First Language:
    English
    Works beautifully. Thank you! :D
     
  8. IL RASTA

    IL RASTA Villager Member

    Messages:
    8
    Likes Received:
    1
    Hello to all

    PLEASE ... I tried and tried ... but i can not understand the know are stupid but I can not understand so please a working demo .... thanks
     
  9. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    I was too lazy until now to make a demo, but I will maybe make one if that can be useful... It might take a bit of time, I hope you are not too much in a hurry!

    EDIT: By the way, what is it that does not work exactly?
     
    Last edited by a moderator: Dec 17, 2015
  10. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    A working demo is now available.

    Link : http://www.4shared.com/zip/l6b7h_Nyba/DemoAmmo.html

    It only contains my own plug-ins, so it does not demonstrate functionalities that depends on, or interact with, other plug-ins from other developers.

    I may release another demo for that in the future.
     
    Roguedeus likes this.
  11. SoulOfRock

    SoulOfRock Veteran Veteran

    Messages:
    38
    Likes Received:
    6
    First Language:
    Spanish
    When i enter in a combat this happend (And yes,is above all the scripts)
     

    TypeError: Cannot read property '_itemId' of undefined

        at Game_Enemy.Game_BattlerBase.canPaySkillAmmoCost (unco_ammunitionsystem.js:691)

        at Game_Enemy.Game_BattlerBase.canPaySkillCost (unco_ammunitionsystem.js:626)

        at Game_Enemy.Game_BattlerBase.canPaySkillCost (YEP_SkillCore.js:702)

        at Game_Enemy.Game_BattlerBase.meetsSkillConditions (rpg_objects.js:2776)

        at Game_Enemy.Game_BattlerBase.meetsSkillConditions (YEP_SkillCore.js:618)

        at Game_Enemy.Game_BattlerBase.meetsSkillConditions (jay_dualtechs.js:316)

        at Game_Enemy.Game_BattlerBase.canUse (rpg_objects.js:2788)

        at Game_Enemy.Game_BattlerBase.canUse (YEP_X_Subclass.js:617)

        at Game_Enemy.isActionValid (rpg_objects.js:4493)

        at Game_Enemy.<anonymous> (rpg_objects.js:4531)
     
    Last edited by a moderator: Dec 28, 2015
  12. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    Strange. Is your actor equipped with a weapon or not ?

    I just noticed that the function is actually used on an enemy and not an actor when that bug happens... Since enemies normally have no weapons, that should definitely not happen. Could you give a list of the plug-ins you are using?
     
    Last edited by a moderator: Dec 28, 2015
  13. SoulOfRock

    SoulOfRock Veteran Veteran

    Messages:
    38
    Likes Received:
    6
    First Language:
    Spanish
  14. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    Normally, Ammunition should be placed below anything else, except for a few (known) plug-ins. See first post for details.


    However, I am not sure at all that the problem you encounter is due to this.


    If moving the plug-in below is not enough, please test the following version instead of the one you currently have :


    http://pastebin.com/4f4meYMW
     
  15. SoulOfRock

    SoulOfRock Veteran Veteran

    Messages:
    38
    Likes Received:
    6
    First Language:
    Spanish
    Thank you so much,i use the version you give me, and now works :D
     
    Last edited by a moderator: Dec 29, 2015
  16. PTS

    PTS Member Title? :D Veteran

    Messages:
    35
    Likes Received:
    3
    First Language:
    ru
    my mistake - inattention. the problem is solved. thanks for the plugin!
     
    Last edited by a moderator: Jan 22, 2016
  17. Prescott

    Prescott argggghhh Veteran

    Messages:
    445
    Likes Received:
    296
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Using this script, I am getting the error


    "cannot read property 'item_id' of undefined"


    I have it at the bottom of the plugin list and when I turn it off this is not an issue.


    It only happens when the enemy is going to use the skill Attack. Doesn't happen when the player is going to use it.


    None of my skills or weapons currently have notetags.


    Here's my log:

    Code:
    TypeError: Cannot read property '_itemId' of undefined
        at Game_Enemy.Game_BattlerBase.paySkillAmmoCost (UNCO_AmmunitionSystem.js:837)
        at Game_Enemy.Game_BattlerBase.paySkillCost (UNCO_AmmunitionSystem.js:831)
        at Game_Enemy.Game_Battler.useItem (rpg_objects.js:3175)
        at Function.BattleManager.startAction (YEP_BattleEngineCore.js:1247)
        at Function.BattleManager.processTurn (rpg_managers.js:2076)
        at Function.BattleManager.processTurn (Ellye's_ATB.js:1830)
        at Function.BattleManager.updateTurn (rpg_managers.js:2064)
        at Function.BattleManager.update (YEP_BattleEngineCore.js:1033)
        at Function.BattleManager.update (Ellye's_ATB.js:1598)
        at Scene_Battle.updateBattleProcess (rpg_scenes.js:2049)rpg_managers.js:1618 SceneManager.catchExceptionTDDP_FluidTimestep.js:89 SceneManager.update
     
  18. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    Please try the latest version, I did a thing that should make that bug stop happening.


    However, I was not able to reproduce it and I don't really understand how it happens in the first place, since normally just before the line where the bug happens there is a condition that the _equips property of the battler must not be 'undefined'.


    I don't know how you get a Game_Enemy to have an _equips property actually not undefined while its elements still are undefined (which causes the bug - when checking the code at that place it tries to read the _itemId property of _equips[0]) ?
     
    Roguedeus likes this.
  19. Prescott

    Prescott argggghhh Veteran

    Messages:
    445
    Likes Received:
    296
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Well, it worked, that's all that matters x)


    Thanks a bunch!!
     
  20. HyperionVIGA

    HyperionVIGA Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Portuguese
    Amazing plugin! Works well with the project i'm working with.

    I'm running into a problem with the charged ammo, though! Maybe you know the answer?

    I'm using, for now, only your plugin and ItemCore. I have 3 kinds of ammo for the pistol in the armor tab, and they are correctly equipped and every time I use one of the three skills that the weapon concedes, the ammo goes down. My problem is that, even though I used the <Ammo Charges: 15> tab, it works as it had only one charge! The ammo also has the <Not an Independent Item> tag, which solved my issue about it not being equippable. 

    In short: The Ammo gives out the kind of damage and the charges, the weapon concedes stats and available skills, and the skills themselves cost ammo (using the <Ammo 1 Equip: 1>, for costing the ID 1 equipment a single charge). Have any of you guys run into this trouble? 
     
     

Share This Page