Help with pickpocket event

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Helloooo everybody! 

Here I am again, now I am trying to create a pickpocket system to my game, simple yet useful.

I am making it like this.:



What already works.:

1- You need an item for you to be able to pickpocket.

(If the player doesn't want to go pickpocketing every NPC I think I should put a choice

in there, if he has the item he should be asked weather he wants to pickpocket or not, I'm

not sure, AND I am open to suggestions =)

2- There is a random chance of this pickpocketing happening.

3- I added a nice script there, which adds a screen where you need to type a sequence of

keyboard keys (Which are displayed on screen) before the time runs out for this

pickpocket to be a success.

What I need help with?

1- How can I add a difficulty level to this? I mean, I want to store in a variable that success pickpocketing

will add like 5 and unsuccessful will add 0 ( I won't subtract anything ). After the player reaches 100 he

reaches pickpocketing level 2, then level 3, and so on. It will get easier. (The script with the sequence will

be an easier one). I am having trouble doing this events and conditionals right now.

2-(Script specific, but maybe someone who has the same script might know) When the sequence fails,

it still goes on and shows like it was a success. I figured that the script number for the sequence would

be also a switch ( As you can see on the image) and that it would determine it's ON or OFF state.

Never have I been so wrong, so this right now is a drawback. This is up to me, and probbaly

the script creator, but as I said, maybe if someone has the same script, you could help me =)

The script is from Moghunter, which you can find at http://www.atelier-rgss.com and it's called "Chain commands".

http://www.atelier-rgss.com/RGSS/System/ACE_SYS02.html

When these problems ( And eventually others that might appear alongside this thread), I think I will

add this as a tutorial =)

Thanks in advance everyone!
 
Last edited by a moderator:

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
For the first part, you can add in another conditional before you set Pickpocket Chance to a random number that checks a variable "PPLevel." When you process the events of a successful pickpocket, add to another variable (PPExp, let's say), then do a conditional that checks if PPExp is equal to 100 - and if so, increase the variable PPLevel. So let's say, at level 1 pickpocketing (conditional branch: PPLevel == 1), PickPocket Chance is a random number between 1 and 5, and when it's equal to 1 (as you have it), it's successful - or, in short, you have a 20% chance of succeeding and adding 5 to PPExp. Then, at level 2 pickpocketing (conditional branch: PPLevel == 2), Pickpocket Chance gets set to a random number between 1 and 4 (or, a 25% chance of succeeding). And so on and so forth.

Make sure that whatever your highest level pickpocket is, your final conditional branch for it is greater than or equal to that level (or, in the processing for adding to PPExp, you do another conditional that checks if PPLevel is at max, and if so, it doesn't add to it). So, for example, if the maximum pickpocket level is 3, then your last conditional for PPLevel would be "Conditional: PPLevel >=3." Alternatively, before you add to PPExp, you could add a conditional "PPLevel == 3," and only add to PPExp in the else section.

Here's a picture example if it helps:

 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Zevia gave you a decent answer to your first question, but here are a few ways to make it better:

A) Instead of doing the Experience checks inside the pickpocketing event, have it Call a Common Event instead, and have that common event check the player's total accumulated experience and set a variable based on what "Level" of a pickpocket they should be based on that experience.  You can do this BEFORE the pickpocketing check is made.

B.) Add that "level" variable to the random number that's drawn for the chance of success, and do your pickpocketing check based on whether the total is above a certain number.  For example, draw a random number between 1 and 30, and add your pickpocketing level to it.  Then, if the total is 25 or greater, it's a success.  If it's 24 or lower, it's a failure.  Your chance of a successful pickpocket will go up by about 3% with each level you earn and you don't need to make, say, twenty different event commands for twenty different levels.

As to your second question, I took a look at the script in question and I was really surprised to see in only use the $game_switches keyword twice.  I don't really see how the switch would be set to false at any point.  I can think of two things to try, though I'm not sure either will work:

A) Manually set the switch to 'false' (OFF) before you call the chain_commands event.  I think it's possible the script can only change the switch to 'true' (ON) upon a success, and simply won't do anything upon a failure.

B.) Replace the following code (near the top of the script) with @auto = false.  Be sure to replace the original code if this does not work!!

if $game_switches[CHAIN_AUTOMATIC_MODE_SWITCH_ID] @auto = true else @auto = false endIf neither of these work, just get in touch with Moghunter.  I think he might also speak Portuguese, so you could ask him a question a lot better than I could!
 
Last edited by a moderator:

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
B.) Add that "level" variable to the random number that's drawn for the chance of success, and do your pickpocketing check based on whether the total is above a certain number.  For example, draw a random number between 1 and 30, and add your pickpocketing level to it.  Then, if the total is 25 or greater, it's a success.  If it's 24 or lower, it's a failure.  Your chance of a successful pickpocket will go up by about 3% with each level you earn and you don't need to make, say, twenty different event commands for twenty different levels.
Using the level to affect the chance would be a significantly less time-consuming (and easier) method. I agree that making a common event to handle leveling up your pickpocketing would also save you a lot of repetition in your events, too, so you should use Wavelength's option. It'll overall be less of a task, and it will allow you to make changes to your pickpocketing system (in case you want to adjust the math for it) more efficiently.
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
I don't have much time now in the morning, I gotta work! Lol

But I did this quickly as a common event, to be called upon trying to pickpocket someone, AND I will give a

choice for the person to try a pickpocket or not.

Thanks for your help guys, tonight I will finish it, but it looks like this right now ( And already works, so

tonight I will just polish it)

(It is long, LOOONG)













I did what Zevia said about Levels and also added that each level (That's why it's long) will have it's own script call 

(Right now it's all 15, I know, but I will change it later, I don't have time right now)

I am considering to rewrite this and do also what Wavelength said about levels, but I wouldn't be able to do it now in the morning.

OH! And wavelength, it worked! I replaced the snipet you sent for .:

if $game_switches[CHAIN_AUTOMATIC_MODE_SWITCH_ID]       @auto = false      end      @com = 0  Also, as you can see, you can never be so sure lol, I am turning this switch off everywhere possible.

Later I will add support to my action battle system so that the failure should give like a bounty or immidiatelly

call soldiers over...

But here it's another problem, how will I transfer actors over to be close to the player?

Since it's an action system battles are done on map itself, so I will have to find a way to transfer enemies

randomly close to the player...
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Just a general tip; when you are using conditional branches that are equal to, you do NOT have to stack them in the else branch of the previous conditional branch. You only do this when you're working with less than or greater than.


Just place the conditional branches underneath each other (and set handling off or something), it should save some screen space.


Also, I have absolutely no idea why you are repeating this exact same chain of events:





The logic I'm getting from this, is that you want to check if the player should level up (in which case it's really bad to use 'equal to', you want to use 'greater than or equal to', just in case on the off chance that your player might have 153 experience and never get the level up). But why do you repeat this for every PickPLvl conditional branch, as nothing changes? In fact, you shouldn't even be checking for levels in the conditional branch in the first place, because you're already using conditional branches to see how much experience you have to increase the level.


You should set your event up like this:


- Conditional branch that checks if the item is in the inventory


- Show choices to ask if they want to pick pocket


- 4 conditional branches underneath each other, that checks which PickPLvl the player has, and randomize a variable accordingly


- Turn Switch Cheat off


- Use the script command to show the custom screen


- Conditional branch that checks if switch Cheat is on, if yes, add 5 to variable PickPExp


- 4 conditional branches that checks the variable PickPLvl for 0, 1, 2 and 3 (all equal to, and all underneath each other).


- In each conditional branch, you add another conditional branch that checks the variable PickPExp if it is greater than or equal to 100. In the 2nd conditional branch check from 150, in the third for 200, and the last one 280. If true, add +1 to variable PickPLvl


- Turn Switch Cheat off


I think that's about it.
 
Last edited by a moderator:

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Huuuum, ok, I re-wrote it like this.:







(Just part o it, too many screens)

As you said @Celianna 

Just a general tip; when you are using conditional branches that are equal to, you do NOT have to stack them in the else branch of the previous conditional branch. You only do this when you're working with less than or greater than.

