#blueprint

402296 messages ยท Page 564 of 403

hollow drift
#

but how do i cast to custom player controler?

#

or how do i tell it about the pawn and keep it updated about its location which is controled in custom playercontroler

#

thought need a cast for it?

#

sorry i struggle still with cast, to fully understand it and explain it well

maiden wadi
#

Aren't you already doing that though? Just GetPlayerController->CastToCustomPlayerControllerType

#

On a side note, it'll make your life a lot easier to wrap common calls like that.

hollow drift
#

how do i store "spawn actor pirate pawn" in "selected pawn"

maiden wadi
#

For example, my typical game controller on this project is BPPlayerController. But instead of using GetPlayerController0->CastToBPPlayerController all of the time since getting the player controller is common, I wrap it in a BlueprintLibrary function like this.

hollow drift
#

"world content" is my "selected pawn" so to speak?

#

eh no

maiden wadi
#

Nah, it's just a node for the BlueprintLibraries. If you're making the function, drag off of the WorldContextObject and type GetWorld, it'll show up.

#

But if you made an array of the type you're spawning in the player controller, like I did here. My Array is of type BPSquadCharacter, not Actor.

#

Normal add would probably work too. Habit to use AddUnique when using pointers.

#

On a side note, this only works if you're spawning these after the controller has been created. Some events in game mode are called before that.

hollow drift
#

ye i just found add too

#

then when its stored, i can cast.. i guess^^

maiden wadi
#

You shouldn't need to cast it if you make the array the PiratePawn type.

hollow drift
#

ok

#

i still struggle a bit

#

also i know i realy should start working with Blueprint Function Libraries... but just too much at once...XD

maiden wadi
#

To try to explain casting, ignore the casting word. Think of it more like TreatAs. You're telling the compiler to treat this pointer as a type.

hollow drift
#

ok

maiden wadi
#

To fully understand casting, you have to already know about inheritance as well. Because you can only cast an object to it's own type or that of a parent class.

hollow drift
#

if i get the direct reference to pawn, it should know what to work with

#

but the pawn is itself not an array, it will be spawned as an array in another bp

#

ok.. i have to think a bit hahaha

maiden wadi
#

Because your variable isn't replicated and you're trying to use it from the client. You've spawned it and set it on the server, but your client has not set that variable. But in your serverRPC, you're sending a nullref pointer through for the server to use.

#

If you plan on passing more than one different type through that RPC, yes. If you're only ever calling it with that object, don't send it through the RPC, just call the RPC, and get that variable on the server.

last walrus
#

Hello
I want to ask a question about logic nodes:
Are there any nodes like branch but for more inputs/outputs like we replace boolean with integer

earnest tangle
#

there's a node called Select which functions for most types of values

last walrus
#

I cant get how it works
are there any good explanations?

hollow drift
#

@maiden wadi do you know those times, when you solve your problem but you actually have kinda no idea how you done it? went blind in with my guts

#

i dont understand fully why, but it works

#

lol

maiden wadi
#

@hollow drift The second picture you mean? Or?

#

@last walrus Select nodes are pretty simple. Consider that a boolean is actually a 0 or 1. Enums are 0 to 255. So a select on int is pretty much the same. Input an integer and it'll select one of the options based on it's inputs. Judging your question though, I think you might actually be looking for a Switch? Pretty much the same thing as Select, except for execution flow instead of selecting a particular value.

spark cliff
#

i'm having difficulty getting an actor to 'faceme' when running in simulation mode, since there's no player character as such

#

GetPlayerPawn, GetPlayerCameraManager, GetPlayerController seem to not get a handle of the simulation viewport

little cosmos
#

I am having trouble setting this simple following door mechanics: I want every time I overlap a BP_DoorOpener, All instances of BP_GenericDoor open

#

How should I set up this kind of communication?

#

without using level bp

last walrus
#

@last walrus Select nodes are pretty simple. Consider that a boolean is actually a 0 or 1. Enums are 0 to 255. So a select on int is pretty much the same. Input an integer and it'll select one of the options based on it's inputs. Judging your question though, I think you might actually be looking for a Switch? Pretty much the same thing as Select, except for execution flow instead of selecting a particular value.
@maiden wadi I'll look for it thanks

maiden wadi
#

@spark cliff I'm not sure that is possible. Maybe through an editor utility or C++

#

@little cosmos There are a couple of different ways. Do you only have one DoorOpener in the level at a time?

little cosmos
#

Let's suppose I do

spark cliff
#

ty

spark steppe
#

Authaer, thanks for your help earlier. had to hop of, gonna try out stuff now ๐Ÿ™‚

maiden wadi
#

@little cosmos Easiest method is likely a dispatch or creating an array to call stuff through. Would allow you to continually add more and more doors with no change. Even if you have multiple door openers, it's probably still the best way the only change is how you reference the door opener. For example, if you want a simple single door opener, just have it call GetAllActorsOfClass on beginplay and return the doors. You can either bind an event in the doors or save the doors in an array for a call later on the overlap. The only change for multiple door openers, you'd probably expose a tarray of doors variable inside of the dooropener, add your doors in it in the level designer. Then do the same. Either bind an event in the doors on beginplay, or just keep the array around and use it to call a function on the doors manually in a for loop.

slender idol
#

Hey guys, got a bit of an issue with my first person camera, it clips through the meshes when I'm crouching underneath them for some reason even if I have the collision test on the spring arm enabled

little cosmos
#

@little cosmos Easiest method is likely a dispatch or creating an array to call stuff through. Would allow you to continually add more and more doors with no change. Even if you have multiple door openers, it's probably still the best way the only change is how you reference the door opener. For example, if you want a simple single door opener, just have it call GetAllActorsOfClass on beginplay and return the doors. You can either bind an event in the doors or save the doors in an array for a call later on the overlap. The only change for multiple door openers, you'd probably expose a tarray of doors variable inside of the dooropener, add your doors in it in the level designer. Then do the same. Either bind an event in the doors on beginplay, or just keep the array around and use it to call a function on the doors manually in a for loop.
@maiden wadi That sounds complicated. I'll look into that. thanks

slender idol
#

here I am crouched underneath a wall but the top right is getting clipped and I can see through

hollow drift
#

@maiden wadi both

#

the get in 1st image i use to select which pawn from the array i want to get, the second one is the construct to fill the array

maiden wadi
#

@little cosmos Try something like this for quick test for a single door opener. Or for opening every door from any door opener.

little cosmos
#

I got it to work using event dispatcher on the FPSCharacter which is being called everytime I step on the BP_OpenDoors trigger

#

and I bind an OpenDoor event on the BP_GenericDoor

maiden wadi
#

This works too. But do try to cut out the character. Because for example, if you decide you want this to work with multiple pawn types, or other things, it makes it easier to alter when you don't have to alter every one of those classes. You'd just have to change your Door Opener alone.

little cosmos
#

Okay man, thanks a lot!

maiden wadi
#

@slender idol To be fair, I don't know why you have a spring arm there. It has no length so it can't push the camera in to avoid anything. There's a setting somewhere you might try, let me try and find what it was.

#

@slender idol Near Clip Plane. You might consider lowering that in the project settings. It should allow things to render closer to the camera I believe. Haven't messed with it much myself.

slender idol
#

@maiden wadi all right, Ill try it out thanks

spark steppe
hollow drift
#

cool ๐Ÿ™‚

spark steppe
#

just gonna have to find an elegant node setup for that

maiden wadi
#

Haha, what's it look like right now?

hollow drift
#

""""elegant node setup""""

spark steppe
hollow drift
spark steppe
#

๐Ÿ˜„

hollow drift
#

aids...

#

XD

spark steppe
#

ffs is the last one?

hollow drift
#

its code before the days of loops

spark steppe
#

but i've seen someone do something similar...

hollow drift
#

idk, perhaps y saw it before. i tend to meme around with it a bit^^

#

damn, we need a code meme section

maiden wadi
#

@spark steppe Wait, you still need to do the nodes on it you mean?

spark steppe
#

yea, i've only reached the point where i understood how to solve it

#

i calculate the required distance on a flat plane by my desired pitch and the height of the vector, so i ignore X axis first

#

then i rotate the whole vector around the z axis, so it stays in the desired distance but reaches the point where it belongs

maiden wadi
#

Do you already have the green vector?

spark steppe
#

i would be done if i had it ๐Ÿ˜„

maiden wadi
#

Do you have the red?

spark steppe
#

yes

#

the red should move to where the green is

maiden wadi
#

Do you know the distance from the character?

spark steppe
#

i can't use the distance as the vector has to stay in relation on its x/y axis

#

wait

maiden wadi
#

That green would be I mean, from character to the green vector?

spark steppe
#

i use the distance, yea

#

the distance is just one node, so yea i got that

frail condor
#

hey guys ๐Ÿ™‚ just a small question, in the animation blueprint state machine stuff
how can I transition on an event instead of a bool for example

maiden wadi
#

Is Red in world or local space?

spark steppe
#

it's relative to the head

#

so local i guess

maiden wadi
#

And is it supposed to remain around the center of the character like your image above?

#

Z wise I mean, up and down. Is it supposed to stay at that z level?

spark steppe
#

yes, it should move on the x/y axis until it's in the field of view, so away from the character

#

wait, so i got the height, i got the distance, it's aยฒ + bยฒ = cยฒ

#

xD

#

ffs, really?

maiden wadi
#

If Red is already at the Z it needs to be, then for safety, just take red. Zero Z out. Normalize it. This will technically normalize it on a 2D plane. Use your distance on this and multiply this Zzeroed vector by the distance. Then readd your original Z.

spark steppe
#

thank you

maiden wadi
#

Haha. Was that the math you needed?

spark steppe
#

yea, and i have the feeling that this is what you suggested earlier but i couldnt twist my head around that

#

thanks for your patience ๐Ÿ˜„

maiden wadi
#

Nah, vector math is fun.

spark steppe
#

or wait

#

it's not all that i need

#

i still have to calculate the final distance before

#

i only know the distance to the green sphere

#

but i would have to multiply the direction vector by the distance of the green sphere

#

or am i wrong?

#

im right for this one^ ๐Ÿ˜›

maiden wadi
#

The dist to the green sphere is the one you need.

spark steppe
#

yea

#

are there any nodes for making my life easier, or do i have to mess with pythagoras now? ๐Ÿ˜„

#

that's really my weak spot... i did trigonometry helpers in probably every language, and everytime i hated it (even in lua xD)

#

the crosshair of what?

maiden wadi
#

@spark steppe Nodes like what?

spark steppe
#

well maybe some vector magic can get me around messing with cos/tan/whatever

maiden wadi
#

@swift pewter Usually you would line trace from the camera, get the hit vector, and use that or the end trace, to do a second trace from the end point of a weapon to the hit location of the first trace.

spark steppe
#

actually i have to calculate the distance by the max pitch (lets say 33 deg) and the height offset from the head

#

so i got 2 angles (as the other one is 90deg) and one side

maiden wadi
#

@swift pewter Hmm. It depends. Single or multiplayer?

spark steppe
#

can't you use getHitResultUnderCursorByChannel node?

#

it gives you an hitlocation

maiden wadi
#

You can if you center the cursor to the screen. But you can also just as easily make a function to return a camera's trace. I normally did it in the character that had the camera.

spark steppe
#

he probably has that, and might want to test it, because afaik that trace happens anyways?!

maiden wadi
#

@spark steppe But anyway. Which distance are you after? Might be a non Greek way to get it.

spark steppe
#

rather looks like it does, as it comes without execution connector

#

well, the distance from head to green sphere, we can ignore x/y axis for that

#

so we know the z-distance and the angle of the head

#

actually, we know all angles

maiden wadi
#

What determines the green sphere? Or the red sphere even?

spark steppe
#

the red sphere is defined from outside (either line trace or some specified goal by other means) so my controlrig just gets a vector where it should aim at

#

the green sphere is something we make up so that the head wont pitch over a certain amount

maiden wadi
#

So in your display above, the red would be the goal, but it'd be too low for the character to look at?

spark steppe
#

yea

maiden wadi
#

Hmm. Do you know at what pitch level you want it clamped?

spark steppe
#

yes

#

i already sorted out if its within field of view, so we can always assume max-pitch as angle, as it otherwise wouldn't correct the value

last walrus
#

Ok so I I've tried some things with select node and now I want to know - how do I get a reference to fuction? for example I want to run 1'st func when the value is 1, second when it's 2 and etc

hollow tusk
#

you should be able to do that with delegates

maiden wadi
#

@spark steppe I wonder if you might just clamp the pitch from the look at rotation after the math is solved?

spark steppe
#

@last walrus you want to use a switch node

#

is it that easy? wouldn't i have to calculate pitch and roll then?

maiden wadi
spark steppe
#

as it would otherwise tilt if the head has also yaw applied

hollow drift
#

ben

#

if y want we can have a look together with it, perhaps we can find an idea together

carmine drum
hollow drift
#

but with share screen perhaps?

maiden wadi
#

@spark steppe Well, you have the look at rotation from the head to the green vector. Since you have the head location and the green vector. So you should be able to just break the look at rotation, clamp the pitch, reassemble the rotator.

carmine drum
spark steppe
#

@maiden wadi i dont have the green sphere, thats why i need the distance of it actually

maiden wadi
#

Oh right. Fair.

#

To be fair, the look at rotation to the red vector should output the same.

#

If you clamped the look at rotation from the head to the red vector? Which I suppose might make the green vector useless? Unless you still need it for something.

carmine drum
#

any ideas for my problem ?

spark steppe
#

the green vector is a control in my controlrig and drives the ik (as i have also spine rotation in the lookAt solving)

#

so thats why i want to get the control somewhere to drive the IK to an actual reasonable target

maiden wadi
hollow drift
#

ben, just a stupid thought

#

can u use an epty?

spark steppe
#

the control is an empty actually

hollow drift
#

ok

spark steppe
#

it's basically a transform which has a location/rotation/scale

#

but some small extra perks ๐Ÿ˜›

hollow drift
#

lets do screen sharing, there must be a solution to it

maiden wadi
#

@spark steppe Oh. Actually wait. I wonder if you could just do a pitch clamped rotator to the red vector, and use a plane trace to get green.

hollow drift
#

i just cant follow well text, looks like its more complicated

maiden wadi
#

Sec, lemme show.

hollow drift
#

i am realy curios now about your setup^^

#

looks realy difficult?

spark steppe
#

guess intersect plane is what you mean?

maiden wadi
#

If my thought is correct, intersection from that would be Green.

#

Basically find the look at rotation to red, clamp the pitch to what it needs, use the rotation from where the head normally is in the direction towards where green would be, find that on the plane facing upwards on Z, at a location of red vector.

#

@swift pewter Are you doing both traces in the same function?

#

@frail condor Either way, either here or in the AnimGraph, you can't really switch on an event because it's all state driven. You need a variable of some kind, either Bool, Int, or Enum to switch on. If you want to create an event to call, either do it in the owning character, or in the EventGraph of the animblueprint. Then you'd get that instance and call that even that'd set a variable for those switches to happen on.

frail condor
#

@maiden wadi thanks for replying ๐Ÿ™‚ yeah i was talking about those haha

maiden wadi
#

@swift pewter You need a SelectVector

#

@swift pewter Do this. That way if for any reason your first trace hits nothing, it has a vaguely right direction to shoot in.

#

Maybe. Is this for projectile spawning or line trace shots?

#

If it's for line trace shots, you probably don't want to do anything if they don't hit something with the second trace. So the hit location should be fine. Might want a branch to do it only if there was a blocking hit.

#

Otherwise you'd end up with particles hanging in mid air at the end of a line trace.

#

That's odd. It's like half of them are being shot towards 0,0,0.

#

Can I see your second trace stuff?

tawny river
#

guessing there's no real way in blueprint to outright duplicate a component?

spark steppe
#

authaer that sounds like it might work, just for my understanding, the intersect plane node... isn't it more like a "trace" of line A vs line B?

#

the inputs in the control rig are a bit different, so i have a direction instead of the end point

#

the plane gets infinite extended from the origin into it's direction?

#

plane should be on the height difference between head and goal (start: 0, 0, 9,...) and extend on the x axis (plane normal: 1, 0, 0)

#

and the direction of the start point points towards that

#

or i misunderstood how the node works

maiden wadi
#

@swift pewter Not sure why it's returning a 0,0,0. You might try branching on if there was a blocking hit before the apply damage.

little cosmos
#

I am trying to make a functionality for when I press Z on the keyboard the pawn changes from First person character to the default roaming pawn. how's that achievable?

spark steppe
#

@little cosmos one way is to carry around 2 cameras and just switch the active camera

maiden wadi
#

@spark steppe That should be the same one as I posted if I'm reading that right. Basically PlanePoint needs to be the red vector. PlaneNormal should be 0X0Y1Z. This is to make it a plane that faces upwards, like a flat floor surface. Start would be the head's normal location, Direction would be the PitchClamped look at rotation turned into a normalized vector.

spark steppe
#

yea i was going a different way but the result should be kinda the same

#

so the plane should actually extend until it's hit by the line?

#

if we think of that node as a plane and some line going through space instead of the greek math that i try to avoid for hours now ๐Ÿ˜„

little cosmos
#

@spark steppe There must be a more elegant and simple way

spark steppe
#

(which it probably is)

little cosmos
#

how do I just switch between them?

spark steppe
#

setViewTargetWithBlend is what i use

#

and i think its better than moving the camera around

#

but whatever you prefer

maiden wadi
#

Is that in Niagara by the way?

#

You put a branch right before the apply damage, right?

#

If the bool going into it is Blocking hit, can you print out the hit location on that? See if it prints anything, and see if it's 0,0,0 when it does.

#

@swift pewter Print on false I mean. Not on true.

solid rapids
#

Hi everyone!

I'm creating wallrunning, i've got it working, but you can move to the right/left by simply looking that way and moving forward or by moving right/left.
I'd like to have it so you'd just stick to the wall. How can i do this?

little cosmos
#

I am trying to make a functionality for when I press Z on the keyboard the pawn changes from First person character to the default roaming pawn. how's that achievable?

maiden wadi
#

@swift pewter Actually I think I just realized the mistake. I completely overlooked that this is for traces. I'm so used to doing this with projectiles. Some of those are probably not hitting because the trace stops just at the wall sometimes and sometimes just barely hits it.

#

I'd bet if you drew debug points from the line end, each of them would show up on the wall, even the 'misses'.

#

So the simple answer is to ditch the second trace. Just do the shooting based off of the camera trace.

dense mica
#

i am working on a very messy blueprint so I had to do that ๐Ÿ˜„

#

(cast fails or returns none)

maiden wadi
#

@swift pewter Depends. That's design decision. In short, you could either do some vector math to trace from the camera little differently so as to only trace from near the character, or complicate it with a multitrace and a lot of vector checks and filtering.

#

@dense mica If it fails, it's likely that the instance of that's child actor class variable is either not set, or it isn't of a class castable to BaseUpgradeElement.

dense mica
#

Child Actor Class node is pure Actor class, CurrentChildActors is BaseUpgradeElement class

maiden wadi
#

@swift pewter Personal preference for simplification would be to just move the trace start. Ditch the second trace, and only trace from next to the character or weapon You can solve this pretty simply. Let me connect a few nodes.

#

@dense mica Right. It'd be like adding an AActor pointer to an ABaseUpgradeClass pointer array. You'd have to cast that AActor to ABaseUpgradeClass. But if that actor pointer is either null, or doesn't point to an object that is actually a ABaseUpgradeClass or a child of ABaseUpgradeClass, the cast will fail and return a null pointer.

dense mica
#

Thanks Authaer

maiden wadi
#

@swift pewter Try this out.

#

Basically it'll find a point directly in front of the camera that is as far away from it as the gun is. Then it'll start the line trace from that point instead of directly from the camera itself.

#

So the line trace should still be centered, it just won't hit anything between the camera and gun.

#

