Battle Items command bug (or not bug)

Discussion in 'RGSS3 Script Requests' started by Magic Dance, Nov 21, 2019.

  1. Magic Dance

    Magic Dance Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    R
    Primarily Uses:
    RMVXA
    Hello there.

    Actually I'm not sure if it's a bug, or is it supposed to work like that, but look:

    0) Let's start a clear project.
    1) For example, let's a group of four actors have one instance of this item:
    [​IMG]
    2) During battle I can choose Items command and select desirable item from the list, it's okay.
    First actor in the row is Eric. I commanded him to use Super Buff Scroll:
    [​IMG]
    3) Second actor would be Natalie. I should not open Items list, since it should be empty by now, because Eric already picked that scroll from inventory and prepared to use it in upcoming round...
    But I decided to open Items and take a look at its empty list, and wait what? Super Buff Scroll still there, and Natalie can select it as well:
    [​IMG]
    4) Then I repeated selection of this poor scroll with Terence and Ernest, and what do you think? Obviously only one actor of the group used it, and others just stood still during a turn doing nothing (in other words, they skipped their action):
    [​IMG]
    I also tried it with 3 instances of Super Buff Scroll, and in Items list it showed the same amount (3) for all actors, so even after Eric, Natalie and Terence selected it, it still showed 3 scrolls for Ernest.
    Btw, this "bug" remains in Yanfly's Ace Battle Engine.

    Alright, finally here is my question: is there any way to make item dissapear from Items list for other actors after one actor already selected it for use in upcoming turn? And if there more instances of this item, for example 3, then show 2 for other actors, if one actor already selected it.
    If I'm just dumb and did something wrong, or didn't noticed that it can be fixed in some simple obvious way, feel free to point this out.
     
    Last edited: Nov 21, 2019
    #1
  2. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,303
    Likes Received:
    549
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    The issue here lies within the fact that in the default battle system actors (and enemies) all act together after each action is selected. For this reason, the item is not consumed before it is used and eventually multiple actors can select it; conversely, once the fastest actor uses it the item disappears and the engine will be unable to find it for any other actor that acts after the first one.

    The only way to change how this act is with a script that changes how the battle system works (e.g. allowing actors and enemies to act instantly when selecting their respective action) or changing how items are handled (e.g. calculating if multiple uses of an item are allowed or not). If you are looking for a way to do it within the engine itself (without a script) it should be impossible for the reasons I explained above.

    Similarly, if you have multiple instances of a certain item, you can use it until the amount of instances in your inventory reaches 0. If you use it with 3 actors, but you only have 2 copies of the said item in your inventory, only the first two actors will be able to effectively use it and the last actor will be unable to perform the selected action.
     
    #2
    Magic Dance likes this.
  3. Magic Dance

    Magic Dance Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    R
    Primarily Uses:
    RMVXA
    Heirukichi, thank you for such an accurate explanation.
    Now I see that this issue can be broken into two parts:
    1. Multiple actors are able to select one item as their action.
    2. During a turn only one actor uses that item, and other(s) just skips their action.
    Oh well, I can tolerate first part, but I really don't like the "skip action" part. I think Guard instead of skipping should be fine. Am I right, that via scripting it should be possible to make engine force actor to guard instead of skipping his action whatsoever?

    Anyway, I must bother Moderators to move this topic to RGSS3 Script Requests board. Please.
     
    #3
  4. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,303
    Likes Received:
    549
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    You are right, using a script that much is possible. However, to have your thread moved/closed or to ask for moderators actions in general you can report your own post. While a random thread is something they might miss, they will surely see your report.
     
    #4
    Magic Dance likes this.
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,970
    Likes Received:
    11,631
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    The way it's set up, it's possible for two actors to choose to use an item that you only have one of in inventory. If the first actor gets knocked out before his turn, the item is still there when the second actor's turn comes around, so they can use it. If you were to "allocate" the item when it's selected for the first actor, it couldn't be selected for the second, and if the first actor is knocked out, then neither would be able to use it.
     
    #5
    Magic Dance and Heirukichi like this.
  6. hiddenone

    hiddenone Lurker Extraordinaire Moderator

    Messages:
    2,033
    Likes Received:
    4,743
    First Language:
    english
    Primarily Uses:
    RMMV

    I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #6
    Magic Dance likes this.
  7. Magic Dance

    Magic Dance Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    R
    Primarily Uses:
    RMVXA
    Heirukichi and Shaz, thank you for your replies.
    Moderator, thank you for moving my topic.

    I understand.
    In my main project I want there to be plenty of usable items in small amounts. Also item invocation speed is gonna be set to maximum.
    So I assume, that there can be cases when player by mistake can select one item to use for two actors. Since in battle items will be acted first, one unlucky actor will skip his turn. What I want, is to allow this fellow to at least guard himself.

    I'm using Yanfly's Ace Battle Engine. As Guard command I use default Guard skill with id 2 in the database.
    If someone know how to script "Guard skill/command for slow actor(s) instead of skipping a turn when one item selected by two or more actors", then please go ahead and write it (ofc if it's not too difficult and time-consuming). Or share your thoughts about which section of Yanfly's battle engine script (I guess?) I should try to edit and how, or what should I add into it.
     
    #7

Share This Page