u/Citizen_Gamer

How to do something while something else is true without using a while loop?

How to do something while something else is true without using a while loop?

I have an enemy character that is on fire and I want the player to take periodic damage WHILE they are inside a radius (overlapping a collision sphere) and WHILE the enemy's fire effect is active (the player has the ability to put it out). But whenever I try to use a while loop it detects an infinite loop (which is the whole point!) and kicks me out. Here's how I have my blueprint currently:

https://imgur.com/a/BnLOHj2

How can I achieve a similar effect without using a while loop?

u/Citizen_Gamer — 5 days ago

Can't figure out why this cast fails in my child blueprint

I've recently learned about the pitfalls of casting and the benefits of using parent/child classes, so I've been reworking my enemy blueprints to cast to a master parent blueprint. In my blueprint component for tracking the enemies' health, I am initializing their health by casting to the parent class, getting the health bar widget, and then casting to the widget so that I can then make changes to their health bar. But the cast to the widget fails, and I don't understand why.

Here are images showing the components of my parent class, how the HealthBarWidget is set as WB_EnemyHealth, and where in the blueprint of my child class it fails: https://imgur.com/a/q7ZxpSY

u/Citizen_Gamer — 6 days ago

How to prevent my player blueprint from including assets from equipment?

I have recently been learning about Size Maps, and reducing the use of casts to keep file sizes smaller, but I have discovered that my player character, which is 1.1 GiB, is including over 800 MiB of information about my equipment, such as the textures for all of my swords and shields. It's inheriting this information through my equipment database, which is referenced in my blueprint component "Equipment System", which does a trace when I click to see if it hits a piece of equipment, and then casts to the equipment to add it to my character.

Is there a better way to do this, or is it not that big of a deal?

reddit.com
u/Citizen_Gamer — 8 days ago

Can someone help me figure out why this is failing?

Once this enemy detects the player, its supposed to use it's ability every 10 seconds, and while that's on cool down, move toward the player and melee attack them when they are in range. Right now, the AttackTarget task keeps firing over and over even though it's supposed to wait for the attack function to return the duration of the animation plus another 1 second delay. I have the check box for "ignore restart self" checked, assuming that would prevent it from triggering again before it finishes.

The strings being printed indicate the state of my "isInMeleeRange" bool, and when the attack task and attack functions are triggered.

youtu.be
u/Citizen_Gamer — 14 days ago

The way I have my enemy's behavior tree set up (see image in comments), the intention is that once it sees the player, it uses it's ability which then goes on a 10 second cooldown. While it's on cooldown, the enemy is supposed to move toward the player and once in range, attack. The idea is that they continue to attack until their ability is off cooldown, and then everything repeats. However, once my enemy reaches the player, they attack once, and then wait until the ability is off cooldown instead of continuously attacking. So their behavior goes:

Ability -> Chase - > Attack -> Wait for cooldown -> Repeat

But what I want is:

Ability -> Chase - > Attack -> Attack -> Attack -> Repeat

What do I need to modify to make this work as intended?

reddit.com
u/Citizen_Gamer — 17 days ago

I have a niagara effect attached to an enemy that spawns several fireballs that fly in different directions and then cause little explosions when they hit the ground. Is there any way to apply damage based on where the fireballs go? I tried:

On Component Begin Overlap (Niagara) -> Cast to First Person Character -> Apply Damage

But this doesn't appear to be generating overlap events based on a print string that never gets triggered.

reddit.com
u/Citizen_Gamer — 18 days ago

I have several static meshes for buildings that incorporate wood and stone surfaces with separate materials for each. I applied the appropriate physical material to each, but my footsteps and weapon attacks are applying the wood material effects to all surfaces. The static mesh itself has no physical material set in either the mesh or the mesh instance. Any ideas what could be happening?

reddit.com
u/Citizen_Gamer — 21 days ago

I am currently using "Event ActorBeginOverlap" and checking if the overlapped actor is a water body to determine when to play my water footstep sounds. However, sometimes it works and sometimes it doesn't, and I can't figure out why. Is there a better way? I'll post a screenshot of my blueprint in the comments.

I tried giving my water a physical material, which is how I'm determining all my other footstep sounds, but it didn't work either.

reddit.com
u/Citizen_Gamer — 22 days ago

This may be a dumb question, but is it possible (and advisable) to pre-load shaders when playing in the editor? The constant stutters and screen flashes when a new shader is loaded is really annoying.

reddit.com
u/Citizen_Gamer — 26 days ago