Ammunition System & Add-on (Crafting System)

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

  1. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Is there any reason why the the order of an equip slot assignment (via Yanfly Equip Core) would impact loading ammo via skill?

    Its being loaded into slot 8.

    15_1117_ammoIssue_2c.PNG

    (This works)

    15_1117_ammoIssue_2a.PNG

    (This breaks)

    15_1117_ammoIssue_2b.PNG

    In either case, equipping the ammo before battle works fine initially. But changing the ammo, for the broken version, won't work in battle.
     
    Last edited by a moderator: Nov 18, 2015
  2. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    EDIT to answer the question concerning Equip Core :


    Yes, you need to give the actual equip slot for the reload skill to work.


    This is because I was lazy, and it is a pain in the a$s, so when I feel motivated I will certainly try to change that...


    --------------------


    I just tried a bit using ItemUpgradeSlots along with Ammunition (& Crafting).


    It happens that it works fine for me, so I this is probably not the reason why some people cannot have independent items while using Ammunition...


    However, I found that the way equip ammo is consumed is not adapted at all!


    Right now, the inventory equipments are consumed first, and the equipped one is only unequipped and discarded when it is alone and there is no ammo.


    Which means, you just have to equip an +3 super upgraded version of your ammo, and you will get all your super bonuses forever until you totally run out of ammo, even if it is your only upgraded ammo!


    That's very practical for the player, but not logical very much... I think I'll have to change the way it works.

    The current way of working concerning interaction between weapon and its needed ammo is that:


    - you cannot equip ammo when the weapon that requires it is not equipped.


    (or else, you could benefit from ammo's bonuses without the weapon to fire them... whut???)


    - when you unequip the weapon, ammo is unequipped as well.


    - if no ammo, weapon cannot fire! But stay equip. Which is a bit annoying, actually.


    What I understand from your suggestion is that also, weapon could not be equipped when ammo is unavailable (and would be automatically unequipped when it runs out of ammo).


    The 'automatically unequip weapon' would not be too hard, but the part where we want to keep the player from equipping the weapon at all when no ammo is available is a bit more tricky: that would mean verifying if there is any kind of appropriate ammo available, if there is, authorize the equipping of weapon, and when its equipped, select automatically one the appropriate ammo kinds and automatically equip it as well, because we don't want a weapon without its ammo equipped...


    But that would mean that during battle, when player runs out of current ammo type, his weapon would be unequipped even if he has wagons of ammo of other kinds... Then a solution would be to make reload skills able to automatically equip the appropriate weapon. But, if there are several weapon using the same ammo???


    Yep, this is tricky.


    I will think about it, though.
     
    Last edited by a moderator: Nov 18, 2015
  3. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    I'm not sure I understand. The equip is defined. Its just moved to the front of the list of slots rather than the end.

    Moving the slot to the front breaks the load ammo mechanic. Leaving it near the end, works normally.

    I think I might have messed up my explanation of what I was thinking....

    The idea is that the way ammo works essentially doesn't change. You still define the ammo and the weapons/skills as is done now.

    What changes is how the ammunition is 'counted' at the time of its use.

    Currently, you have 10 bullets, and an action deletes 1 bullet. You have 9 bullets left over. Once you have zero bullets left, the action is unusable.

    With charges, you have 1 magazine of bullets with 10 charges, and an action uses 1 charge. After, you still have that 1 magazine but it has 9/10 charges remaining.

    When that magazine has 0/10 charges remaining, it is unequipped or destroyed (defined by note tag?). Just as though the 10 bullets had all been used up.

    Now that the actor no loner has any ammo, they need to load a new magazine of ammo. if they are in battle, loading acts like it does now. The load ammo skill that does this would still be ammo specific. So using a different skill would load a different magazine of bullets. Etc...

    This can be extrapolated to replicate charges on wands or arrows in quivers, Etc... All that's necessary is some way to remove charges from the ammo until the ammo has no charges left and is unequipped, rather than each individual ammo being deleted, until all ammo is gone. You don't even need break the current individual ammo mechanic. Just allow the ammo object to be labeled with a charges count note tag... Which will flag it to be unequipped when zero (after an action).

    I hope that's clearer. ;)

    edit:

    With this charge mechanic, it would be easier to support individual items as ammo.

    You might even extend it to your crafting addition, for reloading items with zero charges. ;)
     
    Last edited by a moderator: Nov 18, 2015
  4. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    I mean that the second number you give in the reload tag is the number of the equip slot where the ammo will be equipped.


    Example :


    - your ammo id is, say, 6.


    - your ammo equip type is, say, 5.


    - your actor has the following equipment setup : 1,2,3,4,5


    Then the reload skill must have its tag setup like this:


    <Ammo 6 Load: 5>


    But later, you replace the actor's equipment setup with : 1,5,2,3,4


    Then you must change the reload skill tag as follows:


    <Ammo 6 Load: 2>


    ...because the equip type corresponding to the ammo has been put to 2nd position.


    --------------------------


    Also, now I understand better your concept of charge.


    Basically, that would mean a single equip-ammo would have a number of 'uses', and when its uses are all consumed, it would get unequipped and a reload action would be required...


    That would be good. I like the idea.


    However, it would require independent items to work, and some people seem to have troubles having them working with Ammunition. I'll probably wait to be sure everything works as it is before i


    mplementing that.
     
  5. Sol Rising

    Sol Rising Veteran Veteran

    Messages:
    162
    Likes Received:
    21
    First Language:
    English
    I just updated the patch and the bug to cause the game to crash with a unequip weapon is no longer occuring.

    However, for some reason I'm still unable to craft items unless the materials are <Not Independent item> as the game won't read that I have the materials in my inventory. The produced item can still be produced while being independent however the crafting menu will not read that I have any in stock already (before & after the item has been crafted).

    I'm not sure where you would like me to upload my project for you to take a look and see.
     
    Last edited by a moderator: Nov 18, 2015
  6. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Thanks for clarifying the slot issue. I suppose I was lucky that I got it right the first time I set it up. Hah!

    No wonder I was confused.

    ...

    As for the charges... It can be implemented without individual charges by setting an array for the item type and reset it when the item expires. The zero charge item could simply be a new item.

    A bullet magazine with current charges could be ID:10, and the bullet magazine that's empty (no charges) could be ID:11... When ID:10 reaches zero charges, its un-equipped and one is destroyed while the array is reset to full charges... ID:11 is then placed in party inventory. Of course, the item could simply be note tag'd to leave an empty item or not.

    Food for thought!

    FYI, I wrote a very elaborate action restriction script in VXAce that I really wish I could recreate in Javascript... Coding doesn't come easily for me and it was a struggle to get proficient with Ruby. Javascript is still difficult for me to follow. But eventually I hope to get to a point where I can write my own features again.
     
    Last edited by a moderator: Nov 18, 2015
  7. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    @Sol Rising :

    Just upload it to any place where you use to upload things if you already have one... Like, mediafire, dropbox... Any of them will be fine.
    If you don't have an account in one of these sites yet, then it is time to create one !  :D

    EDIT:

    Made some updates, look at the main topic.
     
    Last edited by a moderator: Nov 20, 2015
  8. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    I seem to be having issues with the Equip ammo actually being removed from my inventory/equipment slot... My skill uses:

    <Ammo 9 Equip: 1>

    <Ammo 10 Equip: 1>

    (Which the ammo is equipped in the shield slot which I have renamed "Support" is detected by your plugin, but after the attack, no ammo is consumed.)

    Really Bizarre..
     
  9. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    I just corrected a bug with the latest (yesterday) version occurring when ammo was not independent, leading to ammo being unequipped at each use.

    Was that your problem?
     
  10. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    My Not-Independant armorID ammos are equipped, and being detected by your ammo plugin, and only let me fire my weapon with the proper ammo equipped, however when i use the attack that uses that ammo, it does not consume it.. Started the battle with wooden arrows (obtained 10 for testing with) my attack skill costs 1 arrow. i kill the entire enemie party with arrows, and when i check my inventory i still have 10.
     
  11. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    When you define the skill cost, have you exactly one space between the ':' and the number in <Ammo x Equip: number> ?

    If you have two spaces or more, that could be a reason why it does not work.
     
    Last edited by a moderator: Nov 22, 2015
  12. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    exactly one space yes. The skills are not usable without the declared ammo types. I would assume it's finding the ammo types properly, but just not subtracting.
     
  13. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    Does it display correctly the item/equip amount?

    Also, could you list me what other plug-ins you are using?

    EDIT

    Also again: are you especially using any battle plug-in that changes the way turn and actions are handled (like Yanfly's ATB, etc)?
     
    Last edited by a moderator: Nov 22, 2015
  14. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    I am, yes. Yanfly's ATB as well as most of his plugins, in the order he recommends. I have this plugin above Yan's Skill cooldown, but below Bobstah's command list plugin, like your instructions said to do. I have no independant items whatsoever (which i am aware you fixed regardless)

    Edit: We don't actually need an "Ammunition" labelled slot do we?
     
    Last edited by a moderator: Nov 22, 2015
  15. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    You normally don't need a specific name for your ammunition slot!

    By the way, I did not experienced the bug when trying Yanfly's ATB, so I must ask for a more complete list of your plug-ins - a screenshot of your plug-in window would be great !
     
  16. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    I disabled every mod except yours now, and I'm still running into issues.

    Your mod detects my gear, but as soon as I use the skill, it no longer detects I have any..

    Edit: It is unequipping the equipped equipment instead of deleting an unequipped copy? How are we supposed to make ammo types that don't have to be reloaded after every shot?
     
    Last edited by a moderator: Nov 22, 2015
  17. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    From your edit, it seems likely that you are using the (bugged) version I mistakenly uploaded yesterday (0.4.2).

    Try replacing with the corrected version I re-uploaded earlier today (0.4.3) and at least the trouble about ammo being unequipped should disappear. Don't know about how it did not apply cost when you posted before, though. It might correct it too, or not.
     
    Last edited by a moderator: Nov 22, 2015
  18. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    I downloaded it after i saw your

    "

    EDIT:

    Made some updates, look at the main topic."

    edit. Was that also bugged?

    Edit: Oh I see. that could be related to it yes. I will try it now.

    Edit 2: Alright, that fixes most of the problem. The other problem is apparently another compatibility issue with Yan's ATB. Apparently the ammo count(Using Bobstah's Command List which works properly with ATB off) on the main command window doesn't update after firing properly. It only seems to update for me when I specifically defend...
     
    Last edited by a moderator: Nov 22, 2015
  19. Unconnected42

    Unconnected42 Veteran Veteran

    Messages:
    108
    Likes Received:
    36
    First Language:
    French
    What is it that you call 'ammo count on the main command window' ?

    Is it the ammo count just next to the name of attack command - like 'Attack [X]' - or the ammo window at the top?

    I cannot seem to be able to reproduce the bug.  :|

    For me, when I fire, any ammo amount info disappear (logical), and when it comes back (next action selection for actor who needs ammo) the amounts displayed are fine...
     
  20. DarkSlayerEX

    DarkSlayerEX Veteran Veteran

    Messages:
    95
    Likes Received:
    9
    First Language:
    English
    really? that's strange...

    But yes, that is what I mean, the [X]..

    It does not seem to like updating until I use Guard with that proper unit using Yan's..

    It's possible I'm only having problems because of all three running at once.. I have bob's replacing Attack with a skill called "Shoot" which is what uses the ammo. without the ATB, it updates properly.. but it's as if it can't tell what to do with both yours and yan's running..
     

Share This Page