- 217
- Posts
- 15
- Years
- Seen Nov 29, 2021
So I tried to butcher a script into allowing you to view your Triple Triad cards from a key item in your bag. Unfortunately it keeps throwing an error, and I've no idea why (or even if this'll work).
Code:
def pbViewTriadCard(cardStorage=@triadCards)
commands=[]
for item in cardStorage
commands.push(_INTL("{1} x{2}",PBSpecies.getName(item[0]),item[1]))
end
command=Window_CommandPokemonEx.newWithSize(commands,0,0,256,Graphics.height-64,@viewport)
# @sprites["helpwindow"].text=_INTL("Choose {1} cards to use for this duel.",@battle.maxCards)
preview=Sprite.new(@viewport)
preview.z=4
preview.x=276
preview.y=60
index=-1
for i in [email protected]
@sprites["player#{i}"]=Sprite.new(@viewport)
@sprites["player#{i}"].z=2
@sprites["player#{i}"].x=Graphics.width-96
@sprites["player#{i}"].y=34+48*i
end
loop do
Graphics.update
Input.update
pbUpdate
command.update
if command.index!=index
preview.bitmap.dispose if preview.bitmap
if command.index<cardStorage.length
item=cardStorage[command.index]
preview.bitmap=TriadCard.new(item[0]).createBitmap(1)
end
index=command.index
end
if Input.trigger?(Input::B)
end
end
command.dispose
preview.bitmap.dispose if preview.bitmap
preview.dispose
end