This is my first post here guys and the first somewhat complex event I tried to make, so please bear with me. I have only been doing this a few weeks, so there is likely a more efficient/simpler way to do this. If so feel free to post it/comment and I will update my event. I welcome criticism so long as it is constructive. Here goes nothing, I hope you find it useful!
The first image contains my pickpocketing common event. Explanations are commented into the event, and the other events that it calls are posted in the next image. The success/failure rates and messages/rewards are simply examples.
The second image contains the accessory common events that are called by the pickpocketing common event as well as the example event itself.
The third image shows a working pickpocketable event.
Notice the move pattern. The event is on fix direction so that when the player uses the action button to attempt to rob him (from behind), the event does not turn around. If the even turns around, even briefly, the variables for recording the event's direction do not work properly and the event will not run. The move pattern is the first 5 lines repeated 20 times. Those 5 lines are intended to mimic a regular random walking pattern (and can be altered or turned off obviously). I repeated them 20 times (copy/paste) because in some cases, say the event managed to walk into an area in which it was surrounded on 3 sides by impassable objects, the event would get stuck. The event would have a 3/4 chance of trying to walk into an impassable object which would cause it to bug out. I repeated them 20 times to give the event a (3/4)^20 (basically negligible) chance of getting itself stuck. It would certainly be possible for a player to intentionally freeze an event with this command if he/she was so inclined and patient.
The event also uses a kill processing script for convenience (to end the event through a common event). The script makes using common events much easier but is by no means necessary:
# Kill processing - event command that ends processing in the current event
# and ALL referring events.
# Use the as an advanced > Script event command
command_end # clears the event list, unlocks the event
@list = nil # clears the event list
@next_kill_process = true # sets the next event up to be cleared
alias update_KillProcess update
if @child_interpreter != nil && @child_interpreter.next_kill_process
# sets kill processing flag
@child_interpreter = nil
alias running_KillProcess running?
# tricks the system into thinking the event is still running until its
# referring event can also be cleared
return true if @next_kill_process
I originally saw this posted by Mithran http://www.rpgmakervx.net/index.php?showtopic=15543&st=0&p=136159&#entry136159
Ideas for building on this event include a global variable that holds the players "reputation" in a given area (changed by stealing/getting caught stealing) and/or a hidden "sneak" level. Depending on your type of game all sorts of things could be added in!
I ask that if you use (or build off of) this event in your projects that you reference me (Iysif) at some point. Feel free to use it for any free (ie non-commercial) purposes, but if you would like to use it in a commercial product I ask that you contact me first either through a PM here or an email at firstname.lastname@example.org
Have a good one!