Just place the conditional branches underneath each other (and set handling off or something), it should save some screen space.

You should set your event up like this:

- Conditional branch that checks if the item is in the inventory
- Show choices to ask if they want to pick pocket
- 4 conditional branches underneath each other, that checks which PickPLvl the player has, and randomize a variable accordingly
- Turn Switch Cheat off
- Use the script command to show the custom screen
- Conditional branch that checks if switch Cheat is on, if yes, add 5 to variable PickPExp
- 4 conditional branches that checks the variable PickPLvl for 0, 1, 2 and 3 (all equal to, and all underneath each other).
- In each conditional branch, you add another conditional branch that checks the variable PickPExp if it is greater than or equal to 100. In the 2nd conditional branch check from 150, in the third for 200, and the last one 280. If true, add +1 to variable PickPLvl
- Turn Switch Cheat off

I think that's about it.
I think I did somethign wrong, or I didn't follow all your instructions... =/

- Checked if item is in inv.

- Choice

- 4 conditional branches underneath each other, each one of them checking the player's lvl

- switch off

- script call

- if cheat on (Inside each one of those first contional branches that checks player's level),

I added the results of a successful pickpocket.

- I added at the end, the level check aswell. (And swicth off =)

- Oh, and there is also conditionals inside each success to determine what the player

will get! Should I add that as another common event? Just to keep it tidy =)

But the thing is, when I test it, it goes directly to the "failure" part. It's skipping

directly to the "else" part of the even. And it also does that 4 times (The number

of level variables I set).

That was the main problem.

Also, as you can see, I'm trying to set a new variable there called "NivelProcurado" which

means "Wanted Level". So the failure should add a bounty on the player.

Now, I am having trouble with this aswell. My game specifically has action based combat,

it's not turn based. (It's like khas' sapphire action system, but another one I found to be better).

So how could I set it? Any ideas?

What I thought about so far, but DID NOT work.:

(Have in mind that enemies in my project are like events, I just have to add that "option" to the event)

- Created another common event that when player's bounty reaches a certain ammount,

it should store the player's map position and transfer the soldiers events to it's position + some number 

