Menu Is Closing *SOLVED*

Started by Seltzer Cole, December 02, 2013, 03:13:38 pm

Previous topic - Next topic

Seltzer Cole

So I made a common events that can be called upon for your 2 hotkeys. The problem is setting the hotkeys. When I open my inventory and use an item, it of course closes and then calls the common event, works for me. The issue is letting the game know which item you just clicked so that the common event can set its variable to a specific digit which would indicate the item. I don't want to have 30 different common events for each and every item. Just use 1.

I tried giving the items different "states" so when you use the item it inflicts you, and then I can just check which infliction you have and that would tell me the item you selected...then it could assign you the hotkey of your preference.

The problem is that the only way to inflict someone is to use the item and then select your character. Is there a way to bypass selecting yourself? Like when you use an item for healing lets say, it makes you choose a "Scope" and I tried making BS State Changes so that I could check that to see the item you used. I want for when you use an item it auto state changes you to whatever I have it set to without even giving you the option of choosing a character to use the item on. Sounds like a simple fix but I have no scripting knowledge =\
You know you play video games to much when you put sunglasses on and whisper "Plus 10 Appearance"

If at first you don't succeed, call it version 1.0

KK20

Honestly, at this point, you really are better off just requesting a custom item scene. This is getting obscenely messy and confusing. I had to read your last post more than twice to understand it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Seltzer Cole

December 09, 2013, 07:32:49 pm #22 Last Edit: December 09, 2013, 07:46:18 pm by Seltzer Cole
Quote from: KK20 on December 09, 2013, 04:36:18 pm
Honestly, at this point, you really are better off just requesting a custom item scene. This is getting obscenely messy and confusing. I had to read your last post more than twice to understand it.


I'm sorry. Sometimes I ramble a bit.   :^_^':

Put simply, when you use an item from the inventory (The one the game comes with) and it displays which character you wish to use the item on (Depending on the Scope you chose), is there a way to bypass this and have it automatically use the item on the main character instead of asking you who to use the item on (I have tried every scope and none of them automatically use the item). Doesn't matter what the item is or does (Could be a healing item for all I care).

With leaving Scope blank, I will not be able to assign it a "State Change" therefore not allowing my variable within my common event to know which item I am trying to use since the inventory menu has closed (Unless of course I make a common event for every item in the game).

If a custom item scene is what I need to request, I may just do that. But thank you for all your help!

Looks like the issue may be fixed in here,
Spoiler: ShowHide
# If effect scope is an ally
     if @item.scope >= 3
       # Activate target window
       @item_window.active = false
       @target_window.x = (@item_window.index + 1) % 2 * 304
       @target_window.visible = true
       @target_window.active = true
       # Set cursor position to effect scope (single / all)
       if @item.scope == 4 || @item.scope == 6
         @target_window.index = -1
       else
         @target_window.index = 0
       end
     # If effect scope is other than an ally
     else
       # If command event ID is valid
       if @item.common_event_id > 0
         # Command event call reservation
         $game_temp.common_event_id = @item.common_event_id
         # Play item use SE
         $game_system.se_play(@item.menu_se)
         # If consumable
         if @item.consumable
           # Decrease used items by 1
           $game_party.lose_item(@item.id, 1)
           # Draw item window item
           @item_window.draw_item(@item_window.index)
         end

But I don't know if it would be wise for me to go editing this without someones help...lol. I did set @target_window.visible = true to false so the window will not pop up but I still have to hit enter again to use the item.
You know you play video games to much when you put sunglasses on and whisper "Plus 10 Appearance"

If at first you don't succeed, call it version 1.0

G_G

You do know you can store an Actor's HP in a variable right?

Spoiler: ShowHide

KK20

Replace the section with this
Spoiler: ShowHide

      # If effect scope is an ally
      if @item.scope >= 3
        # Activate target window
        @item_window.active = true
        @target_window.x = (@item_window.index + 1) % 2 * 304
     #   @target_window.visible = true
     #   @target_window.active = true
        # Set cursor position to effect scope (single / all)
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
       
       
      # If items are used up
      if $game_party.item_number(@item.id) == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If target is all
      if @target_window.index == -1
        # Apply item effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      # If single target
      if @target_window.index >= 0
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      # If an item was used
      if used
        # Play item use SE
        $game_system.se_play(@item.menu_se)
        # If consumable
        if @item.consumable
          # Decrease used items by 1
          $game_party.lose_item(@item.id, 1)
          # Redraw item window item
          @item_window.draw_item(@item_window.index)
        end
        # Remake target window contents
        @target_window.refresh
        # If all party members are dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If common event ID is valid
        if @item.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @item.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If item wasn't used
      unless used
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
     
     
     
      # If effect scope is other than an ally
      else

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Seltzer Cole

December 10, 2013, 06:48:58 pm #25 Last Edit: December 10, 2013, 06:53:25 pm by Seltzer Cole
Quote from: KK20 on December 10, 2013, 01:02:10 pm
Replace the section with this
Spoiler: ShowHide

     # If effect scope is an ally
     if @item.scope >= 3
       # Activate target window
       @item_window.active = true
       @target_window.x = (@item_window.index + 1) % 2 * 304
    #   @target_window.visible = true
    #   @target_window.active = true
       # Set cursor position to effect scope (single / all)
       if @item.scope == 4 || @item.scope == 6
         @target_window.index = -1
       else
         @target_window.index = 0
       end
       
       
     # If items are used up
     if $game_party.item_number(@item.id) == 0
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # If target is all
     if @target_window.index == -1
       # Apply item effects to entire party
       used = false
       for i in $game_party.actors
         used |= i.item_effect(@item)
       end
     end
     # If single target
     if @target_window.index >= 0
       # Apply item use effects to target actor
       target = $game_party.actors[@target_window.index]
       used = target.item_effect(@item)
     end
     # If an item was used
     if used
       # Play item use SE
       $game_system.se_play(@item.menu_se)
       # If consumable
       if @item.consumable
         # Decrease used items by 1
         $game_party.lose_item(@item.id, 1)
         # Redraw item window item
         @item_window.draw_item(@item_window.index)
       end
       # Remake target window contents
       @target_window.refresh
       # If all party members are dead
       if $game_party.all_dead?
         # Switch to game over screen
         $scene = Scene_Gameover.new
         return
       end
       # If common event ID is valid
       if @item.common_event_id > 0
         # Common event call reservation
         $game_temp.common_event_id = @item.common_event_id
         # Switch to map screen
         $scene = Scene_Map.new
         return
       end
     end
     # If item wasn't used
     unless used
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
     end
     return
     
     
     
     # If effect scope is other than an ally
     else



Works flawlessly! I was all  :wacko: but now I am  :-*

;) lmao THANK YOU!

Quote from: gameus on December 09, 2013, 07:55:11 pm
You do know you can store an Actor's HP in a variable right?

Spoiler: ShowHide



Yeah I know that, but the issue was when you used an item it always wanted a "Scope" which would pop a window up in game, asking who to use the item on. I just wanted it to automatically use any selected item on you instead of asking who to use it on (You have no teammates in my game). But KK20 fixed the issue for me.
You know you play video games to much when you put sunglasses on and whisper "Plus 10 Appearance"

If at first you don't succeed, call it version 1.0

KK20

Funny thing too is that the fix was just copy-pasting the right stuff from update_target. Could be cleaner, but, you know, inherent laziness.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!