#blueprint

402296 messages ยท Page 413 of 403

crystal mural
#

Let me make a quick video ๐Ÿ™‚

sand hull
#

can anyone help me with online name tags?

hardy merlin
#

There's two steps to solving your problem. The first is making a consistent fire rate, so that the right number of shots are generated. The second is Interpolated projectiles, so that if multiple are fired in the same frame they don't all stack on top of eachother.

#

The first is easy, fortunately.

crystal mural
astral fiber
#

I got a mower, which has a collision box, and a foliage, which collision should I set to the mower, and which to the grass?

odd ember
#

@astral fiber I recommend reading up on blueprint communications listed in the pinned post of this channel

hardy merlin
#

@crystal mural I see. You want a consistent fire rate.

crystal mural
#

That's right.

astral fiber
#

@odd ember I did very much with blueprints, but the collision thing is new to me

hardy merlin
#

Okay let me think this through. You will want to do this using variables, and not using delays.

odd ember
#

exactly why you should watch that video

hardy merlin
#

@crystal mural Do you have a variable that sets the rat eof fire?

odd ember
#

because collision is how blueprints communicate

crystal mural
#

I do.

hardy merlin
#

Is it "shots per second" or is it "seconds between shots"?

crystal mural
#

One that can be upgraded. It's going to go all the way from 1 up to 400. But now that I see I'm doing it wrong, that max 400 might not be correct.

#

ms between shots. It's a Gatling gun.

hardy merlin
#

Milliseconds or seconds?

crystal mural
#

Milli.

hardy merlin
#

Ah, that will probably mess you up since most Unreal timing uses regular seconds.

#

You'd want something like 0.01 seconds per shot

#

Though honestly, counting up is easier.

#

So 100 shots per second is weaker than 200 shots.

crystal mural
#

Ja, but that would give me 100 per second right?

#

Yeah you got the idea.

dusky moat
#

guuuuys

#

me again with push problem

#

