- 1,224
- Posts
- 10
- Years
- Omnipresence
- Seen Aug 8, 2023
Moves the desired NPC in a (seemingly) more natural move route. Moves in a random direction still, but continues that path for a random number between 1 and 4.
Basically, just add this in a new section
Make you event look like this one. Should be parallel process, the "23" should coordinate to your desired event, and have a Wait X frames command before that. The wait command makes sure the event doesn't move overly fast.
Can be called for a different event than it's placed on (for instance, I could keep my example event but change the 23 to 22, and event 22 would move instead).
Basically, just add this in a new section
Code:
def pbBetterRandom(eventid)
character = get_character(eventid)
# If no character exists
if character == nil
# Continue
return true
end
$game_player.update
$game_screen.update
numToMove=rand(5)
direction=rand(4)+1
directionpass=direction*2
if numToMove>0
numToMove.times do
character.through=false
if character.passable?(character.x,character.y,directionpass)
pbMoveRoute(character,[direction])
end
end
end
end
Make you event look like this one. Should be parallel process, the "23" should coordinate to your desired event, and have a Wait X frames command before that. The wait command makes sure the event doesn't move overly fast.
Can be called for a different event than it's placed on (for instance, I could keep my example event but change the 23 to 22, and event 22 would move instead).
Last edited: