def pbItemMenu(index)
[COLOR="Red"]if $game_switches[86]==true[/COLOR]
ret=0
emptyspot=-1
pkmnid=-1
endscene=true
oldsprites=pbFadeOutAndHide(@sprites)
itemscene=PokemonBag_Scene.new
itemscene.pbStartScene($PokemonBag)
loop do
item=itemscene.pbChooseItem
break if item==0
usetype=$ItemData[item][ITEMBATTLEUSE]
cmdUse=-1
commands=[]
if usetype==0
commands[commands.length]=_INTL("Cancel")
else
commands[cmdUse=commands.length]=_INTL("Use")
commands[commands.length]=_INTL("Cancel")
end
itemname=PBItems.getName(item)
command=itemscene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
if cmdUse>=0 && command==cmdUse
if usetype==1 || usetype==3
pkmnlist=PokemonScreen_Scene.new
pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1)
itemscene.pbEndScene
pkmnscreen.pbStartScene(_INTL("Use on which Pokémon?"),@battle.doublebattle)
pkmnid=pkmnscreen.pbChoosePokemon
emptyspot=0 if @battle.doublebattle && @battle.battlers[0].hp<=0
emptyspot=2 if @battle.doublebattle && @battle.battlers[2].hp<=0
if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen)
pkmnscreen.pbRefresh
pkmnlist.pbEndScene
ret=item
endscene=false
break
end
pkmnlist.pbEndScene
itemscene.pbStartScene($PokemonBag)
elsif usetype==2 || usetype==4
if @battle.pbUseItemOnBattler(item,index,itemscene)
ret=item
break
[COLOR="red"]end[/COLOR]
end
end
end
end
You might be able to make the change in there. Which function do you think you'd have to change?I am still lost as there is so many areas to change and i not sure where to edit, is it in PBExperience section for exp issue??
This seems like a good start. What do you mean it doesn't work? Do you get an error message, or does it do nothing? If it does nothing, is your switch set to true?And for the item, i tried this method under pokebattle_scene but it does not work.... the red words is the one that I have edited
Spoiler:
Code:def pbItemMenu(index) [COLOR="Red"]if $game_switches[86]==true[/COLOR] ret=0 emptyspot=-1 pkmnid=-1 endscene=true oldsprites=pbFadeOutAndHide(@sprites) itemscene=PokemonBag_Scene.new itemscene.pbStartScene($PokemonBag) loop do item=itemscene.pbChooseItem break if item==0 usetype=$ItemData[item][ITEMBATTLEUSE] cmdUse=-1 commands=[] if usetype==0 commands[commands.length]=_INTL("Cancel") else commands[cmdUse=commands.length]=_INTL("Use") commands[commands.length]=_INTL("Cancel") end itemname=PBItems.getName(item) command=itemscene.pbShowCommands(_INTL("{1} is selected.",itemname),commands) if cmdUse>=0 && command==cmdUse if usetype==1 || usetype==3 pkmnlist=PokemonScreen_Scene.new pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1) itemscene.pbEndScene pkmnscreen.pbStartScene(_INTL("Use on which Pokémon?"),@battle.doublebattle) pkmnid=pkmnscreen.pbChoosePokemon emptyspot=0 if @battle.doublebattle && @battle.battlers[0].hp<=0 emptyspot=2 if @battle.doublebattle && @battle.battlers[2].hp<=0 if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen) pkmnscreen.pbRefresh pkmnlist.pbEndScene ret=item endscene=false break end pkmnlist.pbEndScene itemscene.pbStartScene($PokemonBag) elsif usetype==2 || usetype==4 if @battle.pbUseItemOnBattler(item,index,itemscene) ret=item break [COLOR="red"]end[/COLOR] end end end end
# Use this method to display the inventory
# The return value is the item chosen, or 0 if the choice was canceled.
For the item yea, it does nothing, and yup it sets to true.
meaning if i set to false, it will be disabled?
let me try about it first
Hmm, well i kinda works, I got this error message but the game can still continue:
Exception: NoMethodError
Message: undefined method `>' for nil:NilClass
PokeBattle_Scene:2469:in `pbItemMenu'
PokeBattle_Battle:2626:in `pbItemMenu'
PokeBattle_Battle:2709:in `pbCommandPhase'
PokeBattle_Battle:2666:in `loop'
PokeBattle_Battle:2756:in `pbCommandPhase'
PokeBattle_Battle:2655:in `each'
PokeBattle_Battle:2655:in `pbCommandPhase'
PokeBattle_Battle:2602:in `pbStartBattleCore'
PokeBattle_Battle:2601:in `logonerr'
PokeBattle_Battle:2601:in `pbStartBattleCore'
def pbItemMenu(index)
[color=red]return 0 if $game_switches[86]==false[/color]
ret=0
emptyspot=-1
pkmnid=-1
endscene=true
oldsprites=pbFadeOutAndHide(@sprites)
itemscene=PokemonBag_Scene.new
itemscene.pbStartScene($PokemonBag)
loop do
item=itemscene.pbChooseItem
break if item==0
usetype=$ItemData[item][ITEMBATTLEUSE]
cmdUse=-1
commands=[]
if usetype==0
commands[commands.length]=_INTL("Cancel")
else
commands[cmdUse=commands.length]=_INTL("Use")
commands[commands.length]=_INTL("Cancel")
end
itemname=PBItems.getName(item)
command=itemscene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
if cmdUse>=0 && command==cmdUse
if usetype==1 || usetype==3
pkmnlist=PokemonScreen_Scene.new
pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1)
itemscene.pbEndScene
pkmnscreen.pbStartScene(_INTL("Use on which Pokémon?"),@battle.doublebattle)
pkmnid=pkmnscreen.pbChoosePokemon
emptyspot=0 if @battle.doublebattle && @battle.battlers[0].hp<=0
emptyspot=2 if @battle.doublebattle && @battle.battlers[2].hp<=0
if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen)
pkmnscreen.pbRefresh
pkmnlist.pbEndScene
ret=item
endscene=false
break
end
pkmnlist.pbEndScene
itemscene.pbStartScene($PokemonBag)
elsif usetype==2 || usetype==4
if @battle.pbUseItemOnBattler(item,index,itemscene)
ret=item
break
end
end
end
end
Now there is a syntax error at line 3301 which is at the end of the page.
If I keep the "return 0 if " but delete the "end" that I inserted below the break. The game can continue but i can still use the items.
# Now calculate EXP for the participants
if partic>0 || expshare>0 || haveexpall
if !@opponent && successbegin && pbAllFainted?(@party2)
@scene.pbWildBattleSuccess
successbegin=false
end
for j in [email protected]
next if !@party1[j] || !pbIsOwner?(0,j)
next if @party1[j].hp<=0 || @party1[j].isEgg?
haveexpshare=(isConst?(@party1[j].item,PBItems,:EXPSHARE) ||
isConst?(@party1[j].itemInitial,PBItems,:EXPSHARE))
next if !haveexpshare && !@battlers[i].participants.include?(j)
pbGainExpOne(j,@battlers[i],partic,expshare,haveexpall)
end
if haveexpall
showmessage=true
[COLOR="red"]if $game_switches[179]==true
showmessage=false
end[/COLOR]
for j in [email protected]
next if !@party1[j] || !pbIsOwner?(0,j)
next if @party1[j].hp<=0 || @party1[j].isEgg?
next if isConst?(@party1[j].item,PBItems,:EXPSHARE) ||
isConst?(@party1[j].itemInitial,PBItems,:EXPSHARE)
next if @battlers[i].participants.include?(j)
pbDisplayPaused(_INTL("The rest of your team gained Exp. Points thanks to the {1}!",
PBItems.getName(getConst(PBItems,:EXPALL)))) if showmessage
showmessage=false
pbGainExpOne(j,@battlers[i],partic,expshare,haveexpall,false)
end
end
end
growthrate=thispoke.growthrate
newexp=PBExperience.pbAddExperience(thispoke.exp,exp,growthrate)
exp=newexp-thispoke.exp
[COLOR="red"]if $game_switches[179]==true
exp=0
end[/COLOR]
if exp>0
if showmessages
if isOutsider
pbDisplayPaused(_INTL("{1} gained a boosted {2} Exp. Points!",thispoke.name,exp))
else
pbDisplayPaused(_INTL("{1} gained {2} Exp. Points!",thispoke.name,exp))
end
end
def pbItemMenu(index)
[COLOR="red"]return 0 if $game_switches[178]==true[/COLOR]
ret=0
emptyspot=-1
pkmnid=-1
endscene=true
oldsprites=pbFadeOutAndHide(@sprites)
itemscene=PokemonBag_Scene.new
itemscene.pbStartScene($PokemonBag)
loop do
item=itemscene.pbChooseItem
break if item==0
usetype=$ItemData[item][ITEMBATTLEUSE]
cmdUse=-1
commands=[]
if usetype==0
commands[commands.length]=_INTL("Cancel")
else
commands[cmdUse=commands.length]=_INTL("Use")
commands[commands.length]=_INTL("Cancel")
end
itemname=PBItems.getName(item)
command=itemscene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
if cmdUse>=0 && command==cmdUse
if usetype==1 || usetype==3
pkmnlist=PokemonScreen_Scene.new
pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1)
itemscene.pbEndScene
pkmnscreen.pbStartScene(_INTL("Use on which Pokémon?"),@battle.doublebattle)
pkmnid=pkmnscreen.pbChoosePokemon
emptyspot=0 if @battle.doublebattle && @battle.battlers[0].hp<=0
emptyspot=2 if @battle.doublebattle && @battle.battlers[2].hp<=0
if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen)
pkmnscreen.pbRefresh
pkmnlist.pbEndScene
ret=item
endscene=false
break
end
pkmnlist.pbEndScene
itemscene.pbStartScene($PokemonBag)
elsif usetype==2 || usetype==4
if @battle.pbUseItemOnBattler(item,index,itemscene)
ret=item
break
end
end
end
end