How do you mean?

#

You're tracing from a point on the gun to a point that the camera is looking at. So it's like pointing to a location from the side vs pointing directly at it.

#

Not really. Think of it like a sphere. You have two lines going straight to the center of the sphere, but one is slightly from the side. It'll hit a different point on the sphere than the other line.

#

They both have the same exact destination, the center of the sphere, but because their origins are different, they'll hit a different spot. So it just comes down to whether you care about that slight inaccuracy, or if you want pinpoint crosshair accuracy.

spark steppe
#

btw authaer its now working with the intersect plane node, thank you

maiden wadi
#

Personally, if I was designing a third person shooter, I'd probably go with a mix of what I did above to avoid things behind the camera, and also do some checks that it isn't too close. If it's too close, I'd probably do some traces from the weapon since you want to give the impression that it's from the weapon, so if it's too close, do it from the weapon, if it's far enough, just do it straight from the camera.

spark steppe
#

didn't help that the controlrig behaves a bit wonky in preview when playing with the control values, tho

#

but the values are what i would expect and ingame it also is what i would expect, so thats good

maiden wadi
#

@spark steppe Victory! I had a thought also that that math doesn't quite apply with pitch up. But I was going to make the point that you could just inverse the pitch direction. do the same math and then double the Z distance up. That or make switches on wither the pitch was positive or not and switch the plane normals and such.

spark steppe
#

i do that at the end of all calculations before readding the head location which i removed before for doing all other calculations relative to it

spark steppe
#

ah, i dont even have to do that if i put the control in a space which is aligned to the head ๐Ÿค”

deft zealot
#

Is it possible to somehow reference a material by tag?

sudden spear
#

Hey guys!
I've got multiple float values from an array of actors. Is there a way to seperate these values or sort them by the highest value?

earnest tangle
#

You can sort arrays in C++, not sure why there doesn't seem to be a Sort node in blueprints

severe iris
#

One of my BPs suddenly wouldn't compile anymore on an old piece of blueprint I hadn't touched for a while saying "Error: Dependency cycle detected, preventing branch node from being schedule" (or something like that). I tried restarting the editor because I didn't know where that was coming from, and now the editor crashes on startup, on KismetCompiler...

#

Any idea what's gone wrong or how to fix it?

sudden spear
#

thanks @earnest tangle !

void snow
#

Hello, I'm new over here and also new to unreal and this a question regarding my first unreal game project!
is there any way that i can spawn/attach the particles to a socket/skeletal mesh when i run the game! (like while runtime)

//I'm using ALS for movement and stuff

maiden wadi
#

@void snow Sure. Which Particle system are you using? Niagara or Cascade?

void snow
#

cascade

maiden wadi
#

Are you wanting to attach an already spawned emitter, or create a new one and attach?

void snow
#

create a new one and attach

maiden wadi
#

Check out SpawnEmitterAttached, should be what you're after I think.

#

Just input the skeletal mesh as the component, and the socket as the name.

void snow
#

ok, thank you!

#

@maiden wadi

maiden wadi
#

@void snow Are you just trying to add a particle, or a second skeletal mesh as well?

void snow
#

only a particle onto an existing mesh (which is held in player's hand)

maiden wadi
#

Kay. you don't need the cast or the add component. Or the GetSocketBoneName actually. Just plug Mesh directly into the AttachToComponent, and type the socket's name in the AttachPointName.

#

You'll probably want to change LocationType to SnapToTarget, and maybe turn AutoDestroy off if you want to keep the particle around longer than it's usual lifecycle.

deft zealot
#

So i have a puddle shader I applied to a material. I can control the amount of puddles through a collection parameter. I am making a rain system, and I want the puddles appear like only in the area where it's currently raining. Is it possible to like, only make the shader work in that specific area in the world of that material?

#

So like it's a landscape, and landscape has that material applied to it

earnest tangle
#

There's probably some way to do it, like doing it based on vertex color values or something... might be a better Q for #graphics though.

deft zealot
#

could not find a single thing about this online lol... and it's honestly super beyond me

void snow
#

Thank you @maiden wadi it worked ๐Ÿ™‚

#

there is an issue with it

#

if i manually give the location it will not follow when the player is crouched

maiden wadi
#

@void snow Does it spawn at the socket location if you leave it at 0,0,0?

void snow
#

no it doesn't it spawns b/w legs instead of the stick

rose hazel
maiden wadi
#

@void snow Is the stick part of the skeleton in the mesh, or is it a separate object spawned in and attached to the character mesh?

void snow
#

its a separate object

devout pine
#

Hey Fellow Blueprint Programmers :)

I need your assistance. I want to SpawnActor from Class on a specyfic streamed level. How to do it? Is there a way to plug an level to an "Owner" pin?

void snow
#

its an animation state in which player has a stick in his hand

maiden wadi
#

@void snow Attach the particle to the stick then. You'll need a reference to it somehow. Alternatively, attach the flame to the same bone you did the stick and offset it enough to make it look like it's part of the stick.

void snow
#

@void snow Attach the particle to the stick then. You'll need a reference to it somehow. Alternatively, attach the flame to the same bone you did the stick and offset it enough to make it look like it's part of the stick.
@maiden wadi with the bone/socket location thing in the particles?

maiden wadi
#

Nah. Your particle should be fine the way it is. Is the stick itself an actor by chance?

rose hazel
#

Plugging a Bool directly into And checks whether itโ€™s true, right?

maiden wadi
#

@rose hazel What do you mean by into and? If you mean the logical And for bool, that checks if both inputs are true, if either is false, it'll output false.

#

@void snow Show me the stick itself, however you've created that.

void snow
#

i got an fbx model with a bone socket at the top

rose hazel
#

I have a branch that needs two bools to be true, so Iโ€™m using and And node. Will plugging the bools directly into the node be fine?

maiden wadi
#

@void snow Ah, okay, so that itself is a skeletal mesh. Where are you adding that to the character and it's hand?

#

@rose hazel That should be fine. Intended use.

void snow
maiden wadi
#

@void snow I need to see inside of that function then. That is likely adding a skeletal mesh component, or setting a skeletalmeshcomponet's skeletal mesh.

void snow
#

This is all Advanced Locomotion System V4

maiden wadi
#

HeldObjectRoot. Try getting that by right clicking in the graph and typing it. Try and attach your particle to that.

rose hazel
#

Is there a way to get the owner of a socket after GetAttachSocketName if the socket is in another blueprint?

maiden wadi
#

@rose hazel What do you mean by in another blueprint?

#

Sockets are generally a part of a static or skeletal mesh. Which you'd already have a reference to if you're calling GetAttachSocketName on the component holding it.

rose hazel
#

Iโ€™m working on a modular gun thatโ€™s broken up into 5 blueprints - the stock, the receiver, the action, the barrel, and the magazine. Iโ€™m working on the action, and it needs to check whether a value in the receiver has been changed

#

One of the static meshes in the action attaches to a socket in the upper receiver mesh

solid rapids
#

Hi again, different question: how would i rotate my player to look towards a vector's direction?

#

More like this: how would i set the player's rotation to a vector's rotation?

maiden wadi
#

@rose hazel Initially I'd just make the point that a single actor with multiple components would probably be a lot better for this sort of programming. Your components could easily be modified with similar parameters and the main actor could do the attached checking from it's own components, etc. Barring that though.. Which is attached to which? Is the action attached to the receiver or vice versa?

#

@solid rapids For a character?

solid rapids
#

Yeah

rose hazel
#

The action is attached to a socket in the receiver

void snow
solid rapids
#

@maiden wadi It's for a character and wallrunning.
I want the character to rotate along a surface.

rose hazel
#

This spawns the action if the associated variable is true

maiden wadi
#

@rose hazel Your Action could call GetAttachParentActor I think. That should return your receiver it's attached to to get your value from it.

rose hazel
#

Thereโ€™s GetAttachParent, but not GetAttachParentActor

#

Although I should be able to reference the actor from the mesh since thereโ€™s a reference

maiden wadi
#

@solid rapids This math with one of these, depending on how you're rotating your character.

solid rapids
#

Ah okay thanks a lot @maiden wadi!
I'll try that!

maiden wadi
#

@rose hazel It's from actor itself, if you're trying to drag off of another pin. Try to see if you can get it straight from the graph.

#

@void snow Oh wait, no, I think it's in your components list. It has HeldRootObject attached to Mesh, and in that is SkeletalMesh and StaticMesh

vast lion
#

Do actors have a โ€œcreated game timeโ€?

solid rapids
#

@maiden wadi I don't think that really does what i want, because i want to set my player's rotation to the rotation of a vector, if that makes sense.
I'm not seeing that happen with this math

#

I think it rotates towards the location of the vector

#

_ _
I just need to get the vector's direction and apply it to my player, but i don't know how.

void snow
#

it works

#

thanks for the help! i was stuck on this for a while

night quail
#

Hello! I'm a little new to landscaping in Unreal, and it would be really nice for my project if I could use Blueprints to control the heightmap (position, z-scaling, units, sections/components, etc.). However, I haven't found any resources on this, or anywhere saying that this can't happen. Is this something implementable?

#

I do not wish to use plugins, if possible

winter garnet
#

Straight question: what a replicated variable means?

neon tundra
#

Probably variables which are important for all users in a multiplayer game ie numbers of players left, leaderboard scores, etc. I could be very wrong though cause I am new to Unreal so, feel free to correct me.

winter garnet
#

Well, I wasn't specific enough. When a variable replicates, what happens?

maiden wadi
#

@solid rapids That's what that math does. In shot, this is leveling the desired facing vector with the character, so that pitch doesn't apply. Then it's finding the rotator that if applied to the character would face that location. To simplify it, you could probably just do TargetLocation and CharacterLocation into LookAtRotation.

winter garnet
#

From the server's perspective, will it send it to the client automatically?

#

From the client's perspective, what happens?

maiden wadi
#

@night quail I'm unsure of how it works, but there is an engine plugin that does it. Check out LandMass. It's Unreal developed, so not really a third party, if I recall correctly. If you wanted you could check it out and see what it's doing.

rose hazel
#

A simple check to determine the parent of the socket and get a reference to the actor. After this, is there a way to check a variable within the actor being referenced?

void oak
#

@rose hazel just cast to that actor/parent

night quail
#

@maiden wadi I looked into that, but all I found was custom blueprint brushes - I don't want a brush, I just want to perform a one-time operation on the entire landscape (which is dependent on the imported heightmap). Ideally, I'd like to take in all the vertices of the heightmap as an array, and perform operations on it

#

It's a little cumbersome to figure out the math behind everything in order to properly scale an image to the desired heights, so I want to automate that - as well as control how many components and sections I have depending on the image's resolution. I can do things like that with materials and texturing, so I hoped that there's something I can do like that with the heightmap

dim robin
#

hello, how can i tell an object to destroy itself when touching the ground?

rose hazel
#

Any changes I should make? This is the Action blueprint, which will be attached to the Receiver in a fully functioning rifle

void oak
#

yeah stop using event tick

#

its very taxing

earnest tangle
#

It depends on what you're doing, I don't think he said what the goal with this is

rose hazel
#

The action will move forward if itโ€™s attached to a Receiver actor and a bool in the receiver is true

maiden wadi
#

@rose hazel Since you're dealing with an actor attached to an actor, I'm still fairly certain that this is what you're looking for. For example, I have a gun attached to a character, and if I put this in the gun's event graph and cast the attach parent actor to the character type, this works.

odd ember
#

gotta love cast and branches on tick

maiden wadi
#

Most things can be made event driven later. Testing doesn't matter. And tick only starts mattering when you start reaching hundreds of objects, or your target platform is an N64.

rose hazel
#

Try open-world survival with plenty of NPCs on a 6-year-old PC

odd ember
#

it's habit forming though and leads to technical debt. I never encourage it but whatever, it's not my call

#

sounds like you shouldn't be doing stuff on tick but whatevs

maiden wadi
#

To be fair, the whole weapon should be a single actor class with interchangeable components, rather than using actors as components themselves.

rose hazel
#

The thing is, there isnโ€™t a base weapon per se

odd ember
#

maybe there should be

rose hazel
#

Every โ€œweaponโ€ in the game will be a series of parts working together

neat stream
#

Any idea on why this would alter the color of the image? It's adding color ... A blueish tint all over

rose hazel
#

Itโ€™s going to be completely modular to the point where individual parts are essentially junk items on their own

odd ember
#

Any idea on why this would alter the color of the image? It's adding color ... A blueish tint all over
@neat stream probably more of a #graphics query but, have you considered that lighting could affect it? does the material have anything in that could alter it?

neat stream
#

can't be because im just changing the same mesh material at the same place

maiden wadi
#

Right. And if you make a base class, your components can still work together the same way that you're doing with actors now. For example, if you create a class inheriting from Skeletal/StaticMeshComponent, then you can make all the components you want with all the functionality you want. And they can all work together in a single actor class that is the weapon base.

rose hazel
#

As for your screenshot @maiden wadi, I didnโ€™t see GetAttachParentActor because I was trying to drag off of a mesh

neat stream
#

(an undo function)

maiden wadi
#

@rose hazel To give a clear example. What I mean is make a single actor class. This is more of less just a container to call simple functions on like attempting to fire, reload, etc. Your components can still attach to one another and have their own functionality. For example if you call fire, you might tell your trigger parent component to call a firing function, this can be overridden in child classes for different effects like single shot, double barrel dual shotgun blasts, etc. Maybe something else decides ammo type if the weapons have variants, and your barrel might do the actual projectile spawning or effects since it has it's own location to do them from. Or your ammo type component can use the barrel for it either way. This all allows you to not only customize weapons themselves, but simplify all of your function calls. No matter what weapon type you have in hand, you'd only make one 'pull trigger' call to the main actor class, and that can chain itself through the components. Better yet, if you're making a UI for all of the attachement stuff, the only reference you'd need would be the one main actor and have some simple functions set up there to poll information from the components, like maybe durability for each component, quality, etc. You could even go so far as to make it so that all you need to do is populate a datatable with the required info per component. As in having a list of what barrels might attach to what stocks, what ammo certain parts can use, damage modifications from both type, and qualities.

void oak
#

Does anyone know how I would be able to grab spawn point locations without level streaming?

night quail
faint pasture
#

@odd ember branches on tick are fine if necessary. Most of the shit we see slapped on tick isn't tho.

#

@rose hazel I'm running a similar type of system for vehicles

#

@rose hazel I'd suggest doing it like this.

You have a base Weapon bp.
The BaseWeapon can have a collision box or whatever, but otherwise is almost empty. In my game the base Vehicle is only a chassis.

You have WeaponParts(Vehicleparts). They are separate actors which can implement certain interfaces like Fire and ADS and Reload. In my game the VehicleParts implement Throttle and Brake and Steer and Activate.

When you add a WeaponPart to a Weapon, you register it so the Weapon can forward commands like Fire or ADS or AltFire to the right parts. You could also do math like updating weapon ammo type or mag size etc.

rose hazel
#

Iโ€™ve managed to work out spawning and firing so far. The player canโ€™t hold the gun yet, but the action can respond to the Trigger bool in the receiver

faint pasture
#

You'll get more milage out of events StartFire and StopFire

#

I would have it set up like so.

Mouse click triggers Fire on the Character, which calls Fire on EquippedWeapon, which calls Fire on it's parts that are registered to receive Fire (WeaponPart_Receiver)

#

Reciever queries Magazine for ammo. If it has ammo, reciever tells Barrel to fire Projectile from Barrel's MuzzleLocation

#

That of course is of you intend to have wacky shit like recievers that don't need ammo or infinite ammo drums or whatever.

#

For realistic guns you can just make it all data driven and have one logic chain that uses data from all the parts to run.

sour urchin
#

how to change child item position inside vertical box?

faint pasture
#

@sour urchin in UMG?

sour urchin
#

yes

late cave
#

@sour urchin maybe use a grid instead? I know the grid slot can be read, but not sure if it can be set in code...

#

speaking of...

#

can anyone see why on earth I'd get these errors?

#

since I can't step through pure functions, I'm having a bit of difficulty debugging

sour urchin
#

make IsValid @late cave

#

from SlotIsGridSlot

late cave
#

@sour urchin โค๏ธ

sour urchin
late cave
#

holy shit, super duper facepalm, you are correct!

odd ember
#

@faint pasture branches on tick are not really fine no. ideally tick should be disabled BP side

late cave
#

thank you for noticing it! eagle eye ๐Ÿ™‚

atomic prairie
#

What is the name of theBP allowing to display a text or image on a actor BP which is oriented according to where the player is? Example: X button for open

proud hull
#

@atomic prairie add a widget component to the actor.

#

You can have its rotation change to face the player, or set it to render in screen space, but in screen space it will be drawn over the player in case that is not wanted.

atomic prairie
#

Okay thanks!!

patent blade
#

Hi ! I'm trying to make a twin shooter game . But the template proposed by UE is not what i am looking for ..
I would like to have player rotation and movement handled by LEFT STICK (or ZQSD on keyboard) when the player is RUNNING. [Situation A]
Player movement is handled by the LEFT STICK (or ZQSD on keyboard) and the rotation by the RIGHT STICK (or mouse) when the player is AIMING (Press LT or right click on mouse). [Situation B]

For the movement i'm ok . But i don't know how to make the second part . Running with left stick and AIM/Turn the character in the direction of the mouse cursor or right stick . Anyone can help me ? ๐Ÿ˜…

faint pasture
#

@patent blade AimDirection should be a function of RightStick, MoveDirection, and bIsRunning

patent blade
#

Could you develop please ?

grave relic
#

Anyone that can help me? I have this "secret door" that i want the player to be able to push open, but it dosent properly have physics on it for some reason, even tho it seems like ive done the collision right

swift dome
#

Hi can anyone help me convert this blueprint from 4.16 to be workable on unreal 4.25

#

The videoTexture component does not exist in unreal 4/25

#

4.25*

sudden spear
#

Hey guys!
I asked this question before today but I can't get my head around it so I wanted to see if anybody else has an idea.

I've got an array of actors from which I do a calculation on a specific value. When I have multiple actors I of course get multiple values. So my question is: How can I seperate/split these values back into single variables so that I can compare them to each other?

pulsar arrow
rough wing
#

@grave relic it'd be a lot better with the physicsConstraint component

#

If it moves like a door

worn inlet
#

Hey guys. I have a question for anyone that's been using nDisplay with vive trackers.

I set up using Ben Kidd's video on youtube (https://www.youtube.com/watch?v=KYgTPJ7REqY) with the nDisplay new project template and created this blueprint: https://blueprintue.com/blueprint/fgg1zcub/ by creating a blueprint subclass of DisplayClusterRootActor
In VRPN, I'm getting the following data from the controller (not using a tracker atm):

Tracker openvr/controller/LHR-F7FD3B46@192.168.0.41:3884, sensor 0:
        pos (-0.08,  0.78, -0.36); quat ( 0.20,  0.07, -0.15,  0.96)
Tracker openvr/controller/LHR-F7FD3B46@192.168.0.41:3884, sensor 0:
        pos (-0.08,  0.78, -0.36); quat ( 0.20,  0.07, -0.16,  0.96)
...

and that's coming through nicely in my Print String (see attached image) so I know that the data is passing through from the controller -> VRPN -> UE4 / nDisplay and it looks similar to Ben's (numbers from -2ish to 2ish)

lastly in my nDisplay cfg i have (alongside my monitor setup):

[camera] id="camera_static" loc="X=0,Y=0,Z=0" parent="eye_level" eye_swap="false" eye_dist="0.064" force_offset="0" tracker_id="ViveVRPN" tracker_ch="0"

[input] id="ViveVRPN" type="tracker"  addr="openvr/controller/LHR-F7FD3B46@192.168.0.41:3884" loc="X=0,Y=0,Z=0" rot="P=0,Y=0,R=0" front="-Z" right="X" up="Y"

