Help for my blueprint project


Just sorry for my bad english , i’m french but i realy need help for my project if you can help me for the base of my project .

My project is when i kill an enemy ( i have create enemy character and Ai ) , There is 20 % of luck to bring down a weapon ( Among my weapons ) and i would like trade my wepon with dropped weapon.

exemple: i kill enemy , he drop an M4A1 i go front of weapon and i press “E” for trade with my weapon ( my weapon bring down and i have m4 in my hand )

I hope to have been understandable with my bad english :frowning:

Hey there,

For killing an enemy, you will want to give him a Health variable. When you hit him with a bullet or line trace, you can call “Apply Damage” on him where you can specify the damage you want to deal.
Inside of the Enemy, you can then use “Event Any Damage” to create the logic of the damage. It will pass the damage you used for “Apply Damage” and you can then just subtract the amount from
the health variable. If the health is <= 0, you can call your drop and destroy methods.

Here are some screenshots of the things you might want to use (no actual setup, because that is too much work for me and you should do a bit of work yourself :D)

You can see they match the values :stuck_out_tongue:

The left one gets called on the Weapon/Player or where you call you shooting event.
The right one gets called on the actor that gets damaged (your Enemy).

For dropping something with 20% chance, you will want to have a simple random int between 1 and 100 (including) and
check if the number is between 1 and 20. So you have a 20 percent chance :stuck_out_tongue:

There are some other random nodes with streams and things that you might want to use.

For picking up the weapon with E, you might want to have a variable to save a reference to your weapon on your character
and a socket on your mesh (google helps you here, because there are already several tutorials on youtube and the wiki for

You can do something like that:

I have not filled the Start and End Location here and i’m missing a cast to the specific weapon class, because i simply don’t have one.
Combine this above with the thing you find on youtube and google and you are good to go (:

Additional Information:

Documentation Page about Sockets on Skeletal Meshs
Youtube Search for equipping weapons to your Player
A video from Epic that somewhat shows you how to use a Line Trace and how to interact with another BP Actor

Oh my God !!!

so fast and clair

realy thanks :slight_smile:

I have just found a video which summarizes exactly what I want to make with my weapon system for you can see . Look at 30 first second

i have create visual exemple of my final project loot drop

And I think of the end to add a percentage of damage According to the level of my character

Gives me your notices :slight_smile:

First of all, please don’t make doubleposts (bump your thread) without waiting 4 days for a new answer from someone else.

The things you posts can be done with the things i posted you before (: I have no time creating your system. I’m pretty sure you can do
this yourself with the links i posted.

Sorry exi , my english is bad bad bad I badly expressed myself, I wanted just to know if it is good idea or not and for the people see my project

Your english isn’t that bad. You just need to express yourself more, not better :stuck_out_tongue:
So let me see…

Yes that looks good. And with these easy numbers you can do it the way i posted you.
You just need to check that the weapon percentage adds up to 100.

If you have 5 weapons, then it is easy, because 5*20% are 100. You can just check if the random int
is between 1 and 20 or 21 and 40 or 41 and 60,… etc.

And for the overall drop you check if the random number is just between 1 und 20.

Both random numbers should be from 1 to 100. That’s all.

And as you already showed, your different colors also add up to 100. That makes it really easy!
Having a 20% drop rate for 6 items will get kinda messy, since you need to recalculate that :smiley:

The part with the extra damage from the Level is good if you want to implement a level system.
You would make a Base Class for all your Weapons and put in all the things these weapons have in common.
I guess you already know about the way you setup these things in an objective orientated programming language like c++ :stuck_out_tongue:

I would add a reference of the holding player to the weapon. Once you press left click, you get the current equipt weapon and
call some kind of “shoot” function. In this function you can use the player reference to get his current level and multiply the damage
of the weapon (: Really an easy and cool setup!