how do i push ai around, since i cant add force to capsule componet (it sais it`s not simulating physics and i cant turn it on obv) but appying impulse on it works but in suck unrealistic way, so how do i PUSH other pawn actor?

hardy merlin
#

Anyways, you'll need the following variables: Shots per second, and a float that represents seconds since last shot.

crystal mural
#

@hardy merlin If I do this properly then I can reconfig my whole upgrade tree to whatever max I can get it to handle.

hardy merlin
#

TimeSinceLastShot will be private.

crystal mural
#

OK, ja I'm listening.

hardy merlin
#

how are you testing if the player has shot?

#

a Keydown event?

crystal mural
#

I press space. Then the whole thing happens. It's a one tap, not a hold down.

#

Then a variable "firing" switches on to stop any more input for shooting.

#

So there is a certain amount of "bullets" too.

hardy merlin
#

Ah, so you want it to be a toggle instead of holding the key?

crystal mural
#

That's right.

hardy merlin
#

That makes things easier.

crystal mural
#

PPRRRRRRRTTTTT until the magazine is empty.

left bay
#

@crystal mural can't see your code, but you could do an Input key > Do once >Set timer by event with (1/fire rate) time while looping

crystal mural
#

Then he goes into a reload animation. Then you can fire again.

left bay
#

then check ammo count or input on release >reset do once node

crystal mural
left bay
#

I don't use While loops very frequently; what is the code NOT doing that you want it to (or doing what you don't want it to, I guess?)

crystal mural
#

@left bay I had the fire rate set to 400 per second. But when putting it down to 200 or even 100 it feels pretty much the same. So it's not actually firing as fast as I intended.

manic maple
#

Hey could someone help me understand why a simple hit event isn't firing?

#

I have this on a projectile

#

The projectile's collisions:

odd ember
#

have you set generate hit events?

left bay
#

@crystal mural fire rate variable is the amount of time before the while loop starts, I believe?

#

lemme open up ue4 and read the tooltip

manic maple
#

The character's collision:

odd ember
#

also

#

you're using overlaps

#

but event hit

#

event hit is for BLOCKING collision

crystal mural
#

My fire rate is how long to wait before doing the loop again. But that's obviously now wrong it seems.

odd ember
#

for overlap you have OnComponentBeginOverlap

#

I also strongly urge you not to use the custom collision preset, as it is buggy as fuck

manic maple
#

Okay, in that case I've set my collision on my pawn to block projectile, it's still not working.

odd ember
#

create your own collision presets in the project settings instead

crystal mural
#

The loop is spawning a projectile, counting up 1, and playing a sound.

#

When the count hits where it should be then the loop breaks.

hardy merlin
#

phone call, sorry.

crystal mural
#

Is it possible that this loop now isn't actually completing before the delay is over?

hardy merlin
#

Delay is weird. You're better off doing something like that on tick.

left bay
#

well ue4 is doing it's regular job and taking awhile to boot lol. What is the tooltip for the 'while loop with delay'?

crystal mural
#

Actually I think that's exactly what's happening.

hardy merlin
#

First, add a boolean variable for "Is firing"

crystal mural
left bay
#

ooooh

odd ember
#

uhh

hardy merlin
#

You want to avoid doing delays inside of loops. It causes all kinds of weird behavior

odd ember
#

why are you making loops with delays

hardy merlin
#

Here's what I would do:

astral fiber
#

@odd ember I read the article, I set both Collision to OverlappAll, but there is no Overlap which gets triggered

crystal mural
#

@odd ember For exactly this purpose.

hardy merlin
#
  1. On tick, check if "IsFiring" is true.
odd ember
#

no man

crystal mural
#

And here I am learning why that was a terrible idea ๐Ÿ˜›

odd ember
#

it absolutely is

crystal mural
#

HAHAHA!

#

OK check for firing on tick.

odd ember
#

best case it holds up the game thread, worst case it crashes the game

hardy merlin
#
  1. If so, add the deltaTime to TimeSinceLastShot.
#
  1. Calculate how many seconds should be between each shot, 1/fire rate.
odd ember
#

@astral fiber did you use the events? did you set the correct collision settings in the project settings?

#

collision is a two way street

#

both collision components need to be able to respond to each other

hardy merlin
#
  1. In a loop, if TimeSinceLastShot is greater than SecondsBetweenEachShot, spawn a projectile and set TimeSinceLastShot = TimeSinceLastShot - SecondsBetweenEachShot.
left bay
#

@hardy merlin would there be a reason not to use a looping set timer by event, with time as the fire rate variable inversed?

astral fiber
left bay
#

because that takes care of the timing without needing the timeShot variables?

hardy merlin
#

If you're already doing things on tick, it's much safer to resolve immediately.

odd ember
#

timers are framerate independent

left bay
#

this isn't on tick I thought; just on click?

odd ember
#

on tick is per frame

hardy merlin
#

Plus, keeping TimeSinceLastShot allows the fire rate to stay consistent across frames.

left bay
#

ah, FE

hardy merlin
#

IE if you have enough to fire 2.5 shots in a frame, the .5 will carry over

odd ember
#

@astral fiber did you go through the checklist I posted?

crystal mural
#

Thanks everyone for the help ๐Ÿ™‚ I'm putting this in a notepad for when I get up.

left bay
#

grug are you and Cranz not saying conflicting things though?

odd ember
#

how so

#

timers are framerate independent

#

tick isn't

left bay
#

ye but Grug said 'keeping TimeSinceLastShot allows the fire rate to stay consistent across frames'?

#

but if the timer is framerate independent then it should allow for consistent fire rate?

odd ember
#

he is using the tick event

astral fiber
#

@odd ember what do you mean with project settings? DO I have to activate overlap events?

odd ember
#

you have a project yes?

astral fiber
#

yes

odd ember
#

that project has settings yes?

astral fiber
#

yes

odd ember
#

so in those settings there is a collision page

left bay
#

ah oof I thought the code snippet he posted was in on input

crystal mural
#

Right now what I have is on input.

#

Click, space or whatever.

left bay
#

so wouldn't that mean NOT the tick event? .- .

hardy merlin
#

You

odd ember
#

well if it's gated or whatever

hardy merlin
#

You'll need to use both. OnPress to set the IsFiring bool, and tick to actually do the firing

crystal mural
#

Ah OK.

odd ember
#

but I do enjoy timers for their elegance compared to using event tick

left bay
#

yeah, so Grug's suggestion is use tick with time variables

#

mine is to use a timer to not need those variables, but they should both accomplish the same thing?

hardy merlin
#

I haven't done much with Unreal Timers, but doing things in tick is better for stuff that needs to occur really rapidly, like this machine gun.

left bay
#

hol' up lemme pseudo code this rq and see if I'm missing something,

crystal mural
#

My loop isn't finishing fast enough I think.

odd ember
#

@hardy merlin timers can trigger rapidly as well

hardy merlin
#

Plus he's eventually going to need to interpolate the projectiles so they don't stack on top of eachother, which requires deltatime info

odd ember
#

it's just a stand in event that can be called as fast as you want

#

framerate independent

#

you don't have to rely on the tick function

#

which I prefer not to

#

you can set your timer to be per frame as well

#

by using GetWorldDeltaSeconds

astral fiber
#

@odd ember I am looking through this page, I dont have any custom collision Object CHannels or Trace Channels.

I have the grass (Foliage, I guess Static Mesh) and another static mesh which gets crontrolled by a VR hand

hardy merlin
#

Sure, but consider this: You fire 10 bullets in a frame. By default, they will spawn on top of each other and reach the target at the same time. If you have the deltaTime info, you can offset each one a little bit to ensure they hit sequentially

#

I suppose you could use GetWorldDeltaSeconds. Didn't know that existed.

odd ember
#

@astral fiber you have that page, now look up what your settings are for the two elements that need to overlap

#

and adjust accordingly

#

BOTH of them need to have the same settings

#

so if one has overlap, the other MUST have overlap too

hardy merlin
#

@crystal mural Now here's the other big question: Why simulate them as projectiles if you're going to fire hundreds per second?

#

Why are they so slow?

crystal mural
#

I think here's the crux of the problem.

astral fiber
#

@odd ember thanks for your time.
I used the "OverlapAll" Collision for both of my objects.
The foliage has "OverlapAll" and the Collision box of the mower also has "OverlapAll". Sadly no overlapping event is triggered

odd ember
#

@astral fiber have you set them to both generate overlap events?

#

@crystal mural I would go ahead and delete that macro

crystal mural
#

It's a stylistic choice to have them go that slow. So you can see the line you're making. At the beginning of the game you only fire 1 per second.

hardy merlin
#

ah, okay

crystal mural
#

Wait, what's my excel sheet say....

#

LOL ja 1 per second.

left bay
astral fiber
left bay
#

I believe glowbeard mentioned wanting it to be modular; this uses variables that set the fire rate, max bullets, projectile to fire, sound to fire, and cooldown/reload time

crystal mural
#

@left bay Thanks, I'm checking it out now.

left bay
#

that means if they wanted to have multiple weapons or a tiered upgrade system it would just be applying a modifier on the corresponding value, and if you have multiple weapons each can have their own default values (higher fire rate, but lower ammo size for instance?)

hardy merlin
#

That looks decent. The only thing is that having variables for things like IsFiring and TimeSinceLastShot allows other systems to inspect those values.

crystal mural
#

Nope, I just have the one weapon.

#

I'll be changing its appearance throughout the levels though.

left bay
#

yeah, and if isFiring is used as a variable for animations and what not it makes sense to be passed in. timeSinceLastShot could just be added as setting the value via event tick

crystal mural
#

@left bay I think this will solve it. The delay isn't dependant on waiting for the projectile fire to finish!

astral fiber
left bay
#

like so @hardy merlin ? I normally encapsulate deltaSeconds from Tick but if you just grab the node reference and drag it to wherever you want to set that variable

hardy merlin
#

Urgh, that is one nasty screenshot

odd ember
#

@astral fiber you need to find the GenerateOverlapEvents for foliage

#

I can see it's not there

hardy merlin
#

NEVER use variables from different execution paths

left bay
#

oh also @crystal mural Decrement and Increment (the -- and ++ nodes) already set the variable; earlier you had an increment and then set

#

the SS is via snipping tool but I didn't feel the need to reupload the code. Also, why? I've found that the variable is recalculated whenever the reference pulls from it

hardy merlin
#

Also, you have to Add delta time to Time Since Last Shot, rather than Set

left bay
#

if you added wouldn't it just get infinitely large? (+~.0167 every time)

#

because deltaSeconds is already time since last frame, ye?

odd ember
#

where do you get 0.022 from

crystal mural
#

I've implemented the code from @left bay and WOW does the game stutter!! HAHA!

odd ember
#

lol

left bay
#

thought that was off the top of my head the time of one frame (1/60?)

#

so the timer is more performance heavy?

odd ember
#

1/60 is .0167

crystal mural
#

So it's calculating it correctly but it's heavy.

hardy merlin
#

Every time you shoot you decrease TimeSinceLastShot

#

Maybe I didn't explain well

astral fiber
#

@odd ember AH ok, where can I find this event?
Normally I use the Collision Events on the Details Panel and connect them with the blueprint

hardy merlin
#

I usually work in C++

crystal mural
#

oh also @crystal mural Decrement and Increment (the -- and ++ nodes) already set the variable; earlier you had an increment and then set
@left bay OMG REALLY!!?

odd ember
#

@astral fiber it's a tickbox

crystal mural
#

Damn there's a LOT I've got to fix then ๐Ÿ˜›

odd ember
#

if it's not there it's not there

#

maybe you can't do it on foliage INSTANCEs

hardy merlin
#

Okay, rename "TimeSinceLastShot" to "TotalFiringTime"

#

Oh wait, it can work better if reversed.

#

Let me write some psudocode

left bay
#

I'm just a student for game design so scripting isn't my forte; always good to learn more. o 3o

odd ember
#

just spell out how many frames you want, multiply that by (1/60) and done

left bay
#

and glow if the problem is from instantiating the sound and projectiles, you can look at object pooling

odd ember
#

if you're doing game design you should really know scripting

#

like in and out

left bay
#

if the projectiles move really slow then they may also be colliding w/ eachother.

crystal mural
#

I've got their collides set correctly, they ONLY interact with the bouncing walls and the enemy.

left bay
#

ye we look into C# and visual scripting but so far I don't think I've been wrong other than the frame rate calculation? Can only learn so much in a limited time when the focus of the program is <20hrs of blueprinting a week. What would you consider 'knowing scripting like in and out' to be?

hardy merlin
#

Whoops that's wrong

astral fiber
#

@odd ember I added a box collision to the static mesh which the foliage uses, but the foliage still seems to have no collisison. Where can I find this checkbox?

hardy merlin
#

Shit I messed that up

odd ember
#

@left bay knowing correct architectural structures, being aware of frame rate based actions, knowing inputs, knowing delegates. have a cursory knowledge of math at the very least

hardy merlin
#

Clearly I need to focus

odd ember
#

then you can add to that areas of focus like camera

left bay
#

definitely know inputs and that tick is frame-rate dependent, we haven't touched delegates at all though.

#

is it only for the C++ scripting?

odd ember
#

event dispatchers

#

same thing different name

hardy merlin
#

Unreal blueprints use the word "Event" too often in conflicting meanings.

left bay
#

haven't used event dispatchers either based off of the ue4 docs; haven't had a use for 'em yet, what're they typically used for?

odd ember
#

and by inputs I mean you should be able to set up events that cater to different inputs, like double click, analog controls etc.

#

you should be aware of the ergonomy of a controller vs. keyboard as well and take that into account

#

but that's less scripting

left bay
#

yeah we've had a few discussions on platforms and control schemes and whatnot, but we haven't made any games advanced enough to require analogs or double clicks; I'd suspect analogs use trig and/or InputAxis, and a double click could be simply made via a retriggerable delay? Cool stuff to look into though, thanks for the info!

#

also @crystal mural 'fixing' (IE streamlining) has been something I've done a lot for our group projects, but if you're mucking about with stuff and testing the advice I was given is to just make it work first, before you worry about refining. If the Timer is too performance-heavy, you can try with Grug's logic (tick check)

crystal mural
#

Thanks for the help again. Now that the fire rate is correctly working I feel like I need to fiddle with some numbers. I put it down to 50 and it still "feels" the same but it's not suttering. It's bed time. Close to 2am here!

left bay
#

dunno if it'll work better or if there's something else killing performance though.

#

aighty aight have a g'night.

crystal mural
#

Cool, I'll give it a think tomorrow ๐Ÿ™‚

hardy merlin
#
{
    fTimeAvailableToFire += deltaTime;
    
    float fTimeForSingleShot = 1/fShotsPerSecond;
    
    if (bShooting)
    {
        while (fTimeAvailableToFire >= fTimeForSingleShot)
        {
            fAccumulatedFiringTime -= fTimeForSingleShot;
            ShootABullet();
        }
    }
    
    // Clamp time available for firing to no more than one shot.
    if (fTimeAvailableToFire > fTimeForSingleShot)
    {
        fTimeAvailableToFire = fTimeForSingleShot;
    }
}```
#

Fixed it.

#

Fixed it.

#

not quite perfect but it;'s coming

astral fiber
#

@odd ember Can you please tell me were I can find this "GenerateOverlapEvents " checkbox?

odd ember
#

@astral fiber like I said it might not exist on instances of foliage

#

read up on it

#

use google

crystal mural
#

Thanks @hardy merlin I'll check it out tomorrow.

#

Thanks @hardy merlin I'll check it out tomorrow.

timid lotus
#

Hey folks, I'm having a slight issue I can't debug - been at it for over an hour ๐Ÿ˜ฆ I'm trying to make "fixed" (predetermined) bullet spread patterns for my shotgun pellets. I've tried a number of different options, and this has by far worked the best - it works perfect actually, adds 5 degrees to each direction and makes my bullet trace go up and to the right. Only issue is, when I look 100% down or 100% up, it completely changes... move the mouse slightly away from 100% up/down and it works fine again, and I can't figure out why :\

#

Sorry for the duplicates, Discord was having an issue..

I also tried this, which almost works perfectly. The yaw adjustment however falls off the further up/down you rotate the camera - the pitch offset works perfect and the yaw does when the player faces straight ahead, just yaw falls off as you look up/down

#

(in both examples, the in vector is the player's "look at" vector)

odd ember
#

@timid lotus because of gimbal lock

#

use quaternions

#

and you won't have an issue

fathom portal
#

MFG quietly googles quaternion

odd ember
#

if you want to know what math hell looks like, it's definitely quaternions

fathom portal
#

MFG has left the chat

#

lmao

timid lotus
#

@odd ember thanks! Given that I had never heard of quaternions before your message, any tips on how I'd go about setting up the formula? :P I'm assuming they're generated from rotators?

odd ember
#

lol nope, no tips

#

that stuff is hard math

#

I barely know it myself

#

but good luck

#

honestly if it's only an issue while at gimbal lock I'd say it's probably worth living with?

analog ice
#

I have a ledge grab and climb setup using 2 sphere tracers, one for the ledge's height, and one for detecting the wall's forward normal. It works well enough for static meshes, but I'm trying to set it up to work with moving platformings as well. When I attempted to create a loop where the "move component (player capsule) to" keeps updating, it sort of works, but very poorly. Does anyone have any ideas of a more effective way of doing this?

#

My best guess right now would be to find a way to have it detect whether the ledge actor is a mover, and if so have it temporarily attach the player to the actor. It's the part of the detecting whether the wall's actor is part of a mover that I'm completely lost on.

#

Is a sphere trace capable of detecting if the collision is with a mover?

timid lotus
#

@odd ember thanks for the information anyway :) I'm off to read up on them and try to figure it out haha

#

@odd ember last question, you don't happen to know the issue with my second screenshot do you?

#

That issue honestly seems easier to fix ๐Ÿ˜›

#

I think I'm just missing a small thing

odd ember
#

I can't tell what is happening just from the nodes

#

I'd try experimenting

timid lotus
odd ember
#

perhaps use Acos instead of Atan

timid lotus
#

basically the +5 to the Atan2 result is applied to the yaw fine at 0 pitch, but the closer pitch gets to 1.0 or -1.0, the yaw adjustment seems to fall off

#

It's as if the +5 is being inverse scaled by the absolute value of the pitch

#

ie. when pitch = 0, +5 is intact, but when pitch = 1 or -1, +5 is completely cancelled

odd ember
#

do you know what the nodes do behind the scenes?

timid lotus
#

It's been a while since I covered sin/cos/tan etc in school so I'm a little rusty, but in general, yes

odd ember
#

they're all inverses so they take a position along the unit circle as a parameter and spit out a euler angle that corresponds to the angle between the position and the x or y axis

last stump
#

Any idea why this is showing up..? it wasn't earlier

#

if i set it to static, then i can't move it..?

hollow cape
#

nope

last stump
#

but why is this showing up

#

it doesn't do it for my other objects, just this one..?

timid lotus
#

You're trying to attach a static mesh to a nonstatic mesh, you should be able to make the static mesh (Box) nonstatic

hollow cape
#

because you're trying to attach something to something that is static?

#

or vise verse. Either way, make it moveable, error goes away

last stump
#

OH

#

i didnt even see that

#

i didnt see my box was static as well

#

fkn parenting got me fucked up for a second

hollow cape
#

๐Ÿ‘

last stump
#

i was so confused

timid lotus
#

@odd ember the part that's messing me up is the yaw parameter being reduced by the pitch value :\ I was a long, long getting the math right on this part, I'm honestly stumped :\

last stump
#

i had it set to movable, but i guess this BP messed up and got set to staic without me even realizing it

odd ember
#

@timid lotus well consider using acos instead

hollow cape
#

@timid lotus this isn't exactly a pretty solution....but can you just figure out if you're gimbal locked, if you are, add a small value, then process

odd ember
#

ah yeah

#

that's actually a good solution

timid lotus
hollow cape
#

instead of complicating things, just add a degree if you're gimbal locked

timid lotus
#

hm

hollow cape
#

or subtract

#

whatever, do math

odd ember
#

@timid lotus I mean take one value into acos, not both

timid lotus
#

actually maybe I could just clamp the pitch value on the rotator

hollow cape
#

yeah that

#

do that

odd ember
#

or learn quaternions

#

๐Ÿ˜…

timid lotus
#

I was reading about them... man they're confusing

hollow cape
#

nobody needs to know math to make games. the hell are you talking about cranz

#

lol

timid lotus
#

It's not often I find a math concept in gamedev that I've legitimately never heard of before

#

I may not fully understand it, but I've legitimately never even heard of quaternions before today

hollow cape
#

in all honesty, learn them

#

it helps

odd ember
#

you'll solve all your rotation issues indefinitely

hollow cape
#

also clamping should work too....at least i gets it "just working"....until the next bug lol

timid lotus
#

what's throwing me off with quats is I can't seem to make them from rotators, just from vectors

odd ember
#

yep

timid lotus
#

so I'm making a quat from my player's forward vector, but then what am I supposed to do with it

hollow cape
#

yep

odd ember
#

the question you're asking is "what is the rotation between vector A and B"

rough wing
#

Why can't I possess my pawn?

hollow cape
#

because that's an actor

#

it needs to inherit from pawn

timid lotus
#

because you need to cast it to pawn (or a class that inherits from pawn) first

rough wing
#

It does

hollow cape
#

then cast to pawn

rough wing
timid lotus
#

not that reference doesn't

rough wing
#

oh

#

thank you solved it

timid lotus
hollow cape
#

@timid lotus For quats, trying to learn it in editor by just messing around is going to be really difficult. It's best to look up some tut videos or documents related to quats first. Get your head wrapped around it, THEN experiment in editor

#

Just my 2 pesos

timid lotus
#

Yeah :\

tired wolf
#

Does anyone know how to have different vault animations over the same object based on if you are running or not?

hollow cape
#

....what?

#

oh vault animation, like jumping over something. I was thinking vault like...you have animations in a vault and you pick a random one

elder crypt
#

I mean if you are using charactermovement from UE4 you can tell if a player is running or not

#

Or at least you should be setting the movement speed somewhere, use that

rough wing
#

Can I possess a character then?

hollow cape
#

anything that inherits from pawn, you can possess

#

and the character class inherits from pawn

latent shadow
#

Does SphereOverlapComponents return components that are part of a bp that would be in that location?

timid lotus
#

Unfortunately it looks like the clamping isn't working ๐Ÿ˜ฆ

#

Sorry, isn't fixing the issue - the clamp itself is working ๐Ÿ˜›

timid lotus
#

I noticed the Random Unit Vector in Cone in Degrees BP node doesn't suffer from gimbal lock ๐Ÿ˜›

#

I suppose Epic is using quats in that node

#

I wonder if I could be using curves for this... hm

tribal axle
#

I have a traceline that sets a material when it hits an actor, and i added a flip flop so it changes the material every time the trace hits it. But for some reason, I aim my trace line, it changes the material, then I pull the traceline away and touch it again, it starts rapidly changing, and it's random whenever I pull the trace away.

true valve
#

Hi - Is there anyway to get New Anim to Play in Play Animation from a variable?

gray atlas
marble tusk
#

Well for one, Make Relative Transform seems to actually have a description, but the other doesn't

gray atlas
#

Hence my confusion... ๐Ÿ˜ฆ

dapper kiln
#

They use different words. alex

#

Oh lol too much... Sorry

plush ridge
#

Anyone know how to get around this? Character's feet sink into the floor when halfway between Idle and Walk animations in the Blendspace.
I know IK is an option but I feel like it doesn't address the problem

#

Walk to Run transition works fine. All animations in this blendspace are from the same anim pack from the marketplace

#

It happens to all of my blendspaces (all of them using animations from their own anim set)

late cave
#

I feed a variable into a function which has the parent class of a widget as its variable type... in that function I want to assign a child class to it instead... is that not possible?

surreal peak
#

Can you show that?

silver bolt
late cave
surreal peak
#

What exactly does that Value pin expect?

#

Like, what type?

#

Also does it make sense to set the Parent ref like this? Shouldn't you rather call "AddChild" on the new Widget, passing in the old?

late cave
#

ok... my use of parent child in this case is wrong... it should be subclass instead of child... but I'm too much of a newbie to know what a "parent class" is called

#

what I want to achieve is the ability to stuff any child class I happen to create into a variable that doesn't care what it contains

#

because whenever I use that variable, I use casting

#

but I don't know how to set it

silver bolt
#

I think you need to rethink this, what are you trying to achieve in practice? Technicalities aside

late cave
#

what I said... the ability to put any number of child classes into the same variable (and then determine what it is by casting)

silver bolt
#

I mean, what UI are you trying to make?

late cave
#

just a bunch of menus... all saved to a single variable, because only one of them can be visible at the same time, so I want to use the create/destroy way of displaying them instead of the show/hide

silver bolt
#

I suggest creating them and storing them in a different way, in a map for example

#

then you have a reference to your menu and can destroy it whenever

late cave
#

displaying them is not my issue

#

that works

#

only storing them in a single variable is

#

that's where my problem arises, because I don't know the syntax or type of variable to choose

surreal peak
#

You can make a UserWidget variable

#

That is the ParentClass of all Widgets you can create.

#

That should be able to hold whatever menu you want to save in it.

frail plaza
#

I have multiple characters with varying stats which I'm storing in an Enum/Struct map and I'm trying to use Data Assets to store base values for each one but I'm having trouble finding the right nodes to extract the info from the data assets like you can from data tables using Get Data Table Row. Can someone point me in the right direction, please? ๐Ÿ˜„

surreal peak
#

The problem with Inheritance in UMG is that the actual UI part is limited to one Widget.
So if you make a Widget, create UI in it and then make a child class of that and you want to extend the UI, then you will notice that it doesn't want that.
You can however, if you want, make a "WB_Menu_Base" class and NOT add any UI elements to it, only code, variables, functions and then inherit from that for all your menus.

#

Then you can save the menus in a WB_Menu_Base type variable

#

Parent and Child in Inheritance is not the same as Parent and Child in a Widget Hierarchy.
So maybe that is confusing you? @late cave

late cave
#

@surreal peak I should not have used those words, sorry for the confusion... yes, I'm doing exactly as you say, a base class with no ui, only functions, and the subclasses contain the visual stuff

surreal peak
#

@frail plaza DataAssets are basically just classes that you can't instantiate.

#

So you can make a DataAsset Variable, put your DataAsset into it and then cast to the specific DataAsset class to access those variables

#

Or you make the DataAsset variable of the correct type to begin with and save on the casting

late cave
#

I'll look over my exact project tonight and see if changing the variable to userwidget makes a difference, otherwise I'll post a screenshot from my real project when I get home instead ๐Ÿ™‚ thanks!

frail plaza
#

@surreal peak Thanks so much!

surreal peak
#

One more note that might help understanding a DataAsset, in case it's still a bit foggy: You can compare them to a Texture, Material or Sound. Just that the info in there is not some art or audio but the data you defined.

frail plaza
#

Thanks, that does help clarify a little more.

frail plaza
#

@surreal peak https://puu.sh/FceK7/849fc29c62.png
The table is just basically display names as rows tied to their base stat data asset. Is there a simpler way to go about this? Or would this be an acceptable way to go about setting base stats for 20-50 units?

amber marsh
#

Dumb question.
If I have a save game data with a fairly large number of characters. And each of those characters have an inventory of items.

#

How do I save the inventory of each character?

#

Its like I need array of arrays

viscid skiff
#

I have a weird question for someone

#

Basically I have run a line trace by channel every tick to see where the player is looking, and it works great

#

Only problem is I get these errors?

#

Should I ignore them..

#

Other half

valid tide
#

How to get variable from child actor and set it?

unkempt harbor
#

Hey guys, anyone on 4.24 and finding that the "Adjust Volume" node no longer works?

#

I'm finding none of my adjust volume works anymore which kinda sucks because thats what we primarily use to fade in/fade out

#

If i'm missing something obvious, any pointers in the right direction is greatly appreciated ๐Ÿ™

timid lotus
#

@amber marsh would a map be appropriate for you?

trim falcon
#

What is the difference between macros and functions?

odd ember
#

macros are shortcuts, functions perform... functions

trim falcon
#

Which is better in certain situations?

odd ember
#

there's no real comparison between them

#

they do different things

trim falcon
#

Thanks alot !

outer zephyr
#

@unkempt harbor For me this still works in 4.24. Alternatively you could use FadeIn and FadeOut nodes

unkempt harbor
#

Huh, thats weird. Maybe its the specific engine version i'm using

odd ember
#

have you checked that you're referencing the correct sound too?

pastel rivet
#

Is it possible to change variables of an unspawned object? etc i have an actor, but i want to change its variables before next level is loaded, where the actor is placed

cyan lion
#

@pastel rivet if its placed on level you can set it as Instance Editable and set it for each actor on scene, if you want to set value for spawned actor you need to check Instance Editable and Expose on Spawn

pastel rivet
#

But yeah i cant spawn these actors dynamically sadly, as all their options are not exposed

#

so it will have to be an placed actor

#

but thanks, ill try to see what i can do here

cyan lion
#

so all you need is instance editable and set all values on scene

pastel rivet
#

so i need to edit the variable with those settings on, but it needs to happend at event begin play of that level?

#

and this will happend before the constructor?

#

@cyan lion

#

Tried it, and that doesnt work, its output is now 0, cant get the variable set before the constructor

jade gull
#

are nested arrays of structs a bad idea?

#

for example, if i made an array of a struct, within which one of the variables is an array of another struct

thorny cedar
#

Blueprint Runtime Error: "Accessed None trying to read property K2Node_DynamicCast_AsBP_Interactive_Engine_Part_1". Blueprint: BP_EnginePartHolder Function: Execute Ubergraph BP Engine Part Holder Graph: HighlightHolderMesh Node: Branch

#

but it worls how intended

pastel rivet
#

its prob your casting that is not valid?

#

dont need those valids on the first one there @thorny cedar

#

can place them on the last ones "casting" ones

thorny cedar
#

what do you mean exactly with the last sentence

pastel rivet
thorny cedar
#

i have some objects i wanna higlight when i grab or hover some objects

pastel rivet
#

but thats likely the error your getting, try resolving that first, but as it seems, how are you trying to achieve this?

livid dawn
#

Is it possible to make actors let click events go through? I have a board game where the tiles of the board can be selected by a mouse click. if there's something standing on the tile the click is not received.

thorny cedar
#

comparing the integer of a bitmask

pastel rivet
#

@livid dawn you can remove collision?

#

turn off*

livid dawn
#

@pastel rivet yes, i don't need collision. would that help with mouse input?

pastel rivet
#

havent tried it, try it ๐Ÿ˜‹

jade gull
#

go through as in to succeed or go through as in to ignore and continue on?

livid dawn
#

@pastel rivet it's surprising, but it seems to work. thanks

#

@jade gull go through as the tile below the actor would receive the click event instead of the actor clicked

thorny cedar
#

@pastel rivet still so many erros

#

same error

keen bay
#

Hey guys! Having an issue with navigation mesh. If anyone could take a look at this video and offer some suggestions I would greatly appreciate it!

fathom portal
#

@keen bay Great video, covered everything you tried, had an example of working vs non-working, wow

#

Most people give a generic "Please my shit is broken how do" without proving any additional information

keen bay
#

Most people aren't serious about Game Dev. I am โค๏ธ

fathom portal
#

Oooooh shade thrown

#

My first thing would be to go to your nav mesh and show it

odd ember
#

GOTTEM

fathom portal
#

Right?

keen bay
#

Sure thing, sec

wintry schooner
#

hey guys im trying to do a stronger zoom for the character when he aims his weapon in ALS V4 but i dont know where to start?

fathom portal
wintry schooner
#

i cant even find the camera??

fathom portal
#

@wintry schooner the camera should be "childed" to the spring arm inside your character blueprint

keen bay
#

I think I found the issue. Will let ya know

fathom portal
#

Sweet, ok

keen bay
#

I should have known to do that to begin with lol. But I was getting frustrated

fossil linden
#

if you have troubles with nav mesh, always delete the recast nav mesh and rebuild the nav

fathom portal
#

Sure, no worries. It's on my list of things to build a navmesh at runtime, so maybe you can help me when I get to that heh

keen bay
#

I just had to change the cell size on the NavMesh

#

Thanks bud!

fathom portal
#

To smaller, so it gets inside the small tile?

pastel rivet
#

@thorny cedar screenshot the error

thorny cedar
#

@pastel rivet i think i got it

pastel rivet
#

Do share!

fathom portal
#

@pastel rivet What program are you using to make those sexy-ass arrows:

#

Mine be like

thorny cedar
#

dont know if this a secre solution

keen bay
#

@wintry schooner Start on Youtube my dude

thorny cedar
#

don't know ig this is a good solution @pastel rivet
maybe check if my hovered actor are correct?

fossil linden
#

import the screenshoot in substance painter for arrows ๐Ÿ‘Œ

fathom portal
#

Ah, ok

jade gull
#

are nested struct arrays a bad idea?

fathom portal
#

@jade gull Not at all, unless you're going like 7+ deep

jade gull
#

ok cool, is just 2 deep lol

fathom portal
#

Yeah, that's fine. I've got like 5-6 deep, and that's probably as far as I would recommend taking it

jade gull
#

i did try in the past in like...4.14 maybe, but had problems with the inner array so thought i'd ask how it is now xD

pastel rivet
#

@fathom portal lightshot

fathom portal
#

I mean, it gets hairy the further you go, you just gotta make sure everything is commented and structured to work instead of hastily thrown together and the first thing that works

#

Ah @pastel rivet, So lightshot or @fossil linden suggested substance painter

#

I usually just use snipping tool because it's fast

jade gull
#

tbf its just meant to be a data sorting app so shouldnt be too bad hopefully

fossil linden
#

substance painter would be a overkill xD

pastel rivet
#

@thorny cedar if it works, thats alright, just do valid checks.
I would have considered making and atoring those casts into variables in the bp

#

@fathom portal why the hell would you use substancepainter for screenshots or arrows ๐Ÿ˜‚ install lightshot, hit printscreen there you go

fathom portal
#

Hey man I don't know, I just work here

#

I'm just here so I don't get fined

pastel rivet
#

๐Ÿ˜‚

#

@thorny cedar how often do you call this?

thorny cedar
#

When my pawn is overlaping with a box in my grabable object

#

then it highlights all spots of interest

odd ember
#

is it multiplayer?

thorny cedar
#

nope

odd ember
#

show your code then for the overlap

fathom portal
odd ember
#

lol

fathom portal
#

I wish discord had an awards system like the forums do

odd ember
#

put in server feedback

#

a bot would be useful for that

wintry schooner
#

@fathom portal so where would the camera that should be "childed" to the spring arm be located usually its in the main BP but for some reason i dont see it

odd ember
#

what would you consider to be the main BP?

fathom portal
#

@wintry schooner Most of the time it should be inside your Pawn:

#

Under a camera boom/spring arm:

wintry schooner
#

yes exactly it should usually be there but this is specific to the V4 ALS bp

fathom portal
#

Can you screenshot the component section of that BP?

odd ember
#

I have no idea what v4 ALS is

fathom portal
#

Me neither, but we're getting there lmao

wintry schooner
fathom portal
#

Is there a camera being added at runtime or something?

odd ember
#

looks like you need to add the camera yourself

fathom portal
#

What's in the "BPI Get Camera Pa..." function?

wintry schooner
#

there already is a camera @odd ember what i want to do is be able to change the positioning of this camera (increase its zoom when the character aims his weapon)

thorny cedar
#

@odd ember im changing my call to a event that is called, when i pick up my object, then it calls to highlight all spots. Seems more efficient

odd ember
#

@thorny cedar but... wasn't that your issue?

#

@wintry schooner yeah I see there is some camera system going on

wintry schooner
#

The way ALS has it programmed just seems alot different then what i usually work with @fathom portal

odd ember
#

you should probably show us what's inside

thorny cedar
#

my problem was that my casts failed and accessed none

lament junco
thorny cedar
#

somehow i got this to work, but calling at event tick seems unefficient

wintry schooner
fathom portal
#

@lament junco "Armor" seems to be a float (a number that can have a decimal) variable

odd ember
#

@thorny cedar yeah if you wanna paste your code I can take a look

#

but talking about it without seeing the code isn't really something I can help you wiht

thorny cedar
#

@odd ember give me sec

marble tusk
#

@lament junco Drag a variable out from the variable list and choose set

thorny cedar
lament junco
#

ah thank you!

jade gull
#

is it possible to change variable type based on enum? only way i can think to explain is like the =Indirect function in excel

odd ember
#

@thorny cedar you shouldn't execute class specific logic on cast fail

thorny cedar
#

yeah thats what i thought. do you have a work around?

odd ember
#

@jade gull you could always use a switch

#

@thorny cedar it's not really clear why you're casting twice to... the same class in the first screenshot?

thorny cedar
#

i have two Interactors in my Pawn

odd ember
#

also since I can't see how you performing the "hover over" I can't tell you what's wrong there

#

well show those as well

thorny cedar
#

i though i have to cast for each Left and Right?

odd ember
#

I see

#

I still don't know your logic for how you hover over

#

you're not painting the entire picture

jade gull
#

@odd ember its for a data table, was wondering if its possible to filter one enum's options using another enum current selection (finally thought of how to word it properly)

odd ember
#

not really

thorny cedar
jade gull
#

eh oh well, just a bit longer on the input lol thanks for replying

thorny cedar
odd ember
#

pretty sure there's a better way of doing that

#

but again, where is it called from? how do you get the array of actors to hover over?

thorny cedar
#

at event tick in my Interactor

odd ember
#

that's a lot of things to be doing on tick

#

can you show me the interactor code?

thorny cedar
odd ember
#

the best way to refactor this would be instead of using event tick, only execute logic when there is an overlap

#

instead of asking per frame to return all overlapping actors

thorny cedar
#

so call this function from my actor that i can pick up when my Interactor overlaps with iit

odd ember
#

but why aren't you just creating a collision component for your interactor

#

and use OnComponentBeginOverlap

thorny cedar
#

im still using the VRContentExample from Mitch that i found and adding the parts that i need

odd ember
#

I don't know who Mitch is

#

but I can't imagine this is how he set up collision to be

thorny cedar
odd ember
#

so is there any reason you couldn't use a trace that hits the object that you are "hovering" over or use a collision shape to overlap?

thorny cedar
#

not really

#

seems simple

odd ember
#

I recommend using that instead

#

because I think a lot of the errors you are getting are from the setup you are having

thorny cedar
#

will keep that in mind!

odd ember
#

and simplifying the setup would make it easier to debug

#

you can do something like a visibility trace on tick

#

per interactor

thorny cedar
#

yep i will sort out the function that i need and then try to simplify

odd ember
#

and whatever they hit (it's going to be a single actor), you can highlight

thorny cedar
#

the highlighting is for the spots i can put in a object

odd ember
#

it doesn't matter

#

under the hood it's the same interaction

thorny cedar
#

raycasting in all direction?

#

ahh

odd ember
#

well no, from facing direction

#

or rather, from where the interactors are, forward

thorny cedar
#

so they only highlight when the user sees them anyway?

odd ember
#

first things first

#

the interactors are physical objects in the world yes?

thorny cedar
#

yep

odd ember
#

yeah so they will have a forward vector

#

you want to multiply that forward vector by however long you want the trace to be then add them to the location of the interactor, respectively

thorny cedar
#

got it

odd ember
#

that's your trace

#

initally just getting it to highlight is the first step

#

but it should be a lot easier since it's only one actor that will be highlit at a time

#

so you were talking about how it is "spots" you're looking for and not visible actors

#

you probably want a new type of trace then in your project settings

#

I guess you can call it something like "highlightable"

thorny cedar
#

yeah i allready done that in the past

#

i did sth like opening a door when the player views on it

#

new tracechannel

odd ember
#

so whatever you want to highlight, you need to make sure has highlightable to block

#

so you can create something like a sphere collision with highlightable on block

thorny cedar
#

but it will only highlight when my trace is hitting my actor, right?

odd ember
#

and test it out against taht

#

it will only register collision with highlights, yes

thorny cedar
#

if my forward vector is sth like (1,1,1) and starts from my interactor location it is a simple line

odd ember
#

what is a simple line?

thorny cedar
#

my trace

odd ember
#

it will always only be a simple line

thorny cedar
#

tracing in the direction of the forward vector

odd ember
#

yep

thorny cedar
#

when my trace is attached to my motion controller it will only highlight when it overlaps with the to highlight object

odd ember
#

yep

thorny cedar
#

understood

#

thats not what i want, but would have done it that way. OK i want sth like i pick up a tire and all four wheel suspension are highlighted while i overlaรผp with my tire or hold it

#

Thank you for your explanations ๐Ÿ˜„

fathom portal
#

Hey friends, I'm getting a compiler error:

#

Basically, after updating to 4.24 my blueprint is yelling at me that what I was using before isn't valid anymore. Which is fine, but after removing all instances of that variable (replacing it with the new, valid "Tile to AHHHHHH" variable) I'm still getting compile issues

#

The original variable no longer exists (as proven by the left side "Tile to" search I'm running)

#

But the interesting thing is if I control+f for "Tile to", it does say the original variable exists in two places, but when double clicking those to try to get to them it doesn't go anywhere:

#

When attempting to see if I can use said variable (right click on open blueprint area and typing), it doesn't show up either:

#

I've:

1: Deleted every reference variable to the original TMap variable
2: Right clicked the blueprint and selected "Reload" under "Asset Actions"
3: Closed and reopened the project about a dozen times
4: Duplicated the blueprint (Same errors)

odd ember
#

@thorny cedar then you're after the same thing?

#

I mean it doesn't sound any different at all

#

if you want to highlight them on pickup you can do that too, then you don't need to do a trace at all

#

in either case, you don't need the current logic you're doing

#

@fathom portal exit editor, delete intermediate folder, see if you still get issues

fathom portal
#

@odd ember Attempting

#

@odd ember Same errors. I'm going to delete everything unnecessary and rebuild the project file

odd ember
#

have you fixed up redirectors?

fathom portal
#

Yessir

#

Or maam, you know

#

Yes person

odd ember
#

being*

fathom portal
#

Yes being

#

Deleted the saved folder and the intermediate, same errors

odd ember
#

that's all I got, other than redirectors

#

well, actually, try deleting the variables and recreate them

fathom portal
#

That's the thing, the variable doesn't show anywhere

#

In the variable panel it doesn't exist, when I search it comes up with two values, but they don't lead anywhere when clicked/double clicked

odd ember
#

they aren't by chance cpp variables?

fathom portal
#

5: Duplicated the functions that used to have these variables and deleted the originals, no change

#

@odd ember I'm 99% sure they're not but let me double check

#

Nope, I have no cpp variable or function that contains the word "attached"

#

It sucks, this is the last error that came up with when I updated

#

Like I'm so close

#

To fix this issue I duplicated the project to avoid corruption and loss, went into the autosaves of my original project, replaced the MainInstance asset with the autosaved version, and replaced all the nodes that needed replacing.

#

Any idea what they're talking about?

odd ember
#

no idea

fathom portal
#

Is that just version control back to a past version?

odd ember
#

I guess that person may have had an autosaved version somewhere

#

but idk

thorny cedar
#

@odd ember how would it highlight several objects at once? Just highlighting all objects of the same type?

odd ember
#

yeah I mean if you already know what to highlight, make it event driven

#

like on pickup -> highlight these 4 objects or whatever

thorny cedar
#

Too simple

odd ember
#

so on pickup -> allow these objects to be highlit?

thorny cedar
#

Where would I do that? In my level blueprint, or where do I get the information to all objects?

odd ember
#

well what do you want to do

thorny cedar
#

As long as i overlap with an object i want to highlight the spots where I can store the objects.

odd ember
#

only when you overlap? not when it's picked up?

thorny cedar
#

Both I thought overlapping includes picking it up

odd ember
#

not necessarily

#

I don't know your setup

#

some games overlap to trigger an interaction prompt first

#

so you overlap first, then pickup as a separate player action

thorny cedar
#

Just give me a idea how you would create a solution to my problem :)

#

Then I can try to adapt to it

odd ember
#

if it's on pickup

#

then just highlight the 4 things you want to act as "spots" on pickup

#

same with overlap

#

if you only want those to be active when you pick up

#

then activate them on pickup

#

or overlap

#

same logic

thorny cedar
#

Can I do it with an event dispatcher?

odd ember
#

we can get into the details in a sec

#

but tell me is that what you are looking for?

thorny cedar
#

Yes that's what I'm looking for. Highlighting when I pick up or overlap with it.

odd ember
#

so they are highlit, or you CAN highlight them?

#

this one matters because you have to think about detection in one case, but not in the other

thorny cedar
#

It's a simple switch not you are able to highlight them

#

Sry for the misunderstanding

odd ember
#

I still don't know which one

#

ok let me just put it down

#

if it's the first one

#

use an event dispatcher

thorny cedar
#

If I pick it up they highlight not can highlight them

odd ember
#

yep ok

#

so the cool thing about event dispatcher is that you can get them to create a binding event in the level blueprint as a shortcut

#

and that's what you want to do here

#

so you want something like "OnOverlap" or "OnPickUp" as a dispatcher in your item to pick up

#

then in your level blueprint, with that item selected, in the right click context menu, select "create event for On(whatever)"

#

then from that event in the level blueprint, hook up the elements you want to highlight and highlight them

thorny cedar
#

Got it! Thank you

odd ember
#

you can equally create another dispatcher like "OnDropped" to make them not highlight after the fact

snow geyser
#

Is it possible to spawn actors from another class as a child of current class?
If not, what would be the way to spawn and transform child components / actors

odd ember
#

@snow geyser for component it's add component

#

I don't recommend using child actors

snow geyser
#

I currently am spawning this grid (looks like a solid block because of closeness) from a separate BP, the issue is that I want to individually have each grid square checking for the same parameters that the house checks for (land slope and existing building) but if I enable any collision on the grid since it is from a separate class it prevents the building from being placed

odd ember
#

why not just set the grid to overlap

snow geyser
#

Overlap all prevented the building from being placed because it (I assume) always detected the collision with the grid thats being placed with it

odd ember
#

I mean all of this is custom setup so can't you just rewrite that?

snow geyser
#

I dont have issue rewriting, just sorta unsure how to fix the issue. I wanted to have them as child or other components so that it would detect self with the grids and the house

odd ember
#

just make your own collision presets

#

like fix the problem at the root level instead of creating workarounds

#

especially since that option is readily available

snow geyser
#

That makes sense, of course. Ill give that a go for now ty.

fathom portal
#

I don't recommend using child actors
@odd ember What's the issue with child actors? I've never heard of that ebfore

frail void
#

I also had lots of bad experiences with it. So I always try to avoid it

#

I had packaging problems with child actors

#

very weird stuff

fathom portal
#

Hmm, interesting

faint pasture
#

A child actor component is just a component that spawns an actor. You can just spawn the actor directly and co trol it's lifetime manually to get the same end result without the weird edge cases.

#

What would be the best approach to a global message bus? I know dispatchers are close but I'd like to set up a system where senders and receivers don't need references to each other. Just route through GameState?

frail void
#

I'm about to finish the same thing

#

I chose the game system

faint pasture
#

U mean Gameinstance?

fathom portal
#

What would be the best approach to a global message bus? I know dispatchers are close but I'd like to set up a system where senders and receivers don't need references to each other. Just route through GameState?
@faint pasture Event dispatchers don't need to reference each other

#

Unless I'm misunderstanding what you're saying

frail void
#

no @faint pasture , the subsytem UGameInstanceSubsystem

faint pasture
#

@frail void Ah yeah that makes sense. I'm already considering a subsystem for projectiles so it wouldn't be too hard to make a message/event bus subsystem

#

For prototyping I have my projectile system set up as a component on GameState, so that can presumably work too until design is buttoned down and I move it all to a SubSystem.

frail void
#

I made a component for the objects and unreal initializes the system itself

#

it's actually very neat

odd ember
#

@fathom portal child actors break very easily and when they don't they have massive performance overhead

#

and really it's just a workaround for not understanding system architecture well enough

#

and unreal unfortunately provides a few too many of those if you ask me

fathom portal
#

What's a good guideline on reposting a help request? A couple hours?

odd ember
#

depends on the traffic I suppose

#

is it the same thing as earlier?

fathom portal
#

Same thing, yeah

#

I'm going through pages of google trying to find out who's had the same issue and fixed it

#

Because I really, really don't want to have to revert

#

I've done enough that it's worth spending a lot of time on it

snow geyser
#

If I spawn an actor from class in a separate BP, can I change the material from within it or do I need to create a function within the BP that had the spawned actor that handles that?

fathom portal
#

You like that @odd ember? I'll just include my errors in screenshots when I help other people lmao

snow geyser
#

Not all heroes wear capes

#

some wear errors

odd ember
#

lmao I'm not the authority here

#

I think you might be better off asking in a different place

fathom portal
#

Oh, I know, was more like "Hey look how clever I think I am lmao"

odd ember
#

seems less likely to be a BP issue

snow geyser
#

Well that half solved my problem, will keep digging for the other half lol

fathom portal
#

What's the other half, share with the class

snow geyser
#

Storing and accessing the reference to them, since each actor being spawned is through 2d grid execution macro and saved to an array

#

simple enough, I already store and move them with mouse cursor, but thats all at the same time in their order

fathom portal
#

1: Drag off the "return value"
2: Do "Promote to variable"
3: Change that newly made variable to an array

#

Wait, if you're already storing them, what's the problem?

snow geyser
#

somehow the way I reference them to change material on tick events isnt working, essentially.

fathom portal
#

Ok 1: Using tick for something like that isn't advised

#

But 2: Can you share the code? Maybe someone can spot the issue

snow geyser
#

Well I want to make a grid that spawns with building and each grid square checks validity of placement to help the player better plan without actually having to manually check each spot but can visually reference

#

so on tick seemed like the only way to do it with each mouse movement right?

fathom portal
#

Hmm

#

Maybe

#

Making it update every time the cursor moves seems like a better idea

#

Maybe, but that's an issue for another time

#

Share your code where you're changing the material, lets get that solved first

snow geyser
#

will snip it together real fast in photoshop

#

yeah

fathom portal
#

kk

#

Mostly just how you're storing them in a variable/array variable and then how you're actually setting the new material

tribal axle
#

I have an idea for a fnaf fan game, a mechanic is one of the enemies stands at the end of a hallway, and his eyes are white. When his eyes turn red, you have to flash your light to stop him. But if you flash your light when his eyes are white, heโ€™ll kill you as well. How would someone go about making this?

fathom portal
#

@tribal axle Which part? Or all of it?

tribal axle
#

Just the ai, I have a trace line to hit the character, I just need the logic.

#

Like, what do I use to simulate the eye change, I donโ€™t have a model atm

snow geyser
fathom portal
#

Ah, I think I see

snow geyser
#

the second is the actual called event for material changes

#

Top = spawn and collect, middle = move grid with mouse and try and condition material changes

fathom portal
#

Well, what I thought was the issue isn't

snow geyser
#

bottom = material change events

fathom portal
#

And which "Set materials" aren't working? the 4 inside "GridMaterialChange" and "MaterialChange"?

snow geyser
#

Yeah, When I try and enable the grid material change ones it ends up screwing with the ones for the ghostbuilding

fathom portal
#

Have you set the debug filter to this object, to watch the lines light up?

#

Like to make sure it's actually *reaching the code

#

This thing:

#

Alternatively you can just add printstrings to the ends of each code piece

snow geyser
#

oh it reads it

#

it just does it in a "wtf why you do this" way

odd ember
#

oof executing on false

#

big oof

snow geyser
#

in the material changes?

fathom portal
#

Yeah @snow geyser, I'm not seeing anything that sticks out as the issue

snow geyser
#

I mean I swapped those to != and on true and it didnt seem to make much of a diff

fathom portal
#

It's the same thing, just some devs get triggered over some stuff

#

I get triggered over using strings to check for settings instead of enums

snow geyser
#

Its the grid material change that is somehow messing things up

#

I broke the link after set actor location and the ghostbuilding behaves properly again

#

Something tells me its the target-self in the on-tick somehow but I cant figure a way to plug in the object reference to that self

#

that self should just be referencing the "GridMaterialChange" event not the BP unless I misunderstand

fathom portal
#

And if you add a print string after the "set materials" it is actually firing that code?

#

Not getting lost in the "true" of the equals check

snow geyser
#

ill add prints to the grid ones

fathom portal
#

Just to narrow it down to make sure the code is running

#

Or do the whole "debug filter" watch the light show thing

snow geyser
#

Yeah its def doing them all but its like not everyhings updating each instance? The ghost-building will go red for a while and then if I clip from a different direction will go blue and stay that way until I clear some other direction.

Normally it goes red then back to blue as soon as it clears the collision

fathom portal
#

Well, are you updating everything every instance?

#

Or are you just checking the one you're touching

snow geyser
#

it should be every instance? The ghostbuilding operates perfectly when the set material for grid isnt enabled. When I hook those back up all of them will change just not accurately each tick

fathom portal
#

Are you getting any "Loop exited" errors in your output after you play?

snow geyser
#

no

fathom portal
#

The loop limit per tick is crazy high, it shouldn't be, but trying to narrow it down

snow geyser
#

How would I do that? Relatively new to UE4

#

just less grids?

fathom portal
#

The limit per tick is like 20 thousand loops I'm pretty sure

#

The chances you're hitting that are slim

snow geyser
#

I shouldnt be anywhere near that yeah. Ive got a 10x10 grid looping once on each tick

fathom portal
#

Yeah, that's totally fine

#

Sorry @snow geyser I'm out of ideas as to why

snow geyser
#

hey man I appreciate the effort either way

fathom portal
#

Sure, sure

#

If you want, we can screenshare and we can try to narrow it down further

hollow cape
#

Trying to read through this

#

You aren't able to change materials per instance?

snow geyser
#

Without the branch after "set actor location" on tick the ghosthouse will perform its checks and change appropriately.

With it enabled I get something like this:

#

where the checks arent happening each tick seemingly, because they are changing to true or false and then staying that way instead of changing back with next tick

fathom portal
#

I mean, it sounds harsh but what you showed wasn't a crazy large amount of code, maybe just rewrite it from scratch, try to see what's going on?

hollow cape
#

your "check overlap" functions you have, what exactly is going on there

fathom portal
#

Rubber ducking is important

snow geyser
#

Theres a lot not shown thats just the grid section involved. shown

#

sec

hollow cape
#

I'm assuming this is something along the lines of an is valid to place this structure step, before clicking the mouse and starting building right?

snow geyser
#

yes

hollow cape
#

have you looked to see what the content of the array is at runtime?

snow geyser
#

I havent, but I assume it checks out because I am moving the entire grid around per mouse tick with its contents?

hollow cape
#

do the red "error" cells stay consistent while moving the mouse?

snow geyser
#

yes, until they have a new collision at a different angle that makes them happy enough to go blue

hollow cape
#

your "grid material change" function after the branch...you're calling the same function on both true and false? what's different there

snow geyser
#

one has "is error" checked one doesnt

fathom portal
#

The "grid material" ones dont

hollow cape
#

oh, not in the screenshot, I'm assuming the screenshot is wrong then?

fathom portal
snow geyser
#

oh I probably forgot to click it while re-hooking it up for the screenshot

fathom portal
#

ah

hollow cape
#

got it

#

just out of curiosity, unhook the "completed" pin

#

what does that change if anything

snow geyser
#

Nothing really, which is odd

hollow cape
#

still acts the same?

snow geyser
#

yes

hollow cape
#

also what's the difference between Grid Material Change and Material Change

snow geyser
#

including the house which should be getting its material change there

hollow cape
#

sorry for the amount of questions, trying to understand the flow

snow geyser
#

no dude its totally fine

#

I appreciate

hollow cape
#

can I suggest swapping the tick out for a Do N just to test. Run the next loop after the completed stuffs

snow geyser
#

target for material change was the difference

#

or, intended to be

#

The fact that the house is changing with the completed branch taken off is confusing since that calls the material change for house

#

Do N?

fathom portal
#

I recommmend merging the two functions

#

And then when you want to change "ghost building mesh", simply pass that in instead of the actor

hollow cape
#

yeah, but let's get this issue solved first

#

lol

fathom portal
#

I mean, simplifying the code base could go a long way in figuring out the error

hollow cape
#

true, however based on my experience...because I do this all the damn time, it can often create other errors that hide the original one

fathom portal
#

You could screenshare with us, remake this bit of code, and rubber duck for us each thing, maybe we can spot the issue

snow geyser
#

Cant screenshare with current connection unfortunately

fathom portal
#

Rip

snow geyser
#

very, but not for much longer ๐Ÿ˜›

#

luckily

fathom portal
#

Congrats!

hollow cape
#

are there supposed to be 2 variants of the red color for the "ghost" box thingy?

snow geyser
#

No. That there are gradients appearing is weird

hollow cape
#

I'm betting there are multiple boxes in the same spot

snow geyser
#

You think they are moving their placements?

#

I only create the grid once, so it shouldnt have more than one

hollow cape
#

put a print string on beginplay of spawning that actor, simple way to check

snow geyser
#

This is where the grid is created and arrays collected for reference

hollow cape
#

oh each little box is an individual actor...nm the print string then. Better off printing the length of the actor array to verify that. I would assume the lighter colors are overlapping translucent materials. Just a guess

snow geyser
#

100 Hellos

#

thats proper

#

10x10 grid

hollow cape
#

so...as an aside. why not use a single overlap volume set to the size of the object, and use that to check if the building can be placed?

#

the for the "ghost" of the building, you can just add a duplicate static mesh component with a different material to show the "ghosting"

#

just set each hidden/not hidden to switch out

snow geyser
#

Im trying to build a grid that extends beyond the building placement itself that checks each grid square for validity to help speed placement

hollow cape
#

fair enough, a single volume could be made the size of the building +20% or something

snow geyser
#

think somethink like that

hollow cape
#

yep, that's probably a single check, not 100 separate cube checks

snow geyser
#

even though each grid checks?

hollow cape
#

if the single large overlap did indeed overlap, then you could get your error state

snow geyser
#

etc

hollow cape
#

I get what you're saying, but I HIGHLY doubt that was done with individual cell checks, but rather a given "extent"

snow geyser
#

Im open to reading material etc on how to make a a single item do checking in a grid like that. im not chained to 2d grid macro execution ๐Ÿ˜›

#

I wouldnt even know where to start

#

Would it be easier to have something inside the GridPanel BP that handles its checks / color change instead of doing that in GhostBuilding_BP ?

hollow cape
#

think of it this way. If the Command Center were in UE4, there probably has a set "footprint" mesh. A plane with a material to be as simple as possible. It would also have a box collision volume fitted to it's "footprint".

#

When it's in place mode, it's visible and if the ACTOR is overlapping another building, then the planes material is set red and bCanBePlaced = false. If it's not overlapping, then bCanBePlaced = true and the material is green.

snow geyser
#

What about all the grid checking happening in places not part of the building though?

hollow cape
#

you mean the screen-wide green/red telling you where you can and can't place?

snow geyser
#

aye

#

That picture its screen wide, but in others its more localized around the building in placement-mode

hollow cape
#

a system probably similar to the navmesh

#

The screen wide one would be a bit harder as you'd have to have something to query against that's like...level wide.

snow geyser
#

Yeah I dont actually need the screen wide one, I just ask to help understand what you are offering

hollow cape
#

hold up, setting something up to see how full of shit I am

snow geyser
#

Im open to spending the night reworking if I gotta

#

lol

hollow cape
#

almost done

snow geyser
#

No rush my dude. Any guidance and help is much appreciated and at your leisure lol

#

Im noodling with some stuff in code to try and track down issues still

hollow cape
#

ok yeah

#

lemme record this

fathom portal
#

@hollow cape That's how I would do it as well

hollow cape
#

just seems so much simpler

fathom portal
#

And then simply when you move it around, snap to a grid if you're going for a grid system. So it can only move 50 units at a time or so

hollow cape
#

yep

#

I was doing in simulate since I didn't have that system set up

#

but yeah, exactly

fathom portal
#

Example ^

snow geyser
#

Ill watch this here in a sec and give it a go, thanks in advanced

fathom portal
#

sure sure, no rush

crystal mural
#

Quick question on a c++ conversion. What would I do here?

#

fTimeAvailableToFire += deltaTime;

fathom portal
#

@crystal mural you want #cpp

crystal mural
#

I mean converted to Blueprint.

fathom portal
#

Oh

hollow cape
#

drag a set TimeAvailableToFire

fathom portal
#

You can add time to time still, yeah

hollow cape
#

drag a get TimeAvailableToFire

#
  • delta Time
crystal mural
#

It's just setting? Not adding to itself?

hollow cape
#

plug into set

#

no you add it to itself

crystal mural
#

OK cool adding to self. Thanks!

#

Got a code example last night so just trying to figure out what's going on ๐Ÿ˜›

hollow cape
#

@snow geyser

fathom portal
snow geyser
#

Yeah that + a slope check is all the house does. essentially

hollow cape
#

this is far leaner

fathom portal
#

^ And no tick required, just update when they move it

hollow cape
#

yeah, I did tick for simplicity

fathom portal
#

Of course

snow geyser
#

The problem is it doesnt exactly accomplish what I want in terms of the grid outside of the building itself

fathom portal
#

The footprint can be whatever you'd like, it doesn't have to match the structure itself

hollow cape
#

yep

fathom portal
#

Like from Harvey's example, the footprint is different than the actual block:

#

Damn now I want to make this system for my game

hollow cape
fathom portal
#

^

snow geyser
#

Aye I get that, I just mean that I still want to have a visual indicator for valid placement in the immediate area. So it would show if it can fit in a place its not currently sitting for example

hollow cape
#

extend the plane, bounds extend

#

that's a far more complex system, but the same principles apply

#

standby....this is a good excercise

snow geyser
#

How can I change only partial grids of that footprint you are establishing though?

fathom portal
#

Like not a perfect square/rectangle?

hollow cape
#

you mean to make it not a square?

snow geyser
#

Sec lemme doodle something to help explain

hollow cape
#

you may need to use actor bounds or something like that

snow geyser
#

ok, so assume the blue building is what is being placed. The grid is center around it

#

some grids vanish when there is no land (the cliff)