# Help for my blueprint project

**URL:** <https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [August 9, 2015, 10:32am UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008 "2015-08-09T10:32:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaanks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chaanks](https://forums.unrealengine.com/u/chaanks)\
**Post date:** [August 9, 2015, 10:32am UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/1 "2015-08-09T10:32:29Z")

</div>

Hello,

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 ☹

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [August 9, 2015, 11:02am UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/2 "2015-08-09T11:02:17Z")

</div>

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)

[http://puu.sh/juW9X/759026f2d7.png](http://puu.sh/juW9X/759026f2d7.png)

[http://puu.sh/juWdZ/7f879d0837.png](http://puu.sh/juWdZ/7f879d0837.png)

You can see they match the values 😛

[http://puu.sh/juWfi/aab56332ed.png](http://puu.sh/juWfi/aab56332ed.png)

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 😛

[http://puu.sh/juWC8/8a9ae0ea94.png](http://puu.sh/juWC8/8a9ae0ea94.png)

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  
this.

You can do something like that:

[http://puu.sh/juWtm/be93f49a1a.png](http://puu.sh/juWtm/be93f49a1a.png)

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](https://docs.unrealengine.com/latest/INT/Engine/Content/Types/SkeletalMeshes/Sockets/index.html)  
[Youtube Search for equipping weapons to your Player](https://www.youtube.com/results?search_query=equipped+weapon+ue4)  
[A video from Epic that somewhat shows you how to use a Line Trace and how to interact with another BP Actor](https://www.youtube.com/watch?v=WwfsWr4A894)

---

<div class="post-metadata">

**Author:** ![chaanks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chaanks](https://forums.unrealengine.com/u/chaanks)\
**Post date:** [August 9, 2015, 11:07am UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/3 "2015-08-09T11:07:54Z")

</div>

Oh my God !!!

so fast and clair

realy thanks 🙂

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

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/3/783d29af3a18c0412ae9173ac7452b2a837dc5e9.jpeg "QUADROPUS RAMPAGE Android Game Review") ](https://www.youtube.com/watch?v=DrX1QV_pj8k)

i have create visual exemple of my final project loot drop

 ![tableau_loot.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/7/e7630818994c2aa943a289d534ed0060903b2597.png)

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

 ![tableau_damge.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/5/a548adbeb7f26e244d600714a135cd9bb8300125.png)

Gives me your notices 🙂

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [August 9, 2015, 1:17pm UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/4 "2015-08-09T13:17:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![chaanks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chaanks](https://forums.unrealengine.com/u/chaanks)\
**Post date:** [August 9, 2015, 1:35pm UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/5 "2015-08-09T13:35:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [August 9, 2015, 1:43pm UTC](https://forums.unrealengine.com/t/help-for-my-blueprint-project/38008/6 "2015-08-09T13:43:37Z")

</div>

> [@chaanks;351912](#):
>
> 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 😛  
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 😃

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++ 😛

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!
