[RMXP]Item that stop giving benefits after a certain amount is used.

Started by jayje, August 31, 2019, 10:45:56 pm

Previous topic - Next topic

jayje

I was talking with KK20, with this, but it seemed like it was a bad time to talk then. No big hurry just wanted to get help with this if possible. Here's what the conversation was at that point:

Spoiler: ShowHide

Al CheddahToday at 12:00 AM
say i have a limit on stat boosting items
and once a certain number is reached, the bonuses don't work
pink b0iToday at 12:01 AM
like the pokemon IV items?
Al CheddahToday at 12:02 AM
that might e the best way to explain it, yes
pink b0iToday at 12:02 AM
yeah you're better off going another route
Al CheddahToday at 12:02 AM
i have a CE that just says "You've reached your limit", but I wanna makes sure it doesn't do anything
i see
what would/should i do?
pink b0iToday at 12:03 AM
do you want the item to call a common event?
Al CheddahToday at 12:04 AM
yes
all the stat boster call the same event
that adds 1 to a variale when there used
pink b0iToday at 12:05 AM
how are you determining what item was used
Al CheddahToday at 12:05 AM
i got an item ID catcher from LittleDrago awhile back
that gets the item ID
pink b0iToday at 12:08 AM
and your item use counter is stored in game variables
Al CheddahToday at 12:08 AM
yes
once it reaches a set number it should stop giving a bonus
pink b0iToday at 12:09 AM
then make the item itself add nothing, and do all the stat manipulation in the event
Al CheddahToday at 12:09 AM
okay. how would I go about that?
using the code from earlier?
pink b0iToday at 12:10 AM
conditional branch: if not reached limit
  actor stat+
else
  message "can no longer boost"
  add item back to party
Al CheddahToday at 12:11 AM
ok, but would I wo do that for the item target?
pink b0iToday at 12:12 AM
maybe you can make another variable for Game_Party, like last_item_target
Al CheddahToday at 12:13 AM
in a script call?:thinking:
pink b0iToday at 12:14 AM

class Game_Party
  attr_accessor :last_item_target
end

Al CheddahToday at 12:14 AM
aahhh
in the actual script
ok
pink b0iToday at 12:14 AM

      # If single target
      if @target_window.index >= 0
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        $game_party.last_item_target = target
        used = target.item_effect(@item)
      end

Al CheddahToday at 12:15 AM
ok so make last_item_target a variable
like in that code
Al CheddahToday at 12:34 AM
wait i thought we were adding/removing the item effects in the event instead of the item itself?
pink b0iToday at 12:35 AM
i had written code that i have since deleted
you can ignore
thanks again and I hope all is well with all parties involved.


jayje

Quote from: jayje on August 31, 2019, 10:45:56 pmI was talking with KK20, with this, but it seemed like it was a bad time to talk then. No big hurry just wanted to get help with this if possible. Here's what the conversation was at that point:

Spoiler: ShowHide

Al CheddahToday at 12:00 AM
say i have a limit on stat boosting items
and once a certain number is reached, the bonuses don't work
pink b0iToday at 12:01 AM
like the pokemon IV items?
Al CheddahToday at 12:02 AM
that might e the best way to explain it, yes
pink b0iToday at 12:02 AM
yeah you're better off going another route
Al CheddahToday at 12:02 AM
i have a CE that just says "You've reached your limit", but I wanna makes sure it doesn't do anything
i see
what would/should i do?
pink b0iToday at 12:03 AM
do you want the item to call a common event?
Al CheddahToday at 12:04 AM
yes
all the stat boster call the same event
that adds 1 to a variale when there used
pink b0iToday at 12:05 AM
how are you determining what item was used
Al CheddahToday at 12:05 AM
i got an item ID catcher from LittleDrago awhile back
that gets the item ID
pink b0iToday at 12:08 AM
and your item use counter is stored in game variables
Al CheddahToday at 12:08 AM
yes
once it reaches a set number it should stop giving a bonus
pink b0iToday at 12:09 AM
then make the item itself add nothing, and do all the stat manipulation in the event
Al CheddahToday at 12:09 AM
okay. how would I go about that?
using the code from earlier?
pink b0iToday at 12:10 AM
conditional branch: if not reached limit
  actor stat+
else
  message "can no longer boost"
  add item back to party
Al CheddahToday at 12:11 AM
ok, but would I wo do that for the item target?
pink b0iToday at 12:12 AM
maybe you can make another variable for Game_Party, like last_item_target
Al CheddahToday at 12:13 AM
in a script call?:thinking:
pink b0iToday at 12:14 AM

class Game_Party
  attr_accessor :last_item_target
end

Al CheddahToday at 12:14 AM
aahhh
in the actual script
ok
pink b0iToday at 12:14 AM

      # If single target
      if @target_window.index >= 0
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        $game_party.last_item_target = target
        used = target.item_effect(@item)
      end

Al CheddahToday at 12:15 AM
ok so make last_item_target a variable
like in that code
Al CheddahToday at 12:34 AM
wait i thought we were adding/removing the item effects in the event instead of the item itself?
pink b0iToday at 12:35 AM
i had written code that i have since deleted
you can ignore
thanks again and I hope all is well with all parties involved.

What I'm basically trying to do is have stat boosting items that increase a certain stat up to a set limit (say 30) after that, it would have no affect. Similar to like Iron or Calcium in Pokemon. TIA!


KK20

You do know that I said all that was needed to be said. It is up to you to make the effort to do it.





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



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

Join the CP Discord Server!

jayje