however the movement of the camera is really tiny. I feel like i've missed something but can't put my finger on it

An overview of the Unreal Engine nDisplay plugin, how to use it and how to setup a config file.

Links
Docs: https://docs.unrealengine.com/en-US/Engine/Rendering/nDisplay/index.html
nDisplay Vive tracker tutorial: https://youtu.be/ZuAwDnw26JI

โ–ถ Play video
grave relic
#

@rough wing

rough wing
#

does it just not move at all?

#

Also in the viewport do you see your fireplace and the wall inside blue/red collision boxes?

grave relic
#

And i cant get it to move

patent blade
#

Non one can Help ?

#

Hi ! I'm trying to make a twin shooter game . But the template proposed by UE is not what i am looking for ..
I would like to have player rotation and movement handled by LEFT STICK (or ZQSD on keyboard) when the player is RUNNING. [Situation A]
Player movement is handled by the LEFT STICK (or ZQSD on keyboard) and the rotation by the RIGHT STICK (or mouse) when the player is AIMING (Press LT or right click on mouse). [Situation B]

For the movement i'm ok . But i don't know how to make the second part . Running with left stick and AIM/Turn the character in the direction of the mouse cursor or right stick . Anyone can help me ? ๐Ÿ˜…
@patent blade

rough wing
#

So youre not looking for a twin shooter youre looking for a third person shooter with the camera upside down?

grave relic
#

Okey will have a check over there, thx for the help!

clear sierra
#

Hey guys, is there any way to generate LOD at runtime for skeletal meshes ?

faint pasture
#

@patent blade if you are running, aim direction equals move direction. Otherwise, aim direction equal stick direction

trim matrix
#

I'm trying to use Suggest Projectile Velocity to get the velocity from point A to point B then launch it in that direction but it doesn't seem to be doing anything to the actor even though the method returns true and I get a suggested velocity.

faint pasture
#

First, why are you overriding gravity to be one.

#

Second, you are suggesting the velocity from 000 to your target point. That's probably not desired

#

Third, you are probably breaking the suggest projectile velocity because you're requesting a velocity from 000 to 000

#

Fourth, is spherer simulating physics?

trim matrix
#

Yes sphere is simulating physics.

#

I thought I had to override gravity.

#

And projectile from 000 to my location was just a test.

#

I don't understand your third point.

#

The actor that's being spawned is at 0,0,0 but

#

my actor's location is not 0,0,0

#

It's like 5000,0,0

faint pasture
#

You should check the velocity change checkbox on impulse.

#

Otherwise, mass comes into play

trim matrix
#

Still nothing, object just drops straight down.

faint pasture
#

What does the output of the suggest projectile velocity look like?

#

It should be a vector of length 400 in the direction toward the target.

trim matrix
#

Yes it's not printing anything I think when I check velocity change in impulse

#

Wait nevemrind.

#

It's just failing.

#

It wasn't earlier.

#

Weird.

faint pasture
#

It can fail due to gravity if the velocity isn't high enough.

trim matrix
#

ooh

faint pasture
#

400 is pretty slow, that's only 4 m/s.

#

You can probably jog that fast.

trim matrix
#

But it's just failing outright

#

Well when I override gravity z with 1.0 instead 0.0 it doesn't fail.

#

And it gives the velocity 2500,0,-999

#

But it doesn't fire the projectile at all

#

I got it working, don't even know what I Was doing wrong but it works..

subtle pulsar
#

Anyone know about publishing games?

odd ember
subtle pulsar
#

Wrong section right?

odd ember
#

yes

subtle pulsar
#

ahh sorry, ive got this logic for the enemy to hit the player and when it shows from the print string its giving location not player name would that still work?

faint pasture
#

@subtle pulsar uh....what.

#

Why would a player name even come into the question?

#

You want to break the out hit to get the hit object

serene vessel
#

I still want to make my NPC rotate to face the player not instantly when touched or damaged, how would I do this?

rose hazel
#

Is there any way to trigger an event when a variable is changed instead of having to rely on checking every tick?

lime mason
#

it says this:
Infinite loop detected. Blueprint: BP_Door_In_interact Function: Set IsDoorClosed Call Stack: Show

dense mica
#

When you iterate for one time you go back and telling the bp to iterate 46 more time again and which makes 47 iteration, and on 3rd iteration you do the same and it makes another 46 more

#

And it never stops

lime mason
#

how do i get it to stop

faint pasture
#

@lime mason whoah wtf is that

dense mica
#

Are you especially using for loop or just opening the door will be enough?

#

For Loop is not a good way to open doors ๐Ÿ˜„

faint pasture
#

@lime mason Use a timeline

dense mica
#

yeah

lime mason
#

how

#

lol

dense mica
#

or RInterpTo could work too

faint pasture
lime mason
#

thanks

rain peak
#

Does IsValidAILocation use the same navmesh as the player character? I can't get it to work, it returns true for locations within level geometry.

faint pasture
#

A timeline is like a little ticky boi you can fire off and do ticky things without sitting on tick updating the door all day when you only care to update it when it's opened.

odd ember
#

only available for actors sadly

serene vessel
#

Still waiting for my answer on how to do AI Chars rotating to face player on touch and damage, like in Postal 2.

rain peak
#

Not sure how it was done in Postal 2, but I do it with a bShouldRotate boolean on Tick()

serene vessel
#

Hmm, I could do that

rain peak
#

you can do the math, right? I've got my logic in C++, but it's something like calculated delta phi between the NPC->player vector and NPC facing vector

#

then lerp to it or just linear add until delta phi < (whatever tolerance you want to set)

dense mica
lime mason
#

would this work?

#

actually i changed it

onyx pawn
#

I have a custom event in my level blue print toggle building that I want to call when a button on my player widget is clicked..

#

but in my player screen widget I can't seem to figure out how to get the event from level blueprint

faint pasture
#

@lime mason Something like the 2nd one would work

#

It'll take some fiddling to figure out what yaw corrosponds to open vs closed but it should work. I usually prefer to have the timeline output just go 0-1 and have it lerp the open and closed rotators

lime mason
#

im having trouble interacting with it

dense mica
#

instead of booleans you can use flipflops

#

and for interaction look for line traces

#

@lime mason

lime mason
#

i have it as a boolean because it might start open

dense mica
#

flipflop can do that too

#

oh sorry now i got it

#

for interactions you can use event instead of InputAction and on linetrace you can get HitResult, break it, on "HitActor" cast to your door actor then call that event you created

lime mason
#

ok

spark steppe
lime mason
#

for interactions you can use event instead of InputAction and on linetrace you can get HitResult, break it, on "HitActor" cast to your door actor then call that event you created
@dense mica when you say event, what do you mean?

dense mica
#

Custom Event

#

replace input action with a custom event

#

and use input action on character class to fire line trace

lime mason
#

so the custom event would ne in the door bp right?

dense mica
#

yes

#

then on line trace call that event with cast to door bp

lime mason
#

i have this in the player

#

it does a line trace then checks if its the door

#

then if it is does the door interact event

#

but

#

idk i

#

it doesnt like something

#

oh

#

its cause i didnt compile it

#

lol

#

ok well it opened but the closing is a little janky

#

for some reason when i click on it to close

#

i have to move and then it closes

#

any idea what thats for?

#

@dense mica

dense mica
#

you can remove the "==" and branch

#

i have to move and then it closes
i didnt understand this

lime mason
#

ok

dense mica
#

what do you mean by "move"?

lime mason
#

so

#

wasd is movement

#

i click to close

#

and it doesnt do anything

#

till i use the movement keys

dense mica
#

could be about collision?

lime mason
#

i have no idea why its doing it

#

oh

#

i guess mouse movement as well

#

i think theres a delay on it

#

or something

#

idk

dense mica
#

i would suspect your timeline

#

i never used timeline like that to open doors

lime mason
#

oh im just dumb

#

i figured it out

#

it was set to 5

#

seconds

#

so reversing it would take a long time

#

ive never dealt with timelines before

#

and all the moment stuff was coincidental

#

fun

#

ive been bamboozled

dense mica
#

๐Ÿ˜„

#

okay

#

is everything works now?

lime mason
#

yea

#

just gotta add sounds

worldly edge
#

so im new to unreal and im jumping in head first into procedural generation ive generated a dungeon kind of. in unity the way to do procedurals would be to have premade rooms and assign them numbers in an array and use if else statements along with a variable telling what side or wall is open to another room here ive taken a different approach and just generated a floor with planes tiled and walls with a cube instance how would i go about making a beginning and an end to this maze i was thinking some sort of ai with a script to destroy the cubes it touches or a raycast of sorts

#

thats long

#

this is what it looks like now

hearty gazelle
maiden wadi
#

@hearty gazelle You mean like reenabling it?

hearty gazelle
#

So I bounce up my character

#

but when I hit a trigger

#

i want the velocity to be reset to 0 so that it stops going up

maiden wadi
#

Sec, have to open UE4. Can't remember what it is offhand.

hearty gazelle
#

let me try

rose hazel
#

I assume itโ€™s possible to add projectile movement into an actor using another blueprint?

#

I finished a .357 round that replaces its own mesh with a spent case when fired, but I donโ€™t want the case to eject itself until the gunโ€™s bolt is completely opened

icy mica
#

@everyone plz help

maiden wadi
#

@icy mica Don't ping everyone randomly, please. What is your jump doing wrong besides just not working?

icy mica
#

sorry about that

#

the character is not jumping at all

maiden wadi
#

@rose hazel You might try a simple static mesh component spawned attached to where it needs to be, and then on the bolt completely opening, set simulate physics on it and give it a velocity.

icy mica
#

@maiden wadi so whats my problem

maiden wadi
#

@icy mica You have no number in the DoN. It'll never leave zero and you're not doing anything on zero.

rose hazel
#

So the projectile movement can just sit there in the actor until the gunโ€™s ready to use it?

icy mica
#

@maiden wadi oh my gosh thanks so much

rose hazel
#

How does 1000 cm/s sound for case ejection btw

maiden wadi
#

Not sure. It's possible. But with that you'd have to attach the actor to the other actor, leave the PMC at 0 speed, on eject detatch it from the gun, then set speed. I was offering a simpler route though. The bullet casing would just be a simple static mesh component attached to the gun with a static mesh set instead of a full actor. Then the only calls you would need to do are SimulatePhysics which automatically detaches, and then a set velocity.

twilit heath
#

@rose hazel its about the athlete's top running speed

#

for comparison

rose hazel
#

The way itโ€™s currently set up, Iโ€™m planning on attaching the cartridge to a socket in the bolt from the moment itโ€™s removed from the mag to ejection

modern cove
#

Can I have a function that will return a Data Table based on a string or text variable? IE: if the input string reads "Table 5", it would return the reference to a Data Table called Table 5

rose hazel
#

I have a finished cartridge with a single bool named Fired. When itโ€™s true, it spawns a bullet, changes the cartridge mesh to a spent case, and plays a sound

twilit heath
#

if you bother to make a TMap<FString, UDataTable*> DataTables; @modern cove

#

then its easy

#

if you want to dig through assets by name, somewhat less so

#

@rose hazel most games can get away with PCS doing shell ejection instead of having Actors for shells

modern cove
#

I'm not finding any nodes that can turn a string into a Data Table

twilit heath
#

create a map variable

#

fill in the mapping

#

and then just access the datatable by string key

modern cove
#

hrm..I haven't made a Map variable before but I see what it does

#

Otherwise I might just have to do a Switch on String and plot out the 8 possibilities

twilit heath
#

make string variable, turn it into a map, then select the datatable for other type

#

then add your 8 elements to the map

#

and then MapVar->Find(StringKey) returns the datatable you need

maiden wadi
#

@rose hazel Are you planning on having your shell casings picked up, or interacted with past ejecting from the gun?

rose hazel
#

They can be collected and reloaded

twilit heath
#

no particle system fakery then ๐Ÿ˜ฆ

maiden wadi
#

Actor is very heavy to be using for something as common as bullet casings. You'd be better off just making a UStaticMeshComponent child class into a UShellCasingBase, and using that for any custom logic you need for picking up and ejecting.

rose hazel
#

Theyโ€™ll be physically locked in place after not moving for a few seconds, but the player will still be able to interact with them

twilit heath
#

but if you have something like 2000 RPM gun and a MP game, that approach will absolutely not work

rose hazel
#

Itโ€™ll be single player only

#

No way in hell Iโ€™d be able to make a multiplayer game with how little experience I have at the moment

twilit heath
#

you can eject it as Actor and when it stops destroy the Actor and replace it with ISM

#

much easier on the performance

rose hazel
#

That could work

#

Would the player still be able to interact with the case at all?

twilit heath
#

a trace would return the instance index of the shell

#

so would a sweep

#

overlap, not sure

#

so its possible to make the interaction

rose hazel
#

As long as the player can click or press a key over them, Iโ€™m good

#

Still trying to figure out how the inventory system will work, but small stuff like this will probably just be an integer somewhere

maiden wadi
#

This is the difference between spawning an empty actor with no static mesh component and spawning an empty static mesh component child class. Granted, you're likely not spawning five hundred at once, but still. And they can have the same exact functionality in the end.

#

Note, that's just spawning. Nothing to do with movement, or anything else.

twilit heath
#

Actor code is simpler to get working though

rose hazel
#

One thing to keep in mind is that Iโ€™m not kidding about being new to UE4. Iโ€™ve had it installed for a while and I know some base level stuff, but thatโ€™s about it

#

As in I donโ€™t know how much I donโ€™t know

#

An ambitious project like what Iโ€™m planning may not be the best idea, but I can guarantee itโ€™s the only thing Iโ€™ll have the patience for since itโ€™s something I actually want to do

maiden wadi
#

I'm not sure how? As far as a bullet casing goes, both have the same kind of events and usage.

rose hazel
#

Based on what I know at this moment, hereโ€™s what Iโ€™d do for a simple bullet casing

#

Spawn an actor with projectile movement, delete it after a delay of 5-10 seconds

maiden wadi
#

@rose hazel This is all you'd need for a component based solution. This being the component parent class. You could either make some switches in here on spawn to set the bullet type, or make child classes with different values. Same as an actor.

#

Your gun actor can spawn it, leave it attached til the bolt opens, then call launch casing. Component handles it's own stuff and then 'turns itself off' more or less until someone walks by and calls an interaction event on it to pick it up.

#

Ideally use Zlo's advice though if you really want the best performance. Having a level actor that can hold ISM meshes would be best after they stop moving. Unless you want them to be able to be stepped on and kicked around.

rose hazel
#

Theyโ€™d be kicked around in a perfect world, but even Iโ€™m not sadistic enough to torture a PC like that

#

As for the actual bullet after itโ€™s been fired, Iโ€™m just going to destroy it. Cases can be reloaded, but thereโ€™s no point in keeping the lead around since it wonโ€™t even be usable

maiden wadi
#

The movement could be a setting too, if you wanted to go that route. Branch on whether or not the user wants to allow it. Single player, so it's not like cheating matters much.

#

But no. The only honest drawback to the component method is that the actor spawning it needs to stay around. Of course that can easily be gotten around by making it in a level actor spawned from like GameMode and held in GameMode for easy getting to spawn more. You could use the same actor for the ISMs too if you wanted to really get optimization crazy.

rose hazel
#

I like the idea of simply replacing actors with meshes, then deleting each mesh when the player interacts with it, although one thing I was planning on is giving cases a โ€œlifespanโ€, as in how many times they could be reloaded before becoming useless

#

It wouldnโ€™t be many - maybe 5-6 times at most

#

Steel cases wouldnโ€™t last nearly as long as brass

maiden wadi
#

Before the crazy optimization talk begins, how many shots are you considering having? Are you going to have a lot of automatic weapons? How many AI might contribute to this? etc.

rose hazel
#

There will be a few automatics, mostly SMGs and larger machine guns

#

Not exactly sure about NPCs, but definitely somewhere in the hundreds

#

Ideally, everything in the game would persist as its own thing - characters, weapons, ammo, etc.

#

Since Iโ€™d prefer not to torture PCs, there are obviously exceptions Iโ€™ll have to make

#

So does an actor simply existing with nothing but a variable still take a toll?

maiden wadi
#

Memory wise, yeah. If you disable tick, the cpu footprint is near nonexistent.

rose hazel
#

Setting aside memory usage, would the following be possible - after a spent case (actor) doesnโ€™t move for a few seconds, it becomes a static mesh with an integer for the remaining uses it has. When the player clicks on it, the mesh is deleted and a new actor with an integer is spawned within the character, and the variable matches the one on the mesh

#

Thatโ€™s assuming itโ€™s possible to have a mesh with a variable in the first place

#

Otherwise, since thereโ€™s a maximum number of times a case can be reloaded, I could simply have multiple meshes (Case0, Case1, Case2, etc.)

#

The actor would select one based on its remaining uses

spark steppe
#

i want to control the alpha of my IK chain by getting the alpha from the rotation difference, anyone has suggestions how to get said alpha value?

maiden wadi
#

Well, the mesh and variable are easy. Simply leave it an actor and disable tick.

#

@spark steppe What is the rotation difference?

rose hazel
#

Perfect. I wonโ€™t have to use any black magic or voodoo to consistently transfer the variables

shadow saddle
#

for collision sphere

#

the main purpose is to detect whther u start to collide with something

#

or when end collide

spark steppe
#

currentFrame to frameTarget is the difference

shadow saddle
#

right?

#

if you are already within the sphere radius when the game start

#

the "begin overlap" wont trigger right

spark steppe
#

but idk whats the best approach to get an alpha value from that difference

maiden wadi
#

@rose hazel Not initially. The concern is more that if you have a few hundred of these, that'll start to add up. Que gamers being retarded, and that quickly turns into a thousand, two thousand ten thousand. Suddenly you have a playerbase whining about it. That's the biggest reason why programmers tend to be so anal about optimization. End users don't always want to use your product the way you intended it to be used.

rose hazel
#

So just using an actor for every single cartridge and case wonโ€™t be a good long-term solution, even if actors stored in the inventory donโ€™t have a mesh or tick is disabled for idle cases?

maiden wadi
#

@spark steppe Wait, by current frame, what do you mean? Having trouble visualizing numbers. If you have like a max rotation and a current rotation that's just simple division.

spark steppe
#

i have the current rotation, and the rotation goal (as quaternion, which i could convert to a rotator)

#

and i want to kinda lerp to the goal, but i wonder which alpha i should use

maiden wadi
#

@spark steppe Do you want to lerp, or interp? Is this something where you have the start and end value, or something where you have the current and end value and it's being called each frame?

spark steppe
#

later one

rose hazel
#

One good thing to come out of this is that I now know ticking can be enabled and disabled, meaning that I now have a better solution for a gunโ€™s action. It currently checks a bool with each tick, so I can tell the receiver to enable ticking for the action when the gun is fired

spark steppe
#

the thing is that i only have access to interpolate methods for vector/floats

maiden wadi
#

@spark steppe Where are you doing this in by the way? Your nodes looked like Niagara nodes last time you were pasting them.

spark steppe
#

controlrig

#

4.26, so it might not look familiar ๐Ÿ˜„

maiden wadi
#

@spark steppe Last question, constant movement speed, or slower as it reaches the target?

spark steppe
#

well i could live with constant for now

#

oh i might have found some node that does the job

maiden wadi
#

@rose hazel All in all, you'll find a lot of things in game design are faked. For example, if you have a bullet casing with uses, in the inventory it likely just has an ID and a durability value and that's stored in a simple array. Even a 3d inventory would be like that and it'd just spawn a localized mesh when the player looks in the inventory based on the inventory's item IDs.

#

@spark steppe Do Rinterp exist in there?

rose hazel
#

Oh yeah. Arrays

#

See what I mean about I donโ€™t know how much I donโ€™t know

icy mica
spark steppe
#

no, but there's accumulate lerp for quaternion

rose hazel
#

Add Iโ€™ve heard about it but I donโ€™t remember to that

