- 1,224
- Posts
- 10
- Years
- Omnipresence
- Seen Aug 8, 2023
This script makes TM/HM icons automatically chosen, based on type. Meaning if you add or change moves you don't have to mess around with their item icons, just delete them and keep these. However, if it finds an icon for the specific item first, it uses that one (in case you want special icons or something).
Download Icons here, put in Graphics/Icons folder (unpacked)
When copying and pasting scripts from pokecommunity, use Thread Tools -> Printable Version
There is a formatting problem that breaks some scripts. If you encounter a "Syntax error", your lack of reading this warning is most likely the cause.
Add this in a new section above the main (and below PSystem_Utilities)
Download Icons here, put in Graphics/Icons folder (unpacked)
When copying and pasting scripts from pokecommunity, use Thread Tools -> Printable Version
There is a formatting problem that breaks some scripts. If you encounter a "Syntax error", your lack of reading this warning is most likely the cause.
Add this in a new section above the main (and below PSystem_Utilities)
Code:
def pbItemIconFile(item)
return nil if !item
bitmapFileName=nil
if item==0
bitmapFileName=sprintf("Graphics/Icons/itemBack")
else
bitmapFileName=sprintf("Graphics/Icons/item%s",getConstantName(PBItems,item)) rescue nil
if !pbResolveBitmap(bitmapFileName)
bitmapFileName=sprintf("Graphics/Icons/item%03d",item)
end
end
if pbIsMachine?(item) && !pbResolveBitmap(bitmapFileName)
move = PBMoveData.new($ItemData[item][ITEMMACHINE])
typeid = move.type
type=getConstantName(PBTypes,typeid)
bitmapFileName=sprintf("Graphics/Icons/TM_%s",type)
end
return bitmapFileName
end
Last edited: