#blueprint

1 messages · Page 198 of 1

tropic peak
#

I need to understand this just once without ending up guessing

dark drum
#

So I have a widget i use to display data from a power generator. This widget is created from the power generator actor. When it's been created, I then call a function on the widget to pass data to it. In this case, the power generator itself.

(I'm not sure how useful these screenshots will be)

tropic peak
#

yeah I get it but it feels a bit different with widgets

#

that's in BP_PizzaPrep

#

so when I create the widget from this class it's not (?) passed to WBP_PizzaBakingWidget

#

therefore I need to set BP_PizzaPrep manually somehow

#

so I do this

dark drum
tropic peak
#

now I feel even dumber 😦

dark drum
#

The initialize function is what I call on the widget from the place that spawns it so it knows it's been given the data it needs to update and do it's thing. (Updating a lot of sliders)

tropic peak
#

when casting, what is the input object

#

I still need to get an actor instance from a scene to plug in there

dark drum
#

To be fair you could probally just expose it on spawn and it'll show up on the create widget node.

tropic peak
#

expose it on spawn - the BP_PizzaPrep variable in both of the widgets?

lunar sleet
#

We’ve told you this in a few ways now

#

It’s not cast -> then find ref

#

A cast checks if the object you fed it is the right one

normal viper
#

hey
so i have an interface with two functions but i cant for the love of god figure out why its saying implement event not function

#

pls need help

foggy escarp
normal viper
foggy escarp
#

yeah

marble tusk
#

I think you can also convert events to functions in the right click menu on the event node

normal viper
#

thnax a lot dude

marble tusk
#

Try implementing the event and see if you can convert it

foggy escarp
normal viper
marble tusk
#

Good to know it's not that straight forward with interface

normal viper
foggy escarp
#

make sure to compile the interface, and you may need to compile the blueprint that implemented it.

foggy escarp
#

I usually just add a return bool that represents a success.

normal viper
#

thank u man

foggy escarp
#

I've been there

normal viper
#

so annoying thou

tropic peak
fiery swallow
# tropic peak 😐

Don't be hard on yourself. Nobody understands how casting works at first. Even the best explanation is often leaving people clueless haha. Once you get it, it will just click

tropic peak
fiery swallow
tropic peak
#

Honestly I don't even know if I need one

fiery swallow
#

well that's not really helpful 😄

tropic peak
#

I mean I'm tackling a new thing - UI/widgets, I don't even know if what I'm doing makes any sense and if it'll produce the output I need it to produce. but before that I need to set references properly because I keep getting "accessed none" errors no matter what I come up with

#

it's a widget within a widget, and both of them need to access an array from an actor the player interacts with when the widget is created

fiery swallow
#

Let's say you wanted to cast to an Actor, if the reference you inserted into the object was a widget, the cast would fail. If the reference you inserted was an actor, pawn, or character, it would succeed

tropic peak
tropic peak
fiery swallow
tropic peak
#

it's a mix of a couple of things. data types are being one of them

fiery swallow
#

if you know the difference between classes, then that's 75% of it right there

#

a cast will only succeed if whatever you feed into it, fits into the same class or a child class of it

#

The only thing you could possibly cast to BP_PrepStation is any actor you spawned in that is BP_PrepStation

#

or a child of it (which I'm assuming you don't have a child of it)

#

we're probably not getting anywhere, you might just have to continue throwing shit at thewall until it starts to stick

dark drum
# tropic peak it's a mix of a couple of things. data types are being one of them

This might help you as I actually talk about hierarchy.

https://youtu.be/eDSrwDQZCVg

In this informative video, delve into the fundamental concepts of hierarchy, casting, and interfaces within Unreal Engine 5 (UE5).

Unlock the power of organizing actors and objects in hierarchical structures, master the art of casting to interact between different classes and blueprints seamlessly, and explore the versatility of interfaces for ...

▶ Play video
tropic peak
#

:/

tropic peak
foggy escarp
#

Learning how to get a reference to a actor is usually the first big perspective change to this type of thing. Player references is easy, since you can get that in many ways. A random actor in the scene you have to already have a plan on how the reference will be found. The easy solution usually is to either plan on the thing that is spawning the actor to do the reference linking or you could have the actor itself reference something like a game mode, game state, or event the player. If its a small project this is all fine. @tropic peak

crimson elbow
#

Does anyone know how to get input actions to work while editable text box has focus? You would think it would be possible to hit the enter key after typing in a password to continue, but nope.

tropic peak
#

I'm at the stage where I just want the things to work. I'm not worried about performance or any other things, I'll get to that later.

maiden wadi
#

My personal gateway to casting was when I was told to say it as "treat as" instead of "cast to". You get an actor pointer back from a trace, you tell it to "treat as MyBPCharacter". If it can, then it succeeds. It it fails, it cannot treat that actor as what you wanted.

tropic peak
#

It just blows my mind how I try to do what people here tell me and I still fail. I did exactly what pattym recorded for me and I still hit the same issue as before

maiden wadi
maiden wadi
#

@crimson elbow That said there are things like OnTextCommitted.

muted otter
#

hiii! silly question, why it's the owning player of my uuserwidget bp unknown? why could it be happening?

crimson elbow
maiden wadi
muted otter
#

even in here stills null idk why

maiden wadi
#

That's before the IsValid has ran. It breaks before execution, go to the next.

#

If the IsValid fails, it's not finding the component.

muted otter
#

oh, I see now. thanks :)

dark drum
muted otter
#

omg I'm retarded

#

jashdajsdhajd

#

I was getting the controller instead of the pawn, now it works. thanks :)

green mortar
#

is it possible to use pointers in blueprint? I would like to save pointer variables instead of direct variables

thin panther
#

no. object refs are pointers though

#

And saving a pointer doesn't make much sense

#

You can't load a memory address from disk

green mortar
#

then that answer is pretty much enough for my case. Thank you!

green mortar
thin panther
#

bear in mind it won't let you use it for primitive types though. Structs and ints and such can't have pointer vars in bp

thin panther
green mortar
#

since they are pointers, it won't be a huge problem

thin panther
#

No, they're already pointers behind the scenes

#

It's all good

#

It's pretty much impossible to take a uobject or actor by value

#

It is impossible in bp

maiden wadi
#

Also don't forget that you actually can save pointers in savegame. 😄 Still love that topic.

green mortar
#

like.. you predict the RAM location or.. what.. 😄

maiden wadi
#

You're C++ familiar?

green mortar
#

nope, I just know the basics

maiden wadi
#

Basics work. So...

thin panther
maiden wadi
#

It works with runtime created ones too.

thin panther
#

Does it? I don't remember being able to do that in pure bp

maiden wadi
#

Not in pure BP no. You need access to two specific things which is UObject::Serialize and the ability to specify the name of something when creating or spawning it.

green mortar
thin panther
#

Ah yeah, that's what I'm saying

#

In C++ you can make it work with any, but in BP you can directly save pointers to editor placed actors and reload them iirc

green mortar
#

ooh

thin panther
green mortar
#

ooh now got it

#

it has a pointer converter that gets updated

maiden wadi
#

When you serialize a pointer property, Unreal writes it out as a path of itself and it's outers. Every object in Unreal has an outer. EG Actors are outered to their world, actor components are outered to their actor.

AbilitySystemComponent on MyGunActor in a map named TheReach for example might be like
"TheReach.MyGunActor32.AbilitySystemComponent"

This is also how pointers are networked. They're converted to a name that can be used to look up the object.

green mortar
#

to match the actor's new RAM location

maiden wadi
#

This breaks normally because when you've spawned 50 actors of MyGunActor. And destroyed the first 40. You have MyGunActor39 to MyGunActor49 left.

When you restart the map if you spawn ten gun actors you'll have MyGunActor0 to MyGunActor9. Not the same name. However in C++, you can directly specify these names.

So in large if you first make a pass that creates everything with the same name if it doesn't already exist, and then replace all of the data in everything, all of your pointers are restored as well.

green mortar
#

Thanks to you two, again

thin panther
#

It's a really fun leap into the engine. Unlocks so much more potential

wise ravine
tropic peak
#

Is there a way to debug widgets? if I have a function attached to a custom event in a widget should I be able to see what that function produces in the designer view or is it going to only work on runtime?

#

also do I need to have a custom event in a widget blueprint, when I'm not really calling a speciffic blueprint via events but creating it via create widget?

maiden wadi
tropic peak
#

looks like the thing I spent the entire day on doesn't work then

celest oar
#

in sound cues, is attenuation the thing that gives it the spatial sound effect?

crimson elbow
#

I have a crazy Input action bug going on. I have a prompt widget with a dynamically loaded button widget inside and those buttons have input actions on them for keyboard and gamepad interaction. Works just fine, until the prompt is deactivated and then recreated. Then the input actions no longer works. The buttons still work, it still has the same focus it had when it was working, the widget reflector is identical to when it was working, but no input actions.
Has anyone seen this before?

#

I'm guessing its a common UI stack issue, not 100% sure though, or why it only effects the button when the prompt is deactivated and recreated. And only if we are using the buttons added at runtime. Seems to work fine if we hardcode the buttons

maiden wadi
#

I had this with the default Back action using action domains. Code around input actions really breaks down with them at the moment.