maiden wadi
#

Haha. I know that feeling. I've been at this about a year now.

spark steppe
#

the only sad thing is that it only allows to set a blend value, so i guess if i set it to 0.1 it will add 10% each frame

maiden wadi
#

@spark steppe Do you read C++ well enough?

icy mica
#

anyone plz help

rose hazel
#

The thing is, I only know how inexperienced I am because I used Roblox for a while. I only knew base level stuff, and I know even less for UE

icy mica
#

@maiden wadi can you help bro

spark steppe
#

c++ yea, but if i would understand all the math behind that stuff is the real question ๐Ÿ˜„

icy mica
#

@spark steppe can yoou help me bro

spark steppe
#

but with that accumulate node the result looks good for me, so i'll just leave it as it is now

#

it doesn't "warp" the head to the location goal anymore, so thats good

maiden wadi
spark steppe
#

it will get slower to the end with that accumulate node if im not wrong

#

if it really adds 10% to the current location each time now

icy mica
#

if anybody gets free just tell me the problem i will be here

spark steppe
#

it will actually never reach the target if i had infinite precision ๐Ÿ˜›

#

@icy mica your screenshot is hard to read

#

zoom in, resize the sidepanels so that its readable and post it again please

rose hazel
#

No wonder. -5 zoom

Yikes

#

I always try to stay as close to 1:1 as possible

icy mica
#

ok i will try to send it again

rose hazel
#

Iโ€™m not at my PC right now, but your best bet would be -1 or -2 max

icy mica
spark steppe
#

still can't read that without getting a headache

rose hazel
#

@icy mica go down to -2

#

Itโ€™s annoying as hell to have to take multiple screenshots, but theyโ€™ll at least be readable

spark steppe
#

that would fit one screenshot if he resized the sidepanels for the screenshot

rose hazel
#

True

#

I personally prefer to leave those alone, so I just zoom in

spark steppe
#

i personally prefer to have everything readble on one screenshot instead of multiple

icy mica
#

i think this is ok

spark steppe
#

that's literary the same zoom level as before ๐Ÿ˜„

#

just without sidepanel

rose hazel
#

@icy mica look at the top right

#

The zoom should be -2 at most, ideally -1 or 1:1 for smaller blueprints

icy mica
#

oh ok

rose hazel
#

Looks okay on my phone. I still have to zoom in a bit myself, but itโ€™s readable

#

@spark steppe alright for you?

spark steppe
#

yea, that works for me

icy mica
#

so whats the issue

spark steppe
#

you are not setting onWall to true

#

so it will never set your gravity to zero

#

thats perhaps one problem in that logic

icy mica
#

spo i have to tick the box of on wall

spark steppe
#

idk about how all your stuff works, but it looks like it should be ticked, yes

icy mica
#

ok

#

nah it dosent work

maiden wadi
#

What exactly is the wallrun goal?

spark steppe
#

you are holding space down?

#

because as soon as you release space it will stop the wallrun

#

also do yourself a favor and make either 2 customEvents or functions which you use to start/stop wallrun

#

that will solve a lot of that spaghetti nodes

#

and makes it easier for you to debug

patent blade
#

Hi ! I'm trying to make a twin shooter game . But the template proposed by UE is not what i am looking for ..
I would like to have player rotation and movement handled by LEFT STICK (or ZQSD on keyboard) when the player is RUNNING. [Situation A]
Player movement is handled by the LEFT STICK (or ZQSD on keyboard) and the rotation by the RIGHT STICK (or mouse) when the player is AIMING (Press LT or right click on mouse). [Situation B]

For the movement i'm ok . But i don't know how to make the second part . Running with left stick and AIM/Turn the character in the direction of the mouse cursor or right stick . Anyone can help me ? ๐Ÿ˜…
@patent blade

austere knoll
#

Is there a node where you can do 2 int comparisons in BP? Such as, if int 1 == int 2 OR int 1 == int 3?
Or do I always have to double-up branch statements to do that in BP?

spark steppe
#

you could use a switch on int node maybe

#

or integer in range depending on what you try to archive

flat raft
#

finished my very efficient, resident evil style puzzle Inventory prototype. I'd like to improve on the max search. It searches a few too many indices. ideas on how to get it to be more efficient ?

austere knoll
#

Ben: Thank you.

spark steppe
#

@flat raft break out of the for loop when you found a slot? but i dunno what it actually does

flat raft
#

@austere knoll you can use the OR node with will result in 1 branch

#

@spark steppe it returns the index of an inventory grid. Like it will return if a 4x3 space is available.

spark steppe
#

yea then you can actually break out of the for loop, or just return the field index once you found a slot

#

so if it's a function return the slotIndex instead of printing it and you should be good

flat raft
#

I don't know when to break. I mean, I don't know the condition to break.

#

there's is some math I'm missing for the maxSerach

spark steppe
#

why do you even continue searching if you found a slot?

#

do you want to get all slots?

flat raft
#

it's one of there...

spark steppe
#

or just the first valid one

flat raft
#

One of these.. so it returns a Array of valid indices.

spark steppe
#

that doesn't sound efficient, except you want to visible highlight every valid slot

flat raft
#

Ya

#

The system works as intended, it just does a few extra loops

spark steppe
#

then it doesnt work as intended ๐Ÿ˜›

flat raft
#

it works, just not as efficient as can be

#

like I could leave it like it is, and it's fine.

#

but I know there's just a tiny number I'm missing that can make it perfect ๐Ÿ˜‚

#

I didnt take into account the grid height, so I guess I'm not done. ๐Ÿ˜…

#

Is your pic a character from that one 2d game?

#

I'm trying to place it lol

#

Cuphead

maiden wadi
#

@patent blade The math for those is a little different. I assume you want it to follow the mouse if there's a mouse and just look in the direction of the right stick if it's a controller?

spark steppe
#
bool isSlotValid(int slotIndex, int itemWidth, int itemHeight){
  int slotCount = inventoryWidth * inventoryHeight;
  for(int currentIndex = slotIndex; currentIndex < slotCount; currentIndex++){
    // return if we reached a point where no slot can be valid anymore
    if(currentIndex / inventoryWidth + itemHeight > inventoryHeight || (currentIndex / inventoryWidth == (inventoryHeight - 1) && currentIndex / inventoryWidth + itemWidth > inventoryWidth))
      return false;


    // continue until theres enough slots at the right of the current slot (count could also be increased by the itemWidth to avoid running into this statement multiple times)
    if(currentIndex % inventoryWidth + itemWidth > inventoryWidth)
      continue;

    // iterate over all slots and check if they are empty
    bool slotValid = true;
    for(int row = 0; row < itemHeight; row++){
      for(int column = 0; column < itemWidth; column++){
          if(!isSlotEmpty(currentIndex+(row*inventoryWidth + column)))){
             continue 2;
          }
      }
    }
    
    if(slotValid)
      return true;
  }
  return false;
}
#

@flat raft thats some pseudocode of how i would do it

flat raft
#

Oh sweet! Thanks, I'll compare.

spark steppe
#

depends on the language you use, idk much about python, so the continue 2; statement might not work there

flat raft
#

I'm using cpp, I just decided to prototype in py cus it's quick

spark steppe
#

ok, in cpp it works

flat raft
#

Thanks Again, I'm out for the night

spark steppe
#

inventoryWidth and inventoryHeight might require to be a parameter if they aren't in scope of a inventory class or something

#

whatever, i wrote so much inventory code in my life that i should hate it actually ๐Ÿ˜„

maiden wadi
#

Yeah, not a big fan of those myself.

icy mica
#

so anyone know whats my problem why cant i wall run here is the script

spark steppe
#

you should tell more what doesn't work

#

no one knows where your node setup stops working

icy mica
#

yes it dosent wallrun thats all

#

all other stuff is okay

spark steppe
#

is the overlap event fired?

icy mica
#

yes

spark steppe
#

are you holding space down before it fires?

icy mica
#

what??

spark steppe
#

your setup requires that

icy mica
#

i also like added the tag

#

and enabled generate overlap event

spark steppe
#

you did copy that nodestuff from somewhere and you have no idea how its intended to work?

icy mica
#

no i followed a tutorial

maiden wadi
#

How do you know that the overlap is firing?

icy mica
#

what is overlap

maiden wadi
#

Overlap: extend over so as to cover partly. According to google.

#

I don't know what else to answer to that. You put the nodes there.

spark steppe
#

the event only fires once you run into the collision box of the actor that triggers the event

icy mica
#

can you tell me on the screenshot or something because i just startes yesterday

spark steppe
#

and as your code relies on the fact that the spacebar has to be hold down, you have to hold it down before you run into said collision box

#

and keep it down as long as you want to wallrun

icy mica
#

oh i will try that

spark steppe
#

either the tutorial you watched was for advanced users which means you should learn the basics, or you should watch the tutorial again, there are many ways to break that logic

maiden wadi
#

You should put PrintString nodes throughout your white execution lines often when creating something. These will print in the top left when something happens, so that you know if the event is even working or not. In short, put a print string node right after EventBeginOverlap, and go run into a wall and see if it prints hello.

#

PrintString will teach you a lot and help you understand the flow of things, and the values of stuff at different times. Other people use the debugger tools as well, either way.

worldly edge
#

ok i have to output true only if 4 bools are false how would i do that

#

i was thinking logic gates

icy mica
#

that works but how can i like wallrun without holding spacebar

spark steppe
#

@worldly edge NOR gate

worldly edge
#

nor only has 2 pins

spark steppe
#

you can add more

worldly edge
#

i thought maybe this would also work

spark steppe
#

you can just use the nor thing and rightclick it to add more connectors

#

or wait... yea doesnt work on NOR

worldly edge
#

yeah im looking i dont see anything

maiden wadi
spark steppe
#

then use an OR gate for the 4 inputs, and put it in an NOT gate

worldly edge
#

ahh

maiden wadi
#

Odd that they didn't do the NOr like that.

worldly edge
#

yeah

spark steppe
#

yea you can just use OR => NOT gate to inverse the result

worldly edge
#

