#blueprint
1 messages · Page 272 of 1
get game instance don't return server's
depend whos calling
GI is not replicated, everyone have their own.
Ah, there's a function for that.. Uhh..
reallllllly?
okay, it seemed the function was run on server, leading to both controllers reading server's GI
No
game instance is not replicated
client can't reach server's GI
and vice versa
Player 1 can only reach their own GI, player 2 can only reach their own G1, player 3 can only reach their own GI
huh, then is there a way I can reach remote machine's GI from the controller?
you get the idea
No, there's no way
Game instance is not replicated
Why do you want to reach their GI?
There is a direct call you can make from C++. But you shouldn't need it I don't think. Cues have a prediction key from their context. If it is a prediction key from their own client they'll run the cue locally.
I had a menu controller and a controller in game
and I want to retain data when transferring
so I stored the data chosen in during menu controller in the GI
and tried to read them with in-game controller
What is the data? Sounds initially like savegame territory.
it's both
savegame that contains player's name etc
and a class that player pick in the lobby menu
Why didn't the player tell the server what they wanted in the menu?
store them in playerstate?
Is there something like "on finished" in widget animations? I would like to remove the widget from viewport after the animation stops playing.
If your menu is networked, then the player's selections should be stored on the server already. So that when they travel to a new map, the server already has this information.
If the client is picking this from offline, there are travel arguments you can use which parse from the options from their login in game mode.
UserWidget has a function for it, but I think there may also be a binding for it on the animation itself.
thxxxx
I guess I can send a GE to the server to plays the cue
but i'm just wondering if it will get replicated back to the predicting client.
yeah there is, Event On Animation Finished,. get the anim ref and do == with your target anim.
If true then do X
I'm kinda trying to do it inside of a function Nevermind I'll just move it outside
it isn't
how to make it networked?
I might need more info to answer that correctly. What is your menu? Is this a separate level?
Simple question, is it possible to put a blueprint inside a blueprint?
I just need something that is great at storing variables inside a blueprint, the only thing I know that does that well, is a blueprint.
Unless it's possible to store variable info inside an component, in which case that also works.
you can store variables inside an object, a data asset, an actor component, almost anywhere really.
Where you put and what will need context.
usually you want to encapsulate an entitny into one
like an inventory component
or targeting component
their variables will be declared in the respective environment
okay, lets say I want to store variables into this arrow right here, how would I go about doing that?
store where?
That blueprint class would have reference to the component already.
I just noticed something, is it not possible to put interfaces into user widgets?
probably possible, but why do you want to do that?
can you give example?
the easy way normally to have a master widget
and all the sub widget is goes to the master widget
communication between child can be mediated on the master
like a timer that would execute code to change appearance of another widget
now I see having a master widget would simply things
if it's gameplay as opposed to cosmetic, you might want to run that timer not in the widget but some sort of manager.
actually wait nvm, I have a window widget which is very complex, I'd like to keep it as seperated to the master one as much as possible due to its complexity
beside you need some workaround to use timer on widget. Widget timeline component is not available, you will have to use the Designer Timeline
Alright let me share all the details so this is more clear.
The arrows, aka the "exits" are used for their location to spawn a new room, as I am working on my dungeon creator game.
Trouble is, just spawning a room is only the first step, I am going to need to store the information of what room was spawned and various other details about that room.
Now, you see there can be multiple exits to the room, so I can't just store that info in the room itself, I need to store that info in the "exits" so I can reference each one when needed.
yeah, store the room info in the Dungeon generator class
there is going to be an infinite amount of rooms, as this is going to be an endless dungeon.
How could I store all that info?
there can't be infintie ammount of rooms, your memory have limit.
You will obviously have to remove the one that you don't use anymore
and pop the new room to the array
Yes obviously, but I need a way to store that info.
Create variable
the type will be what ever your info will represents
if you need an array of those room, then create an array variable of those master room
what's the array for? we are just talking about storing data-
also it is impossible to have blueprints inside blueprints?
because that would be loads easier
Did you come from unity?
no
The array is the reference to the instance of your master room
it will point to all the master room in the world
you can grab the instance and grab their data
E.g. the number of walls, the exit arrow, w/e it's there.
I would recommend watching the video that is pinned earlier
it will really help with the foundation of OOP
I just want a place to store variables.
you say I can store them anywhere, yet every place I list to store data you said isn't possible
I said store them where it make sense
an item component would have variables related to the inventory
a targeting component would have variables related to targeting (The target actor, the initiator, etc)
encapsulation is a fundemental of OOP
So I can't store them in components and I can't put blueprints inside blueprints
how do you draw that conclusion?
what
you didn't answer my question-
CAN you store variables in an component?
CAN you put a blueprint inside a blueprint?
I just need to know this
you can store variables in a component as stated earlier
if by putting blueprint inside blueprint reffers to child actor component then not really, as that;'s a broken feature of unreal
One last question.
Lets say we have:
Exit1 Exit2 Exit3 Exit4
All of them are going to have the SAME variables, but each with different info saved inside them.
For example, Exit1 may have its "room number" variable be set to "34"
but Exit2 uses that same variable named "Room Number" BUT it's number is "54"
Is that possible?
You are mistaking actor component with a primitive type
Those Exit1, exit2, exit 3 are arrow components
if you want to have variables inside them you will have to create your own custom Arrow component
which is not what you want to do.
The variable should live in the master room
now what you can do is to create a variable type called Map
where it takes a key and pair value
So you can use Arrow component reference as the key and number as the value for the room number
so it will look like this
Key: Value
Exit1 : 34
Exit2 : 54
Exit3 : 32
What's value meant to mean in this senario?
can be what ever you want, in this case it's the room number so the type is integer
and what's key ?
the master room is just one thing.
they exits are many things.
how could one possibly store all the completely differing info in one place where it must be used in multiple places in multiple ways?
Isn't your dungeon generator going to spawn multiple master room?
how are you planning to spawn your rooms then?
each exit will have a long list of variables it needs to know before spawning the room.
not just the room, but the location of all the objects in the room and far more
sth like this
a widget
and the button pressed will change the game instance variable
So what get spawned?
forget about the details of the variable, what's spawning the room? and what is the room class?
All rooms are children of the master room.
yes
and who spawn them? Dungeon generator?
Yes
you can declare the map in the master room
The child bp will override the value
if you never hear inheritance, now it's the time to research about it.
you already have the idea of inheritance with spawning child bps, but you don't seems to grasp member variables that get passed down to children,.
omg I am gonna record another video bc clearly we aren't understanding this hold on
I am going to sleep soon
this is how you can associate your exit with the room number. Do this in every child instance
Backwards even
yeah
been wanting to say backwards
it's mostly derived from guesses.. watch the pinned video and your life is easier.
gonna sleep, gl
HOLY SHIT
THIS IS THE INFOMATION, I'VE BEEN TRYING TO PRY FROM YOUR COLD PROGRAMMER BRAIN'S HANDS
HUZZA
LETS GO
FINALLY
THANK YOU
I don't know if this is the way I will do it
you probably want to get fammiliar with structs
or Data assets.. but yeah a lot to learn
you will always end up with better version everytime you start a new project
it's fine to start simple I guess
short of me saving this to external files after generating the map, idk what else I could do
the info has to be stored
somewhere
so I can load the room back up
when I walk backwards through the map generation
bottom is how you retreive the value
so if GetMeExit1_RoomNumber function is called, it will return 45
wait a second, what about other variables?
that's just number variables
does it let you save any other type of variable ?
All the data should live in the Room object
not the exit
that's soo backward
the exit is just a location
all the info is in the room object
what do you even mean mannn
Think of it this way
the player needs to load a room
room loads
the only way that room could load
is if the previous room was loaded
if that room was loaded
so was the arrows
so, when the player gets close enough
the next room will load
its that simple
no-
Think about MINECRAFT
how do you get BACK to the chucks you where in before?
that info is stored
so you can return to that same spot
yeah, those info are stored in the dungeon generator
its the same thing
or what ever manager you chose, I will just use the dungeon generator to keep all the info
the point is you are lacking the foundation of OOP. Watch the video if you decide that you are stuck.
but if we dump all the info of alllllll the rooms, after about an hour or so of playing, we have a shitload of data now in that dungeon gen blueprint
yeah and? what's wrong with that?
how is dumping it else where somewhat make it better
they will still occupy memory in your computer
Actually not dumping the info in the singleton sounds pretty bad.
Here is my last tip
Dungeon Generator hold References to all INSTANCE of the rooms in the world.
Each room have their own variables
now in dungeon generator you have reference to every single room in the world. You can do what ever with that info.
Things like, getting the room number in the BP_Room_1
Or getting the room number in the BP_Room_2
, etc
because this isn't minecraft, not everything is on this perfect easy to understand block system.
keeping the data in the exits is more reliable.
Because when you physically arrive at the room, the info is already there.
but then that does come with a potential issue, of each room now storing all the details of the room prior, that could also build up, so instead of just loading one room, you are loading that room and the info it saved about the previous room, and the one before that, and the one before that..... etc.
I think my solution might have that flaw
keeping the data in exits is plain insanity
I just don't know any other possible way to do it
I've already explained soo many times, I'm about to give up
you can easily get a ref to the previous room or ALL rooms by storing every reference of the room you spawn in your dungeon generator class
if that doesn't click, you should get 2 - 3 hour lesson on Python regarding object oriented programming.
It's actually very useful to understand what object is, what data should it contain. Defining relationship, abstraction, etc.
I just don't know how to do that on such a grand scale.
Millions of rooms
what you are doing is not grand scale
I can't quite comprehend it
it's actually plain simple
and it doesn't matter if you do it for 2 rooms
or 100 rooms
start small, get used to the engine and how things communicate
who knows in the future maybe you can use wave function collapse to generate your dungeon.
maybe I need to create some kind of "generation_log" that writes down everything the dungeon gen has ever made.
every exit and where each exit lead to, everything that is in the room, what room was spawned, etc.
You can easily get everything that the dungeon gen has made in run time
Dungeon Generator -> Spawn room 1 -> Add to the array
Dungeon Generator -> Spawn Room 2 -> Add to the array
Now the array hold reference to room 1 and room 2
you can just DungeonGenerator-> Get room 1 -> Get me your exit room 1
or DungeonGenerator->GetRoom 2 -> Get me your exit room 2
aww man
Dungeon generator simply hold a reference to the room it spawned
you already ahve the reference you can access anything the instance has
all the exit it has, all the room number assinged to the exit, blah.
how much do you cost to just join a call and teach? genuinely curious at this point.
im going overseas so can't do it sorry and those information can easily be obtained with a few hours of learning OOP outside unreal imo.
altough I don't deny 1 on 1 session is a good form of learning
i wish i have a mentor
I fucking miss school bro, that's back when I could actually retain info lmao
if you really have money to burn, you can hire some of the guys in #hire-a-freelancer but the free way is there too,. Just learn OOP
check out leaf branch gaming if your new to this. Or other tutorials online. He goes really well into explaining how to do things. I dont know if he has beginer stuff but it might be worth checking out.
I cant find the right word / term.
I want a target icon for my third person action game w/ a widget.
Is there a way to spawn a widget (screen view), and then attach it to any actor?
Tutorials I saw keep using event tick to update the location so its not dynamically attached to anything.
@pulsar axle Here is spawning 5 "rooms" and assigned a random number to each of the room
The Dungeon generator Spawn the room and keep reference to it
notice how every time a room is spawned it's added to the SpawnedRoom array
with the spawned room you can get everything
That's pretty cool, but then when I wanna get a room back, how am I gonna know which one belongs to where?
you can loop through them and getting the exit the room number it has,
or you can get one of the element (the bottom one gets the first room that is spawned)
wdym by you want a room back?
you destroyed it?
ok I can picture it
if you are talking about mine craft
Yes, but just like in minecraft, when you walk forward enough, what's behind you is destoryed, what's in front of you is newly generated.
but if you walk backwards, you want to get back to what you once had.
hence why I wanted to store the details of the rooms
Then you will need to define them
look into structs
So your structs can contain, the number of exit, and their location
but that's probably not a solution for something like minecraft
don't think about infinite world
they probably use some sort of algorithm
you can store like maybe a 1000 randomised entry that define a room
and those entries are mapped to the location of the player
Well, the map DOES have a seed, does that help?
depends on how you use it
I wouldn't know
but you can get predictive result with seeds yes
but then the rooms would reset each time you returned to them...
hmmmm
you see the dilemma I've been faced with
Is it possible to assign the room a random number from the seed, and that's how we find that room later? (or from STREAM I should say)
the info for the room is already made with the seed at the start of the game
true
the actual representation of the room can be spawned using the entry that is made using the seed
If you are not doing open world, which maybe you shouldn't
instead thingking about minecraft maybe just tackle finite randomised dungeon
wave function collapse seems to be a popular method to generate dungeos / rooms
that's also pretty advance
and any generation with blueprint is going to be slow as f
That's easy, I already did that it took like a day.
wait blueprint has downsides??? :W;
plenty
Generating random worlds using the wave function collapse algorithm.
This video explains how the WFC algorithm works, and explains how to implement the WFC algorithm in python code.
☕️ ☕️ No coffee, no coding! 🔥 🔥
If you like to support my work with a small donation:
https://www.buymeacoffee.com/CodingQuest
Thank you!!
You can find th...
FRICK
well
fuck
now..
i
god damit
that means training myself for blueprints is pointless
its only for small games
it can't handle anything of decent scale
Blueprints may be enough for small games
and there are titles out there released with blueprint only
I really thought it was just a code visualizer
not big studios ofc... that will never happend
doing minecraft with blueprint is insane
just make smaller games
then pick up a programming language
and move the heavy stuff in C++
the rest can still be in blueprint
I genuninely can't, I've been kicked out of every programing class I've been in.
deadass teachers keep telling me I'm too stupid to learn code, which is why I try so hard with block code
meh, that's what I told my self too.
until I have the motivation to not give up
i still dont understand codes written by others
but if you know the basic, you can do a lot already
I only started programming when I was 27
I think it’s something anyone can learn. You just keep being stupid at it until one day you aren’t
If you believe your self to be stupid then it will be real
“I don’t know the thing… yet” is my motto
Also programming is kind of a different mindset in general. You have to break things down and down and down until you get to the base level and build back up
Going to the store becomes -> wake up->move leg out of bed->move other leg out of bed, etc
New plan, make infinite dungeon with block code blueprint stuff, if game gets popular, use newly gained funding to pay someone smarter to rewrite the code
You'd normally set it up with a seed so that whatever spawns is determined by the random seed
so it consistently gives the same r esults
but is "infinite"
This sound like reverse engineering. This is just a possibility of how you can learn smth
each room doesnt need to know anything about other connecting rooms
I’d start out just making a button that opens up a door
Which sounds simple but is surprisingly complex
I've never tried walking 'backwards' in something like this but i imagine you track some index
which says roomnumber
and use that to query the seed for the n'th number
a given seed will always yield the same sequence of random numbers
Seed 0:
015941851230648961231521564891256...... every single time
now if you know this information, using it in a room generator should be easy enough
RoomID = Number index
Room 0 = [0]1594185123064896......
Room 1 = 0[1]594185123064896......
Room 2 = 01[5]94185123064896......
and so on
yeah this is great and all
but how do we get that info when we want it?
generating the room is easy
you generate the info
add it to the array
Get fammiliar with structs
depending on gametype, im not sure i'd store so much info really
a minimalist approach is something like you only store what deviates from the random generation
room 3 is always spawned wiith X items in it. If something has changed thats what you store in some struct, and remove during room generationo
rooms need relations...
lets say I am 5000 rooms away from spawn, if I want to walk back, how am I going to call those rooms back to me?
how is the game going to know which one to grab and put where?
You see this is why the only way I ever understood this concept is if the exits stored the data from the room ahead, or in this case the room behind.
because otherwise I don't know how we'd figure that out.
thats the seed's job 🙂
using the seed, it will know what was there
because it's generated deterministicly
the only thing random about it is the initial seed
the rest is a fixed sequence
forever
I'd suggest testing it with a seed 🙂
a very simple bp
spawn 10 instancned static meshes , in a row
set the scale for each of them based on a Random float from stream
so your telling me, the seed is going to grab the room from the stored data, then place the exact room is spawned before, back where it once was if you walked backwards?
We need the seed to pick the room from the stored data, otherwise it will be a reset room, back to how it was at the beginning.
That's like building a house in minecraft, coming back to it and finding the house is gone and the trees you cut down are back
Look at this;
randomly generated scales
uses a seed
which i reset for each build
this was seed 794
changed to 1
back to 794
exactly as last time
also I think you are overestimating the seed's power here.
It knows how to perfectly generate the map once.
Walking backwards is not the same as walking forwards from the program's prospective.
Walking forwards is generating 50 random rooms and it will always generate those 50 random rooms when you boot up with the same seed.
However, I have no reason to believe it would do those exact 50 rooms again if we walk away and return to that spot.
you need to reverse the stream while walking backwards
alternatively you'd store the number generated for each room 🙂
has some microscopic memory footprint but sounds more reasonable than backwalking
since reversing a stream apparently isnt a thing
@gentle urchin how would you preserve the info to determine which rooms the player is going to?
if we to spawn the rooms based on the player location
Not sure i get the question
like if I'm walking to a door, how would I know that it's room 76
I'm considering to just doing it this way if I can't get wfc to work
just had a revolation
Probably ignore everything I said before, I didn't understand the magnitude of your question at the time.
I deadass forgot in my game, it's part of the lore that after ONE day the world resets everything outside the spawn room.
So we only need to store data for like one day, meaning storing data in the exits isn't that terrible
lets say a day lasts 40 mins in real time
I actually need to investigate this a bit 😅
One thing is if all are in a sequence
But now its kinda not?
Can you walk a seed in a gridlike manner 🤔
is there a way to move a widget over one actors head to another. like a target icon?
Assuming the doors are what triggers things to load, you can use it's location (Possibly normalize it so it's an int vector) and store it in a map, with the room index. When you go to a door, you can check if it's normallized location is in the map, if it is, use the room index, if not, generate one.
Short answer is yes. Are you using a widget added to the viewport or a widget component?
That means memory footprikt increases over time and seed is only used to initialize a tile, regardless of location
That would give inconsistent results of the same starting seed depending on the way you walk
made a widget, have a widget component on actor bp and then created the widget and set it.
Oh... Yea, they could use the location (x, y and z) to generate different sine waves that you combine together. The seed would then be used at the very beginning to generate modifier values used for generating the sine waves.
Is the component inside a specific actor just for the target icon?
its in a parent class that will be used by all player and enemy actors
Just give it a actor var ('DesiredTarget') which you set when changing target. You can then use this, and lerp it's current location to the target actors location (+ an offset if required) on tick.
What am I giving an actor var to? The widget I created? And how do i change the position of a widget?
To the actor the widget component is inside.
does this make my storing data in exits idea not so terrible @frosty heron ?
I still don’t understand. How am I able to change the widget location. I don’t see anything that would let me do that and have it then be attached to the new actor.
(I don’t have my main machine with me so this is a crude setup of the concept I have.)
The widget component is in the player character and not in a seperate actor?
The widget component (being an added component in the third person character scene) will be in a parent actor. All player and enemy characters will be a child of that class.
The widget itself is a different blueprint class.
If you want to seamlessly move the widget from one head to another then you can forget about widget components
Let alone the freaking overhead they have.
Better to simply have a container in your HUD that you can add entries to from wherever you want and those entries then position themselves based on whatever logic you want.
E.g. Deprojecting a 3d location to 2d.
Or doing that on top of interpolating between the two locations to get your "moving from one to another"
I would always suggest using that setup anyway instead of using widget components.
That way you get full control, it's easier extendable and you can handle different widgets potentially overlapping cause they will all be in the same parent slot
@storm solar
WidgetComponents are mostly a VR thing to render 3D widgets. The screen space stuff is added fluff on top which you can do yourself just fine without the components
+1 for ditching widget components for anything that isn't specifically world space 3D widgets. They're bad for screen space.
I didn't know widgets had those types of issues.
Are they bad for performance?
The main widgets im using for for a general hud and for damage popups when an actor is hit.
Is there something I can look up as reference? Also, aren't HUDs generally a widget?
Not Widgets
WidgetComponents
Yes
Slate or UserWidget, but yes
ah gotcha, not widget components. ok
Could you break this down for me.
Do you mean I would set up all the logic of location in the widget itself? And the third person character actor wouldn't have any component of that widget in it by default?
I guess the main thing Im stuck on is what node moves the widget to a space. I just know create and set widget. I've been checking but haven't found anything for moving it.
yo if anyfolks have trouble understanding why the cast node can be a problem here is why (i have understand it after some time so i share it now cause it might help someone) IN BLUEPRINT *
CONVERSATION WITH CHAT GPT
so if i have a blueprint A that dont have to be loaded at the start but i cast to blueprint B wich will be loaded anyway, that mean that blueprint A will be loaded cause blueprint B need it to be if i use cast and therefore its bad ?
ChatGPT a dit :
ChatGPT
You're absolutely right! If Blueprint A casts to Blueprint B, and Blueprint B is loaded into memory at the start of the game (or whenever it's required), then Blueprint A will also be loaded into memory because it contains a hard reference to Blueprint B through the Cast To node. This can indeed lead to undesirable memory usage, especially if Blueprint A isn't supposed to be loaded initially.
Why This Happens:
The Cast To node creates a hard reference between the two Blueprints. Hard references cause Unreal Engine's garbage collector to ensure that both Blueprints stay in memory as long as one of them is in use, even if Blueprint A wouldn't naturally load otherwise.
Watch this recorded session from Unreal Fest Seattle 2024 that uncovers the truth behind Unreal Engine best practices.
Are Ticks really that problematic? Should you make all your meshes Nanite? Is the ChildActorComponent truly cursed? Should you never use Cast?
You've probably heard many of these so-called ""best practices”. Check out this v...
watch this
i did already i know but i thought understanding concretely wich bp behave in what circumstance something valuable
And btw i was thinking what happen if u use a blueprint interface at the game start to set a variable of blueprint A* for example from blueprint B that require to be loaded anyway but the blueprint A where u set it should not be loaded ?
mb i forgot a part in my sentence*
Does it load the bp A that should not be loaded cause u have to to set the variable and therefore it would be the same as casting ?
An Interface can avoid the loading. It's still a cast, but a cast to the Interface.
But you shouldn't litter your project with Interfaces...
Alright but what the solution in blueprint then if i want to use a reference to my character bp in a small actor with small feature that dont have to be loaded at the start ? interface right ?
also an interface doesn't remove the necessity for something to be loaded
True but the Interface would in fact mean that the BP you try to avoid loading now has the chnace to be loaded later
it removes the necessity that whatever is loaded, has to be of a specific type
in the correct use case of an interface, yea
So i should use an interface and set that specific variable when its required only to be correct ?
we can't give you an answer to that without knowing the full context
Well i have an actor that will use the camera of my player character and i need a refence to my character but this actor dont have to be loaded at the start of the game
Loading your Character BP isn't always a bad thing. If your Character and the small feature are neee at the same time anyway
There is also a big chance that your Character isn't actually that overlaoded, cause maybe you were smart enough to use SOME Interfaces where it made sense, and SOME SoftReferences.
Point is that this is rarely the case. If you want to really make sure the BP load stuff isn't a problem, use C++.
well i m neither smart or a cpp enjoyer sadly i wish but for now i do with what i can
and whats the point of bragging(im not talking about u guys but just its everywhere) about interface if its not to use in that case i dont get it
You would usually have a Widget that represents your HUD. In there you could have some sort of Panel Widget, fwiw a CanvasPanel, that solely responsible for holding these "WorldLocation" Widgets.
Your HUD Widget would be created in your PlayerController or PlayerCharacter. You can get a reference to it from basically everywhere due to that, and then call some functions on the HUD to add and remove these "self positioning" "WorldLocation" widgets.
You can also put that CanvasPanel into another UserWidget and put that into the HUD for some cleaner code.
And these self positioning WorldLocation widgets would then be some base UserWidget you create, e.g. WB_WorldLocation, and in there you would code how the Widget positions itself inside the CanvasPanelSlot it will be in, if you add it to the CanvasPanel.
The CanvasPanelSlot has options to define the Anchor and the relative Location.
There are functions on the PlayerController to deproject a WorldLocation to a 2D Location.
And with a bit of math, google, and, if you are into that shit, ChatGPT (please don't) you can calculate then set that 2D position.
Pretty sure you can find that setup, or at least something like this, via google.
After that, every system can add these widgets to the Screen.
And if you add a "GetLocation" function to the base class that returns some Vector3D, which you can then feed into the math for the 2D Position, you can make child widgets of that one and override the function to return whatever location you want. E.g. the Character's location.
So it would be:
- WB_HUD
- WB_WorldLocationWidgetPanel
- WB_WorldLocationWidget_1
- WB_WorldLocationWidget_2
- WB_WorldLocationWidgetPanel
With the lowest 2 being added runtime to the WB_WorldLocationWidgetPanel's CanvasPanel.
It's mostly that people tend to use "XYZ" for everything. Here Interfaces.
It's like someone using a Hammer to put a Screw into the wall. Might work, but is it the correct approach of using the Hammer?
i can sse thing being situational and correct in specific case thats why i ask to u guys that know
You usually use Interfaces if you have multiple different classes that don't share a parent class and you want to still be able to call common function on them. E.g. an Interaction System where you want to interact with Actors, Characters, and what not.
You can also use Interfaces to abstract some implementations away, so that others can add new ones. An example is the OnlineSubsystemInterface, where each new implementation use that Interface with which the end-user then handles online stuff.
Using it to avoid hard references in Blueprints is in theory also an option. But you'd want to make sure you aren't spamming it everywhere just for the sake of eliminating every hard reference.
what does this behaviour cause, is that just for project complexity issue ?
Spamming it around?
yeah lol
It becomes incredibly difficult to debug and read your code.
Adds tons of additional assets etc.
yeah i have discovered that i see
So yeah, you could call it complexity issue
It's especially bad if you end up having an Interface that really is only use for a single class
Like pulling all functions out of your Character into an interface
If you would have tons of different "things" that can be characters, and they can't share parent class, then having a Character Interface with all those functions would make sense
But just to stop the hardreference, it will make things really difficult to follow
There are a lot of cases where it makes sense to use SoftClass and SoftObject references
So that you load them during runtime when needed.
But even that is only needed if you are even loading them later
If you load Character and instantly the Mesh, then it#s redundant in theory
It would maybe improve the editor load times though
But you could for example have a Spawner Blueprint that uses DataAssets with the information to spawn the thign you want to spawn.
That DataAsset could be a soft reference, so the Spawner only loads it if it wants to spawn it.
And the DataAsset itself could also have soft references in it, for textures, or the class it represents.
That will help load times and what not, but again, has to be done in a way that it makes sense.
You don't ever have to use SoftXXX if the target device has infinite RAM and your target audience has infinite patience. When you don't use soft pointers, everything references everything else, and all of it will all be loaded on start, meaning the startup time will increase.
(how i understand)
well this is good to have written like this thx guys
Yeeeah kinda. If your game is small enough and no one notices it then you are good of course.
If you have a MOBA with 160 characters, having them all hardreferenced in the GameMode or so via an Array of allowed Character Classes, you'd have one hell of a time. Especially if only 10 characters at max would be used.
If your game has 4 characters that will almost always be used together, then it might be redundant to think about it.
Ultimately you gotta ensure your editor and game load fast enough to your liking
Which is a subjective (and sometimes objective) thing which you can test via Unreal Insights and your own watch fwiw.
But it's def good that you are all aware of this and of the possibilities to fix it.
Last time I really had to fix it was for The Ascent cause the load time was too long for console requirements 🙃
At which point you have no choice anymore
When I just learned about it i thought it wasn't anything important. But after I optimized load times I cringe every time I see a hard reference that could be a soft one. Now I constantly think about what to load and when
I wish life was long enough to apply all optimizations
i dont XD
realy cool to have concrete example
Yeah, with Load Times just being one of the smallest things in that topic. Enter general CPU and GPU optimization, and Player 3, Bandwidth.
(that's a poor multiplayer joke)
thank god there are profiling tools for the engine, including a CPU tracer and a network traffic analyzer
I wanted to say "I don't know what I would do without them" but maybe I should know what to do without them
Does anyone do code reviews for BP code? Does anyone know anyone who does?
asking again, at least ideas on how to implement this. Basically the slide off of the enemy when doing a hard dive directly above them rather than hanging above them.
Is this your game or a reference to how you want it to work?
reference
that is wuthering waves
if you scrub around the midpoint of the vid
you see the character slid to the side of the enemy before hitting the ground
Do you use a character actor and a character movement component?
yes
i know default capsule collision behavior has them bounce
when step on is not enabled
character movement component can handle sliding. I don't know if it's good enough for you though. Have you ever seen sliding in action? You can see it when you slide along walls when you try to move into them
ye
This same mechanism may slide your character away from an obstacle below the character
right
but the issue is the default capsule behavior
where if the capsule collider hits the top of another capsule collider
and that collider doesn't have step on enable
it will bounce them upward and away
rather than let them slide down
bounce? bounce like a physics object? Or bounce like an object with a glitchy overlapping collision? Can you show how it looks?
you can replicate it if you have two characters
and drop one character directly on top of another character
some gravity or falling shenanigans. Character movement component has a falling behaviour, maybe it does something unusual when you hit an uneven floor (for example, top of the capsule). I'm reading the source code for it rn, maybe I can figure it out without launching the editor
i would love to know where in the source code it's doing that
i did not have physics enabled
cause otherwise i cannot move with movement component
how can I enable this "show only actors" section in 2d scene capture
JumpOff or something like that I guess.
Don't think you can fix this without your own CMC child class.
There should be a dropdown enum above that to select the type
mannn
I added that to Mover for a client of mine, so that the player slides off of anything that is not walkable.
In theory it's just applying a force into a given direction while adding gravity.
got it, thanks man, it was under "Primitive Render Mode"
"force" being just velocity of course
Does anyone know why some nodes get replaced randomly with 'PLACEHOLDER CLASS' type?
And I cant fix it, unreal keeps doing it on restart
How would you approach a system for detecting whether or not an actor is visible to the player camera?
I had one in mind based on a series of line traces, but I feel it'd be unperformant or obtuse.
hello , i'm doing a coin pusher game , and i want to destroy the coin when it falls off the machine ( i tried multiple things and even the simple fact to destroy the coin if it collide with anything doesn't work ) , someone can help me know what am i missing here ? thx
here is my BP_Coin :
You are destroying the logic before the string is called
Destroy actor (self) should be at the end of your logic
ok , but even if i put the print before, it doesnt change anything
idk how you are hitting it either, but you might want to do a line trace by channel for visibility and break hit. I don't know how you're checking the hit
i'm not checking the hit
( sry i'm new to bp )
i tried on my own then followed this tuto
https://youtu.be/3TnmhfKGTC0?si=x-OGO5akJTCK0xj7&t=84
Learn Unreal Engine 5 for free with my fun UE5 tutorials!
Unreal 5 Game Development Masterclass (90% Off) https://tinyurl.com/unrealengine5
Try a course at: https://training.mammothinteractive.com/
The best way to support our channel is to subscribe to my online courses on programming and more. 20-60 hours of content added every month. Clic...
the guy on the video doesn't check for the hit as far as i understand, he fire , and if the projectile hit anything , it's destroyed
i make my coin fall by gravity on the box and it collide with it
so are you using a projectile? if not, if the goal is just for collision and physics simulation, you don't even need dedicated BP logic for that. Just select the mesh components or default scene root and select the box 'simulate physics' you can adjust the mass too which will give you leeway on how it interacts. Also make sure collision is set to block other actors so it collides properly
These should be found in the details panel of the BP actor
There already is one. Everything has a RecentlyRendered call you can check with a slack time.
I'm a C# programmer just starting with blueprint and I have a question about printing. Is there a node equivalent of a string.Format operation with arbitrary number of string inputs? Right now I use Print String, which is fed from Append String, which is only appending two strings together at a time, which creates disproportionately giant sections for very simple prints like Filtering by tag X, got 24 results. I'd like to have a single node equivalent of print (string.Format ("Filtering by tag {0}, got {1} results", tagName, resultCount)). Something like a big text field node to which you can drag any number of String connections.
Not Strings. But FText has a Format node that I think you're after.
Which you could just convert to string. Or use PrintText.
From what I understand FText is for user facing localizable text. Is it fine to use for developer only utility prints?
But does it allow me to select only certain parts of the actor?
Particularly, damageable areas in enemies
Sure. If you want to be extra careful, then mark the property as not localizable. For example this. Click the flag here and uncheck Localize.
Omg, this is perfect, thank you!
And connecting random value types doesn't pollute the graph with cast nodes, awesome!
One last question about this: is it possible to edit text on nodes like these via the Details pane or via some sort of dedicated multiline popup? It's somewhat awkward to type long strings into a tiny input field on the nodes and having the node resize and cover nearby nodes after every text edit you make.
No, I can't think of anyway that is justifiable.
If I were in your shoes, I would have pre defined ammount of entries. E.g 2000 rooms info.
Reading squize suggestion I would use grid based system, so we can calculate based on the player location in relative to the world location, which grid the next room is.
The rest is just pulling the corresponding data from the element.
The random part would be generating the info and that can be done with seeds.
You can shift enter multiline it. Or make the input a variable in the class. Never cared much past that personally. 😄
I'm not sure about your use case. But the recently rendered is specifically for actors or primitive components of any kind and I believe it's largely based on their bounds and whether they're occluded from the camera.
What do you need to to know if a damageable is in camera view for, in general?
That bool is pretty unreliable from my experience.
I have a first person targetting system that has 3 - 4 valid arget points on an enemy (Closest example is V.A.T..S. from Fallout 3 onwards.
What is the in camera view for?
There is a lock on system. Basically just to know if the player can lock on them, then a line trace is done to all the damageable area components to check if they are valid targets
Depends on what you use it on and whether you're using culling well. Some things have a much larger bounds than you realize sometimes. Specially cases like particles which can dramatically increase an actor's bounds.
It works by tracing a line towards components of tag X, so if you shoot for tag "body" you have scene components in the body that can be unblocked in camera view. Then you attack one at random
The multiple components is for fast accuracy and cosmetic impact VFX spawning
what the hell is this?? the same thing works with the other ABP I'm using.. exactly the same trick
ahh my bad
time for a clean up in there.. i got some obsolete stuff with similar names
Depending on desired effect, if you only simply care about whether they're on the player's screen, then I'd be inclined to say follow ColdSummer's deleted note of projecting them to screen.
I'm hesitant to fully commit to that idea though simply because it's cheatable. Someone changes their field of view, or has a widescreen monitor and suddenly they have an advantage or disadvantage. Not likely an issue in singleplayer game, but still a point to keep in mind.
Hmm... Projecting them to screen could work, but how expensive it is?
But in regards to recently rendered
I could make it a different way
How expensive would it be to make, roughly 10 to 20 line traces every update?
For the traces, probably not much. But everything is relative. Something "cheap" in one project is a crippling component keeping you from your 60fps target in another project.
Regarding the projection to screen space, that's very cheap, it's basic point is in box math. In fact Epic added some box nodes recently.. I wonder iiiiif...
20 line trace is nothing
You can do a thousands and it should be fine
Most people probably know how vats in fallout work
Current idea is to have the player see the overall hit chance of the attack targetting an area displayed on screen, OR if the attack can be performed at all (because it may be blocked)
Since the game is real time that means the game needs to do this every update or it won't be accurate
Which is a bit of a bummer since it's a binary but if the cost is negligible it should be okay
Something like this would be the projection to screen box check I think.
Then again I'm early enough that I may just end up reworking it in a way that way fewer lines are needed
But of course this doesn't help check for occluding things that may still be in screen's space. So probably wasted effort over a trace in the first place.
I have never used that node before so it never crossed my mind
Yeah lack of logic for occlusion kills this for my case... But I still wanna learn about this. Seems like a good niche to keep in mind for later
Okay oddly enough this is EXACTLY something I needed for a different project I had on standby... Funny.
Or close enough at least... Something to use a Point instead of a collider for collision checks mostly
And this is exactly why I feel like I have ADHD some days. I go off trying to learn about something, and I find something else neat completely unrelated to original topic and want to put it in a different project.
I was suggested using a radius collision of 0 though. No idea if that's safe
Why is this binding giving me this tooltip? Even though it claims no value will be returned, it actually passes the data I want and is working as intended. Not a real problem, just curious if anyone has seen this before
It will pass the data, but not by reference.
Meaning if you intended to pass a reference to a property, and then reassign it and expect the original property to change, then it won't do that.
Ah, fair enough
I have a question about behavior of local variables within loops. My basic understanding of "local" is "local to the function body of a given blueprint", as in "declared at the top of a function".
I see a few examples where a "read local variable" node is utilized with an array variable within a loop. The variable is then used as if it was completely guaranteed to be empty, despite multiple loops occurring due to earlier foreach node. Printing the contents of the variable tells me it's indeed unique per each iteration of the loop and doesn't keep accumulating entries, despite looking like it should. What gives? Where's the hidden "clear the array" operation in this graph?
My only theory is that on-blueprint variables do not actually have class-wide scope and that the first instance of "read local variable" node is equivalent to declaring a local variable deep within your function. If you first use a local var within a loop, it's local to current iteration of that loop, ergo always empty. Something like the following code. Is that right?
void MyBlueprintMockup ()
{
// TArray<Actor> MyLocalVariable;
// My intuitive understanding of how "local" variable would be declared - at the start of a blueprint run
// But this doesn't seem to be the case
foreach (...)
{
// If you first use a local variable within a loop, it seems to be empty every loop, so it probably gets declared like this?
TArray<Actor> MyLocalVariable; // unique and empty to each iteration
}
}
(Ignore the missing execution link to Append in the screenshot, got it fixed right after taking it, sorry!)
Oh, sorry, ignore the whole thing, local vars are properly local to function scope. If I see it right, the mistake I made was logging the output of Get Attached Actors, which is guaranteed to be a unique collection every time, and not my own local var accumulating child objects. Doh!
Hi I am stumped trying to make a simple buying system. I am confused on how to communicate to the widget where to subtract coins from the players coin component? The subtract function works on it's own but not when called from in the widget. The Item system is just a yes and no button with a picture of the item. It comes up in game and the no button works, closing the prompt
https://forums.unrealengine.com/t/deproject-project-are-there-similiar-functions-outside-of-hud-canvas/295364
So i didn't find the math for deproject screen to world. Project world to screen seems to be doing ok besides the scale.
Any suggestions for what to search for the deproject route. I found a bunch of youtube videos in unreal, and some general math ones. But none doing exactly what i was looking for.
like this: https://forums.unrealengine.com/t/convert-3d-hit-location-to-2d-character-image/2004847
I could really use them outside of HUD. but right now Project/Deproject for all practical purposes are accessible only from HUD or Canvas. Are there static/World function that would accomplish similar thing ?
Hello, I want to create something like this on the image. I have 3D world space hit location and I’d like to show that location on the character image in the viewport, visually show last hit location on exact spot on the character. What is the right way of doing it, hence I tried converting 3D location to meshspace and then in the widget I trie...
crude demonstration of the positioning running once every second.
How can I have an Interface be a reference to my WBP_Main?
The subtraction should work, provided you set the reference of the player.
Also print string the value to check after the subtraction.
i got it to work after a bit. I am now stuck on getting the character being talked to to spawn the item
you buy an item, then from a spawn point the item would show up. Like a table then you would get close enough to collide with it to collect it
I would probably have the merchant handle the spawning logic.
The merchant would be the one holding the table location too, to spawn the item.
Not the player.
that's what I am intending to do
I have a location in the merchant to spawn but I don't know how to reference it correctly either in the component or UWBP
Well the widget should know both the player and the merchant.
It really depends on the game but for simplicity you can make the merchant be the one to spawn the widget
You can easily pass the buyer (interacting actor) and the merchant reference to the widget when you spawn the widget.
So your widget shop now knows who's component to use to subtract the money and the merchant to spawn the item.
it knows to subtract from the player coin component and who the player is, but then how would I make it work with another actor? thats is where I am stumped
this is the widget
On your widget shop, create a variable called merchant. Set the type to actor reference or you can use your bp merchant
Set the variable to instance editable and expose on spawn
Now when your merchant spawn the widget, get self then connect it to merchant variable that is exposed to create widget node.
I see, so then the logic for the spawning the item would then be added to the base character class or handled otherwise?
No, no the function to spawn the item should be exclusive to merchant bp
Unless the player can sell items too
okay I see thanks I will try it
I will hang around for a bit if you need further help
thank you I have been taking lessons on this so trying this from mostly scratch is a bit confusing
We all learn everyday
Alright I got the merchant part but how can I call the logic to spawn the item that is already inside the merchant? since the actor reference doesn't have the logic itself
the merchant is a child actor
Wdym by the merchant is a child actor
Btw instead using actor reference just use your merchant class and the reference
hes a child actor of the character class
So a pointer (object reference) to a merchant type instead of actor
okay I will try again
Btw for further reference you can cast the actor but it's not neccesary at all in this context.
As you only need to know the merchant, not a collection of something that derived from common base class.
so from the merchant how will it know how to start the "Place Item" event after I press the button on the Sell screen?
The widget calls the merchant to sell the item
Button sell -> get merchant -> sell item function
thank you I get it now
I have trouble understanding the communication of blueprints most
can you not use async load in a function?
Does the fact that my Dialogue component only works on characters cause problems with thi? I made a separate new blueprint just for the merchant and tried calling it after the yes button and it still didn't work?
the sell menus is inside the dialogue component for this and is triggered with an alternate interact
No latent action in a function
What don't work? Also I don't really like the part where you pass the component. Imo you should pass the reference to the actor.
From there it's get actor-> get component by class
That way you can pull any data from the buyer instead just the coin component.
ok found out more or less how to do that wuwa style of bounce
or really just no bounce, turns out there's a parameter called JumpOff Jump Z Factor that i can set to 0 to avoid being flung upwards and still be flunged side ways
thanks for sharing, I might need that
ye
honestly kinda funnny it took diving into the source code
to find out that variable is exposed to the editor
Eye sea
Thanks I will do that in a moment when I come back
Hi All,
I'm new here, and pretty new to Unreal.
I'm trying to figure out an issue with my Turn In Place blueprint. Currently, I can rotate my character and after +/-90° it calls an Animation Montage to turn the character. This works properly, but after the montage finishes the character snaps back partially.
I'm basically disabling Use Controller Rotation Yaw when standing still, then checking for a rotation change. If that exceeds a threshold (+/-90°), it sets Turning=True (to avoid multiple triggers) and then runs (via a Run on Server > Multicast chain) a function to play the montage.
On completion (or interruption) of the montage, it sets Turning=False, stores the current Actor rotation (for future rotation delta comparison), and finally reenables Use Controller Rotation Yaw.
As far as I can tell, the issue stems from over rotation. The camera turns up to 90° with the characters legs held in place. The animation plays, but now the character turned 180°. Something corrects and turns the mesh -90° to match.
I don't know what's snapping it back and how to fix it?
not sure if this is where I should grab the component but I think this is the right spot it's the only place where I can access the component
Because everything on your Hierarchy pane is locked including the selected element called Border.
oh yeah
so im looking for something that will teach me how to do random craft rarity with random stats on items. does anyone out there know of any guides or tutorials
you will just use random value nodes, in case of algorithm if you want multiple stats you will apply the thing, you will put chance (this is also random value range) in game that determines if this stat will show up or not. If you want full algorithm ask chatgbt, this system is not hard to do, you can figure it out by just gbt
Hello everyone) Please tell me how I can synchronize the sound with the set? I have a mine, it blinks (light) and makes a “beep” sound.
Here is a blueprint of the blinking light.
Key is providing the item with a seed
Then use the seed in all the calculations / chances / values
Seed <-> Stream
If the seed is staying still all the time, is this means it will give predictable results? Is random values in range uses seed ? (If yes,) How to avoid it in blueprint nodes?
Using the seed gives you deterministic outcomes, yes
So you randomize the seed when an item is created
Which means the item will be unique as long as the seed is unique
Hello. I have an ability where the character goes airborne. How can I detect when they've touched the ground after? There doesn't seem to be any useful bindings in character movement component.
Character has a Landed function.
It does?
Oh you meant function. So I have to override it, I can't bind.
Thanks.
Looks like there's a C++ event I can bind to.
There's a delegate too.
@trim matrix really thought that was unreliable on unreal bps
Who said that? O.o
its never got me much of anywhere on some of the stuff ive tried but generalized stuff
you can anything with bp, it's just not true if someone said you cann't
so is there a way to randomize seed in bp? or it's randomized when I use that nodes?
I'm not sure I'd go so far as to say anything.
and that would help me not only do the random stat but also the rarity with those ranges
Stream from seed
yes.
yeah, What I have know (a friend of mine said) is that if you want fully customized systems, or just a professional who works for optimizing, cpp is more suitable
These are extremely simplified versions. But this is the general idea.
It's just a lot of data manipulation really.
ok i should clarify it as a stat modifier. So lets say i have a tool with harvest damage and health damage and i want it to randomize with rarity the amount each rarity could add to the tool and only apply to the harvest damage
Okay so first you randomize the rarity. Then lets say for like harvest damage. You have a list of ranges that a tool can have for each rarity for each stat. So you pull harvest damage's range using the rarity you already randomized, and randomize a float within that range.
what is the meaning of stream in generally in terms of programming, I know from physysics also in math but not that completely, if you have got time for explaining i will be glad
Aaah. That's not in my version of Unreal. Thank you, though.
Random numbers in computers aren't truly random. They use formulas that can produce numbers that seem "random enough". But these formulas need some kind of starting "seed" value so not everyone who uses the same formula gets the same results. Once you have the "seed" decided, you will generate the same "random" numbers in order from the stream.
So if someone else used the same seed they would get the same random numbers. (Note that the actual random numbers are usually generated as raw random bits and then scaled to useful ranges)
so the stream is determined order of numbers, which we will get when I we want another number
that's what I understand
Yeah. you can think of a seed as a unique arrangement in a deck of cards. You'll draw the same cards in order.
TBF Stream in this case is just a name someone gave this data type here. It doesn't really match with the computer science definition well.
no no no wait, I don't understand, what is the difference of stream and seed?
It's actually a problem in software where randomness REALLY matters, like gambling and network security, because a powerful enough computer can reverse-engineer the seed and predict what numbers will come next.
If i have a well established struct and I add a new variable, a boolean, nothing happens. If I convert it to a string, sure! But when it becomes an enum, all hell breaks loose and several functions are invalidated. Anyone have any idea what is happening?
A seed is the starting value that the others "grow" from. The stream is an endless list of random numbers that is generated.
haaa ok, know I understand
Typically seed is chosen from the current Time of the electronic device.
thank you so much for helping
General serialization problems with BP structs. 🤷♂️
is there a workaround?
so far most of my work is slowly drifting to intense regex
and as much as I like hardcore regex, it's tough on the fingers to type and parse it
C++ structs. Or getting really used to fixing BPs.
How can i achieve this
i dont want to make button/images for every key on the keyboard
one of the weirdest bugs I've seen in Unreal is this one while clicking on the mesh the Unreal will crash and then after opening it back the mesh will completely vanish. you can see in the picture that I'm clicking on the mesh but it does not show it in the viewport or show any details panel (the Dragon in the viewport is not the mesh it is a static mesh)
Your character BP is corrupted.
Is there a way to fix?
duplicate it and see what's left
usually unreal will skip corruption on duplication
same
and it still crashes?
https://brandtborges.wixsite.com/authaer/post/fixing-corrupted-blueprints
You can try this to see if you can fix the mesh pointer to see the details panel again.
no
so it's fixed or not? you send mixed messages...
It only crushed once and then the bug happened
Yeah. BP's pointer to the mesh probably serialized bad. So it's loading nullptr. The mesh component is likely still there as a subobject. You can try that plugin tool to reset it using the editor utility
Did UE 5.5 break some blueprint nodes and permamently replaced them with ''placeholder class'' for anyone else?
you miss some plugins probably
Hey does anyone know how to change the pivot point of a model on the fly using blueprints?
at runtime?
When the game is running.
I have a map generator, it needs to place rooms, the pivot points of the rooms need to changed so they can be placed perfectly on the selected exits, it's a long story.
just use a scene component to offset
or use math
is a room just a mesh?
Not that I've noticed personally. Whats the issue?
yes lemmie record a video explaining it propperly hold on
anyone see a replication issue here?
Adding to what Adriel said, have the component be attached to something like a scene component. You would move the scene component when you want to move what's attached to it but it allows you to modify the relative location (offset) of the attached thing.
yes
You have variabled spanning across different exec paths. This could cause problems.
how do you expect that data to get there
your ONLY way to send data to the server is through a run on server event
The two events aren't replicated event either. Just standard events. Not sure if this is intended though.
here's the video explaining the situation
You can do that just with transform math and attachment
use sockets or scene components (your arrows)
Are there's structures by any chance? Or something add via a plugin?
is it not reccommended to use functions from other BP's ? does it matter
that doesn't matter, the fact that your code is telling it to run a function using the output from another function (that never actually ran on the instance of this object that is requesting that data) is.
What do you mean
you have to remember that your multiplayer code represents multiple objects on multiple machines
Those classes are from a plugin
but its embedded in content folder now
so idk how it would reference a plugin
what kind of math? I know there is ofc some exact position possible to put it there, but what equation and I am even trying to do to get that result?
sorry, that issue is resolved you guys were correct, i think this should work , although in general, is it not wise to use functions from other blueprints if we're constantly calling them?
hey guys.. been trying to make my inputs mappable.. why does GetAllPlayerMappableActionKeyMappings return an empty array here?
It's most likely a load order issue then. So the BP that's using the stuff from the plugin is loading before the plugin stuff so when it goes to find it, (on launch) it's not there.
what are you trying to do here, a number pad?
it doesnt make sense because its referencing stuff from the plugin
and this error never happened before for years
for the question, its a diff scenario
i have a door buying bp that has functions to check money / change , etc
and i have a menu as wlel, wondering if should incorporate those functions here
or constantly call them
OK, think about it this way
UE5.5 might have changed the load order of a few things. 🤷♂️ Generally though, if things break when you reload your project, it's normally a load order issue.
what is the minimum amount of data the client should be sending to the server to notify them of what they're trying to do?
is it "I want to buy this door"?
whatever that means
its a function so its client sided no?
In the game mechanics
run that on both sides unless you want to have to wait for the server to know if you can buy the thing
Multiplayer is a whole can of worms, you're probably going into it too early tbh. But anyway, here's the general form of anything you'd want to do.
Client:
Input -> optionally do some local checks etc -> tell the server something (I want to buy XXXX door or whatever) in a run on server event
Run on Server Event -> take the passed in data, do whatever checks, do the thing, set some replicated state or spawn actors or wahtever
I have the position of the arrow (SelectedEntryPoint) and the postion of the room (LatestRoom).
What math would be needed to place the doorway of the SelectedExitPoint Arrow, in the perfect position? that position being SelectedExitPoint (the exit from the room prior)
Personally, if you're checking if the player can purchase something, it should be handled server side. If it's possible, the server would then tell the client what it can do.
OK, but you guys are missing the question
Is calling a function thats from another blueprint inefficent
I believe you're looking for this.
no
makes no difference
damn.. I'll try that, thank you
thanks
Think in terms of transforms, not just positions. transform being position + rotation.
I'll have to think a bit about how to do it in one shot but the quick and dirty way would be to attach the hallway to the arrow, then set the hallways rotation to be the world rotation of its attachment socket/arrow, then offset it by hallwaypos - attachmentpos
@olive sedge Do note, you need to call this before, somewhere as well.
I know you can do it in one shot with transform / inverse transform nodes but I'd have to think a minute
can't really do the quick and dirty way here, bc in this instance that hallway connects to the rest of the map, that would be like moving a city to match a closet's position sadly xD
thank you, noted
what do you mean by "connects"?
Is the rest of the map attached to the hallway?
you're moving the closet
or you can move the room, either/or. Pick one thing to not move, and move the other
We need to moving the latestroom, (the closet) so we cant move the hallway
bc the hallway connects to the rest of the map
ok so invert what i said
@maiden wadi can I use this one? if not, what's that LocalPlayerController node?
That's probably fine. LocalPlayerController is my own function.
what-
that brings us back to the original problem and why I came here xD
You want to place a room such that its entry socket aligns with an existing hallways exit socket, right?
socket being the thing that represents where things should snap together, your arrow or a socket on mesh or whatever
As I said, I have the position of the arrow SelectedEntryPoint and the position of the room LatestRoom and the position of the SelectedExitPoint
I cannon't simply move the LatestRoom to the SelectedExitPoint, because that wouldn't be the position of the SelectedEntryPoint anymore.
@olive sedgeJust some extra helpers in my debug stuff that helped me put together mine. 😄 Reset to default, a test for mapping a key to the second key slot. And a debug print to print out all of the mapped key slots.
this will come in handy 😅
Which of these things is movable, and which point (entry or exit) belongs to the movable room?
SelectedExitPoint belongs to the room prior, as it represents the exit to the room prior. (And so it can't be moved, as it belongs to a room connected to the map now.)
SelectedEntryPoint is a randomly chosen doorway in the LatestRoom.
LatestRoom is the room being added to the map in this process, it CAN be moved as this process is what is attaching the SelectedExitPoint from the prior room to the new SelectedEntryPoint of the lastestRoom
@maiden wadi the EILPS is valid, th EnhancedInputUserSettings are not :/
I explained it here I think this might help
this is the more technical written explanation above
I got it working
how did you do that? :O
This is for the sockets pointing the same direction in world space so the out one points out and the in one points in to the new room. For them to point opposite you'd have to modify it but it'd be the same general idea.
also thank you
I'm kind of crying for help right now, haha. I keep getting this unknown error every time I package my game fully in UE5. I've tried a lot, like downloading the SDK and such, but I'm still pretty new, so I’m not sure if I did something wrong. Can anybody spot the issue in this text? Just spam me if you need more details. 🙂
Thanks!
MapCheck: Warning: M_Base_Props Material /Game/ModSci_EngiProps/Materials/WaterDrum/MI_WaterDrum.MI_WaterDrum was missing the usage flag bUsedWithInstancedStaticMeshes. If the material asset is not re-saved, it may not render correctly when run outside the editor. Fix
MapCheck: Warning: _M_Master_Material Material /Game/Polar/Materials/Architectural/M_Generator_Off_Inst.M_Generator_Off_Inst was missing the usage flag bUsedWithInstancedStaticMeshes. If the material asset is not re-saved, it may not render correctly when run outside the editor. Fix
MapCheck: Warning: M_BasicMat Material /Game/TokyoStylizedEnvironment/Materials/Unique_RoadBarriers/MI_RoadBarriers.MI_RoadBarriers was missing the usage flag bUsedWithInstancedStaticMeshes. If the material asset is not re-saved, it may not render correctly when run outside the editor. Fix
PackagingResults: Error: Unknown Error
Here is the full error
https://docs.google.com/document/d/1zMt0DaSQjnhW06UXoNoMtTJ0ewNucRzTIcmfk0gPcFU/edit?usp=sharing
alright thanks a ton I'll give that a crack
is this the wrong chat?
Did what you did, but it seems it still attaches to the first entry point every time...
show your code for how you feed it the transforms
Make sure to enable them in project settings.
they are.. I think it's because of LocalPlayer.. I kinda just don't have that
You have to if you have a controller.
@maiden wadi what does your LocalPlayerController node actually do?
It's odd.. I just added a 2 second delay to make sure it's not because the system is not yet properly initialized or something but GetEnhancedInputUserSettings is still not valid
This is enabled, right?
@maiden wadi ah! there we go! thank you!
For the other question, it's literally just this.
.h
template<class TemplateClass>
static TemplateClass* GetLocalPlayerController(const UObject* WorldContext)
{
static_assert(TPointerIsConvertibleFromTo<TemplateClass, const APlayerController>::Value, "");
UWorld* World = WorldContext ? WorldContext->GetWorld() : nullptr;
UGameInstance* GameInstance = World ? World->GetGameInstance() : nullptr;
return GameInstance ? Cast<TemplateClass>(GameInstance->GetFirstLocalPlayerController()) : nullptr;
}
UFUNCTION(BlueprintPure, Meta=(CompactNodeTitle="LocalPlayerController", WorldContext="WorldContext"))
static APlayerController* GetLocalPlayerController(const UObject* WorldContext);
.cpp
APlayerController* UAuthaerObjectLibrary::GetLocalPlayerController(const UObject* WorldContext)
{
return GetLocalPlayerController<APlayerController>(WorldContext);
}```
I see
did this help @faint pasture ?
Hey, was just wondering if anyone could help me out with something. I’ve got global time dilation running to slow down time however, I also have a timer by event running which runs every 1/10 of a second to calculate a progress bar.
Problem I have is that the global time dilation is affecting the timer by event meaning, the timer goes slower. Is there way to make it so the timer by event is not affected by global time dilation?
Ah @faint pasture I found the flaw! It wasn't getting the child component
It picked a door, but it's not rotating it correctly hmm
I feel like we need one final multiplication that accounts for the rotation of the lastestRoom
it's currently set to this
any ideas @faint pasture ?
I'm using an array of structs to set up the day parameters. each day is added manually to the array (screenshot 1). However it fails the validity check for some reason. For some reason I feel like it's not recognising the array values at all.
First screenshot, corrected
Debug currentday integer
it's not that, I already done this. tested with 0 and 1, as there are two entries in the array
0 works fine, 1 breaks
so it doesn't recognise the second value at all like it's not there
@maiden wadi do you know how to get these by any chance?
Is there an issue with struct arrays? I can't think of any other reason.
Hello mavendigital, I ran a few tests on our end, however I was unable to reproduce the issue that you have described above. I have a few questions for you that will help narrow down what issue it is that you are experiencing. Quick questions: Can you reproduce this issue in a clean project? If so, could you provide a detailed list of steps ...
post from 2016 but.. same stuff lol
I'll restart the editor and see.
@maiden wadi these seem to not include it
so dont use is valid index, just check ind <= array last index
does it really matter
it's not fetching the array value it should (as it is there)
it's not the array length issue
so is valid returns true?
You have to get the input action. It has a PlayerMappableKeySettings object, you get that and then get the DisplayName off of it.
if I fetch the value from position '0' - yes. the problem is the editor does not see any additional array entries while there are more.
do you know if it is BP exposed?
Adding any additional array entries doesn't help either. It only sees the first one. weird.
5.5?
yep
achievement unlocked I guess, heh
i'm pretty sure that this works fine in 5.5
CPP struct no crash
well it's not crashing for me but it's not working either :p
Is this on a blueprint placed in the level? If so, maybe when you updated the variable it didn't change on the instance placed in the level
yeah, it is
damn, you're right
I would've never figured that out.
Yeah, I've had that before. I think if the variable isn't the default value, then any changes to that variable in the blueprint editor don't change the instance since it has its own instanced value
hmm is there a way to force some sort of an update on the actor?
Not sure other than just deleting and placing it again. Maybe there's some reset to defaults option somewhere
ah right made same mistake
just compile it should update placed actors unless you modified array on them
nah it doesn't. i'll just make a function to update all actors with the editor array values
thanks @marble tusk @lusty birch
I'm a bit lost on this.. who do I get the input action from? EILPS? Input User Settings? Mapping Context? Key Profile? Key Mapping Row? 😅
What do you have to work with atm? I'm not sure what you're working with.
basically anything.. I want to mostly work in blueprint since I want to distribute it later but I can use some c++ helpers if I need to.. currently I have this
and then currently I do this @maiden wadi
Check out the debug prints I showed earlier. It has the data for each. The struct has the "AssociatedInputAction" in it too.
ah, I didn'T see that, sorry
thanks so much!
Hi, I'm making a little effect for my main menu where the camera will slowly rotate based on where your mouse is, clamped between specific values.. I've got it mostly working however the issue I'm having is that when i play on my normal monitor (27-inch) it looks fine, but when I play it on a laptop (14-inch screen) you're able to look left/right/up/down far more than you can on my normal monitor.. So it seems that screen size determines how much the camera can move, or at least appears to move, in any given direction despite me having it go between specific max values.
I'm not sure if aspect ratio has anything to do with it however Constrain Aspect Ratio is ticked.. or maybe the FOV? Does unreal do any auto-FOV stuff based on monitor size/resolution or something that i'm not aware of?
Any ideas how i can make it so the camera can only move a certain amount in each direction, regardless of screen size, resolution ect..?
Do these monitors have different resolutions set? Like one on 1080, one one 720?
The laptop is in 1080p, my monitor is 1440p, although ive set my resolution down in game through the settings menu to 1080p too see if that made a difference to how far i can rotate the camera in any direction and it doesn't seem too
From what i can tell i dont think its to do with the resolution
DPI scale might be changing in that case. There's a multiplier for that somewhere that you'd have to apply I think.
Ohh this one? do i just need to swap the original one for this one?
or is there some math i need to do lol
hey are you free to help for a second? I just need a hand
Depends on the issue. 😄
There's a... I don't remember the name off hand. ViewportScale or something I think, that you can multiply the viewport size by.
ahah, well I discussed it with Adriel, detailing the variables here.
this was his answer, and it's almost perfect
rooms are being placed exactly where they need to be, only one issue, the room isn't being rotated to match the doorway
Is this issue something you are willing to help with? xD
Oh yeah theres a Get Viewport Scale node.. In my Calculate Initial Offset function where im using Get Viewport Size, do i just need to multiply in there straight away before i divide the viewport size with the mouse positions? or would i do all of that first and then multiply it by Get Viewport Scale just before it goes into the clamp which sets OffsetX/OffsetY? Im not great at this math stuff 😂
The room being placed is the brown area? What is the movement gizmo? And what is the red circle?
that red circle is the doorway it chose to spawn the room from.
hold on, I'll get the video of me explaining it to catch you up a lil
here's a full break down.
and here's all the variables in play atm:
SelectedExitPoint belongs to the room prior, as it represents the exit to the room prior. (And so it can't be moved, as it belongs to a room connected to the map now.)
SelectedEntryPoint is a randomly chosen doorway in the LatestRoom.
LatestRoom is the room being added to the map in this process, it CAN be moved as this process is what is attaching the SelectedExitPoint from the prior room to the new SelectedEntryPoint of the lastestRoom
I had to double check something. Inside of your CalculateInitialOffsets, can you try to divide your GetViewportSize by GetViewportScale before using it?
Ive added it in just before, although to test it on the laptop i need to package, upload & download it
, do you think that should be enough to fix it or is anything else needed before i package it? lol
When i play it on the pc, it doesn't look like it changed anything which i think is a good thing cause it looked fine on the monitor anyways
So wait, the brown room is not in the correct location then? It should be outside of this white room where the teal arrow is?
do you understand ? :O
This is the current logic, which is flawed somehow
I think the math is just wrong
well
kinda
I mean it does get the room perfectly placed in the doorway
its just the rotation of the room doesn't quite work
I have got problem recently, which is,
I have got AI which I want it to move on air also (Mostly Air) but incase of nav mesh bounds volume, it works only in just ground
So I tried several things like an searching in Nav Mesh details, for like finding a click icon "Hey! Click here and your character will be flyable!" But as you guessed I didn't find those things
Also tried to ask my friend GBT, but he said there is nothing I can do, so anyone who knows ?
more examples
Maybe it's just not possible.
do you know how to change the pivot point/origin point of an object using blueprints
because then it would be as simple as spawning the room, changing the pivot point to where the entrance needs to be, and bob's ur uncle.
Hey all, question for anyone who knows. Is it possible to get the camera auto exposure level in blueprints? I want it to drive a function on my character.
If im starting to learn ue5, should I just stick with blueprints and learn c++ later if I need it or no?
you just need to learn, not think about what to learn, I just wasted a lot of my time about thinking what I will do, this or this in engine, so just flip a coin, when coin is in the air, you will understand what you truly want
How do I detect if anything is above the players head (need to detect if crouching can uncrouch or not)
I am not sure but you can check the height above you + if there is something and for detecting with Line trace nodes3
using project world to screen to have a widget go over a actor. What is the math behind scaling it? I have the distance from the actor to the camera... but what is the exact maths behind getting it to scale appropriatly?
ok, thank you!
also why does ue5 have motion blur default on in settings, is it just me or does motion blur look horrible?
it might be the camera lag/ delay settings?
no, i just turned off motion blur in ue5 settings and it looked 10 times better
its just weird, I'd think it's cus the laptop im on is really bad but motion blur also looks terrible on my good pc at home
Right now my character will register as uncrouched when they release key, I need it to detect if they are still crouched in movement, if they are then dont uncrouch
Any ideas
how to use cue4parse?
Did anything change on widgets / widget component with widgets being placed in world space in regards of Tick? it seems tick is called two times and then won't tick again. I just created a test widget with a counter that changes a texts text each tick but this just runs two times and then stops, but I don't quite understand why it stops ticking. My guess is it's broken since some engine upgrade. either 5.4 or 5.5
consumers can't see bad foliage or aliasing or low LOD if you blur it. and motion blur happens in real cameras in low-light conditions, so it's not entirely unnatural or unrealistic
?
I'm trying to let my character hold onto objects. when the character holds onto an object, I want their movement to be constrained around that point.
I've played around with creating a physics constraint between a primitive component on the target actor and the capsule of my character, however movement is not constrained by that.
How would you do this?
ah god damn simulate physics needs to be on for the child but I obviously don't want that on for the capsule
The motion blur is fine. i think his real complaint is they have it cranked up to max which really does destroy visuals while playing. Idk about others but until I disable it or turn it down I get editor stutters when testing.
are widgets (ones added to viewport) visible anywhere in the editor outliner when the game is running?
there's the widget reflector
other than that only a "HUD" class actor gets spawned for me
Tried this on the laptop but the mouse is still able to move so far right that Keir Starmer wants it in prison lmao so it didn't seem to make a difference if not slightly worse somehow lol im wondering if FOV has anything to do with it cause even tho i have max offsets that it can move each direction in but a change of FOV on the laptop could mean moving 15 units to the left or right is much more than the FOV on the monitor, not sure if the camera is doing some auto-FOV thing maybe
gonna investigate
Hello! I am trying to achieve a control scheme for a top down game in the style of Hades or Ravenswatch.. when pressing quickly a directional input, the character should rotate to the direction completely. Cranking the rotation rate to a high number doesn't work. I came up with this solution but it doesn't quite work :
does anybody know how I could achieve that ?
If you want it to always face move direction, there is basically a boolean for that
It's on the Character Movement Component and has something with Orient to Movement in its name iirc.
Needs the Character to not use Control Rotation Yaw (also a boolean, on the Character though).
If you want to do the math yourself, yo ucan also use the "Acceleration" on the CharacterMovementComponent for the World Direction of your Input.
And rotate the Character towards that on Tick or so
With the edge case of the acceleration being 0,0,0 if you don't press a key
yep I am using Orient to Movement and it does work as the character rotates towards the direction input, but takes the rotation rate value to rotate the character. Basically if it's too low, it rotates as long as you have the input pressed, if you release the input, the rotation stops
Right, then do it on tick. Grab the last non-zero Acceleration and rotate towards that.
Wouldn't use a Timeline for that
Tick -> GetAcceleration -> If not Zero set as Target Direction (normalized) -> SetActorRotation to Interpolated value from Current Actor Rotation to Target Direction (Rotation)
yeah the timeline is probably what's giving me hectic results
Hi! I'm relatively new to Unreal and currently learning Blueprints through a course. I think I'm having an issue with inheritance. Initially, I had an animation override in the BP_EnemyTemplate Blueprint, and everything was working fine. However, I wanted both my character (BP_RedHood) and enemy (BP_Skeleton) to inherit the attack override. So, I moved the function from BP_EnemyTemplate to BP_CharacterTemplate, from which BP_RedHood also inherits, while BP_Skeleton inherits from BP_EnemyTemplate.
After moving the function to BP_CharacterTemplate and making the animation override an AnimSequence as a variable so I can choose the animation that overide for every enemy. I started calling the attack interface in BP_EnemyTemplate, which connects to the function in BP_CharacterTemplate. On BP_Skeleton (which inherits from BP_EnemyTemplate), I set the variable to the attack animation, but nothing happens.
Additionally, the old functionality in BP_EnemyTemplate no longer works when I try to use the original method that was previously functional. However, I discovered that if I use the Attack interface directly in BP_Skeleton and call the inherited animation override function (originally from BP_CharacterTemplate), it works perfectly, and the animations play without issues.
Any Ideas?
I am gonna try that, thank you!
It's like 10 nodes or so
I am quite noob but I see what you mean, I am gonna try to make that work
I'm trying to follow what exactly the issue is.
You have:
- BP_CharacterTemplate
- BP_EnemyTemplate
- BP_Skeleton
- BP_RedHood
- BP_EnemyTemplate
Correct?
Yup
And you have a function called PlayAttackAnim in the BP_CharacterTemplate?
Which plays AttackAnimSequence.
Yes, that correct
And the BP_EnemyTemplate has an Interface (not sure the name), that provides a function called Attack, which you implemented in BP_EnemyTemplate.
And that calls PlayAttackAnim.
And then in BP_Skeleton you set AttackAnimSequence to "something" (Attack Asset).
And based on the image, you are also overriding the Attack function that your BP_EnemyTemplate provides inside BP_Skeleton and it now does nothing.
So based on all of that, currently, nothing should really be working.
Unless you have an instance of BP_EnemyTemplate with a valid AttackAnimSequence on which you either call the Interface Attack function or the PlayAttackAnim function directly.
BP_CharacterTemplate and BP_RedHood both don't have the Interface, so they would only be able to call PlayAttackAnim if directly called.
And BP_Skeleton is overriding Attack, replacing its parent's implementation with nothing.
Does that somewhat describe what you are currently experiencing?
In theory, if you just want this all to work, you'd need to delete the Attack override in your BP_Skeleton.
If you also want your BP_CharacterTemplate and the BP_RedHood to be able to use the Interface, then you'd need to move the Interface to BP_CharacterTemplate
That's kinda all that could be wrong at this point.
fwiw, if you call PlayAttackAnim on the BP_Skeleton directly, it should also work atm.
Just the Interface is broken cause you override the function.