crimson elbow
#

I have no idea what ActionDomains are.

maiden wadi
#

Unsure then. When you deactivate said widget, is there still an activated widget in the hierarchy?

crimson elbow
#

by hierarchy, do you mean the common UI widget stack?

maiden wadi
#

Anywhere in the viewport.

#

You can use this to test
CommonUI.DumpActivatableTree 0 1 0 0

#

Should send a bunch of stuff to your Output Log window.

crimson elbow
#

using that command I do see an issue, when the prompt is open the second time, the button widget is not activated for some reason. I wonder if that is the cause. Let me try to force activation every time its created to see if that does anything.

maiden wadi
#

That would definitely be the cause then. 😄 CommonUI Input Actions require their owning widget to be activated.

crimson elbow
#

Oh, I'm already activating the widget everytime, wtf

#

I wonder why thats getting deactivated

maiden wadi
#

Remove the arguments. The 0 1 0 0

crimson elbow
#

I think I have a basic misunderstanding of deactivating and creating common UI widgets

maiden wadi
#

Do the non argument command when it's activated the first time and then do it again once you deactivate and reactivate it. See if there's anything in it's activatable tree that is still deactivated.

#

If it is within a second activatable widget and that parent isn't activated, this child can't be either.

crimson elbow
#

Working:

