Top Down Stealth Toolkit

Can you point me in the right direction for how actual projectiles/ hits are registered? I would like to add a rifle w/ automatic fire, but i want to make sure the weapon is working like the others, ie. sounds/ laser sight/ etc. But looking at the hand gun I’m still not sure what’s going on, i’m learning as i go lol, thanks for all your help :slight_smile:

Also, I have a cover system I’m going to be using, that allows you to take cover along walls and duck when you pass something like a window or the wall gets shorter/etc. I can’t seem to find a wall height that ai can see when player is standing but not see when crouched…

That’s quite neat actually. I’d also like to add some basic placeholder animations, at least from the animation starter pack, and maybe paragon characters for firing or melee attacks.

Basically what’s happening is that once the weapon aim is activated, the TargetEvaluation function in BPC_WeaponTargetingSystem is constantly checking for what it is hitting to update the laser, but also stores the target that is being hit as well. This information is stored in the component’s ActiveTarget variable. This variable is then used by the Event Fire interface function in the Weapon blueprint and then the damage is applied to this target actor as shown here:

So you can create a child class based on the BP_Weapon_Parent class for your rifle weapon and then implement this Fire interface function pretty much the same.

As for the actual damage itself, it is using a custom interface BPI_DamageEffects for standard weapon fire as well as other types of effects like stun, emp blast, etc.

For the rifle you can just call the ApplyDamage_Handgun function. It’s already implemented in the enemy AI parent blueprint.

As for the cover system, it’s not present at the moment since I’d have to draw two vision cones one for such scenarios which can be taxing on performance if there are many AI agents. I can look into how it can be added, but are you planning to use vision cones for AI in your project?

Well, I was hoping to use the ai as it comes, adding some attack logic/animations down the road. But for now it works pretty much how i want it to out of the box, I just want to be able to duck under a box/wall whatever and not be seen.

so for the rifle fire, would i just use the handgun damage, just call it repeatedly for automattic fire?

Well if the vision cones are not required to be displayed for the AI guards, I’ll test out the hiding behind covers system and let you know.

And yes, you can just call the apply handgun damage repeatedly. It’ll just kill every AI guard/camera/turret that is being targeted while firing the gun.

right on, thanks a bunch man. If you can come up with something. I would like to model the pxs metal gear in homage, so the cones don’t need to be seen on the map, I have a plan for putting the cones on the mini map by just using a decal high above the npcs/ cameras so it shows up on the mini map, but on the map it there is no cone visible.

So i’ve got a quick question about how the weapon system works, I’ve altered it a little bit, but i think what i’ve changed is pretty self explainatory, i basically set it up to aim when pressing the button and fire when releaseing (metal gear solid psx style) for some reason, i fire once and everything is fine, but i have to run the cycle twice to fire a second time… so i fire once (press then release), when i press again, the aim idle animation plays, but the aim does not ready(no lazer site) and when i release the button, no weapon is fired. Then, when i press the third time, the aim shows up, and release causes fire as expected. my blueprint is here
A Firing Mechanism posted by anonymous | blueprintUE | PasteBin For Unreal Engine let me know if something i’m doing is obviously causing this problem.

I’m not exactly sure what’s causing this. The best course of action would be to use debug points or print strings at every node to see where the flow stops during the firing logic.

But before doing that, could you try setting the Cooldown parameter for all three weapons in DT_Equipment data table to 0.0.

There is a chance that the weapon cannot be activated again during that default 1-second cooldown. I set the cooldown delay as a placeholder for the animation delay, but since you already have animations, that’s not required anymore. If that doesn’t solve it, let me know and we’ll look into other options.

nope, that cool down was the issue. Setting it to 0.0 kept me from firing ever again, but setting it to “0.1” allows rapid fire :slight_smile: thanks again!!

now i just need to figure out how to make an alarm when the player is in the spot light…the ai system is still confusing me :frowning: lol.

I’m struggling to find where the equipped item widget gets set. I want to have a second widget on the left side of the screen. So the character can have like, emp’s equipped at the same time as having a gun equipped. I have set up the inventory, but i’m not sure where the equipped item widget gets it’s data.

Never mind lol :stuck_out_tongue: i found it. I now have two inventories, one for weapons, one for gadgets. as well as corresponding menus for each. Now i just need to set up using items from in menu.
thanks a ton for all the help :slight_smile: it’s really coming along

1 Like

any advice on setting up an automatic weapon? I thought setting the ‘use item’ event to trigger on a while loop conditional to the button being pressed down, but for some reason that just causes an infinite loop and game crashes… any ideas?

I’m guessing that the delay might have something to do with this. Instead of setting the delay to 0.1, we’ll try removing the code for delay altogether. Can you make the following changes within the BP_EquippedItemState blueprint:

Since you already have firing animations, we don’t really need any sort of external cooldown. So might as well remove the cooldown timer and immediately end the cooldown state. We can go further than remove the call for cooldown event altogether, but for now, just let me know if this fixes the infinite loop error.

By spotlight, are you referring to something like the camera cone in MGS that causes the alarm system to trigger when player is within its range?

Spotlight like in metal gear one, helipad area, lights move around on the ground and if you go into the light it triggers the alarm. I used a security camera, I added a spotlight to a duplicate blueprint; changed it’s ai perception angle to 360 and scaled perception cone till it matched my spotlights. Then i attached the altered security camera blueprint (called BP_Spotlight now) to a barely visible cylinder at a slight offset, then set the cylinder to spin real slow. Two of those with opposing spin rotations (one is set 90, the other -90) and i have a working spotlight system.

I’ve been working on a lot of other stuff but i’m getting close to bug fix time and i will go back to the machine gun/automatic fire problem and let you know if the cool down was the cause. Thanks as always for help and response.

Hey, things are coming along real well, thanks again for all your help. I’m trying to integrate NPC_Manager asset, and i can’t seem to shoot the new npcs… i’ve added all the interfaces/ components that i see in the patrol guard parent to my parent npc blue print, as well as the required "apply handgun damage’ damage interface function, but when i line up on the new NPCs, no red line and no hit is detected. I’m not sure what i’m doin wrong lol.

i was able to figure that out. :slight_smile: Things seem to be working, by and large, however, i’m getting an error i can’t pin point when using a child of player parent:

Hey boss. i’ve broken something :frowning: lol for some reason, my guards don’t see my player character any more. I’m not sure what i messed up. I made a fresh top down game and copy pasted the patrol gaurds over, so i’m pretty sure it’s something in my player character, where in the payer character blueprint is the logic for being discovered?

Hello, how is the toolkit’s compatibility with later versions of UE, specifically v5.3?

KR,

Andy