#blueprint
1 messages ยท Page 264 of 1
Correct. This is the component IMPLEMENTING the event. But none of your screenshots are CALLING the event on the component.
@dawn gazelle so now the new problem is that after I close my widget, I cant move my player


or is that the wrong way to do it?
Again. This is getting all ACTORs. A component is not an actor.
I got that working a year ago... its difficult to do in UE without experience.
it's like after you start up that widget and close it later, your player goes on a wheelchair @dawn gazelle
is there a way to broadcast to everything implementing the inferface then?
regardless of whether it's a component or actor?
Oh yea I realizing that now 3 weeks in LOL
Ok never mind I found what was putting my character on a wheelchair
๐ซก
You could iterate over every single actor and get all of it's components with the interface and run it. But realistically that's going to blow up performance wise. Cause you'll be literally iterating over EVERYTHING. All static mesh actors, their static mesh components, some random camera actor and it's camera component in the level. The landscape and it's components, etc etc etc.
This sounds more like something where you would place an event dispatcher somewhere global. GameState or something similar. And let components and actors that care register to it, then you can broadcast that.
@dawn gazelle turns out the problem is with this one
oh wait I know how to fix it
parent of that one is wb_crafting_menu
if the other problem with my previous reference was related to a parenting reference issue
then that means this one is also related to a parent reference issue
that means this variable is essentially equivalent to an abandoned orphan who's parents died in a car accident an autumn night 6 years ago in a small town due to poor visibility, fog and rain
What it boils down to right now....Are you actually setting a reference to an "Ingredients View" widget in that reference anywhere in this blueprint? If not, then it would always be invalid.
That's not setting a value in it... That's defining the type.
You're saying it can contain a reference to a "WB_Ingredients View" widget, but how are you actually giving it a reference to the widget you want to use?
SET allows you to populate the variable, sure
Do you really need to SET that particular variable tho?
i thought that was enough, as it was itself giving it a reference
SET doesn't just give itself a reference. You feed in a reference to set it to.
return value of the crafting menu?
but wait i think i am setting the crafting menu right after i created
Is the "Crafting Menu" a "WB_Ingredients View"?
the reason why im not hooking up everything to crafting menu widget is because i would have a very messy blueprint
so i just promote someone to variable and really clean up everything
wb_ingredients_view is living rent free inside of wb_crafting_menu
but its not a child or anything
Ok... So then do you really need to have a variable that references a WB_Ingredients_View in your player controller? Is this the only place its getting used?
Can you maybe utilize your WB_Crafting Menu reference and get its WB_Ingredients_View that is living inside of it instead?
inside of this blueprint yes
its the only place
So then it's not really useful as a variable here - it's a one time use thing.
You'd want to GET your WB_Crafting Menu, make sure it is valid, and if so, you should be able to GET its WB_Ingredients View and call that function.
thats what im doing now
You mean this?
The baton is getting passed on from one to the other
Ok thats fine... I wouldn't necesarily do a valid check on the WB_Ingredients View on account that it's something contained within the widget, so it should always be valid.
But again... This wil throw errors.
If it's not valid, don't just proceed.
Is Not valid > Print a log to warn you there is a problem > Stop doing anything that tries to use the invalid reference.
Looking at the errors again went into some of them and realized I had the same (crafting system) code on "Ac_crafting" as well as Controller bp at the same time, what this did is it still caused despite that i had fixed all of them, now it got updated and i decided to delete this entire crafting system from controller and keep it on ac crafting instead and it all works smooth like butter on warm toast
thats a good idea but if its not working then I can see it on my crafting menu
also now i replaced all the unparented movement component components, so now all adolescents are supervised by an adult, and I find the parent of them first, and their grandparents, and their grandgrandparents too
it's a family issue
Congrats. You're starting to understand references, and how they can relate to one another ๐
After the most patient person on here has spent day and night pointing in the right direction
Pointing... got it ?
I went through helping someone's doing save system because he promised that he knows blueprint and can do it in 15 minutes if people just show him how.
End up as 4 hours session. Promised my self to only to not ever do it again.
alright, normally this is hopeless asking for help in BP based chat for performance stuff, but can I ask the best performance tweaks for BP only as I'm the main programmer for our project and my course never covered it as bp performance was never considered an important factor
i know the basics such as interfaces but most of it is foreign to me
Do you have performance issue? no? then don't need to optimize early.
interface is not optimization tool
if you were fed bullshit about use interface don't use cast by youtubers, read Unreal Myth and Bust article for facts and what to do.
things to avoid
Hard reference in Data Table
Looping over large data with blueprint
i was fed "bullshit" by an industry professional who worked on the lego games
im not saying you are lyong of course, i am just citing my source
if the person think interface is replacement for casting then he doesn't deserve the job or the title.
That or you just misunderstood
i may have absolutely
https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
Read this article from Epic employee
my opinion holds no value, I would just go over the article to answer most of your questions.
common traps and misconception around bp
Can't / won't 
yes you can do it!
yeah, they mainly were saying my basics were wrong, dont think they meant me to gain a phobia of casting
wish id have realised that a year ago cause ive been avoiding casting for years
That's why I have vendetta againts general youtubers
we got people coming everyday saying don't cast use interface
Not necessary tbh
you can go with Before 5.5 equivalent
I would totally avoid blueprint for world generation
or voxel/grid stuff
if you need to loop a lot of times, blueprint overhead matters
it can be 500X slower or more
what weve discussed was multiple layers of height maps
cause they want villages that know where eachother and generated dungeons are
theyre also not using grids or voxel
want a fortnite esque aestetic
im fully aware this is probably not going to be possible with the team we have...which is him and me, maybe a third for vfx XD
you can prototype in blueprint but it's important to know it's limitation. If you need to loop over large data, it's a good indication to refactor it in cpp.
thats my main role in most groups, i just do prototypes
then of course tell the programmers whatever extra they need since in know my fair share of that too
i just find BP so much more readable
how do you set up a iswalkingforward boolean
Velocity dot Forward vector ?
this one?
Yeah
GetVelocity->Normalize
GetActorForqardVector
If you only care about exactly forward then thats if the dot product is =1
If you have some leeway, you may want it from > 0.3 or smth
Or you can read the input values
is this right or should the bottom one be different
and ya i only want forward
ActorForwardVector , as in forward relative to the character
Even if you want exavtly forward i might consider a small deviation
.95 or so
Almost precisly forward
ty
also what does dot mean
or do i guess
it works lets gooo
Why is this getting 12 sockets when the debugger shows there is only 1 socket?
if i get forward vector and multiply with -1 and add some offset shouldnt i be getting backward vector? then why am i getting right vector
Because forward vector isnt .X explicitly
The entire vector orientation is forward
So you nultiply the entire vector with -1
Also combine it with existing location of the actor to get world space
instead of x * -1 you are saying to multiple vector with -1 and add offset?
TargetLocation = GetActorLocation+(GetActorForwardVector*-1*offset)
offset add or multiply?
Multiply
ah wait you told to add vector location
i wanted offset backward direction only not on all axis
this is what you said right?
is that correct?
Yepp
it is spawning right beside actor location
i want that blue sphere in shown red area
50 beside it, yes
changed 50 to 1000 now it is around the location where i wanted
thanks mate, little confusing tho
is getworld delta seconds and the delta on tick gives the same or almost the same result?
not playing with time dilation or anything
Should be
You could calculate center
If the actor has any tick interval set, then it won't be the same.
Yeah, I end up just passing delta seconds
thx
does anyone know how to make a ui text binding only run once?
Don't create binding if you don't want it to be evaluated every frame. Just sets it?
ahh thank you
Or let it be read
im a little confused what you mean
when the player dies i just want to get in game time and set that as the text
idk why im having such a tough time with it
Use event dispatcher
I only want it to occur once so that the score doesnt keep going up once the player has died
When the player die it just broadcast the delegate and anyone that listen to it can act accordingly
so this will not restrict to only U.I but to anything that needs to know the Player has died
Widget Construct -> Get Character -> Bind to death event
Player Death -> Death.Broadcast
Widget then -> UpdateText -> Player has died
this is the last thing i need to do before im done with the game. It wa sjust meant to be a quick test so their wont be anything else
is an event dispatcher a little heavy for this
takes a minute
not doing it that way probably mean that you haven't been doing one way relationship
which can cause headache as the project scales
gotcha
Who creates the widget? @dim halo
the only actor in the game that can kill the player
i.e. the only actor in the game that knows when the player has died
well that just makes event dispatcher even more valid since the actor in the game kills the player need to know if the player died
if it were made in the player character where the death happends then you can do the more lazy way which is to just get the ref to the widget and set text (not prefered but works)
would this be how i do it
the player doesnt actually die im just ending the game so the thing that "kills" the player is really the only thing that needs to know
you will have to get a ref to the widget and set the text when the "death" happend
if this is happening at the time of death shouldnt that set the text or am i a bit confused
it will, I can't say anything from only that snippped, wouldn't even know when it is run.
but for proper game, don't do this. Distribute the task sensibly. These kind of U.I can probably offload to HUD class
Does anyone know why this node is getting 12 sockets when the debugger shows there is only 1 socket?
If anyone can help:
trying to find the best way to have multiple local controllers operate a character select screen at the same time.
Iโm relatively new
#multiplayer , not many people doing local multiplayers though.
which node do i need to change transform mode of the spring arm from world to relative?
You don't really need a node for that. What are you planning to achieve?
Components attached to other Components have both a RelativeTransform (to its Parent) and a WorldTransform (based on its Parent's WorldTransform).
There should be functions to set Relative or WorldTransform for SceneComponents (which a SpringArmComponent is).
The DropDown you are showing is mainly for Editor only stuff.
i need switch mode to make camera follow/unfollow character by pressing button
Hm, that's not really how that works. You can set the SpringArm's WorldTransform to a fixed one when it should stop following for what it's worth.
But the proper solution is actually to use the PlayerCameraManager and to code the exact behavior into that.
The SpringArm, or rather the CameraComponent, is only an Offset to your Character's WorldTransform.
Unreal Engine only really knows "ViewTargets", which are Actors. By default UE will look for the first Active CameraComponent on a ViewTarget to offset the Transform (and pull some additional visual information, like FOV, PostProcess and all the other stuff you can set up on the CameraComponent).
But in theory, if you want to "cut the camera loose" from the Character, it's best to create your own APlayerCameraManager BP/C++ child class and override the UpdateCamera (or whatever the method is called) function and returning the Location/Rotation/FOV you need for the given situation in your Game.
You have access to the ViewTarget in that function/class, which you can cast to e.g. your Character (if that's your ViewTarget).
E.g. you can have a boolean on the Character that defines if the Camera is following or not.
In the PlayerCameraManager you can cast the ViewTarget to your Character, get the boolean and if it's false (let's say it's called bCameraFollowsPlayer) you can just return the Parent call, so handle it just like it would do without overriding it, and otherwise you can code whatever you need and return the WorldLocation/Rotation that the Camera should be at.
Def the cleaner solution and in terms of using UE you should always try to utilize the base classes it provides to get the maximum out of it.
At least on the Gameplay Framework level
u made a simplest thing overcomplicated for me
i just need to switch mode from absolute to relative, bcz, when the free camera is focused this way, overhead HP widget is twitching
I didn't make anything overcomplicated. I explained you how to do it properly. You can of course hack some stuff together and call it done.
On the other hand, I did tell you you can set the set WorldTransform nodes, so the "simplest thing" solution was also provided.
The SpringArm is most likely still following the Actor. I'm not even sure if setting the Location once would do anything. Maybe your InputAction is set up to trigger constantly as long as you hold the key, but then the Location would fight with the one the Component inherits from its Parent/Actor.
You can try, instead of setting it one there, to save the GetActorLocation and set a boolean in addition, and then use the Boolean and the saved Location to set the SpringArm WorldLocation on Tick.
But well, hacky solution, up to you.
Speaking of the spring arm, how would I be able access its variable from outside the character without casting to the character? I tried using an interface but didnt get it work
Sounds a bit like an anti pattern there
If you really need to avoid the cast, you can find the component by class.
But that's of course slow and should be avoided.
Interfaces could work, but each Actor that has a SpringArm would need to implement the Interface and whatever function you have for returning the SpringArm.
thanks for replying!
This is how I have it now.
Interface with an input of the player character,
In player character I call the message and set the player character
Then in the volume, implement the interface and call the event to get that player character variable so getting the spring arm and setting the arm length
Why are you calling the Interface Function on "self" and then pass "self" as the PlayerCharacter?
"self" is your PlayerCharacter. All you are doing here is calling the Interface on the PlayerCharacter.
That's probably not what you want?
GetComponentByClass sounds like a more reasonable approach
The function should be called something like "GetSpringArmComponent", returning a SpringArmComponent reference.
Then implement that on the Character
And in the Overlap event, call the GetSpringArmComponent interface function on the "OtherActor" pin.
okay so the interface should be inplemented on the character and not ont he volume? The volume is where the function is called?
Right, do you know what Interfaces are and how they work?
Cause it surely looks like you don't.
kinda of, trying to wrap my head around it
An Interface allows you to call functions on Objects without knowing there actual Class.
That is usually only useful if you need to do something with Objects that don't share a common class.
Best example for Interface usages is an Interaction Interface, where a function called "Interact" is added to the Interface.
Then, when trying to interact with different Actors (e.g. a Lever, a Button, or an NPC), all you'd do is trace for a given Actor (or get the Reference however you like) and call the Interact Interface function on whatever Actor you traced.
If the given Actor implements the Interface and then Function, it will call it on that Instance.
E.g. the Button would implement being pressed and the NPC would start a Dialog.
Interfaces are redundant if the different options share a parent class. If you can put the function in question into the parent class and override it in the children, then there is no need for an Interface.
Interaction is a good example for Interfaces cause a Button inherits from AActor, which an NPC might inherit from ACharacter. And while ACharacter ultimately inherits from AActor too, you have no way to put a common parent class in between that.
So for your specific issue, if you want multiple different classes that don't share a common parent to return a potential SpringArmComponent, then you would need to add a GetSpringArmComponent function to your Interface, add it to the different Classes, implement the function and then call the Interface function on whatever Actor you want to potentially get the SpringArmComponent from
(Many, including me, prefer components over interfaces as they can remain stateful and have pre implemented code, unlike interface)
If you, however, know that it will always only be your specific Character class, then using an Interface is redundant
Interfaces still perform a cast. You gain nothing from that. At that point just cast to your Character class and grab the SpringArm.
I usually combine them. Components for Interaction are nice, but I would still want a Getter via an Interface to access the Component.
I bought a course in the past from Smart Poly... he does the same thing... trying to avoid casting but end up passing a hard ref of the object anyway.
@surreal peak Thank you for the explanation, I was able to set up interaction like you mentioned with the interfaces, just this is different but also not dfifferent so I was confused
Yeah, it also doesn't help that a lot of people don't get that Interfaces are just another class the BP inherits from, so one has to cast anyway
Still don't like the "UseAnInterface" part.
Like, mostly cause it's so not explaining as to why
"Can't / Won't"
Which is not enough for a Beginner to understand
Someone who needs that image is def not able to tell if they can't or won't
I have linked the full article earlier but clearly wasn't read ๐ฆ
the fact that he tries to even pass a hard ref to the player character
Also not a fan of the Actor Tags. But that's mostly a UE problem.
I have not, in the past idk how many years, used that Tag Array
It was never needed.
Trying to avoid memory foot print from hard reference but end up passing the hard reference to the interface anyway
If those were GameplayTags, that would be a different story.
so how to avoid those hard references? ๐ค
Hard References to Assets, in this case BPs, can be avoided by not using the BP Asset when not needed.
That's what the image is about.
E.g. if you need a property or function that is part of the C++ class, don't cast all the way down to your own BP class.
But you also need to realize that hard references aren't anything bad if your need them.
okay, so in this case where I just want to get the spring arm from the player, I can get component instead which will not to a hard cast to the entire BP
If your Volume there needs to access teh SpringArm on the Character BP, then it's totally fine to simply cast to it.
You can work your way around this with an Interface
As explained
I just want to zoom in or out the camera at certain points haha
But in cases like these, it's questionable if the efford is worth it
Interfaces make it really annoying to navigate your code
Then just cast to the Character and alter the SpringArm.
Or add an Interface to the Character that allows access to the SpringArm.
There isn't much more to it.
Despite cutting this whole thing further apart.
For zooming i'd implement a funciton in my character class and let that handle the spring arm modification
not a fan of externals modifying internals
Yeah, but the point is they want to modify it from an overlap
So the Overlapping Volume Actor has to notify the Character
I would just have a function on it to tell the Character to modify it.
I mean, I would over engineer the shit out of this anyway
So who am I to speak
OnOverlap -> CastToMyCharacter->SetSpringArmLength(float NewLength)
just got this working! so I just had the interface on the wrong volume instead of the character
This way, a class that I've modified, can intervene or react to it being changed
I would have a APlayerCameraManager child with an Array of Modifiers for my Camera that have priority.
And that would control the Zoom Level and then different Overlaps can get the CameraManager and push a Modifier on overlap and remove it on EndOverlap.
xD
this what I got, I will probably expose the arm length so I can adjust in editor
Im just starting to play with the camera manager, so maybe ill do that next lol
pointless interface
Sure that can work. But you can probably drop the == check
And simply check if the SpringArmRef is valid
Before modifying it
Casting is absolutely FREE or cost next to nothing
But you'll ultimately notice that your setup is in fact a bit too simple
it's the memory footprint you are trying to tackle from the hard reference
How do you return back to the default value?
which you drop there anyway
Where is that stored?
What if 2 overlaps modify it?
It's better to delegate the whole SpringArm state to the Character
And instead of doing the GetSpringArmComponent add functions to modify the SpringArm via the Interface
And use those
OtherActor -> ImplementsInterface(ISpringArmInterface)->ModifySpringArm
so many voices! I appreciate the help guys
Sorry, I should learn to not meddle
Take the best of all of them tbh. None of use have the true answer anyway
I can see how it easily becomes very confusing
All based on experiences and subjective shit
yeah, I really appreciate it! It's very insightful!
And programmer god complex, so all of your solutions suck anyway 
I gotta help bath the baby now, but I will be back if I get confused again ๐
aha yeah I work with a few programmers so I am used to the programmer god complex ๐ฅ
@compact fable https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
Read this article when you have time
thank you! I will take a look tonight
Another option is to drop the interface and use the 'Get Component By Class' node and just get the spring arm. Just have to check it's valid first. That way it'll work with any type of actor without having to implement the interface.
@compact fable 3 ways for you. ๐ I prefer the top one but as eXi said, pick which ever is best for your situation.
(The bottom interface one, you would need to implement the function to update the spring arm on the actor it's placed on)
(4th option , letting the Character handle the changes! ) ๐
5th one is creating a custom component for modifying the spring arm. Probally OTT for this use case though haha.
Ooor subclass the springarmcomponent
My outcome was mostly to provide an opportunity for a project specific class to control the state changes ๐
Casting to C++ class won't load the object since it's not an asset
so many choices! Thank you @dark drum
I am using the ability system to trigger a punch ability.
However, during it, my character can not move at all. I need this ability (and montage, of course) to be interruptible if the player moves after say 1 second from triggering the ability (and montage.)
Have to say that the animations themselves are root motion.
What is the best practice of doing the above?
you can perhaps use an anim notify state which checks if player is trying to move during the montage, if so, blend out
Anim notifies inside animations can know if player is trying to move??
That's new to me
yeah of course! ^^ the good thing with this approach is you can determine when a montage can be "interrupted"
something like this should work
could you share what that function is doing?
Yes so when I press a crafting button, only one item from the ingredients is removed
Because completed
hmm. not sure how this inventory is built. but the map in RemoveIngredients() should correlate to an Identifier | Amount
right!
So the things you told me was working, is not working ๐
wait, which things?
because completed?
I was questioning how it could
there are two add to inventory
You remove on complete instead of loop body
How do i check if a level exists? I have a name, and will open level with that name.
Though sometimes this name is not a level
don't ever rely with name if possible
use soft ptr instead to compare level
somehow epic doesn't have UWorld exposed to blueprint by default... maybe to protect blueprints users from using a hard ref to the world, no clue.
Bp got safetyrails, no question about it
the add to inventory from interaction trace with the world works
I think i will create a data table with all the levels names
the add to inventory after you created a craft <----- this doesn't work
lmfao
thanks
what if you change one of the level name? what if you do a typo?
sure it can work, but not the approach I will take.
Woah. Thanks!!
yeah thats right
is this better?
Yes
Ehat does log say
so rock is not being removed?
yep
before it was wood not getting removed, rock was always removed
now its the other way around
Show us the log
try putting a breakpoint on RemoveIngredients (F9) and check the map
How does the 'Remove From Inventory' function work?
Did you find array element? True
What did you find(quantity)? One
The find in recipe map is a ItemId/Quantity
Not index to remove.
You should specify the amount to remove.
Index should be handled internally in the RemoveItem
It needs to look through the unventory untill it has remived all items in the recipe list
that means I need to do the same as here
Two loops and then do == node
or maybe something like this
So the 'Index' you're providing is actually a quantity and the 'Name' is never used. As Squize said, you need to loop through 'Content' and find the matching index required based on the supplied name.
this should check if Item ID matches name inside content and return if it does
@dark drum I made this, this works, but do you think there is anything wrong with it?
I tried to run it and I couldn't find any bugs
I guess it's good
it works... so i assume no problem
no bugs found
I'm making a dialog between characters.
Each answer will change different stats.
Insult: -10 relationship, +5 arrogance.
Push: -20 relationship, +6 arrogance, -5 energy.
Hug: +10 relationship, -1 energy, +4 friendly.
For now what i have is a Data table, with Name, "Insult", then a TMap with String and float. So like Relationship -> -10. So now i know Relationship must decrease -10.
How do i now convert the String "Relationship" to the actual variable Float Relationship in the character?
as i scroll thru the screenshots here..
Guys.. you don't need to drag Wires all over your graph, from the Function Input to the target..
You can simply rightlick.. Write "Get <InputName>" and you can create a Getter for the function Input... no spagetthi everywhere..
Yea, you need a for each with break. Once it's found the item in the content var. it doesn't need to look through the rest. Also, your passing the quantity of the items currently in the inventory into the remove from inventory function. Depending how you use the input in the function, this could result in all the items being removed. This most likely needs to the the value returned on the initial 'find' node.
Also, with the 'Name' being stored as a text value. If you decide to do any nativatation, this whole thing would most likely break. Text should only really be used for things that would be shown to the player.
You do that when you tidy up. ๐ To many extra clicks when you're in the zone. ๐
You could use a "String Switch" to execute different routes by the Input String.. which then change different values of different variables
Alternatively...
A Map of <String, Value>
Where you can use the String directly as Key
Alternatively:
Gameplay-Ability-System (= GAS) AttributeSets, where you can get the Attribute by String name and change it.. or change the value of attributes by GameplayEffect
Many roads lead to rome
I always do that even when creating the function, just to have a clear view on the rgaph, without additional rendering of wires everywhere..
But i think.. personal preference
ill go with this one, sounds like the simplest and easiest
thanks
GAS is kind of complicated
just the setup - if the basic Actors and Classes are done, it gets super easy and fluid.
but yes.. if one is beginning, it can be overhelming
That RegionTwo is inside the if block or is outside?
outisde
then why it not prints RegionTwo if the RegionOne is false?
cause its ouside
Read the pins ๐
if its outside it should not care about bool regionone, right?
What's connected to the false pin?
don't egnore the sequencer which has two exec pins
Region two should get printed, regardless of the state of the Bool.. since a sequencer will always fire all its Executors in order.. one after the other finished
from the code side i guess this looks like
if(bRegionOne)
{
print regionone;
}
else{
//nothing in here
}
print regiontwo;
but i am curious why is regiontwo not printed
this is what i am asking
you sure it not get printed? maybe the print time is wrong, or key is overwritten, or the color makes it being overseen?
First, execute the branch, then print
That's what you have
print time is 5sec, color is black still not shown on screen
but in logs i found it was printed ๐
seems like issue with screen log
print to screen is checked ?
have you set a Key in the print String?
interesting.. maybe try with a different color than black.. like a very dark grey..
and setting that bool to true, the regionone also not prints in red color
possible that the renderer uses black as opacity 0
then definitely something is wrong with your screen logger
Do you set ENABLEALLSCREENMESSAGES to 0 or called DISABLEALLSCREENMESSAGES ?
i guess its broken yeah, because in logs it works print to log
not remember
Try to set ENABLEALLSCREENMESSAGES again..
And.. if you are on Source version of the engine, make sure to have the correct build setup (Development Editor)
you also wanna check for the DisableAllScreenMessages...
1 - Close your project.
2 - In .\Saved\Config\WindowsEditor\Input.ini file, delete these lines have โDisableAllScreenMessagesโ, save file.
3 - Open project again.
in all conditions it says enabled ๐
i think you just need to call the ENABLEALLSCREENMESSAGES without a value ๐
yeah it works now ๐
DisableAllScreenMessages is ok when shipping the game to avoid any prints (like the Shift + F1 to mouse unlock thing..).. but it also makes all the debug prints not being drawn
thanks for poining this out
oO i think they're stripped off anyways if you don't make a Development build
I'm trying to use tags for character statuses, but I also need those statuses in the my blueprint animation.
I'm trying not to keep it too tied and use only tags, but in my animation blueprint I can't check for tags since it's not thread safe. Or at least it's not recommended.
What do you guys think should be the design here?
show how you try to access the tag from the AnimBP
where it complains about thread safety
well it's inside a method that's called from BlueprintThreadSafeUpdateAnimation, so it make sense - I want to keep it thread safe, just not sure how
I'm usually using the Property Accessor thing, just can't use it with "Has matching gameply tag" method
show the graph... there are certainly ways to get this data in a threadsafe way
Not really sure what you're asking to see. Does this help?
make a function to get the LyraCharacter, it just returns the variable
mark the function as threadsafe, pure and const in the function details
and then use the function to get the character reference for your target input of HasMatchingGameplayTag
it should work, but i'm not 100% sure
sometimes the animbp graph is a bi...t hard to deal with
@spark steppe how do I know that method is thread safe btw?
I mean according to the compiler accessing that property isn't thread safe, so why would the method be thread safe?
yeah actually it doesn't allow me to do that in that method
the function is supposed to return the character reference
not the result of the query
the point of the function wrapper is to have the const promise, which tells the compiler that you aren't going to modify data on that character
I don't think that's true though, the data on the character can be changed - it is multi threading and data is changing
during animation?
but even if so - I still need to call the "has matching gameplay tag", and that's not thread safe.
So how do I continue after having the thread-safe method that returns the character?
if it's running while the update logic is running, then yeah. Update logic can change character data..
are you sure that it complains about the matching tag thing not being threadsafe?
i think it's rather because your character reference isn't const
are you sure that it complains about the matching tag thing not being threadsafe?
Yes, it complains about both.
It doesn't even allow me to choose that node btw, I have to copy it from somewhere else - and then it complains about it
Weirdly enough, it complains about everything once I add it
is the getChar function set to const?
yes, const pure and thread-safe
maybe remove the threadsafe, i'm not 100% sure which it was tbh
I think I found a way though; Lyra project has a c++ base class (LyraAnimInstance) with FGameplayTagBlueprintPropertyMap; which is a map of tags to class variables, and I can add my tags there and then use the variable.
Even the comment on it:
// Gameplay tags that can be mapped to blueprint variables. The variables will automatically update as the tags are added or removed.
// These should be used instead of manually querying for the gameplay tags.
UPROPERTY(EditDefaultsOnly, Category = "GameplayTags")
FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap;
Hey I have this custom macro for a For loop with delay but I want to make a For loop with break with delay and I don't know how to do it. Can someone help me here please?
@spark steppeAnd thanks for the help btw!
@swift kiln Add another Exec pin in the Inputs.
Then connect that to a "break logic" (assign your Local Integer to Last Index I believe)
@haughty ember
https://youtu.be/k2IP5DYQ0-0?si=4KpNmonpvpBj5nlG&t=1255
Has a developer ever casually mentioned something that made you realize you could've cut months off your last project? You could be that developer! Join Unreal Engine Evangelist Chris Murphy as he runs through some of the lesser-known Unreal Engine 5 features that could turn weeks into days.
Weโre excited to bring you sessions from Unreal Fest ...
add a gate (G + Leftclick) before proceeding to the first branch.. Make the Input Exec opening the gate and starting it (Sequence Node maybe).
Have a second "break" Exec Input that closes the gate
this kind of explains how it works
maybe it just wont work for your specific scenario where you use the tag query ๐คท
Thanks for suggestion but I tried the gate logic which worked just fine
What gate logic
this one
Oh.. just to complete this..
The gate only fires one exit. If you want to have the completed also fired, you may want to have a Sequence from the Break input to first close the gate, then go to the output completed
personally I think the gate overcomplicates stuff; you have your loop anyway, setting your state so it will max anyway makes more sense to me.
But if it works for you, that's great ๐
that's a wild macro to begin with...
i think it needs at least some failsafety to somehow cancel earlier execution if it get's called again!?
No, that's not hoe a break loop should work.. since you eant to otput the index thr break occures.. and not the maximum value ๐
you can actually look at the macro to see how they did it ?
@lofty rapids yup, and they use a boolean.
@scarlet root if you want the value then yes, a boolean is the alternative. Either way a gate sounds overly complicated for this case, at least to me ๐คทโโ๏ธ
Question: What is the practical difference between using regular Trace By and Multi Trace By?
The multi trace is for when you might want to get multiple actors.
Does Multi Trace account for Duplicate Actors?
I believe it's returns an entry per hit component so if you have an actor with multiple components it would give an entry for each of the validly hit components with the same hit actor.
I use both in this finial trace (ball on a stick) i made a few days ago.
So in terms of Guns and Melee, should I use Multi Trace or just Regular Trace? If it depends, then on what occasion should which be used?
It depends what you're going for. Guns probably just regular trace unless it's something like a piercing round that can go through enemies. Melee weapons could be either again. A stab might be a single while a more slashing type attack might benefit from a multi to get multiple actors along a path.
Right, expanding upon the melee thing. Using Multi Trace for a slashing attack would only be good if I'm only doing the trace once.
If I were to do trace by on Notify Tick (AnimNotifyState tick to follow the AnimMontage), I should use regular Trace?
You might still want to use the multi. I will often use one and then end up swapping it as I refine the behavior. You might find that a regular trace missed some actor that would be considered hit, especially with traces that cover a longer distance.
Why wouldn't this be happening?
The Green is the Actor.
The Red is the Boom Arm.
The Blue is Follow Camer "Player Camera".
The Pink is the Get Camera Position.
But, the Camera is suppose to be at the Blue. After AI Move, the Camera posiion isn't updating?
So use multi just in case i missed something, but still have the AddUnique to check for duplicate hits.
Sounds about right. I am using multi traces for my melee system
Looks like the Player Controller and the Get Controller (also a player controller) are out of sync... I have no idea who this happened...
anyone had any success with the delete file node in bp?
If i check the same file with the FileExists node it returns true, but then it does not delete it. Bit puzzled
Out of sync in what context?
Whats the file path?
C:/Users/xxxx/Documents/Unreal Projects/xxxx/Content/UI/Map/T_Map_2F.uasset
i redacted stuff with xxxx where needed.
Is the map open that you're trying to delete?
nope, this file is not open when the code is executed. But also i dont get any error output
in context, if useful
but i dont think im doing some weird operation there that could cause failing. then, i am happy to stand corrected
oh well no need to debug this in-depth. im gettin by deleting dups manually. just wanted to know if someone has used this node before successfully and there is maybe some quirk i need to be aware of
What does the 'GetFilePath' macro do? It might be returning something different to what you actually check earlier in the chain.
oh actually youre right, i should use the macro in both places. its the same code as the previous check
I'm noticing an object spawning with vastly different behavior when I spawn it via "SpawnActor" vs when it is simply part of the level.
Specifically, it spawns with "Hidden In Game" set to true, and it also seems to have very weird collision behavior (the collision config seems to be set correctly as far as i can tell, but it generates no collisions, which is incorrect)
What is it you're spawning?
it's a building plot; i have a simple building system where the player can interact with plots to spawn buildings
the spawning logic is incredibly straightforward ^ (the final node is a workaround for the visibility issue, but i don't understand why that's happening at all tbh)
maybe bp plot is doing it ?
setting it to hidden, or it's hidden in game by default
what is it being called in?
nothing like that going on in there. and the plots placed as part of the level all work correctly
relatively complex chain of logic on that side. it's being called by a quest completion objective
What is 'Location'? I assume an actor placed in the level?
hii wanna ask is there a better way to do this? with it like this rn, when i do another thing (aiming on the second pic) it resets my move speed back to default when I crouch, aim then stop aiming
don't update the max speed in there, just the flags.
Then have a method called "Update Max Speed", call it in the Tick event, and in there decide the speed based on different variables (crouching, aiming, etc)
im new to unreal so i dont really understand but when i search that i dont see anything
Just type max without context clicked
I'd just leave it event based
having this on tick, when you have all the executions avaliable, is just waste
i Would wrap the speed change in a function tho., And just call that
i dont really understand? theres a lot but i dont see anything that looks like what i need
"have a method" = create a method
What do you need?
can you explain what a method is first?
If you're asking that I watch a few starter YouTube tutorials.
a method is a function
made for a specific task
so one of this?
those are functions
you can create new ones
by clicking the plus sign
Tutorial time sounds reasonable , it's time well spent
im a little confused cuz i cant find anything online searching method function
Did you watch any tutorials?
watched one to set up a base for shooting
You should watch a few beginner blueprint tutorials... Let me look.
i tried to look for some but i found a lot thats goes through too much and the other is for animations so i kinda gave up.. probably shjouldnt have done that then
Maybe this:https://www.youtube.com/watch?v=0yZVkF9rLgg
Want to add functionality to your Unreal Engine 5 game or experience? Designers, artists and just about everyone can do that with Blueprints. In this video, you'll the basics of what blueprints is and how you can use it to get started writing scripts for your games.
By the end of this video you'll create a toggle-able flashlight and door that a...
And maybe this:https://www.youtube.com/watch?v=opyV7rhKSFc&t=14s
Get my 12 hour course on how to make 2D games with Unreal Engine:
https://tinyurl.com/Ultimate2D
Support the channel on Patreon:
https://www.patreon.com/CobraCode
This is an introduction to Blueprints with Unreal Engine 5 for absolute beginners. We are using the full release version of UE5 which was released in 2022.
If you're new to this top...
Hey folks. Some reason even with my character's movement component having Orient Rotation to Movment enabled and Use Controller Desiered Rotation disabled, my character will always snap to the original rotation... any tips? It's clearly trying to rotate each frame when moving but snaps back in a very jittery way.
Pawn had "use controller rotation yaw"
thanks for showing me some videos on this, ive watched them both but i dont find anything on methods. I tried searching them up but cant seem to find anything as well
there is fuctions which i know what they are already, are they the same?
Yes
Normally a function has a return value
Where a method does not in UE
Here ->
In Unreal Engine 5 (UE5), the terms function and method are often used interchangeably, but there are subtle differences based on context, especially if you're working in Blueprints or C++. Here's a breakdown:
Some things can only be done in methods is the main difference. Like calling animation BluePrint methods I beleive.
that clear things up a lot more now, ill look up functions more then thanks!
I'm using an Enum to choose a name of a speaker in a data asset. In the script displaying dialogue, I figured I can convert the Enum to a next, yet only when converting to a string first.
The problem is, this can apparently not be localized for names that would have to be localized.
ChatGPT claims there's a node "Get Display Name Text" but it doesn't seem to exist.
Any idea how to convert and still be able to localize? Or: an easy way of being able to choose the name in the DA?
They're both really the same thing but with slightly different rules. A "method" isnt called a method in unreal. Its an Event. Its the same as a function except it doesnt return anything. This is also what allows it to be latent (delays/async/later callbacks etc)
So a "function" usually returns something (altho its not a rule, but the restrictions still count in regard to latent etc)
An "Event" is just a function that per rule cannot return anything
In C++ (for UFUNCTIONS amyway) theres litteraly no difference between the two. Because they are in fact the same thing
@lusty delta make another text array and get index based on enum int
ehm, yeah, I guess, I can somehow figure this out. thanks!
I wouldn't use an enum here
GPT also claims there's an option "Expose Enum Entries to Localization", but it seems to be another lie ๐ฆ
but what?
Name, text
I'm using a data asset and I want to be able to easily choose the name for every entry and not have to type it.
"In programming, a method is a function that is defined within a class"
Gameplay tags then
Either way, the list of valid entries to an enumeration shouldn't really be data. It shouldn't really be changing when you add a new character to the game.
ECompassDirection won't really ever change. It'll be North, South, East, West. It's not like a new direction is gonna drop.
ECharacter will change all the time.
2.5 half days to get this to work because of issues with rotation, AI, and possess... ๐ข
I don't think I understand. I wanna change who is currently speaking just like is happening here and display the name accordingly.
I don't know what gameplay tags are, actually.
Semantics
Which is 99% of it
This would be a method?
UCLASS()
class MUSIC_API UElectronicDance : public UGenre
{
GENERATED_BODY()
public:
UFUNCTION()
bool Crystal();
};
(Specifically the "Crystal" part?)
i mean it makes sense by definitioin
you need to access the outer class to access the function
Unlessss static?
Hmm nvm guess it still technically belongs to the class
Unreal doesnt refer to methods anywhere in bp tho
Its only events or functions. Using method will only create extra confusion imo^^
Blueprints is a ByteCode VM scripting language made up from scratch.
They also call Pointers References. I wouldn't really use that as guidance :D
Every time I have to explain a new BP user what a "Reference" in BPs is I get annoyed.
Cause I can't just call them Pointers, the have no clue what that is. And References are a thing they could find online and would learn the wrong thing then.
sigh
Are UE5 rotators stored internally as quats or Euler angles?
For refering to things specific to bp Im not sure using another reference is helpfull beyond creating confusion ^^
Maybe you could give them some reference material 
Point them to some reference material perhaps?
So bp refs are pointers, and not refs?
Thought they were refs and not pointers (no dereference involved)
Never really gave it much consideration ill admit
||And even tho a function belonging to a class could be refered to as a method, it is still also a function ๐ ||
While there is a difference between pointers and refs, I think for most users they just care if theyโre working with the object itself or a copy
Yepp yepp
Most modern C++ code pushes references instead anyways
Pointers are footguns in a lot of cases but are powerful
Should be Euler Angles
I hate working with pointers ๐
pointers and references are similar, very close to the same thing
in cpp you can use a reference as a pointer
BP References to Objects are Pointers. Or at least they behave as such.
BPs also have references to Struct elements
Those are .. I guess actually references
I'll admit... Even though I learned what pointers do decades ago... I always had a hard time figuring out why you use them and though I do understand why now, I still struggle with their syntax (&*?!). I've gotten much better with them working with them in Unreal.
I yeah I can point them to reference material, but since they learn BPs and not C++, it's tricky to find something explaining that stuff without going too far away from rounded little nodes.
The joke was right there
Pointers are for when you need to pass stuff around but donโt want to copy the whole object
I mean, Pointer Syntax is stupidly easy. First class at Uni we had got a fake Address Row with numbers in some of the slots.
And then multiple different expressions, such as ***ppptr + 5 or *(**pptr + 2) - 3
And had to figure out what goes into which cell.
@_@
After that it was mostly boring.
It just looks like the code is swearing at me!
It is. It's calling you names.
T_T
references and pointers are always complicated topic
No but honestly, pointers are really simple. It's an integer with the number that points to memory.
If the address is 1000 and you add 5 to it, then it's now pointing to the memory with address 1005.
It also made things even "easier" once it was clear that Array[5] = 10 is the same as *(Array + 5) = 10
but if you have done memory addressing at any point it becomes a lot easier
Yeah
in things like assembly you need to worry about that kind of thing, unreal takes care of it all in bp
And ***ppptr ? That's also only looking weird, but ultimately it just dereferences one "pointer" after another.
Since Pointers are just integers with an address number in them, if one pointer points to a pointers which pointers to a pointer, if you just put 3 * in from of it, it will chain.
Obviously that Uni exercise was done in a way that the fake cells had numbers in them that were addresses of other cells.
As soon as one touches a TMap with a Value that is a pointer, calling Find on it will get you into a Pointer to a Pointer situation.
I tried TPair with a pointer
I left screaming
Also messed up and chugged 40 gig of ram in seconds
Find just gives you a pointer to the Value or null if it can find it.
If the Value is itself a pointer, then what you get is just a pointer that points to the actual pointer, which in return points to the actual data.
You can probably chain that hmm
Wonder if TMap allows UObject*****
Let me tell you the tail of how I lost one of the pointers in between my pointers.
But yeah, back to References vs Pointers in BPs. I still don't like that they are mixed up there.
Not that BP users would be less confused.
ref and pointer are so similar i'm not surprised it's mixed up, they are basically the same thing
i like to think of them as the same atleast
fundamentally they both "point" to something, instead of hold the value
Its always confusing reading about it ๐
But it kinda makes sense
References are just dereferenced pointers if im not mistaken
Brings along some type safety which pointers doesnt (or didnt?)
:=)
Is there a better way to replicate Pitch than using Multicast >> Set Rotation?
Get Base Aim Offset doesn't works on clients side
GetBaseAimRotation should work just fine
@tight pollen
That's literally using a replicated Pitch Value for SimProxies
Trying to avoid using "Get all actors of class" Node. So i got NPCs ai walking around town and going to different destinations. But whenever they decide to go to a new destination they are calling get all actors of class and selecting one. Is there a way I can some how cache this is like a manager bp at begin play and then get my AI to just reference that to get data about the locations? I can put an actor in the world and have it call get all actors of class, but how would i get a reference to that actor into my AI controller or AI class? Please let me know if you can THANK YOU!!!!!!
How many actors are you getting to make the choice from?
Eventually maybe 250.
probably less actually
Probably worthy of optimization at that point depending on how often it's running. As far as the general question, you can make a manager someplace glocal like a component on your GameState, or a singular actor in the level. Then you could either access it through GetGameState->GetComponentOfClass, or GetActorOfClass
If my Ai can just get access to a manager actor i think it will work. I guess i would just have to have every ai cast to it at begin play.
ohh
Ok and if i use get actor of class, Would i then have to cast to it as well? or would i not need to because there is only 1 manager actor ?
It wouldn't matter if you needed to cast to it or not.
for sure. Saving your answer in my notes. THANK YOU SO MUCH. This has been super helpful bro
Very much appreciated!
Of course. Anytime. ๐ Also semi unrelated due to C++ requirement, but you can also make WorldSubsystems for this sort of thing too.
ahhh ok for sure. When i level up more I'll look into that lol! but i'll put that in my notes as well
So why is it doing this? I've used the exact same setup before in another bp and it works?
You haven't set Value to point to a specific instance.
In this case that "Value" variable should be an instance within the widget, no?
It's not a separate variable Natsuya created.
Yeah, it's supposed to be set here:
Then it's probably called too soon. Underlying widgets are not created until just before PreConstruct.
I've the exact same logic here and it works perfectly fine
Are you calling one after adding it to the parent?
this is where I call the one that works
this is where I want to call the one that doesn't work
Why aren't you using the ArrayElement here?
You can cast that. But right now you're telling that one widget to update multiple times.
But what is OptionLine?
But it still fails!
is a template widget that holds all the layout for each option in a menu. Rather then having a gazillion items to make a single line, I use 1 optionline
But that specific one. Is it a default widget in that blueprint?
the optionline var is a reference to the that widget by itself
๐คทโโ๏ธ Either the internal widget inside of OptionLine was removed from it's parent and collected, or it was never created due to OptionLine not being added to a parent, or being remove and all of it being collected. I'm unsure
is there a way i can import tracked camera motion from blender, into unreal and use it as a camera shake in my game? im using a headbob camera shake rn and it just looks bad. im trying to give a convincing handheld camera look
they pretty much just use c# naming for things, right?
even a UPROPERTY pointer basically acts as a c# weak reference in the way that it specifically points to an object as opposed to memory. well, it DOES point to its location in memory, but its tied to the specific object
well I figured out a different approach that actually works better, thanks anyway
This is what im doing for my CYOA game. ITs mostly UI game, where you go to places, and then choose what to do.
Is this okay?
I was told to do Gameplay Ability System though this sounds simpler to me ๐
at least for GAS, you can at least borrow the gameplay tags hierarchy to minimize the amount of strings and names for your switch cases
you don't necessarily need the abilities or effects, but the gameplay tags will definitely help immensely when it comes to classifying stuff
and you can provide some basic boilerplate GAS system to give characters an ability system component so they can received named events
thanks
and to my surprise
you can just give an ASC in BP classes
which I think is sufficient enough to receive gameplay events
le oof
can someone else me figure this one out? I am trying to have different meshes inside of a blueprint, that when the player looks at the mesh, it will show a message on screen, the function already works when return node is used, but I cant figure out how to make an array, that calls the specific mesh the player is looking at...
quick question, what would happen if you try to set opacity in the negatives?
would it automatically clamp it back to 0?
i can easily set it so that 1 mesh has a name, but i need it so like, 15 mesh, can have individual names when looking at
cant be more invisible then invisible
there is the make array option
yes, i can make an array and attach all of the mesh components to it
but i cant figure out how to have the correct info FROM the array be called to the return node
this is when the player is looking at it right?
yes
so i presume you have some linetrace system going?
yes
and a blueprint with about 20 different buttons
need each button to show which one you are looking at
why do you need 20 different buttons well if you already did the line trace, you can then pass in the actor that got hit in the line trace into the function
and use array find function
to see where it matches
you can probably use a set if you want O(1) look up times
since using find on an array can be slower
array find function?
its an elevator btw xD
like i know this is incomplete, i just dont have a clue how to set the find array to work with what im actually looking at
so from there on the lookat
add a parameter for actor
and pass in the actor that your linetrace picked up
@dawn gazelle remember when I had a problem with this system that was basically checking if you got the right ingredients or enough of them to be able to craft something? That was solved. But now the same problem would come except in this case I have a different system. And that is a slot color system.
Same problem here
Well (almost the same)
And I blame this function
so as soon as I get one wood, this slot turns to looking normal
You'd have to check if you have enough of each ingredient in your inventory. That means keeping track of a total for each until you've got enough of each.
Once you're sure you have enough, you return true.
so it IS a problem with that function?! I found that very fast
I am returning true once I have enough
hot NEW method of commenting code... abstract soyjaks for new developers to decode
- You're not checking the total of any particular item in your inventory
- You're checking if the total length of the list of ingredients matches the number of particular ingredients in the inventory (in other words, if your crafting recipe required 2 wood and 1 rock, and you happened to have 1 wood and 3 rock, you would still be returning true
So that means... You're fixing a car, and instead of checking for the wrench and screwdriver, you see that you have two tools. You just count but never check what those tools actually are. They could be a hammer and a paintbrush or a spoon and a toilet brush, but they are totally useless. And what I need to do is do both at the same time. Count both quantity and if the item id of those items is correct?
Right, but what is its crafting requirements?
Looks craftable. And it's allowing me to craft it
It shouldn't be possible to craft here.
- You're checking if the total length of the list of ingredients matches the number of particular ingredients in the inventory (in other words, if your crafting recipe required 2 wood and 1 rock, and you happened to have 1 wood and 3 rock, you would still be returning true
You have an ingredient list of 1.
And if I craft it, it will actually remove 1 wood from my inventory.
Oh this is fun too... You're checking if the quantity in your array >= the "Slot Quantity" of the class default object, nothing to do with the actual crafting requirements.
So it's probably 0 coming out of that number there.
which is true.
so then you add 1 to your counter.
Then this part will return true.
Also I got this new function
Loop through required ingredients, store the # required of the ingredient.
You have a function already in your inventory that should be able to tell you the number of any particular items in the inventory. Do this.
Compare that number making sure it is >= # required of the ingredient. If it is not, then you must return false.
If you make it through all ingredients without returning false, then you should be able to return true on completed of the loop.
So this sounds like, we're making soup, and instead of adding the right ingredients, my code just pours random things into the pot until it feels full enough and assume itll taste good?
so i should pull another function inside of "Can Craft?"
So I got 3 functions that sound like could help
- GetItemAmountFromInventory
- Is Item In Inventory
- GetItemData
you only want me to use one of them, which is the first one?
Well, if GetItemAmountFromInventory is still set up the same, that one seemed to count the total from all inventory slots from what I recall.
The other problem here... Is that with each ingredient, you're having to loop through you inventory that many times... That's not great.
Ideally you'd loop through your inventory only once, checking if each slot contains a desired ingredient, and if so, increase a counter that relates to that ingredient, an at the end compare the counts of each required ingredient to the amount found in the inventory.
someone recommended me i do this:
That would be the required check at the end if you loop through the inventory only once etc..
but im comparing dictionary/map to content which is struct, i guess it doesnt have a boolean but i can engineer it to have a boolean value, for example , if return output is 0 then that means it's false, if return of the integer is >0 then return output is true
?
is this a good method ?
I mean this
You don't need to put your inventory into a map.
You just need to keep track of:
ItemID > Count in Inventory
Just like your recipe keeps track of:
ItemID > RequiredAmount
I've been told that my code right now is kinda like when you keep checking your phone too often because youre anxious about missing something important, even though you know theres nothing new yet. And that is bad for performance and thats why someone recommended me i use these Find - Find nodes. after one loop that goes through the few ingredients.
Another one recommended this
or its more like checking laundry one sock at a time, even though you could just do it all in one go and save time
I never said imma put my inventory into a map
anyone have any idea how to use this correctly - I just want to orient my player to the cursor, but if I calculate the mouse position from the player controller it spazzes out, I assume because I set the control rotation from that calculation. it works fine if just use gethitresultsundercursor to get my mouse location
But that's what im already doing
That's not keeping track of how many are in the inventory.
I need to keep track of them, storing them inside of the Ingredient Local variable?
Loops through all ingredients, storing the Name > Amount Needed.
Loops through the inventory, checking if anything is a required ingredient an keeping track of the number in the inventory.
Loops through the ingredient list, checking if the found ingredients quantities < the required quantites and if so returning false....
IF the loop completes, then all igredient have been accounted for, and we can return true.
This sounds like it's trying to find a needle in a haystack while the haystack is on fire
You normally do not want to use actor classes as a means of keeping track of static information about items. They are meant to be objects that are spawned and exist in the world, not meant as a data asset.... A Data Asset is something that works better for storing static data about an object that doesn't need to be spawned in the world. A close second would be a data table, but they have their own struggles if you load them up too much too, and makes it kinda wonky to handle since you'd have to continually store the data as variables in order to access it.
Don't worry about that for now. Get your system working, otherwise you're going to be struggling trying to rework everything.
This is a good method?
That's how i'd handle what you have currently.
It limits the amount of loops needed.
so i know you can't run timelines in widgets but is there some equivalent in widget blueprints for it?
Animation Sequence is probably the closest equivalent XD
Do you Create Widgets at runtime, or you include all widgets in the HUD as collapsed, and make them visible anytime they are needed?
I have a ton of Widgets all hidden (Collapsed), under my mainwidget. Then i just make them visible when i need them. Is this the correct thing to do?
guys, is there any way to make some kind of checked get from array? so if the index is out of bounds it won't give me an error like:
LogScript: Warning: Script Msg: Attempted to access index 1 from array
use commonUI!
Usually the Main HUD would be where you have a Canvas so you can at least lay out certain things. Not easy to programmatically add everything unless you've gotten a well defined layout with containers and can easily plop them into where they need to be at the time.
You need to validate the index is valid before attempting to access it if your index variable could be put out of bounds.
omg, it's gonna be ugly.. I think I need to move it to cpp, now it's cute like:
https://blueprintue.com/blueprint/ytsmfv83/
oh, I can make it a function :/
Well you can set them back to point to nothing, so I wouldn't say they are references in the actual sense.
usually the latter. Better to create all you need ahead of time and only do dynamically if you can't preplan when you need it
guys, is it okay that? kinda annoying thing. why it shows incorrect value?
I never relied on watch variable. Just print them imo.
thanks all
have a look at common ui anyway ๐
is it that much better?
i like widgets
it's scaleble and overally great
it's same widgets just different base classes, all is the same, but a bit different workflow. more convenient in many ways
Not quite the same, thereโs some useful things common stuff can do that regular widgets canโt
Setting it up initially is a little painful tho ๐
I would probably not do any serious project without CommonUI anymore.
Maybe a pain to set up, but it gives a lot more than just "different base classes".
Needs C++ in some cases though
Where does "Desired Ingredients" and "Found Ingredients" come from? @dawn gazelle
Is there a better way to do this otherwise massive switch function?
also, will text variables get converted to different languages in the event graph? I want to compare some text with a string, and I need to know that it will always be in the same language while being used in logic (it ought to convert when being displayed)
ping with response please
i think varaibles get created from when you promote a value to variable from this creation of yours, (and maybe also SET them afterwards) , otherwise they would be empty values
Hi, I have created a save system, but when I tried to load the inventory, the saved items loaded correctly. However, the items I picked up are also appearing in the game world. Is there any way to remove or destroy those extra items?
Looks like a collapsed graph
@dawn gazelle also where are you getting this from? I mean it's a new variable right, but where is it getting SET? Where is this getting any data? It's gonna be an empty variable
@gentle urchin can I ask you instead about Datura's code?
Where tf is "Desired Ingredients", "Found Ingredients" and "Ingredient List" coming from?
Hello, bit of a computer science question here. I have a 3 integers (32 bit) that I want to combine into a string for savegame, and I want to make the string as small as possible. Is there a better way to do this other than just concatenating the integers together (with dividers to show where one int ends and another begins)?
three integers in a string are usually stored with a delimiter @wraith loom this is a classic technique and still works great
but you could also store a hex representation
which is typically smaller than a large number
normally it's just number|number|number
also depends on how complicated you want the reader
you want to just convert a string to a number, or do you have to convert a hex string to number
but imo hex would be smaller
atleast for larger numbers
Hello there i am using "Archviz" explorer template for my project and i created another level to practice, i have added one BP_explorer_Pawn node in map but when i start the game it spawn another pawn object rather then using the one which is already in the level
it doesn't automaticaly posses one of the ones in the level
you need to set it in the gamemode override
set the pawn
you need to make a game mode class, set the override to that class
and then you can override the options
if you are saying this , then it is already done
yes
no
the class are same but the problem is it is creating another instance
Select the pawnninstance in the level editor , go to the details panel - search for "Possess Player" and set it to "playercontroller0"
well ya
it doesn't use the one in the level
it spawns a new one
thats intended behavior
just remove the one you placed in level
and put a player start
it worked
I know ๐
thank you both of you
Glad it worked
๐
gonna remember this
super dumb blueprint question.
I have a branch, which means i ahve two execution paths.. i want to do some logic on one of them...
But after that.. i want to go back to the main execution flow;
ie; i want to merge both branches back to the single execution flow (rather than end one branch).
How can i do that
maybe describe what you want to do gameplay wise
pick a node and run both execution to it
if i draw two execution lines to the same node, the first one disconnects?
it's pretty abstract, but an example would be:
do stuff -> branch :
if A) do extra stuff
if B) do no extra stuff
Then..
do final stuff.
how do i merge the two white lines from the two branches... so the final stuff can be done regardless of which branch it went down
If A -> Do Extra -> Do Final
^
If B -> Do Final
well you are probably in some control rig or PCG
that's not standard bp stuff
can't you copy the return node?
looks like i can only havce one of them
ya idk because it's not normal bp
yeah,
can you only have one return ?
I'm looking at it, it seems you can only have one return
can't copy paste, can't even make another output pin
hmmm i found this
seems cumbersome but might work
so they want to just use sequence, and abuse the fact that it will jump to #2 after finishing #1.
Where #2.. is just the return node
I don't know what the OP is talking about
probably just saying rubbish
when asked about solution, he is just saying he doesn't use UE
๐คทโโ๏ธ
how sequence could help with the branch
looks like they are just suggesting not running both, but running the if in first part of sequence, and then return after
hmmmm
so in theory it would return after both run, which makes sense
What a mindfuck
i think that will work
and is what the reddit guy is trying to articulate poorly
it's the same logic
isn't there a helper function to calculate the closest actors in an array of actors?
anyone worked with templates. im constantly lost in this soup of blueprints and finding myself having to breakpoint the hell out of everything
is this even worth it?
by this time id have done the whole thing myself i think

I don't think so. It would be really easy to make into a input output function yourself
it is but I think it existed. Don't want to reinvent the wheel if possible.
What template?
blueprints become ๐ real quick
Any ideas on what could be wrong with this part of my in-level cutscene trigger blueprint? It's for a 2.5D platformer, and is supposed to "camera pan" to the left or top by adding increments to the X, Y or Z vectors (checked in that order) but it's timing out at the first branch.
i'm still trying to figure out what is right with it
Just a regular sort function, i believe so
found it
Fix your spaghetti first, maybe then you will see it
nvm! it's from some plugin I am using
just gonna re-create the functions on my own library
use nearly equal instead of equal on the lastbranch
not sure if that's your issue tho
and use a decent amount of tolerance, something like 0.001
or maybe even higher, 0.1 or 1 should probably work, too
and if you need further help i would advice you to clean up that mess, because it's a disgrace to ask people to sort it out for you
Does passing pointer as reference instead of value even make sense?
probably not right? even thousands of them should be negligible?
Ye but not doing bp atm
If im not mistaken by ref is less of a copy than a regular input ?
I don't think I can see bp the same way again after mine got corrupted
Could be wrong tho.. just heard it a while ago
ahh yeah, I heard this before as well
nah you are probably right
might end up with more overhead
But you inow what to do if performance is an issue ๐
i doubt that pointer arrays are your primary concern... ๐
I've only really done that once, and then lost track of how to do it. If it helps, I'll give you the breakdown of what's supposed to happen. The incrementing variable is counting from zero to however much pan distance is set by hundredths, one increment at a time (.01, .02 etc.) This is added to the X, Y or Z and fed into a vector which is then used to set the camera location, essentially panning the view. (So basically, it's the same thing I'm doing to set the camera position while the player is in control of the action.) Once each increment is counted and the camera is advanced, it should restart for the next one.
we don't even see what's on your branch logic for the left branches
Thge branch nodes are for setting the correct axis
you showed us half of it, and i'm afraid to see the other half...
Hi guys, beginner question: what are these node in the Event Graph? Thanks
that's a macro
which is declared in the BP it exists in
could be collapsed graph too? I think
yea possible, i don't use them often enough to tell
it's soo conviniently cropped, hard to tell
maybe show us what it looked like before you double click it
actually, this is the half that is giving me problems. The conditionals going into the branches are in alphabetical order from the top (so X, Y and then Z in that order, and if the axis is not valid then a quit node crashes the game)
Hi, can I get a second opinion on this?
So basically what im trynna do is have SLOT only turn red if you are too poor to afford it.
That's how capitalism works.
You should only be able to unlock it if you have more than 2 wood, otherwise it's called STEALING.
And this is the code responsible for it
So it takes ingredients from the inventory aka searchers through your content array aka your backpack, and in this procedure it tries to compare it to the things that already exist in to the other "array" <--- but its not really an array, it's actually a dictionary... ( although they work the same way pretty much )
Theres no difference cause I convert them anyways with certain nodes to both be comparible to a "equals equals" node ==
at least thats what I think it does
I'm with my family for Christmas week, although I do have remote access to the development rig in case I figure out how to clean up the blueprint graph or solve the problem (would have it directly on my laptop, but I'm platform approved so I can't exactly do that without risking exposure)
This is like when a vending machine requires $2 for an item but only checks if any money at all has been inserted.
You can still get the item with just $1.
what exposure?
because NDA
also the fact that it takes a lot of storage space to hold it all on the dev drive
remote access to development rig?
Why not just use source control
if the idea is to re-do the codes using Remote Assistance, that sounds pretty insane
In theory I could, but due to my use case the editor is built from source
I don't see how that gate you from using source control
The engine files have nothing to do with the project files
your laptop don't even need the source version
My brother can open the project using non source version
while I use source build on my end
which I'm aware of,, but trying to keep all of the copies in sync (whether git, one drive etc.) is something else
and some people find certain things to be more convenient for them
Keeping in sync means using source control
in any case, I'll take a look at cleaning up the blueprint graph and repost
And you will also look into git
a few command lines to keep in sync and the ability to revert beats re-doing codes using remote assistance anyday
I should also note that I have a lot more display room on the main rig as it's hooked up to a 4K (while my laptop is only 1080)
Nothing to do though
Hi, is there anyway to change the drag-and-drop's dragging visual when I enter another widget?
this shouldn't even be a fight tbh
Im sure there is a way to have that display room on 1080p too. If not on windows then on linux at least probably
as a last question for now, I was only able to add the dots once for straightening out blueprint graphs and then lost track of how to do it. What's the procedure for that, if I may ask?
Double click the line
or you can right click the line and select re-route node. (maybe)
Usually I just double click the line.
is slot quantity correct, perhaps the quantity is off ?