- 232
- Posts
- 8
- Years
- Seen Apr 28, 2025
Every new game will generate an ID for the character, which script can check that ID?
Here you have methods for both showing your ID and comparing it to random number (like lottery does)
Paste it anywhere in PSystem_PokemonUtilities
Spoiler:def pbShowID
pbMessage(_INTL("Your ID is {1}.",$Trainer.id))
end
def pbcompareID
num = rand(256)
num |= rand(256)<<8
num |= rand(256)<<16
num |= rand(256)<<24
pbMessage(_INTL("Your num is {1}.",num))
if num == $Trainer.id
return true
else
return false
end
end
Okay, I want to make a conditional that checks the coach with ID 5000, I want the event to happen only with that player, which command do I use?
There's a problem with that, and it's that the ID is always much, much higher than 5000, but if you want to make it, paste this script with the other two
Spoiler:def pbcompareID(num)
pbMessage(_INTL("Your num is {1}.",num))
if num == $Trainer.id
return true
else
return false
end
end
On a conditional branch, use the Script pbcompareID([S-HIGHLIGHT]the number you want[/S-HIGHLIGHT]) and it'll work
There's a problem with that, and it's that the ID is always much, much higher than 5000, but if you want to make it, paste this script with the other two
Spoiler:def pbcompareID(num)
pbMessage(_INTL("Your num is {1}.",num))
if num == $Trainer.id
return true
else
return false
end
end
On a conditional branch, use the Script pbcompareID([S-HIGHLIGHT]the number you want[/S-HIGHLIGHT]) and it'll work
I imagined that with your script I could conditionally verify the trainer ID generated on your Trainer Card, but I tested it and it didn't work ...
def pbshowID
pbMessage(_INTL("Your id is {1}.",$Trainer.publicID($Trainer.id)))
end
def pbcompareID(num)
pbMessage(_INTL("Your num is {1}.",num))
if num == $Trainer.publicID($Trainer.id)
return true
else
return false
end
end