Display      LogUIActionRouter         Dumping ActivatableWidgetTree for LocalPlayer [User 0, ControllerId 0]:
Display      LogUIActionRouter         ** Active Root **
Display      LogUIActionRouter         WBP_QuitGamePrompt_C_0: IsActivated? [true]. LayerId=[376]. [0] Normal Bindings.
Display      LogUIActionRouter             WBP_QuitGamePromptButtons_C_0: IsActivated? [true]. LayerId=[391]. [2] Normal Bindings.
Display      LogUIActionRouter             -Legacy_DT_PromptInputActions_Confirm_Settings: Owner [ConfirmButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter             -Legacy_DT_PromptInputActions_Return_ControllerOnly: Owner [ReturnButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         *****************
Display      LogUIActionRouter         WBP_LegalScreen_C_0: IsActivated? [false]. LayerId=[75]. [0] Normal Bindings.
Display      LogUIActionRouter         WBP_LoginWidget_C_0: IsActivated? [true]. LayerId=[75]. [4] Normal Bindings.
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_OpenSignup_ControllerOnly: Owner [Btn_NewSignup], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Quit: Owner [QuitGameButtonMain], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Continue: Owner [LoginButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Back: Owner [BackButton], Mode [Menu], Displayed? [false]
#

Not working:

Display      LogUIActionRouter         Dumping ActivatableWidgetTree for LocalPlayer [User 0, ControllerId 0]:
Display      LogUIActionRouter         ** Active Root **
Display      LogUIActionRouter         WBP_QuitGamePrompt_C_0: IsActivated? [true]. LayerId=[376]. [0] Normal Bindings.
Display      LogUIActionRouter             WBP_QuitGamePromptButtons_C_0: IsActivated? [false]. LayerId=[391]. [2] Normal Bindings.
Display      LogUIActionRouter             -Legacy_DT_PromptInputActions_Confirm_Settings: Owner [ConfirmButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter             -Legacy_DT_PromptInputActions_Return_ControllerOnly: Owner [ReturnButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         *****************
Display      LogUIActionRouter         WBP_LegalScreen_C_0: IsActivated? [false]. LayerId=[75]. [0] Normal Bindings.
Display      LogUIActionRouter         WBP_LoginWidget_C_0: IsActivated? [true]. LayerId=[75]. [4] Normal Bindings.
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_OpenSignup_ControllerOnly: Owner [Btn_NewSignup], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Quit: Owner [QuitGameButtonMain], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Continue: Owner [LoginButton], Mode [Menu], Displayed? [false]
Display      LogUIActionRouter         -Legacy_DT_AuthMenusInputActions_Back: Owner [BackButton], Mode [Menu], Displayed? [false]
maiden wadi
#

WBP_QuitGamePromptButtons will be your issue then. Something is deactivating it.

crimson elbow
#

So the buttons widget is active the first time its open. Then I close it by calling the deactivate node on the parent widget (prompt window). Then recreate the buttons widget again and re-add it to the parent widget. At the tail end of creating the buttons widget, I activate it everytime.

open garden
#

What's going on?
Calling Set Actor Rotation in the character blueprint = no flicker
Calling Set Actor Rotation in blueprint component = one moment of flicker
Exact same code

maiden wadi
crimson elbow
#

I think I see the problem. "Deactivate" just hides the widget. The buttons widget is still in there from the last time the prompt was open

frank locust
#

I may geniuneinly just be dumb with how often i get stuck on dumb stuff.. Can anyone tell me why the particle system spawns but not the pawn class BP in this drastically simplified code?

maiden wadi
frank locust
#

for added context, the 'spawners' are placed in the world along with the grid that serves as the map in the construction script of my grid generator. and before even trying it i bet thats my solution lol

maiden wadi
crimson elbow
#

what I was doing instead, was adding another button widget to the prompt. I was adding a new child to it everytime I opened it, without clearing first

frank locust
maiden wadi
frank locust
# maiden wadi The usual case for this is that you didn't project the AI to the navmesh or trie...

speaking of navmesh. is it as simple as assigning a navmesh to my spline mesh to make my ai follow the spline to the destination? you may remember helping me set up the spines end point. More importantly than that question, any idea if its possible or how to use the data from my spline to alter the properties of the tiles in my grid that it hovers over or intersects with? As of now Im just placing road tiles on top of my grass tiled grid to represent the path from spawner to center of grid but I'd like for the spline to just affect the tiles thats already in my grid instead of placing a new mesh for the splines

#

hopefully that was a least a little coherent lol

maiden wadi
#

Making an AI follow a precise path requires implementing a custom path follow component. At least it used to unless something has changed. The best you can do without it is custom nav areas with lower move costs.

I'm not sure I follow with the tile question though?

vast bone
#

I want a sequence to play when the character steps into the battle ground

Just some warming up sequence

But thing is when the character steps into that ground the enemies will come to attack

What do i do?

I tried set game paused but that pauses the sequence aswell

eager python
#

SPAGHET.

frank locust
eager python
#

Better?

crimson elbow
eager python
#

It gave me anxiety to move them around like that.

frank locust
# maiden wadi Making an AI follow a precise path requires implementing a custom path follow co...

I may have to return to this question with a clearer head lol. But as of now, i generate a grid using the grid execution macro, then I use random floats between 1.0 and -1.0 to generate random heights for the tiles. I proceed to check for the corner tiles of the grid and place my spawners at those corners. The bp for the spawners constructs the splines leading from the corners to the center of the grid. As of now I then add spline meshes to my splines(those stone tiles) but I would like to just use the data from the spline to determine the properties of the tiles from the initial grid. I.E. change the height of the tiles along the splines

granite scarab
#

Does anyone know how I can make a replicated sprint system? It's not very easy from what I can tell. I've been at it for well over a month since at the slightest trace of ping, spamming sprint will cause the player to jitter all over.

open garden
quaint fable
#

Hey! This is probably really simple but I'm not sure what to do here. I want this BP_Flashlight to attach to the FollowCamera component on my player character. What do? When I try "get FollowCamera" from BP_ThirdPersonCharacter it says it's not a component of BPThirdPersonChar, so it must have a target

maiden wadi
maiden wadi
quaint fable
#

thank you! I was trying to cast to followCamera

#

why does it work that way though?

wise ravine
#

What is the best way to get my UI to communicate with my GameInstance? (Instance is listening for UI input)

maiden wadi
quaint fable
maiden wadi
quaint fable
#

Now the only issue is that I'm not sure how to position the flashlight where I want so that it's not blocking the viewport

tropic peak
#

How do you deal with this kind of errors in widgets? "ToppingIcon" and "ToppingName" are UI components which I can't "set". For some reason it displays just one item from the array too..

maiden wadi
# quaint fable I just want to understand how casting works

Think of it as TreatAs. You have a pointer. Like GetPlayerCharacter. This returns the instance that you're playing as. Lets say you have B_MyPlayerCharacter, which is a direct child of Character.

You have this inheritance tree.

UObject
AActor
APawn
ACharacter
B_MyPlayerCharacter```

You've asked for the player's character, which is a B_MyPlayerCharacter. But the engine doesn't know about B_MyPlayerCharacter, because that is your project class. They had zero way to know what that was when they made the engine so the getter simply returns it as an ACharacter pointer.

Even though it passes if back as ACharacter, it's still a B_MyPlayerCharacter. You simply cast that pointer type from ACharacter to B_MyPlayerCharacter which lets you access B_MyPlayerCharacter functions and properties.

Alternatively you have a differing hierarchy.

UObject
AActor
B_MyCoolWeapon

If you cast GetPlayerCharacter and try to cast it to B_MyCoolWeapon. The cast would fail. This is because the character is a B_MyPlayerCharacter. And your B_MyCoolWeapon does not inherit from B_MyPlayerCharacter in any way and therefor will fail the cast.

Thus it can be much easier to rename the cast node in your head to TreatAs.

EG
GetPlayerCharacter->TreatAs B_MyPlayerCharacter 

You're trying to treat the character you're given back as if it was a B_MyPlayerCharacter.
quaint fable
maiden wadi
#

You have to understand something to explain it. 🤷‍♂️ Youtube tutorials generally miss that first part.

dawn gazelle
#

Unless you can predictively guess the next word to use to explain it, although this doesn't work very well.

#

(Damn you LLMs)

maiden wadi
#

Gotta say. As a Mass Effect player. I still can't get over the idea that people call them AI. They're barely even a VI at this point. :/

quaint fable
#

Yeah they kind of just say "do this, then do this" without explaining why lol

maiden wadi
#

"That's not correct, you're wrong because the stars don't align with jupiter."

"Oh! I'm sorry about my mistake, let me try to rephrase that in a way that is still completely and utterly wrong."

wise ravine
#

Should my main menu be in a seperate level? So while in the menu the player doesn't have to have the map loaded in?

maiden wadi
#

Depends on what you mean by main menu. Also depends on whether your game has multiplayer.

wise ravine
maiden wadi
#

IMO I would still put it in it's own map. But in singleplayer it isn't necessary. You can show it anywhere as long as you want to.

In multiplayer you need a main menu map because it's how Unreal handle's disconnects and such. Net drivers shut down kicks the player back to the main menu along with doing some other cleanup stuff.

wise ravine
#

I'll just make another map

eager python
#

Is there a function I can use to evaluate whether a given vector exists within X distance of another given vector?

maiden wadi
#

There should be a distance function for it.

eager python
#

I'm literally a moron

#

I USED the word

#

And didn't even think to search Distance

#

I was messing with Nearly Equal

maiden wadi
#

😄 Alternatively it's just (Vector1 - Vector2) -> Length

eager python
#

Yeah, my brain is stuck in 2D from using IntVector so much for the past 2 weeks

#

I really regret not just going all vector

#

I may go back and clean it up still

hard charm
#

Guys, does anyone use the smooth sync plugin?

frosty heron
#

Nope

sharp totem
#

can souls-like combat be created entirely with bp? I know a bit of cpp, but I'm considering whether to start researching to code more complex parts of the system or to build it entirely with bp from the start

quaint fable
#

this is probably simple. When the flashlight is attached to FollowCamera, it blocks the viewport. I want to set it backwards on the x axis ever so slightly so that you can't see the flashlight. I tried set world transform and local transform

tropic peak
#

why not just make it invisible

wise ravine
#

Will this work? Because I dont think it's supposed to

#

Can I get a ref to the char that way?

maiden wadi
tropic peak
#

you could probably also use Get Player Character too

maiden wadi
wise ravine
# maiden wadi Yes

Perfect. 2nd question, are structures independent to the actor which contains them?

#

I'm pretty sure they are*, but I wanted to confirm

quaint fable
tropic peak
#

set mesh to be invisible

sharp totem
#

soulslike is basically arpg

quaint fable
#

@tropic peak isn't that what this does?

sharp totem
maiden wadi
wise ravine
maiden wadi
maiden wadi
wise ravine
#

Also maybe this is something I don't see, but If it returns False.. Why does it go to True?

sharp totem
#

also the elden ring wiki has this charts, im new to unreal so idk a lot about blueprints but it ressembles them, are this charts complete enough to make a combo/attack system for a boss?

frosty heron
sharp totem
frosty heron
quaint fable
frosty heron
maiden wadi
# sharp totem also the elden ring wiki has this charts, im new to unreal so idk a lot about bl...

This is the main reason I say GAS. You can easily make things where you set effects that apply tags to a character. EG something as simple as attacking and parrying. Doing a block for example might place a simple blocking effect on the character. But for a short time there will also be a Parry effect with it. Read effect here as buff.

In the attack skill, if you hit a target that has the parry effect and said target is facing the attacker, instead of dealing damage to them, it can trigger an effect which leads to the defender's parry ability triggering. You can sync animations and such between the two skills at this point via playmontage or however you choose to do the animation sync.

You can do all of this yourself. But it's a ton of extra work to build the framework GAS already gives you. And the C++ requirement stops at Attributes for the most part. Which you don't "need" for this, but can be nice.

quaint fable
# frosty heron Post the result

well I feel dumb, it was simple. I needed to also set the visibility for the flashlight child actor component. It's probably not even necessary to have this component, it's just what came with the flashlight asset

frosty heron
#

Try not to use child actor component they are buggy

quaint fable
#

yeah I can just delete it

frosty heron
#

U bought a flash light system from market place ?

wise ravine
frosty heron
wise ravine
#

I need it to be false so it initializes some stuff

frosty heron
#

Well save file do exist, wat do you want the code to return.

Delete your save file if you don't want your save to exist

wise ravine
shut quarry
#

How do I intercept any key events while a widget blueprint is in the viewport?

frosty heron
wise ravine
tame walrus
#

Hi All I have a problem with Boxtrace for My Third Person Character the Boxtrace is weird when character rotates about 20 degree but it looks fine at 0 Degree - 90 - 180 / any help would be nice 😄

wise ravine
#

False - If the save doesn't already exist, then create it
True - If the save does exist, then load it

My issue - It never returns False

frosty heron
flat raft
#

anyone see this before ?

wise ravine
quaint fable
shut quarry
#

where is the "Is Variable" setting. I'm tryna enable it but I can't find it. (I'm in a User Widget Blueprint)

shut quarry
shut quarry
tame walrus
# shut quarry

i did red mark it on the picture i send you need to create a button first to see it in details

shut quarry
# tame walrus You mean this ?

yeah but i'm not trying to limit it to a button, i want it no matter where my moues is, if i press a key I can see the key pressed

frosty heron
#

Also google

narrow pendant
#

is there a way to "Watch this Value" inside a function?

frosty heron
#

They r not reliable, especially when it comes to pure func

narrow pendant
wise ravine
undone bluff
#

how to handle the same input action doing multiple things depending on context?
There's the obvious way of doing some flow control and routing to different functions from the same input event, but that can get a little messy.
Alternatively, one could make several nodes for the same input action event and run a corresponding check on each one, but that also seems bad for readability.
Then, there's input mapping contexts, but I feel like it's a bit overkill to use these for stuff like changing from melee to ranged combat, for example?

shut quarry
tame walrus
shut quarry
#

ill try that

tame walrus
eager python
#

Spent 11 hours today rewriting a large portion of my dungeon generator code because I wanted to open a space in the workflow to add and remove more things before placing the tiles. As an added bonus, I now also have a much cleaner looking floor plan.

wise ravine
#

Can someone please help me understand why for one breakpoint there is a set location for the struct, but on the next breakpoint that value is 0,0,0

raw spindle
#

is there an easy way to make a tuple in blueprint?

quaint fable
#

Hey! I've got an interaction system where you can press E to interact with whatever actor you're overlapping, as long as the blueprint interface is implemented. The problem is when I use E to pick up a flashlight and equip it, then I can't interact with anything else. It's like the overlap collision is conflicting with the other objects.

lunar sleet
quaint fable
hollow cove
quaint fable
quaint fable
#

Im fairly certain that's what I did, but I'll do that again

hollow cove
#

id be curious what it prints if it doesnt work

quaint fable
#

I'll let you know

granite scarab
#

Okay, why's my sprint system so jittery the second it's exposed to ping? Isn't this how you're supposed to do this?

spice gazelle
#

Am I just stupid? I mean, probably yes, but.. I keep trying to set the name from my actor component to the widget, and it's just not working... any ideas?

#

it was on the construction event forever, i just changed it to tick to see if that would change anything, and no, it didnt.

finite hearth
#

Is there a way to preview combo box state changes in the designer? Like, can I test what "on hover" looks like without needing to launch into the game and call the widget?

graceful sage
spice gazelle
#

I set a reference to the player blueprint as a variable in the widget bp

graceful sage
#

Is it set?

spice gazelle
#

yep

graceful sage
#

Beginplay -> Get owning player pawn -> cast to class -> set main character

spice gazelle
#

there's a hard reference set

graceful sage
#

Ship info has a value?

#

Not sure why you need to cast there either

spice gazelle
#

ship info is a struct, with the ship name value.. i'm calling the info to set the text on the TXT_ShipName text

graceful sage
#

Yes

spice gazelle
#

im casting from the widget because I need to access the ship component, which has the ship info struct

hollow cove
#

i.e. you press the button and release it immediately, the two signals to the server are now racing

graceful sage
#

Can you show beginplay?

spice gazelle
#

it is just a pawn reference

#

ahh let me play with that

graceful sage
#

Construct I mean

frosty heron
#

Your only option is to work with cmc framework

#

Which is to toggle the bitflag

#

Cpp only, look up del goodie cmc tutorial

#

You will never get smooth movement in multiplayer with cmc using blueprint no matter what people tell you or those fake shitty youtube videos

granite scarab
frosty heron
#

Tldr you can't do it in blueprint

granite scarab
frosty heron
spice gazelle
#

i removed the tick, and cast and added it to the construct event, and im actually getting something back, but it just the default setting for the component, not the info from the player bp

frosty heron
#

What would the time do?

spice gazelle
graceful sage
#

Sprinting works for me in bp but I've only tested with 2 players on steam. Probably not with more players

frosty heron
#

You should test with lag

hollow cove
frosty heron
#

And if you do it on server I wouldn't call it work.
Client prediction is necessary for movement, either you have it or just don't do mp game

granite scarab
graceful sage
# spice gazelle

Okay where did you set it now? Do everything on construct. You don't want to keep setting on tick. Unless you are passing the var in exposed on spawn

granite scarab
spice gazelle
#

it's on construct, the reference to the BP is set as a variable, I actually set the variable to the BP reference, instead of a pawn reference. i have nothing on tick. that was just a temp test

frosty heron
granite scarab
graceful sage
frosty heron
#

You can afaik changed the movement to be client authorities but then you won't have any correction

spice gazelle
#

the value of what?

graceful sage
spice gazelle
#

the value is a hard reference to the BP now, that is the value.

graceful sage
#

That's not a
How variables work

#

You don't just select the object type and expect it to have a value

spice gazelle
#

i'm pretty sure that's exactly how that works.. that's how I was abloe to pull the ship component, and the get info from the ship component.

#

otherwise it wouldn't have known where to get the info from

graceful sage
#

Are you getting errors?

spice gazelle
#

no it compiles fine, it just doesn't give me my desired answer./

frosty heron
#

Is main character set?

spice gazelle
#

oh wait..

graceful sage
#

After you play do you get errors

spice gazelle
#

there are errors..

#

but it was only in the log

frosty heron
#

You getting accused none error i bet

graceful sage
#

^

spice gazelle
#

yep

frosty heron
#

Show where you set main character variable

#

Ok so u never set it

graceful sage
#

He doesnt

frosty heron
#

Pass w.e you want the data to be pulled from. I'm assuming your player character

spice gazelle
frosty heron
#

I suggest to make your main character instance editable and expose on spawn

#

Set it in create widget

sacred thicket
#

Hey guys I'm trying to do a combo system, im extrememly new but from what my theory is if you press a button then if you press it twice or more within a few times then play the next animation

#

Wait I just thought of something

#

Creating a counter for each time its pressed

fiery swallow
#

that's not sarcasm either

frosty heron
#

Might want to think about input windows and input buffer too depending on your need

fiery swallow
#

unless you go the other route which is anim notifiers

sacred thicket
#

Gonna be real have no clue what those are I'll look them up

fiery swallow
#

one step at a time

spice gazelle
#

weird.. so when I changed it to the ship info quality, it gsve me: EQuality::NewEnumerator0

fiery swallow
#

just get the counter working to play different animations and then pat yourself on the back for doing it without help

spice gazelle
#

so its not giving me the info..

#

or.. it's not giving me the name of the enumerator, just the fact that it's enum0

fiery swallow
#

one returns that weird string you got, the other returns a human readable version of it

sacred thicket
#

Oh shit

#

Enhanced input is cracked!

fiery swallow
#

does it do that automatically? I haven't used it much yet lol

sacred thicket
#

It's fantastic

sacred thicket
spice gazelle
#

well, figured out the enum issue, but its still picking from the default struct value.

sacred thicket
#

Enhanced inpuit is actually good enough to make a combo system without much code

spice gazelle
#

i really like the Enhanced Input System.

sacred thicket
#

Honestly same I'm gonna do more research into it

#

Didn't even take minutes I've got a working combo system albieght its only strings

#

Anyone know how to transition back to move states after an animation is done playing?

lunar sleet
frosty heron
#

Just use montages

#

It will fall back to your animbp after playing the slot

fiery anvil
#

I implemented this line of code following a yt tutorial to make a rifle that shoots, one problem. i cant figure out how to make it so that it will spam shoot if i hold down the left mouse button. can anyone help?

#

is there any sort of hold input bp that will repeatedly continue aslong as im holding it down or something?

spice gazelle
#

if you learn how to use the enhanced input system, it's fairly easy to do.

fiery anvil
#

whats that 😭

spice gazelle
#

there's several ways you could go about it though. Probably not the most efficient way, but could use a do n for how many bullets you have in the magazine, and then put a delay for how long you want between shots, and then have a command that resets the node.

frosty heron
#

Are you gonna have multiple gun type?

#

Fk delay

spice gazelle
#

hence the not most efficient way. lol

frosty heron
#

Most Broken way

fiery anvil
#

no its just for this rifle

frosty heron
#

Timer or delta time is your friend perhaps

fiery anvil
#

i just want it to constantly rrepeat

spice gazelle
#

not the way id ever go about it. i'd just use the enhanced input

fiery anvil
#

okay so how do i go about this

spice gazelle
#

well, enhanced input is a bit more advanced.. best to learn flow code and order of operation first.

fiery anvil
#

is there no simple way outside of enhanced input

zenith moss
#

Came across an interesting problem, curious if any of you know what's going on here

Both of these events successfully spawn and possess a pawn. However, when I connect the "started" pin, I get "Accessed none trying to read player controller" error. When I add a breakpoint, the player controller is valid. If I do an is valid check, the player controller is valid. The accessed none error seems... erroneous

#

the error does not occur when I use the "completed" enhanced input pin

spice gazelle
#

i mentioned one very simple way, though not efficient. look into set timer functions, and flow code functions. It's important to understand if you're gonna make blueprints. the enhanced input allows you to set behaviors on input keys without having to specify in the code..

frosty heron
#

Enhanced input have triggered pin which get executed every frame. You can use this to check if you have a valid gun, if you do, the gun bp will decide if it can fire or not based on cool down (fire rate)

#

Fire rate, damage, current ammo, ammo type, etc can live inside the bp_gun

fiery anvil
#

I set it so that theres a boolean when its pressed to set as pressed and then on event tick it checks if its pressed and shoots with a 0.1 delay between each shot (its a rifle)

#

is that good or do i do ur method

frosty heron
zenith moss
#

I press the I button on my keyboard

frosty heron
frosty heron
subtle shoal
#

Get Editor Property apparently cannot access properties that are within structs in assets.

How do I access such properties?

zenith moss
frosty heron
#

Where is the is valid check?

#

Output log is saying you are trying to access nothing at some point

zenith moss
#

I assume it's internal as clicking the "is valid" in the error log just opens the standard macro

frosty heron
#

I'm just saying I don't see the is valid check in your code

zenith moss
fiery anvil
zenith moss
frosty heron
frosty heron
#

This should be coming from your blueprint. Click on the branch in the error log

subtle shoal
frosty heron
#

You r not even showing where it throw the error , the error is coming somewhere else where you attempted to do is valid check

zenith moss
#

If I click branch or is valid in the output log it just opens standard macro

frosty heron
#

When you click on branch or is valid from the error log, print screen that.

#

Shouldn't take you to the inside of the macro

#

You are doing is valid check somewhere on null object

zenith moss
frosty heron
#

Somewhere in your bp player character

graceful sage
#

Is the inv input action you posted in playercontroller

subtle shoal
zenith moss
zenith moss
frosty heron
#

I never have to deal with python code

subtle shoal
frosty heron
#

Why don't you just edit the default value in the structs?

#

Are the change based on some data?

subtle shoal
zenith moss
# subtle shoal Is there library out there with a function that does exactly what Kismet Set Edi...

https://forums.unrealengine.com/t/getting-nested-struct-value-from-blueprint-variables-with-python/129490/6

Not sure about a library but this is what I used to modify C++ structs via python

Epic Developer Community Forums

Thought I’d elaborate further for anyone googling: I’m trying to write a python script that modifies the members of a user-created struct. It seems you cannot accomplish this with blueprint-created structs. Attempting to do so always results in “Failed to find property” error. However, doing this with C++ is trivial. For instance, say I creat...

#

last post

zenith moss
#

The NPC class values are all set via editor utility widget

#

makes modifying NPCs blazing fast

frosty heron
#

Sounds good

zenith moss
#

the component is what isn't valid

subtle shoal
# zenith moss https://forums.unrealengine.com/t/getting-nested-struct-value-from-blueprint-var...

I don't know how Python interacts with UE4. Whatever this is, it needs to be "plug-n-play" with my existing blueprints. I need a node that can get/set any property of any type in any number of layers of structs of an asset by property name (non-useless version of Set Editor Property).

This has to exist, right? Structs are so common that I am still in disbelief that Kismet screwed this up.

zenith moss
#

Unfortunately if both of those don't apply to your case, I don't know a solution

tropic peak
#

WBP_PizzaBakingWidget is an overlay with two buttons at the bottom and a scrolling box at the top. Inside the scrolling box I'm trying to display all toppings used for making pizza. Each toping is a data asset having name, image, description. WBP_ToppingWidget is responsible for displaying these details for each topping. I have three issues that I don't understand.

#
  1. When I'm setting the topping name / image into a widget text / image I'm using ToppingIcon and ToppingName variables (which are created by widget components, and can't be set). When the widget gets displayed, I get null reference errors.
#
  1. If event pre construct is not attached to "get toppings" event it will not display any toppings in the crafting UI. "Get Toppings" runs the function from screenshot in previous question (to populate the name/image)
frosty heron
#

It is simply null at the time of accessing

#

Your topic icon is not set when you try to set the brush

tropic peak
#
  1. To populate the ingredient list I'm using a function PopulateIngredientList as seen on screenshot. I iterate over all toppings in an array and then use the create topping function.
tropic peak
#

is valid?

frosty heron
#

Why do you want to ignore? The question would be why is the function get called when you don't have valid instance

tropic peak
#

well you can't really "SET" these

frosty heron
#

Set what?

tropic peak
#

ToppingIcon / ToppingName are the ones I'm using

#

so as widget elements you can only get them

frosty heron
#

If you are actually drag the component it should always be valid

tropic peak
#

I did

frosty heron
#

At this rate since I don't have your project I'm just gonna guess that you have a variable declared called toppingIcon

tropic peak
#

yes

storm shale
#

What is invalid is WBP Topping Widget could be getting the name wrong

frosty heron
#

Well there you go

#

Why do you want a pointer to topping icon?

#

Go to your widget designer, click on topping icon. In detail panel make sure a tick box called variable is ticked

tropic peak
#

it is ticked

frosty heron
#

You should see ToppingIcon component variable

tropic peak
#

that's how I got those vars

frosty heron
#

Well use that one instead, it should never be invalid unless u delete it

tropic peak
#

I did

frosty heron
#

Show your variables

#

Entire pictyre

tropic peak
frosty heron
#

Bigger picture , need to see components too

tropic peak
storm shale
frosty heron
#

I can't download the pic with bad internet connection but you could mention if the error is not run time

#

There's a clear diff

#

What does the error says anyway. I can't read from my end

tropic peak
#

I did mention that the errors pop up when I enable the widget when the game is running

#

Blueprint Runtime Error: "Accessed None trying to read property ToppingIcon". Node: Set Brush from Texture Graph: Create topping Function: Create Topping Blueprint: WBP_ToppingWidget
Blueprint Runtime Error: "Accessed None trying to read property ToppingName". Node: SetText (Text) Graph: Create topping Function: Create Topping Blueprint: WBP_ToppingWidget

frosty heron
#

You are having compiling error

frosty heron
tropic peak
#

oh that -nothing, I broke the node by accident

#

it's not there (the error)

#

it's compiling just fine

frosty heron
#

I see the issue

#

You never set wbp topping widget

#

You just passing null ref

#

To fix this , make it point to the widget you created.

From create widget return value, drag the return value and connect it to set wbp topping widget

#

@tropic peak

tropic peak
#

I'm here, I'm reading and trying to understand 🙂

frosty heron
#

Gonna go now , it's easy fix. Gl

tropic peak
#

❤️

#

you're a star @frosty heron

#

that fixed displaying the toppings but null errors are still there 😄

lunar sleet
tropic peak
#

yes!

#

but it fries my brain when I think about them in this context

lunar sleet
#

Ok

tropic peak
#

If I can't set the variable, then how can I make it not null?

lunar sleet
#

Let’s try this is one more time

tropic peak
#

(it's a widget element)

lunar sleet
#

You are using a CreateWidget node somewhere right ?

tropic peak
#

yes

lunar sleet
#

Ok. The return value gives you the ref

tropic peak
lunar sleet
#

K. Click on the magnifying glass in the error and screenshot where it sends you

tropic peak
#

Function to populate the topping icon / name

lunar sleet
#

What are topping icon and topping name, other widgets ?

tropic peak
#

they are elements of a widget

#

WBP_ToppingWidget

lunar sleet
#

What kind

#

Buttons or what

tropic peak
#

image and text

#

image as in texture2d

lunar sleet
#

And how did you GET them, is this logic all in the same widget ?

tropic peak
#

I get them by setting them to be variables and then dragging onto the graph

lunar sleet
#

Alright

#

So you just ticked the isVariable checkbox and then dragged them from panel right?

tropic peak
#

that's correct

lunar sleet
#

Put a breakpoint on CreateTopping

#

Then step through the code and hover over the input and output pins one step at a time

#

Also

#

Make sure CreateTopping is not called anywhere else other than that screenshot you showed

tropic peak
#

there?

lunar sleet
#

Yeah, step into first

#

Then next step

tropic peak
#

ARGH

#

I think I might have found it, i need a minute

#

I think CreateTopping was being called from two places

#

yes that was causing the issue

#

thank you @lunar sleet, you're a champ

#

just one more thing

#

oh I think I know

lunar sleet
#

Getting the hang of it then

tropic peak
#

it looks like DisplayPizzaMakingWidget is not called anywhere 🤦

lunar sleet
#

Now you know how to debug

tropic peak
#

I should really just turn UE off at 10pm and call it a day rather than produce a ton of weird stuff to fix the next day

lunar sleet
#

You’ll be able to figure out most issues on your own

#

Yeah rest is important

tropic peak
#

yeah this week I'm doing 14h+ a day of unreal so after a certain point it's just zombie development

graceful sage
#

Why don't you do in character?

lunar sleet
#

Set view target with blend is a good node for cam switch

graceful sage
#

You can get player character and cast to your character bp and get his camera there

#

Typically on beginplay store a reference to character on controller

#

Use that reference get his camera do what you want to do

#

Watch videos on blueprint communication

#

And variables

frosty heron
#

Set view target with blend is the path with least resistance

#

There are soo many ways to switch camera some context is needed

#

Yes that's correct, my pfp is red panda. It's many times more cute than raccoon, good on you to notice

dim hearth
#

If I were to have any questions regarding a problem in my blueprint, would this be the right place to ask then?

tropic peak
#

yes

dim hearth
#

Okay nice. So the problem should be quite simple. I have attached a screenshot of a camera that I'm trying to set up (from scratch).
The video I follow didn't do any more steps than me, and they somehow made it work. I've tried looking around but I don't know what to exactly search for either...

#

But what is my target?

graceful sage
#

Since you're not in your controller you need a reference to your controller and plug into target

tropic peak
#

get player controller

dim hearth
#

So "Get player controller" targets player state, which it says I'm not either...

tropic peak
#

you need to connect the return value from Get Player Controller to the target input of the Set Control Rotation

dim hearth
#

But haven't I done that?

graceful sage
#

No it says target self which is whatever bp you're currently in

dim hearth
#

If I do that, then there is no problem, but my camera can't move?

#

Have I missed something?

#

what should that be connected to? Because it's not in the video either

tropic peak
#

ignore what I said

dim hearth
#

okay

tropic peak
#

are you calling these events anywhere

graceful sage
#

Those are input actions

tropic peak
#

oh right

dim hearth
#

Sorry if I'm being too dumb, but I don't think I understand the question...

tropic peak
#

no it's me being dumb

#

didn't notice they are input actions and not custom events

dim hearth
#

But what is the problem then? Is it because I'm writing inside of a "pawn"?

graceful sage
#

What are you trying to do

dim hearth
#

trying to make a movable camera. Like a character that can look around

#

I've made zooming in and out, with limiters. But that's it

graceful sage
#

Just follow this

#

Hey guys, in today's video I'm going to be showing you how to create a free look camera system in Unreal Engine 5. This allows you to hold or press a button that lets you move the camera around the player without changing which direction the player is moving in. This works great for third person shooters, a great example is PUBG.

#UE5 #UnrealEn...

▶ Play video
tropic peak
#

working with widgets/UI is such a pain in the back

frosty heron
#

widgets is the most chilling system to work with

#

imo

mental trellis
#

Slate > *

frosty heron
#

@mental trellis btw, later on in my game, my character might deal 100 damage instances within a second and I want to show pop the damage text for each of them

#

will be using a normal text widget be ok? or lag is guaranteed?

mental trellis
#

Should be fine. If you're worried about creating a ton of widgets, pool them? Use slate?

#

Fortnite uses slate when it needs a lot of ephemeral widgets iirc.

frosty heron
#

slate it is then =(, didn't have a good memory working with them

mental trellis
#

Just do it in umg and if it gives you 2 fps, do something about it.

thin panther
#

Could always use niagara for damage numbers

mental trellis
#

How would that work? Damage numbers as a particle with a unique texture per number?

#

or perhaps some sort of 0-9 texture which atlasing?

thin panther
#

I'm honestly not sure. I just know it's popular.

#

Just flicking through the first result I found and it's definitely sampling some texture, so no really dumb unique texture per number

maiden wadi
#

It's the same general idea as subuv sampling, like you would do on a fire particle sprite sheet. Just instead of flipping through them, you pick one subuv index and stay on it.

mental trellis
mental trellis
maiden wadi
# tropic peak working with widgets/UI is such a pain in the back

Most all programmers feel like this unless they're UI specialists, it seems. To give you some advice to make your life easier. Stop trying to tie gameplay code into UI. Gameplay code just works and does things and has delegates that say something happened. UI just sits on top of that. Gameplay code should have no idea about the UI at all. When you do this, you get a nice decoupled UI system where one thing does it's own thing, and the other thing does it's own thing. You'll get much cleaner and simpler to follow gameplay and UI code.

bright flint
bright flint
mental trellis
#

A good MVC approach works really well with UI. It's basically how UE is designed too.

dark drum
visual crest
#

Set geometry collection node does not work!! Is there a way to spawn a chaos destructible mesh at runtime?

maiden wadi
# dark drum I recently remade a power generator system component and fixing the UI was as si...

It gets even better with more generalized gameplay systems. It's one more reason I recommend people not to be afraid of GAS. In a small side project of mine, I can display any attributes I want just by picking them and the style. EG ProgressBar, Text, etc. I have a small set of generalized widgets that take in parameters from a definition which describes the attribute. If I want a stat sheet for a character I just make an array of attributes I want it to display and give it a abilitysystemcomponent. It pulls them from the component and displays them in the correct style.

Even more so on this are generalized systems like turning one thing into another. This one is a huge pet peeve of mine when I see gameplay programmers making a special thing that makes this, and then a special thing that makes that, etc. Cause as a UI person I have to follow along multiple systems doing the same thing. Everything in a game that does this is nothing more than your average crafting system. You need two structs to define the entire system. One that has a list of generalized things. I use a struct of a PrimaryAssetID and a float. And then a second struct which has two arrays of this and some other data like craft name, craft duration, etc.

This system works for literally anything that has inputs and outputs.

  • Forge in a game like Valheim that takes in ore, crafts ingots and spits them on the ground.
  • survival game crafts items from one inventory to another
  • RTS game takes global resources and creates a unit in a building
  • Tower Defense building upgrades
  • Survival game building system
  • Perk systems
  • Talent trees

All of these can be defined as a list of things required and a list of things given with a duration of time taken(even if instant). And I see gameplay programmers making one thing that makes weapons, one thing that makes survival gear, one thing that makes furniture, another system that handles perks, etc. Just boggles the mind how complex people want things.

tropic peak
normal viper
#

hey guys
hope u all doing greart
i have this probleme where if the player keeps spamming the interaction key the text will keep displaying forever

maiden wadi
tropic peak
#

moving the selector around is one thing, knowing where to move it is another

#

overall it's all bleh.

dark drum
maiden wadi
#

That's what focus is for. It handles that for you.

tropic peak
#

huh

maiden wadi
#

Unreal defaults to the arrow keys. And DPad on gamepad. If you set focus to a button in a grid and press arrow right or DPad right, it'll try to pick the button to the right of it to focus.

dark drum
#

One thing I've learnt is don't fight with the widget nav system (focus and focus path) lol. To many headaches from trying.

dusky cobalt
#

Guys, if I'm using Data Assets to create my units basically to be unique and have different things and in the end I spawn class BP_Unit, but imagine you have 2 workers from different factions, one is gathering by transporting and 2nd one is adding resource instantly without need to transport.

Do I just create this logic in one class and switch on enum which I them provide in Data Asset (like this unit InstantGathering and 2nd one NeedToTransport).
Or should I utylize class inheritance? I wanted to kind of avoid creating each class for every unit, but is storing the logic in one class for let's say 4 different type workers heavy? I'm just thinking about future and if I'm not gonna end up shoting myself when trying to fit everything in one place. Like I don't think 3 more lines of code will change anything but it's more about clarity of things? Should I use components maybe for these kind of logic?

maiden wadi
tropic peak
#

not gonna lie I tried using chatgpt to get ideas how to develop this and yeah, it's all garbage

#

I might need to look up a tutorial on inventories or something

dark drum
barren turret
#

are there any nuances about players using (possessing) pawns instead of character classes for multiplayer? (The game is 2D and I want to change collision boxes from capsules to cubes, therefore will start it from pawn)

dark drum
barren turret
dusky cobalt
normal viper
dark drum
maiden wadi
# dusky cobalt Guys, if I'm using Data Assets to create my units basically to be unique and hav...

Personally, I have very simple BTs for my stuff and I specify these on the unit's data. So for me the way I implement this is that I have two pawns. Both use the gather resources so they go to the resource and harvest it into their inventory. At full they swap to the storage BT in their data asset. One of these makes the unit move to the storage, the other simply moves the item to the storage.

barren turret
dark drum
# dusky cobalt Do you mean Behavior Tree as Behavior Object? Or just normal UObjects? Do you me...

Either the be honest, it depends what sort of behavior you're having. If it's pretty basic and doesn't need a BT, then uobject is fine and you can have a generic function called 'Perform Action' that the unit calls when it should perform an action. You can then create children of the base action object and override the function to define what should happen.

BT's would most likely be more flexible though.

dusky cobalt
# maiden wadi Personally, I have very simple BTs for my stuff and I specify these on the unit'...

I can relate to this a bit, because that is how I also did it at first and I could just swap different BT for different kind of workers, that would be easiest, but right now I'm trying to not use behavior trees for what player units are doing, so I'm doing ''behavior'' in blueprint.

I just wonder what is the best way to create 2 different similiar events and then asign them to type of worker. I wish there was a way to create like whole event, close it into capsule make it variable and add it to the unit based on input info from Data Asset.

I'm thinking components and add component on run time but then it's like do I call to Unit > Gather and then Gather calls to component, but if you have 2 components then either I have to call to both of them and 1 that is added will respond and the rest will call null, or I make all events and possibilties in 1 class and switch branches on input Data from Data Asset so like Gather > Go to resource > Gather > Deposit (here branch if needs to transport or instant deposit), would it be the way ?

maiden wadi
dusky cobalt
# maiden wadi Why are you avoiding that for player units?

I don't have good anserw for that other than it's just a bit more performant to have this simple logic in the blueprint and not in the behavior tree that ticks all the time. Also a bit easier to get unit out from the gathering state.

dusky cobalt
maiden wadi
#

This is my primary AI tree ran on all units in game when they're spawned. I just change the primary and secondary behaviors mostly. Like primary behavior is for sending them to attack or move. They'll carry out primary tasks before secondary and then move to the next behavior. usually this ends in them idling to look for targets.

frosty heron
#

@normal viper you can try using retriggerable delay instead

#

It will reset the time if the node gets fired before the timer end

normal viper
maiden wadi
#

EG Move to and aggressive Idle. MoveTo is put in primary, aggressive idle in tertiary.

frosty heron
#

Don't know what you want me to say

normal viper
frosty heron
#

I literary explained maybe you should try reading

normal viper
#

ah sry bro i really didnt see the message
sry sry

#

my bad

frosty heron
#

All good, replace your delay with retriggerable and maybe it turns out ok

#

Not sure why you add to viewport again at the end tho

normal viper
#

aight ill try

frosty heron
#

Doesn't seems to do anythinf

#

@normal viper actually I just read the code again, you will still have issues.

#

My suggestion is to create one subtitle widget only and just update the text whenever the function is called

#

You are creating a new subtitle everytime you want to update a text.

What you should do here imo, is to create a subtitle widget if none exist and if it exist, just update text

dusky cobalt
# maiden wadi EG Move to and aggressive Idle. MoveTo is put in primary, aggressive idle in ter...

I tried to make this logic in behavior tree, it was working ok, but it wasn't really good in beeing responsive to player inputs? I probably just made it wrong etc. but now I moved it to blueprints it's much better performance and the responsiveness is amazing. Like you click, it attacks, you click stop it stops and resets target. With trees sometimes it didn't go out from the tree and it was still doing one of the task even if it was aborted, or going back into Attack state sometimes the target was set, so it couldn't set new one and a lot of shit to think of so it worked in every case. And it also had to go trough ai controller, set bt.. set target.. and now it's like Click> Attack > if no target > Sphere Trace, Set Target and attack, which is crazy good responsivnes (almost like you play league of legends), but works for x + units.

I think I will try to learn a bit about UObjects and see if they can be usefull. I wish I could make some things more modular but Components don't fit 100% what I want to do and probably creating something like Spell Gather 1 and Spell Gather 2 and assigning it to unit into slot [Gather] would call what ever was added to that slot it would be perfect. Maybe UObjects can do that.

visual crest
#

This crashes the editor when I try to use the array after I set it this way. So how best to go about doing this? I need to set a chaos geometry collection that spawns when the specified static mesh is destroyed.

normal viper
frosty heron
#

@normal viper hey man, it was my bad for getting moody but anyway are you sure it's fixed?

#

from what I observed again, there should be another issue

#

problem is you are creating multiple instances when you should only reffer to one

normal viper
frosty heron
#

if you want to drop your latest code, I can try to look at it to potentially fix some edge cases (bug)

normal viper
#

here u go

frosty heron
#

@normal viper use this node instead

#

Also your code is fine except the normal delay. But you can further optimize by creating the widget only when interact is called

#

but if you don't need that optimization, it sort of work as is (just change the delay to refrigerable delay

normal viper
#

ok already done

#

and thanks again

frosty heron
#

what does the crash says anyway

visual crest
frosty heron
#

Perhaps one or all of those pointers you passed are null?

visual crest
frosty heron
#

Well it does says you are trying to access out of bound index

#

An array of size 10 is 0 to 9

#

and there you are trying to access 10

visual crest
#

I know but I don't think I am

frosty heron
#

add break point on where you think the crash happend

visual crest
#

this is it

#

the only time I use the array

#

I mean map

#

and for some reason it crashes 100% of the time

frosty heron
#

I'm not sure tbh, map and array is like very different, if you dont call this node does it stop crashing?

#

Map doesn't have concept of order afaik

#

you won't even get an index

#

but the crash is array related it seems

visual crest
#

yea if I dont plug that return value into that pin I never get a crash the moment I do I get a crash

frosty heron
#

add breakpoint on the is valid check

#

then step through

#

findout where do you exactly crash

visual crest
#

nvm I think I just found it lol

#

I have no clue why I even added that -1

#

nop did not fix it

frosty heron
#

you need the -1 actually, trying to access length would be the case of accessing 10 in an array with a size of 10

#

where the array ranged from 0 - 9

#

so yeah, it's not the map that is crashing, deffinitly the array

visual crest
#

o yea

frosty heron
#

show the entire picture

#

are you trying to get the last index of an array?

visual crest
devout tide
#

this would already give an error since you are checking if is valid but also casting

visual crest
#

I was getting the hit part but some time damage is enough to destroy two more parts at once so when that happens I get the another part and destory it two

devout tide
#

better to add an Is Valid Macro and properly handle the case in different executions

visual crest
#

ok how would I do that?

frosty heron
#

unrelated but instead -1, you can just grab the array and type last index for neater code

Also everytime you are accessing an object reference, you want to cosndier adding guard (eg is valid check) unless you always expect something to be not null

#

in a case of a hit mesh or a scenario that it can be null then you deffinitly want to add a guard

visual crest
#

ah is valid should be run first I see

faint pasture
#

doesn't a cast imply an is valid?

frosty heron
#

he is using those pure function cast

#

but yeah maybe you are right? it has the success node

faint pasture
#

can't it just be that Selected is Hit if cast succeeds and array contains it?

visual crest
#

Hopefully this fixes it

frosty heron
#

use the is valid macro , you will end up with less node

visual crest
#

nop still crash lol

faint pasture
#

Isn't a macro just copy/paste anyway?

#

should be identical

frosty heron
visual crest
#

I KNOW

frosty heron
#

what im saying is, I don't think the crash comes from any of the blueprint you showed

#

but it's only pure guess at this point

dark drum
visual crest
#

This is the code that is causing the crash

#

But I dont see how

#

I removed every thing to do with the array that could cause a crash just went and got random instead of hit

faint pasture
#

might not be this code at all

#

make this code not run

#

idk a thing about GAS other than it's huge and I don't wanna mess with it unless I have to

frosty heron
#

Ahh yeah we can forget the gas part

#

basically I am spawning locally because delay when shooting sucks

#

but I also tell the server to spawn a replicated fireball so everyone can see it

faint pasture
frosty heron
#

I'm just trying to figure out how to sync this in the best possible way, it do be weird if I got a headshot but everyone see me miss?

visual crest
#

this is my crash log

#

says a bunch of crap then says array

dark drum
visual crest
dark drum
visual crest
#

sorry it spams a error with my AI patrol points that has nothing to do with this lol

#

but I am going to go fix that now lol because its easy to fix

dark drum
visual crest
#

yea its my destructible mesh

#

this is what spawns it

#

and the moment I plug that collection pin in and test it crashes

frosty heron
#

My money is here

visual crest
#

ok what am I doing wrong?

frosty heron
#

try to unpin it see if it stop crashing

visual crest
#

it does

#

but then my destructible mesh does not get changed either... Also there are some times it work fine without crashing for like two or three hits then crash

frosty heron
#

how is collection in even set?

#

construction script seems to be a pretty bad place to init stuff from object ref

visual crest
#

Ok Ill try in begining

frosty heron
#

issue here is you are probably passing bad data imo

#

like where is collection in even set?

#

why is it on construction script?

#

best way to get to the bottom here is to use IDE anyway since the project crash on CPP function

#

like you can't see what it's trying to do without actually diving inside

visual crest
#

still crashes

frosty heron
#

yea no suprises

#

i mean there is no attempt to fix the crash soo far

#

it's not gonna go away until you find out what the issue is

visual crest
#

I removed it from construction to begin play

frosty heron
#

I would say what ever you pass to set rest collection is not good enough, right now it's all just guessing game.
The only way to find out is to actually dive into the code

visual crest
#

This is what I am passing in and I am manually setting that data like this at the begin play of my buildable

#

I would love to figure out how to auto tie a static mesh to its corresponding destruction mesh but I have not been able to figure that one out yet

sacred thicket
#

Hey guys I was able to make a combo melee attack using Enhanced input. EI makes it pretty easy, All I did was make a few Input mappings and named one combo that one activates after 2 inputs of light punch

#

Then it activates an animation montage

#

However If you keep pressing it the input just repeats

#

anyway to buffer it using EI or code

#

Watch

eager python
#

When you guys rebuild your functions so things work differently, do you keep copies of the old versions or just delete them and rely on version control if you want them again later?

visual crest
dark drum
visual crest
fiery anvil
#

i have some files i wanna import, for some reason it just wont, i dont know why. i have seen other people import it just fine yet for me it bugs and dosnt allow me to. help?

dim agate
fiery anvil
#

it tried drag and drop and i tried to import it normally

#

both didnt work

maiden wadi
dim agate
fiery anvil
#

yes

#

is there another way

dim agate
#

Just confirming what you meant. Are you trying to import the whole batch? If so, what happens if you try one file?

fiery anvil
#

no just one

#

pistol fire fbx

sacred thicket
#

Actually boys ive almost got it

dim agate
visual crest
maiden wadi
# eager python Oh god why

Lol, I do this when fixing other people's logic. "I think I know what the intention here was... But just in case we'll leave this chunk of insanity down here til we're done."

sacred thicket
#

Im almost there It stopped firing off every second after I created a delay and a boolean in place

tame walrus
#

Hi Can Someone help me with this Boxtrace. The trace is weird when the Character is not in 0 - 90 - 180 -270 -360 degree

sacred thicket
#

It now acts like a regular melee attack but now I need to get the combo working properly. It has decent input buffers instead of just restarting the animation over and over again

maiden wadi
tame walrus
runic plinth
#

Hope I don't mess any chat flow but I was wondering if anyone could point me to online sources or clarify what would the difference while in runtime between streaming level instances versus spawning an actor of the level instance BP (the BPP_x UE creates for you). Seems to be the same result

proper flower
#

hey

#

someone can help me about rotation with physics of a spaceship?

maiden wadi
fiery anvil
#

When I drag and drop it shows an X and when I import it’s just blank nothing happens

tame walrus
eager python
#

Anyone able to humor me with why this might not be doing what I expect?

Expectation:

  • Look at every Floor Tile we're about to place when we drop the NextRoom into the Dungeon
  • If that Floor Tile already exists, remove it from the incoming Room (so we don't duplicate Floor Tiles)
  • If it doesn't exist, add it to the Dungeon, and then look at each Room we already added and remove any Vacant Spaces we find that share the incoming Floor Tile's location

What happens:

  • Everything works fine except it doesn't actually remove the Vacant Space from the existing Room (the final, uncommented loop at the end)

In the screenshot you can see a Room where it placed a floor tile but didn't remove the previous Room's Vacant Space from that position, and the debug text shows that the coordinates are equal.

eager python
#

Holy shit

#

This explains so many problems I had earlier

#

Alright, so easy fix then is to just expand it to manually remove that item from that index in the array?

maiden wadi
#

😄 It's fairly easy to make your own ForEachByRef node though. You just change some of the stuff around after copying the original ForEach

eager python
#

😮 Sounds scary. I'll have to look for a tutorial.

#

Wait

#

If For Each is a copy, then why does my dungeon work at all?

#

Like, you can see in those same screenshots, the first check which works fine is a For Each on the Floor Tiles for the next Room, and then I just drag a pin and remove from the next Room directly

#

That's how I've added literally all of my room components so far o_O

maiden wadi
eager python
#

That long line over to the right is the one that Removes the element from that array if it was found in the dungeon already

#

That small box here on the left

faint pasture
#

the last remove is modifying a COPY of the entry in RoomList

eager python
faint pasture
#

you are copying the entry, removing a tile from it, then discarding the work

eager python
#

Yeah alright I'mma need to look up that For Each by Reference thing

faint pasture
#

This smells like C++ territory, how long does this take to run right now?

eager python
#

Not long. Sec I'll find out.

#

In theory, this fixes it right?

#

Takes about 3-5 seconds to generate a 25 room dungeon from scratch.

faint pasture
eager python
#

Incl mesh

faint pasture
#

You could do the data in like a millisecond in C++ if done right, probably less time. Holler if you ever want to go down that route, I've done similar stuff. I'm working on a high performance WFC implementation.

eager python
#

Might be worth pursuing in the long run. The thing that I think it holding it up is my approach to placing Rooms... Rather than placing them sequentially, I create a "Pool" and draw Rooms from it that fit with whatever I've already placed, like a puzzle (no corridors, no spacing between Rooms). I generate a new pool of Rooms any time I am unable to find a piece that fits.

faint pasture
#

Very similar idea to WFC

#

placing stuff that already fits

eager python
#

I haven't messed with optimizing the room pool creation yet though either, so it makes hundreds more than it needs to.

faint pasture
#

What I found works great for the "Does it fit?" test is bitwise logic

eager python
#

Elaborate on "bitwise"?

faint pasture
#

basically I have 8 states that a tile can be in, so 1 byte can represent any combination of the states a tile can be (basically, representing what's allowed right now)

#

11111111 means anything fits

#

10000000 means only floor

#

etc

eager python
#

Oh fascinating

#

So as a way to circumvent looping multiple arrays

faint pasture
#

so then the logic of "does this room/stamp/pattern fit?" is basically doing bitwise logic on the elements of 2 arrays and anding all the results together

#

if every tile is allowed, the room/stamp/pattern is allowed

faint pasture
eager python
#

I was looking at some WFC videos before I started this project and ultimately decided that it confused me and I wasn't sure how to implement it. So I'm building this entirely from scratch, and it's my first programming project in 15 years.

The check you're talking about sounds extremely similar to what I've ended up with though, just probably way more optimal.

faint pasture
#

You can see that you have something very similar going on

#

you're basically doing overlapping model with N x N patterns and I guess randomly generating them instead of learning from an example?

#

also you're probably not doing the propagation step

maiden wadi
# eager python Yeah alright I'mma need to look up that For Each by Reference thing
  1. This is the normal ForEachLoop. That highlighted node is the only thing you have to change.

  2. You can copy the macro by double clicking on the ForEachLoop to go to it's implementation. You right click it in the list and copy. Make your own Macro Library of Object type.

  3. In the copied macro drag the input array and get the ref getter instead of the copy one. Connect the Array Index integer to it. Drag it's output to the Outputs thing to create a new pin. Delete the old one by copy.

faint pasture
#

You might actually be more like the simple tiled model with irregularly shaped tiles

#

your rooms don't need to match overlapping right, just match at the edges?

eager python
#

What I do is...

  • Check each Room in the Pool for a Door that faces the Exit we're currently trying to attach a new Room to
  • Check if any Floor Tiles overlap
  • Check if any Doors would be blocked by incoming Walls
  • If any of these fail, the checked Room is not a valid puzzle piece
faint pasture
#

ok so sort of the same idea but a bit different

#

I'm guessing you fill in holes after the fact?

eager python
#

And then after finding a Room that fits, I go through each of its components and decide whether or not to keep them. So for example, the Vacant Spaces need to be discarded when another Room's floor is in those spots.

#

What holes?

faint pasture
#

vacant spaces or positions not claimed by a room

#

idk what your room shapes and sizes are

eager python
#

Oh. That's all variable - I'm making it modular so I can use any meshes and have it properly scale and assemble them automatically.

faint pasture
#

Do you have some way to run this async or does it just stall while thinking?

#

idk if BP has any async or not

eager python
#

Idk what async means

#

I can show you what it does via screen share if you want tho

faint pasture
#

the 3-5 seconds that this takes, can you move the camera or is it just frozen?

eager python
#

Oh, I can move around. It's laggy in the editor but I haven't tested it packaged yet.

#

The problem I had was that when I move the "planning" code to the Construction Script (to occur before hitting Play), it started thinking it was an infinite loop, which I can't fix without that 0.0s Delay in there.

#

I can mess with all that later though too.

eager python
chilly gazelle
#

I'm working on calculating the pitch angle my AI need to look at to shoot at a specific location on my character, but I'm having a problem with solving at distance. As magnitude goes to infinity, arctan goes to 0, so the offset isn't calculated anymore. Any thoughts on how to resovle this? I've been banging my head against this for ages!

eager python
chilly gazelle
#

I run into the same issue with that node

#

that just shows where you're looking, but I need to calculate an offset from where they're looking to where they need to look

faint pasture
# maiden wadi

there's so many "I'm looking in this direction" things in Unreal

#

control rotation, base aim, focus now, probably like 2 more

chilly gazelle
maiden wadi
#

You don't need much for AI focusing stuff other than the above. You set the target or target location. And then your control rotation drives an animblueprint's 1d or 2d aim offset.

median swan
faint pasture
#

it ONLY takes in and spits out raw tilemap data. What you do with it (heightmap, spawning actors, whatever) is up to you

#

bitmap and settings in -> math -> bitmap out

median swan
eager python
faint pasture
#

In my usage we'll be doing that as a post-process

eager python
#

Generate dungeon, then add extras?

faint pasture
faint pasture
#

Check pathfinding, add extras, then select meshes for the tilemap, smooth walls if wanted, etc

#

We want to experiment with multi-layer WFC, I think it could be pretty powerful

eager python
#

Pathfinding is a thing I haven't even attempted to learn yet.

faint pasture
#

I'd recommend making your fundamental data representation some sort of integer grid

eager python
#

I'm also kind of trying to hold out until they inevitably launch a dungeon generator version of their new PCG tool.

median swan
faint pasture
#

I haven't tried that style, only overlapping

maiden wadi
eager python
#

Right lol

maiden wadi
#

Realistically you'll never see that from Epic. Too game specific.

eager python
#

They're getting close though with the Biomes thing. Biomes are basically Room Themes.

#

You can define a Dungeon "Biome" and a Crypt "Biome" and make it place actors based on the Biome, which is cool

#

But I think it's still a nightmare to get it to place things in a way that snaps together nicely

maiden wadi
#

I need to check on that actually. It might help our PCG at work. Takes a ton of time to generate PCG on our maps

#

ATM we just have separate PCG graphs per biome type.

eager python
#

Yeah I haven't messed with it too much yet. I get the impression it's still going to change dramatically between UE versions, so I'm afraid to commit.

faint pasture
#

that lays out land, water, mountain, whatever. Its colors are biomes

#

then the next layer lays out individual building plots or features at the 1m scale

#

as a seperate WFC run per island in the upper layer

#

then within the islands of that one you run a WFC at say the 20cm scale to lay out walls and windows and such

eager python
#

Interesting.

faint pasture
#

each layer defines the wfc example for the next layer. Haven't tested it but I think it might end up with some cool results.

#

Caves of Qud does something similar

eager python
#

WFC scares me. I don't feel like I see dungeons that resemble actual structures come from it too often...

#

(Then again, I haven't looked THAT much into it to be fair)

#

I bet PCG could make a sick Cave dungeon in its current implementation though

#

Take a big block of dirt and just bore holes through it

eager python
faint pasture
#

that's for an organic cave

faint pasture
eager python
#

It almost looks like it's printing variations of a template over the board?

faint pasture
# eager python It almost looks like it's printing variations of a template over the board?

Basically every 3x3 pattern in the output will be from somewhere in the input, and the 3x3 pattern frequencies should corrolate. If you draw more outside and less inside, you should have less inside. This was before I had that bit working correctly so it drew more inside than it should have. Still wouldn't be a bad map with a bit of post processing and it can crank these out indefinetly.

eager python
#

How much "randomness" is there in WFC generally?

#

I have my generator creating each Room as follows:

  • Pick a random Area for the Room (Area range limited by variables)
  • Break that Area into "Chunks" of Floor Tiles (Chunk area also defined by variable)
  • Convert excess Area into Stray Tiles
  • Place the first Chunk at relative position (0,0)
  • Pick a random Chunk, pick a random Edge, place another Chunk on that edge, repeat until out of Chunks
  • Place remaining Stray Tiles randomly around the Chunks
eager python
normal viper
#

so i did a simple animation of fading in and out for text but the fade in works and the fade out doesnt
the text just vanish
and when i added print string to see what going on found that the animation and the setting text to empty fire in the same time

maiden wadi
normal viper
maiden wadi
#

Why would it? You should be setting it when interacting with something else.

  • You create widget for the first time with blank text.
  • You set it for an object which sets the text and animates it in.
  • You stop interacting with that and let the text fade out. It's now invisible.
  • You interact with second object which immediately sets new text and starts fading it in.
#

IE On the last step, the text is already set before the fade in animation starts. So there' sno issue to just fade it out and leave it there til something else needs it.

normal viper
#

well that make sense
thanks man

#

ill remove the clear text

#

and leave it fading out

dark drum
#

Its always interesting checking out the templates from time to time. There's always slight changes between versions. Like when was there a weapon component in the FP template lol.

maiden wadi
#

Still waiting for them to remove that construction helper shit from the C++ templates. 😦

dark drum
#

I only created it to nab the pickup rifle. 😅 Now I need to figure out the reasoning for the setup haha.

craggy star
#

Hey

I am using the Adventurer's Inventory Kit and following the developer of its video asto how you integrate it into ALS

My issue is that in the first 20 seconds of the video the dev changes the game instance in ALS to BP_GameInstance, which doesn't exist in ALS for me

In this video, I've tried to show you guys how to integrate Adventurer's Inventory Kit with Advanced Locomotion System V4. In the next video, I'll be showing changing ALS states according to the equipped weapon. I hope you guys enjoy it!
Marketplace Link: https://www.unrealengine.com/marketplace/en-US/profile/Tala+Esenlikler

Thank you all for w...

▶ Play video
craggy star
ionic nacelle
#

a little stuck, it suggests that I set stop jumping to a button up event but I'm stuck on how to go about this

ionic nacelle
final berry
#

Hello! I was under the impression you could update the value of a key in a map by adding it with the same value, however that doesn't seem to work. Am i missing a setting or? I've verified with a breakpoint that the tmp int is 1 and the name is one of the keys in the map. But when I check the value of the key after this node has run it is still 0

proper flower
#

what is wrong with my directional movement input?

#

I need to have movement in a relative direction, even if I rotate yaw pitch or roll

dark drum