( I thought about that for them not to appear on the player, or create an error and don't appear 

at all, I don't know).

- The player should get a message notifying his bounty level, though he can not check it.

(It's currently appearing, but no enemies)

- The player should be able to escape the enemies and keep stacking the bounty level, and then,

after some time it should reset or he could pay his bounty, etc. 

(It would be tied to other events, like the time script I use).

The thing is, i'ts not working at all, any ideas? The main problem is the enemies not appearing,

the rest I think I could handle (Badly, I know, but I could =)

Thanks everyone so far! It's been a great help.
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You could simply use a script called "CSCA: Professions" for handling the XP. Level ups happen automatically with that incredibly useful script.


I made a pickpocketing system with that, and a sneaking and lockpick system too.


For your question with the guards arresting people.


Here is what I did:


1. Get a script which can check for the player's range from an event automatically. I recommend Vlue's Proximity Detection Script.


2. When you fail the pickpocket, turn a switch on, which activates an event page for all of your guard events, and for everyone who you want to attack the player or simply to yell on him, etc.


3. On that fail event page, make a proximity check for whatever range you want the player to be detected. Now, make a 'set move route' command, and put a single 'move toward player' command in it. After the'set move route' command check, make another conditional check , which checks for a smaller range than the previous you set up.


This check will trigger the "Caught! Go to jail, basta!" part of the event, or whatever you want to happen, like triggering the 'attack the player!' effect, etc.


4. If you want the player to be able to escape from the guards and move your guards back to their original position when the player is out of range, get another script, a pathfinder or something similar (like Vlue's "Eventing: Fine Tuning" script), and in both of your 'else' part of the proximity check in the guard events, make a 'wait' command and set it to the amount you want the guard to stay at the current position (to look for the player for a bit, for example), then after that, set the guard to move back to it's original location with the previously mentioned script(s).


This works like a charm for me.


Although, I haven't tested this on large maps with multiple guards yet. It is possible that if you make a lot of guards, your game will get some FPS drop from all the proximity checks this will trigger.


But there is no need for a lot of guards, just set their speed to something very high, so that they can move there fast.


Big note:


At point 3., if you make it with a simple 'move toward player' command, it is possible that your guards will be stuck at some point, if they collide with a building in the way, etc.


So it is recommended that you use a pathfinder, just like what you will use at point 4., and set the X and Y co-ordinates to '$game_player.x' and '$game_player.y'. This will make the events move where the player is, regardless where he is, and they will get there for sure, regardless if there are any buildings, events in the way.


Guards simply appearing out of nowhere is a bit... Well, let's just say, that I would not do it like that. :p


But if you want, you can make that happen too. With a script, which is already mentioned, Vlue's "Eventing: Fine Tuning".


I managed to replicate a whole Skyrim-kind "illegal activity" system with the scripts mentioned above.


Sneaking, pickpocketing, lockpicking, stealing (stuffs which is owned by others). All of these got a level automatically maintained by the Professions script.


If a player is caught while trespassing on a place he shouldn't, lockpicking, pickpocketing, or stealing and a guard catches him, several options are available:


1. The player can try to talk his way out of it (Persuasion level check - made with CSCA: Proffesions script).


2. The player can bribe the guard (several checks, too many to list, lol).


3. The player can accept jail time (instant transfer to jail, random events happen there).


4. The player can try to incapacitate or kill the guard (triggers a battle).


Lot of eventing, lot of scripting, but it can be done, and the result is satisfying, at least for me. :)


I would like to make a separate scene for pickpocketing, that would make the system even better, but I am occupied with other things now, so that will have to wait a bit.


Anyway, try the things I wrote, see if it can help you with your eventing.
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
@sixth, you really don't exist, do you? It's awesome! You are a real life saver lol.

I will do that once I get home, I use csca quest script, I didn't know about this professions script.

I really like his scripts.

About pathfinder, I was about to set that, as I would have wandering people and merchantes around my map globaly,

and I didn't think about using it that way! Instead of making different events and teleporting it, why not pathfinding??

This solution was really good.

Since my game has too many scripts, and it will surely lag on big maps, I will sepparate the main map in dozens of smaller

portions and make a map of course, that will store the player's position, etc. That I still have to think about, soooo don't worry,

I will try to make it less laggy possible.

The thing is, as I said, I use a action system, to trigger a battle won't be so simple, I will have to call 

another event page, or a common event and make this guard an enemy.

But this is somethign to think of, it will be done easily then.

Those scripts really saved my brain cells.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Yeah, actually that Professions script saves hell of a lot time for making custom, level-able things for your game, not to mention that it saves countless amounts of variables and adds unlimited options for your game for literally anything! :)


I use a lot of script in my game too. I don't even dare to write the amount of scripts I have installed, because some people might think that I am out of my mind, lol.


Most of these scripts are eventing tools. Without these scripts, I would have give up my project for sure. Eventing with them is a breeze, and the usage of variables and switches went down from hell of a lot to 0. Yes, to 0, lol.


I made a very complex puzzle, which involved multiple parties (3 to be exact), 13 trigger-able objects and 11 "road-blockers", all of these events contain high amounts of nested conditional branches, and none of them uses any switches or variables for the puzzle. That's 24 events which need to be in the exact condition, or else the player can not finish the puzzle. There is only one way to finish it, which I managed within around 30 minutes of heavy thinking, lol, and I made it. I wonder how long would it take for someone else to finish. :D


Anyway, my point is, if you are not afraid of using scripts, there is a very high chance that your eventing time will decrease a lot once you find the necessary script for it. And ohh, yeah, you can be sure that there is a script for just about everything you need!


I know, I have more than 2000 stored on my PC... You know, just to be sure... :D


Sorry for the random off topic!


Just finished with a script edit and wanted to do something while drinking my coffee in peace. :p
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Holy Sh#$%, I missed so many good scripts from casper. 

-Gathering script (But this one I hope Evgenji will make one that connects to his time system),

-Game Over options

-Achievements (This one is awesome)

-Teleport system

Well, I still have to check them all =) But they would look fine on my game!

Tonight I will be BUSY. That's for sure.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top