lets hope this blueprint to check if two rectangles intersect works hahah

#

ill know what to check first if things dont work out

maiden wadi
#

@worldly edge What data types are you using? What do you mean when you say rectangles?

spark steppe
#

isn't there something for basic AABB intersections in unreal?

worldly edge
#

i have a vector position of two rooms im trying to generate and i have to see if they intersect by comparing the point of origin x of R1 and the point of origin x + size of r2 i think if this comes back false then they arent intersections

#

and idk man im still getting used to blueprints

spark steppe
icy mica
#

thanks everyone for your help my wallrunning works now

spark steppe
#

@icy mica what was the issue?

maiden wadi
#

That's strange. I know that FBox has a C++ function for that. I wonder why it's not exposed.

worldly edge
#

idk how id implement that code into my blueprints

#

im sure what i did works and if it doesnt its some dumb error

#

and it looks super messy

icy mica
#

i dont know it just randomly stared working lmao

maiden wadi
#

@worldly edge Just curious, what is the size you have? How are you measuring that? From the center point to the box extent, or width/Length?

worldly edge
#

i think its bottom right tcorner or thats how i did it ๐Ÿ˜†

#

realizing now tho origin would be in the center of a object

spark steppe
#

you shouldn't have to deal with the origin at all, only lowest corner and the highest opposite corner

worldly edge
#

what i thought

maiden wadi
#

As long as those points are in world space. Most Unreal math tends to use a center point, and a box extent.

worldly edge
#

i know that first one

#

not box extent hto

#

tho

maiden wadi
#

Center point in world space, and box extent towards the front upper right corner in relative space.

worldly edge
#

ok cool

spark steppe
#

are the rooms spawned or are you doing the check before you spawn them?

#

if they are in the level you could do a collision check within the engine

worldly edge
#

the rooms arent spawned when this check happens

#

for questions sake what nodes can spawn rooms or shapes without premade meshes like is there a node that can make a plane or cube just through blueprints

#

instead of static instantiated objects

spark steppe
#

is maybe one of the rooms spawned?

worldly edge
#

No

maiden wadi
#

If you spawn anything, it has to be an actor to be in the world, or attached to an actor as a component. Otherwise you're relying on math and values.

worldly edge
#

nice thanks for all these knowledge nuggets

spark steppe
maiden wadi
#

Lol. I just went to double check. FBox does have an overlap to check another FBox. How is that NOT in a library somewhere??

spark steppe
#

sadly they don't expose the necessary stuff to blueprints

#

@maiden wadi go make an addon and sell it for $100 on the marketplace :p

worldly edge
#

i liked to code in unity haha

#

but cpp is totaly different

maiden wadi
#

It's really not. Trust me.

#

I learned it in the last few months and my background came from blueprint and UI design LUA scripting.

spark steppe
#

yea, if you ever plan to get into cpp, something like this is good to get started

#

not too complex and it has some value in it if you can use it ๐Ÿ˜„

#

Lua? Where?

void snow
#

yo @maiden wadi Yesterday with your help i attached particle to my mesh, now im trying to destroy that component when the state is changed to normal from torch

spark steppe
#

@void snow can't you just disable the component?

void snow
maiden wadi
#

@void snow You'll want to save that particle emitter to a local pointer and call destroy on it when your event fires to change to normal if the emitter is valid.

void snow
#

this is torch sate

#

state*

#

so i wanted to destroy it

worldly edge
#

dude looks like dark souls

void snow
#

or disable

worldly edge
#

freaking great

maiden wadi
#

Probably destroy. Particles are cheap to spawn.

#

And you're already spawning it.

void snow
#

yeah i want to destroy the particles, but i don't know how to get the reference of it

#

i tried promoting it to variable

#

didn't work

spark steppe
#

don't they have a lifetime?

void snow
#

no i guess they are spawning on each other when i put the torch out

spark steppe
#

or do they maybe have the option to rely on some other element to stay active?! never worked with particles in unreal, so im just throwing out ideas^^

maiden wadi
#

Normally they do, but you wouldn't want it for something like a torch, you'd want to disable it so the torch doesn't just randomly die.

void snow
#

Yeah!

#

now how do i get the reference for it?!

maiden wadi
#

You can create one by right clicking the blue pin on the right side of where you're spawning it. It'll create an actor variable of the emitter type.

sterile wraith
#

Hi there, does any one know a cool way to get UDP into Unreal? working with 4.26 at the moment.

maiden wadi
#

@sterile wraith Unsure. I don't know much beyond Unreal's default networking and replication that works on UDP. Might ask in the #multiplayer channel though.

sterile wraith
#

ok, will do thx

cold sinew
#

Authaer@maiden wadi are you on bro

#

You are the one who know how to make it

void snow
#

Thanks for help it worked ๐Ÿป

cold sinew
#

I have a wall i want to interact with the wall as a parts i want to divide the wall for example 6 parts and interact seperatly with these parts

#

Each part i can draw outline or paint it change the texture seperatly

#

Like House Flipper game they can interact with small parts from the walls and each face side seperatly

maiden wadi
#

You're probably just wanting to make separate components in the same actor and make the wall an actor if you're trying to make it like that game.

cold sinew
#

Yes but do i need to divide the mesh and group them into one actor

#

Or can i make it with one solid mesh

spark steppe
#

just make a actor blueprint with a cube as mesh and some collision box and call it a day?!

#

then spawn multiple of them next to each other

cold sinew
#

Its not a cube for all

spark steppe
#

ok, idk the game, so maybe im missing deep knowledge

dense mica
#

Construction Script runs only once when game started, right?

cold sinew
#

@dense mica runs on Editor once actor initiliazed

#

@spark steppe yes i have houses i want to interact with walls as squares so i can paint each square seperatly

dense mica
#

Understood. I am having a weird problem, my arrays changing their value in runtime I get suspicios of construction script.

cold sinew
#

Thats the idea

#

You have something changing the data

dense mica
#

I only have one "set" for that array and not using it in any other place, only using gets

#

If you have any idea

#

I am hovering over the pins to show current values on breakpoint stop

#

SpearHead_C becomes AxeUpgradeC* with no reason

maiden wadi
#

@dense mica Where is the array populated?

dense mica
#

Its the most messy blueprint I've ever worked so its also confusing. But trying to solve this for 6 hours and double-checked every little blueprint code to ensure I am not using that array anywhere else.

maiden wadi
#

In short, the construction script gets ran once for every time an actor is spawned, this includes becoming irrelevant and then being respawned in when it is relevant. Also for every time it's moved or placed in the editor.

dense mica
#

Understood. I am using another arrays there to update the avaiableUpgrades in editor time, but its not relevant as I understand

maiden wadi
#

What does GetCurrentAttachment return?

dense mica
#

I have local variables of these two in CacheAttachments, only reason I am doing this is ChildActorComponent is not caching stored values

#

And I am caching my valus in an array on BeginPlay

#

And when doing ForLoop for creating widgets, I am just using this arrays, because when I set new child actor class old values removing

maiden wadi
#

On a side note, the Get node in your one function isn't necessary. You can use the array element from the foreach loop the same way. Still looking through the rest.

#

@dense mica Curious. Can you put a print after the...

#

AddNewObjectToScrollBox. Put a print after that and put the breakpoint on it instead of the AddNewObjectToScrollBox function?

#

See what the array of classes points to when it breaks on the print node instead.

dense mica
#

Disclaimer: When I dont add elements to array its null

#

Not returning AxeUpgrade

#

When I add new one its being converted to AxeUpgrade(?)

#

Even with the multiple elements its returning a single element

#

Which is making me suspicious of this is being used somewhere else but I used "find" on every blueprint class and searched for AvaiableUpgradesx, its not being used as "set"

#

Disclaimer: When I dont add elements to array its null
oh wait, even when i dont add elements its returning AxeUpgrade now..

exotic geyser
maiden wadi
dense mica
#

Just wondering.. Does blueprints ever do something wrong? For example compiler is broken, cached wrong values or processing wrong values..?

#

AxeUpgrade2_C also not being used on anywhere

exotic geyser
#

@maiden wadi Ah ty forgot about this lol

maiden wadi
#

@dense mica Never ran into that issue myself. Although I'm not a fan of the blueprint debugger. I hate it. I've tried using it a few times and it just feels cumbersome for testing. I have never once been led wrong with printstrings at the correct execution time.

dense mica
#

Understood. Well, I am going to recode everything from stracth then. But one more question, do you have any alternatives for ChildActorComponent? I am storing multiple arrays and structs in my upgradements, that was why I used them but got disappointed with them really bad ๐Ÿ˜„

earnest tangle
#

What problems did you have with that? I've heard it's a bit of a kludge but at least I haven't had any major issues

#

You can manually spawn actors and attach but that comes with its own pitfalls (such as the attached actor won't auto-destroy if the parent destroys)

dense mica
#

Well I have multiple for loops and a tons of conditions checks to set upgradements for preview only, when I dont confirm I am reverting to the last confirmed class for upgradement etc. etc.

#

And when I switch between classes its not storing values

#

I need to cache values and set them back

#

Which is causing trouble at the moment (you can watch video on the upside)

#

System is working very good but carrying data from a class to another class and resetting conditions etc. was pain in the ass and now just because of they are not keeping editor values I am having issues ๐Ÿ˜›

earnest tangle
#

Ah

#

I have a system kinda like that in my game where I spawn some accessories for NPC's

#

I have a struct for holding data on it - basically it contains info on what accessories should be spawned and a few other things that are adjusted on the NPC

#

these are pretty easy to copy around and modify

#

the NPC class then just looks at the data and spawns the right things

dense mica
#

I am also doing the same but for preview-confirmed states I needed to use something dynamic

#

The problem is when it comes to ChildActorComponent my structs stays but the values I put in editor wont

#

Anyway I already solved that with caching values in beginplay and setting lastconfirmed class on widget, but today something weird happened thats ruined everything, prorably its something I cant see or an engine bug

earnest tangle
#

It can be a bit tricky sometimes with values when they are copied instead of referenced

#

You need to make sure the correct kind of operation is being done on the correct object