Need help with a PickPocket Blueprint

I have plans to steal objects, but first and foremost coins. Will add objects later on.

I have done exactly like yours, however the enemy still have endless pockets and me allows me to spam R. What am i missing?


Can we see how you are calling this function?

This function? Pickpocket_

You need to call it. To call it means to use it. You need to connect the function to the rest of the code.


My suggestion is to take a step back, look at some tutorials, true fundamentals, try to wrap your head around how stuff works first.

1 Like

Yea, that is propably for the best to just learn how blueprints works, i am eager to jump into and work on this game but without having any backround in blueprinting doesn’t bode well.

Realy appreciate your help and taking your time, I will propably figure this out in some time.

1 Like

I mean, all the bits are there. Have one function that returns the coins and counts the attempt, and delays. Call it in the loop and send the int to the Game Mode

You really are pretty close.

Realy hate asking for more help, but how do i construct this function that you are speaking of?

Does this look right, are they supose to be on the same page?

Return the random number of coins here here :point_up: Call it here :point_down: instead:

Like this? its not compatible.

No. The random goes inside the function and then call the function.

  • that’s your function:

Call in the loop.

Why cant i attach it?

The pickpocket is a function of the NPC blueprint, not the player’s. It’s the NPC that must store the attempts, delay them and generate coins. The very first pic I posted:

This function and all the variables belong to the NPC. The player cannot (and absolutely should not) track what the NPCs are doing with their money and time. It’s the NPC’s job; you grab one or more and run their Pickpocket function; they will tell you (return) what can be stolen.



You had it going here:

Not sure why you moved the function to the player. Also, avoid plopping down orphaned nodes, use the context sensitive nature of the wires: drag a wire ==> then search:

Alleviates lots of headaches and helps preventing mistakes as you’ll receive filtered results that make sense in this particular context.

Allright, i have attached it. Whats the next step?

image

Like this?

1 Like

Looks fine. I hope you’re calling the right pickpocket function that has all this inside.

This?

How do i call this

Somehow you ended up with:

image

I don’t even know why you have two… You are really creating utter confusion for yourself:

Close all tabs, open the main graph:

Make sure this function has the stuff you need. Rename it if you must so you know what to call.

This Pickpocket tab is the one that controls Cast to AI, target is AI.

The other one is this.

This one is correct right? Its in a sequence but shouldint make a difference.

Its in a sequence but shouldint make a difference.

What’s in the sequence? It’s not even connected… which means the attemps are not being set.

You do not need this:

image