#blueprint
1 messages ยท Page 263 of 1
make block
try block
context?
something is wrong because your traces go through your character
meaning the hit is ignored
id like for headshots and stuff so id like to keep it
Got a screen of the trace itself?
^
you mean this?
it got green as well so it should mean the trace is hitting the target
??????????????????????????????????????????????
Some of them hit the target
put a print string
can you turn on Show Collision so we can see
I mean the code doing the actual trace
yeah it looks like it works but you're a bad shot
i am hitting tho, the green dont lie
this is wiht show collision
Its only hitting the skel mesh , which is fine
and idk how to do a print string with just hitting the target, i tried to do that too but it just print whenever i hit anything
you can print the hit Component or the Hit Actor
to find out what you are hitting
but it seems hitting already
yeah...
So what's the logic that don't work?
so it's working
Perfect
this is the damage code
Gj everyone ๐
let's wrap it up
its just the collision thing thats erroring becuase wihtout it the target dies but falls through the floor
let me do a vid
When you simulate ragdoll you simulate physics on the skeletal mesh component and detach it from the capsule afaik
yes
You don't want to do NoCollision
yes
That will just make your character fall through the floor
yeah that fixed it, sorry for the trouble for such a silly mistake
don't be sorry, good luck next
the place where the target dies is like wall tho, i cant walk through it
is that anther collision thing i need to take care of?
send us visual if possible
ahh I get what you mean
That's because the capsule component still standing there
you can change the collision channels on the capsule component to ignore pawn
if you type Show Collision you will see the capsule component of the dead character blocking your way
yup, should do with camera as well
how stop the momentum when the npc dies tho, i think thats what making it fly back?
and can i just switch the capsule to no collision after death, i can move it around by walking into it and the ragdoll is jmping around
you can see from my last vid
oo thats fine, i might just change it to a death animation when i get my hands on one then
what about this?
you could but what i would do is change the collision channel reaction of pawn to overlap
i thought about that but id still want the player to not be able to phase through people lol
SetCollisionChannel or something like that
thats what im trying to do but i cant find a node to change it?
never mind, i didn't know why i searched just mesh and not no collision, its 1am and i really should sleep lmao
while i was at this i also figured out it was probably the capsule thats fling the ragdoll around, good to know 
So let's just pretend we have a new global disease outbreak and to prevent the spread of death we quarantine people into groups. We know we have a coronavirus like pandemic but we have 30 different evolved mutations. These viruses have gotten better and more resilient and we need to seperate those with known infections into specific wards and isolating individuals with unknown symptoms to prevent contamination, as we're treating them. Why would then the organization of this code fail to work?
For one I can tell that the Item ID im connecting there on the 2nd function at the end isn't gonna be hooked up to anything so it's not gonna work with or reference to any data. Because that's the way that my inventory system is structured.
But then I would have no way to reference any Item name ID connection to the "Add to Stack" function. But I guess that would be easy to fix, as all I need to do is create a Item ID input and then to "==" (equals equals) to whatever Item ID name im getting from
But then the question is, should I be getting the Item ID from the top or from the bottom?
Should I be gettng the Item ID from the "Is Item in Inventory" output or from the "Make S_ItemData" ?
..or from the get class defaults? (probably not that one)
@dawn gazelle
AddToInventory should handle the stack adding
Its the inventorys responsibility
Nobody else should care about how the inventory handles it
Just like others dont care how inventory removes items from it
Adding To Inventory should return a bool for success
WhileLoop are generally not recommended as they remain a pitfall with blocking behaviour causing infinite loops if not done correctly
it already is
should I remove my while loop? it never caused infinityception
Still crafting has no business checking for slot and calling internal methods to the inventory component , imo
If you know how it works and the pitfalls, you can ofcourse keep using it
Just saying it generally wouldnt be recommended
Regular loops work just fine for this
which methods speifically?
"still crafting"?
Still, "Crafting" has no.....
I assume thats a widget ?
Holy shit im reading stuff qrong today
Nvm, seems its all in the inventory comp
Also you dont seem to be chevking max_stack amount when adding to existing stack
I assume thats some parameter on the class in the slot
yeah but somehow that works, it doesnt have any problem calculating amount
This logic makes little sense to me
If you talk through it, does it make sense to you?
Specifically "AddItemToInventory"
it works
but for me what seems weird is this
when i complete this loop it will turn everything zero or will it add zero? as if affecting zero change?
hey guys need help with a formula
that would be delightful. Also there Im now passing array index too
im doing a block thingi, but when the "amount is surpassed or the remaining amount should be put into "damage taken"
block 50, damage 75 then 75-50 but the remaining should be put in damage taken
it doesn't
What happens when it overflows?
What happens when you pick up a stack of 20 rocks?
rock has limit to 10 rocks
so it will just create a new slot
So what hapoens when you pick up 10
10 new slots?
1 slot with 10?
1 slot with 1?
everything works as normal
you give stackable amount to rock anything
u want
10<---
is the current
For example
this axe has stack size 1
maybe you destroy it from too much use and then you need to create another one
@steady night you can get the remainder
InitialDamage = CurrentDamage;
CurrentDamage -= BlockAmount;
BlockAmount = max(0.0, BlockAmount-InitialDamage)
Rock stack size is actually 20
I wanted to change name to "Stone"
but then for some reason it failed to work
Although I change this name both from the itemData here in this data table
๐๐
and from inside the child blueprint of this item itself as well
Sounds fragile
and i just copypasted the same thing everywhere, same characters, same capitalization etc.
true
but maybe it's not
maybe it's the way im doing it that is wrong
but yeah, it could be engineered better i think
Just move away from regular input field "Name" for ItemID and make it a gameplaytag
Save yourself before its to late
is that a type of variable?
oh you make that from the project settings?
and attach to it a data table?????????
The only annoyance is DT
It doesnt support row name as gameplaytag
So you need some c++ logic to do that
Just dont us DTs
DTs are nice when you need to view a large number of items in a list
Go DA route for inventory items
but yea I will go with DA for Items
Imagine loading 1k items for one row 
DT is okay, just make sure stuff like sprite, mesh, other heavy class reference is not hard ref
but yeah, i like DA approach more now that i used them
specially with PDA
Any advice there ? ๐
Still havent used DA
But imagine youd need some DA manager for lookups?
i just steal the concept from lyra 
I want to use DA but access it in a DT fashion ๐คฃ
can consider PDA fashion
asset registry would be the manager for lookup
then it is also immune to directory changes if so happens there is
Thats neat
if we could dirrectly call functions of structs in bp, i think it would be chaotic ๐
class and struct in cpp doesnt really have too much of a different
Overhead
but i think the inventory concept from lyra makes alot of sense
Item Definition has Equip Definition
Equip Definition has AbilitySet to give to Owner
so equipping an item gives you a certain ability
modularity at its best
tho it needs GAS
we love GAS
Less if you do a pure c++ class but any unreal class carries overhead
Yeah i lacked skill when i first tried it
But i want to revisit that very soon
Did another struct inventory and i already dislike it
the fragment based item definition is also kinda dope
Managed to put together uobject replicated quest system so one step closer
Yes!
tho kinda overengineered for reusablity
one thing is since lyra is kinda old at this point, they didnt do their "Item/EquipDefinitions" in DA, but you can always just change that yourself
People work pretty well with known constraints
lyra has its own issues
Dont we all ๐
guys does anyone know how i make folders in variables real fast?
If you select the variable you can see category in the detail panel. Fill it with a name of your choice
guys its me again
I'm facing some bugs in my game and could use some help:
Inconsistent Stone Spawning:
I have 4 indices in SpawnPoint fed into a For Each loop to spawn 4 stones per hole.
The spawning is inconsistent across 12 holes, sometimes spawning 1, 2, 3, or 4 stones per hole.
Multiplayer Sync Issue:
In 2-player mode, players see different stone counts in the same hole. For example, Hole 1 on Player 1's screen has 3 stones, but on Player 2's screen, it has 1 stone.
Thanks !!! โค๏ธ
i also noticed when I eject from the player controller (in my editor window), the number of stones changes to match the player 2 window. However, when I reattach to the player controller (main window), the inconsistent stone count appears again.
For example, in the main window, one hole has 4 stones, while in the player 2 window, the same hole has 2 stones. When I eject from the player controller in the main window, the stone count changes to match the player 2 window.
Any ideas on what might be causing this issue?
hey guys, was just curious, I'm creating my own project in UE with blueprints as a hobby. In my career life I'm web app dev for over 10 years now. I have integrated AI into my workflow kinda quick as it hastens my work quite a bit.
I was wondering, with UE blueprints an AI (such as ChatGPT) can give you hints, tell you what you should/could to do, give you some course, hint you some functions to use, but it is rather slow as this "visual" programming need to be completely done by you versus like C++ code that AI can create and you can actually copy and adjust itself.
Have any of you figured out how to implement or use AI more effectively within project based on UE Blueprints other than just having chat buddy?
Cheers!
Not trying to vent, actually interested in using AI more effectively, if there is a way
Chat GPT can't really code for you in C++ for Unreal Engine
you will be lucky if you can compile 10% of the time
Well, sure it won't create you a project, but I guess it can give you a lot of usable snippets for you to use, which can be really usefull for ksilled programmer and a lot of time saver. I guess nobody expect to copy 500 lines of code from AI and expect it to run as expected?
Anyway, not my point. was leaning towards how to use AI within blueprints.
nah it's garbage
I used it
wasting time really
you gotta learn what you gotta learn
LLM is not a shortcut, it's a trap
It's a tool and I'm looking for suitable way of using them as I do in my web app career very well.
Such as Cursor AI that can loadup project and give you better insight and hints than Copilot for example. And since I'm don't have that insight in UE dev I'm asking if someone else has?
You can ask #cpp, no one found useful (and time saving) ways to use chatgpt, copilote or jetbrain AI assistant for "medium" or larger code snippets, its usually good for single line auto completion.
So for a BP usage it will be 300% worse
So its faster to do it yourself
Using LLM is gatekeeping your self
just an advice from someone that have used and relied on it on the past
And your new to UE, using AI isnt a good way to start. Its like copy/pasting a dumb YT tutorial
nothing like making you punch the monitor when LLM gives you non existence functions
Together C & C++
I see, ok.
I mean it helped me a lot, like suggesting a function or way to implement certain things, simplify BP schema etc.
it really doesn't. You will relaized this at some point.
Are you new to UE ?
Yeah, did fair share of tutorials, avoiding C++, keeping myself in BPs.
gate keeping my self for years was the worst decision I made
Might find hidden stuff here https://notes.hzfishy.fr/Unreal-Engine/Extra/Unreal-Engine-learning-speedrun
I mean I'm in programming for over 10 years, I know programming standarts, concepts and basics, I'm just new to UE.
Kinda feels to me that avoiding using AI is like refusing to adapt, but may be different at UE.
Thanks for your thoughts.
If you know Java Script / Python then you don't really have to learn BP
you will already know the concept of OOP
it's not about refusing to adapt, many people have used it. You can ask other experts opinion in #cpp , they will give you the same answer
It is very intuitive for me, just searching for the right functions etc. is really painful.
wait for it to give you non existence functions
Your programming skills of other languages may help you designing systems and learn faster.
But your new to UE, so it doesn't change the fact that you cant know if AI is saying shit or not
can someone please help me it feels like am invisible here
it will give you wrong answer more often than not
10+ years but you cant find functions from google searchs ?
I understand, but learning myself is the same process, just slower? How would I know, learning from available tutorials, which are those feeded to AI anyway?
Idk what you did in 10years
Eh, no need to be toxic my friend. Every language has its own naming.
I really dont have knowledge of UE functions.
Doesnt change the google search process, being toxic isnt my goal
no different than looking for API and researching on your backend career
But you keep saying AI helps when it doesn't in your case
I can recommend Matthew Wadstein videos for most useful and common nodes.
So Google search will feed me right answers but AI that is feeded by the same data does not?
Many blog posts arent trash and have valuable info
You can check pinned messages here, the blog post is shared
Are you looking for confirmation bias? Why not ask the experts in #cpp if you are not convienced.
I also listed useful resources there https://notes.hzfishy.fr/Unreal-Engine/Extra/Unreal-Engine-learning-speedrun#more
Yes because google will redirect to human written posts
AI will generate
You still have to watch out to not terrible answers in forums
Thanks for your inputs.
I haven't come for confirmation, I came for use-cases, you both are just telling me not to do that and I hear you.
For me personally shutting something completely down if it has such strong potential, as it does in my career, feels too ignorant.
But with that being said, I'm new in UE and I'll keep studying, cheers both. ๐
well if everyone (you can ask for more people) tells you the opposite. It's probably a good indication to consolidate your stance.
But the engine is to big and private, so only AIs like copilote (github, jetbrains,...) could understand it correctly at some point
When it comes to blueprint it's multiple times more terrible btw
If only the unreal documentation section would be heavily updated
it could actually be truly helpfull
Read source 
"how to communicate between blueprints"
"Here's 4 options :
1 -
2 -
3 -
4 -
These are the pro's and cons. select one, and we'll guide you on a simple implementation tour with explanations of each step"
๐
I have 1 or 2 ideas on spawning stuff in multiplayer
but looking at your blueprint it might be a hand holding session
tell me your objective, maybe I can put it in words
I want to create a system of statistics: strength, dexterity, intelligence, charisma, etc. in general, with 50 statistics, what approach will be the best? should I create it all in an array, each variable separately? I don't know where to start
GAS have steep learning curve but for attributes and ability, it's soo valuable I don't want to roll my own worse version
since you have 50, you probably shouldnt write them one by one each in a variable
since each stats would probably need, add, remove, override, temporary stats, affecting stats
generally when creating this system I want to trust the client so it doesn't have to be 100% replicated
if GAS is out of reach, you may want to make your own attribute system, though probably should be similar
in the simplest form, you want to have a Map of Name:Int, handle all the addition, changes and removal in one place
Why is the 2nd window here not collapsing ?
or you can move to each attribute being its own UObject, having their own derivative class from a parent UAttribute or something
It's only collapsed the first time I open the crafting window, but stays open forever, and it's interfering with my update system. It should close down and open again every time
Can you recommend a YouTube video about GAS?
maybe I'll use it
I just don't know if it's worth it if I don't care about full replication
GAS handle a lot of the multiplayer stuff
that's what make it indispensable for many
from my experience, GAS handles Attribute, Effects, Ability all quite seamlessly, valuable to any stats heavy game regardless of multiplayer
Is it OK on just BP? or C++ required
stuff like temporary +5 strength, which result in +25 attack, etc etc
these can be easily defined in behavior
its c++ required
learning it would need quite some time
making your own but similar system should be okay too
in general, statistics are a simple thing, when I look at it only from BP, I wonder what is so complicated in GAS
these are just statistics
its what you do with these statistics
as i said, you can always do it in the simplest form first
e.g. if a player has more Strength, he deals more damage, if he has more Dexterity, he runs faster, etc.
I'll check GAS, maybe I'll use it
Yeah go use GAS
Check tarnek github readme of GAS
when using Blackboard and Object references (keys), and BTT, there is no way to just set the direct object reference of actor variable once and then get it from the BTT -> Blackboard keys somehow? I can understand that from Event ReceiveExecute you have to cast it to the BP where the BB is running from. so that would be AIController, not the player.
The game structure
Its a 2 player game were each player has 6 holes and each holes has 4 stones
So this is the first thing I wanna accomplish before moving to the logic of moving the stones between holes
And each holes are separate BP and they have a stone array variable that holds the a mouth of Stone in the hole as this will have the game logic to function
You will need to write the logic run only by the server to define the 6 holes and the 4 stones each character posses
Character and controller class is not suitable for this btw
if the clientes doesn't need to know about the holes spawn position (I don't see a reason they should)
You can use the game mode since it's only exist on the server.
And when you spawn, you spawn a replicated actor. Only have server spawn actors.
Spawnign as client will only spawn the object local to the machine.
@sick sky @frosty heron Have you used GAS?
Yes the logic I wrote(to spawn the stones and update the hole stone variable) is on the GameModeBase
Yes, I am struggling and debugging it atm.
It's easily the most important system for my game
and the holes?
Spawning is as easy as telling the server to Spawn the actor
if the actor being spawned is set to replicate, the client will eventually get their copies.
And FYI begin play is 95% the wrong place for multiplayer
The holes blueprint actor are inside the level editor
Ohhhh so I used begin play to execute a custom event that triggers the spawning of the stone
Then just spawn from the game mode.
Server ->Get all holes in the level, spawn stone on their location
This is already wrong approach, you are not gonna get far not knowing switch has authority, isLocallyControlled and when begin play is called.
The spawn logic is from the gamemodebase i created
If the actor exist in multiple machine. Begin play will run whenever the actor is ready
So server character 1 spawn. Begin play called
Then player 2 join. Server call begin play
Then client call begin play as well in its machine
Yeah and its great
Then it will also call begin play on player 1 character in player 2 machine
Ummmm
So I later use switch has authority
And I stored all player one holes in a variable inside the game mode same for player 2 which is what I use to spawn the stones
This is the flow
Doesn't says much.
Let's step away from your system and just try to spawn actors at the start of the game where all players can see and in sync.
Create a blueprint actor and set it to replicate
Game mode start -> spawn those bp actors into the world.
If you see it in server, you will see it in client.
Oaky doing that now
Then work your way forward
how long it took you to introduce GAS into your projects, it seems complicated
especially when I don't know C++
but let me mention I have 2 cameras in the level and each player is assigned to one cause they need to see the game from their own perspective
and I noticed when I eject from the player controller (in my editor window), the number of stones changes to match the player 2 windows. However, when I reattach to the player controller (main window), the inconsistent stone count appears again.
For example, in the main window, one hole has 4 stones, while in the player 2 window, the same hole has 2 stones. When I eject from the player controller in the main window, the stone count changes to match the player 2 window.
@frosty heron
1 week or 2 to correctly understand the bases
Well this is a whole different thing
Move away from your stone and just see if you can spawn actors in multiplayer
Then you can work your way slowly
Camera being ejected or not has nothing to do with how the actors are spawned unless you do something OnPossesed
Which is a function that gets called on server when a controller posses a pawn
but C++ is only a little? Will I have to use it for every attribute?
Attribute declaration needs to be done in cpp
why didn't they add the ability to do this in BP? :/
but only this? Will I have to do anything else in C++?
There are a lot of things you can only do in cpp. But there are also things you can do in bp.
Like activating abilities and granting one doesn't require you to use cpp
i mean you could expose it to BP, that is another option...
It's not complicated. And you only need C++ for the attributes. Try GAS Helper if you don't want to use C++, it supposedly allows BP attributes.
Gameplay Ability(GA): Does stuff, spawns helper actors, Plays Montages, plays on off cues, adds GameplayEffects, etc.
GameplayEffect(GE): Data class which defines applied attributes, applied tags, and applied state based cues.
GameplayCue: Visuals and Sounds.
GameplayAttribute: Definition of an attribute, it's name, whether it's replicated, how to replicate it, whether it's clamped to another attribute by default, etc.
i spawned a simple cube blueprint and it worked correctly
even
now just apply that to your system
Game Mode -> Begin play -> Get Holes -> For every hole, spawn stones.
with the stones being a replicated actor
Im using this Get Game Time in seconds at the start of my function here to see how performance intensive it is, every time i go back to this function time goes from 4, all the way to 15, and it keeps going up and up and up the more i press this button, does that mean it gets slower the more I come back to this function?
this just return you the game time
if you craft 2 seconds after the game start, then the time will return 2 seconds
if you wait 12 seconds later before you craft again, the time will return 14 seconds
you shouldn't be worried about performance at this point tbh
and if you do care, you would offload the heavy stuff in cpp (like iterating over large data)
other than that, most stuff is probably negligible.
it worked correctly all 4 cube spawn and are the same on both player so the problem is my stoneBP that's where the problem is coming from
i wanted to add water splash using niagara when a car passes through the water puddle, i am new to Blueprints, is this the right approach, if not can you point me to the right direction. Thank You
how would I offload the heavy stuff in cpp?
I dont know c++
do you like offload them via an AI or smth?
you learn it or you live with bp limitation
or some automatic way via the unreal packaging process?
How can one order components, so that the tick of 1 happens before another?
Again, you shouldn't be worrying about optimization at this point
do you think that this is 'heavy' then?
nah
now this was the evil for some reason it doesn't work with replicate
but someone here earlier told me that this is doing like a thousand iterations
not sure how others done it, but you can probably disable tick and just tick them using a manager
more multiple of thousand iterations
an actor or a component that have a reference to the components you want to tick in order and just call the TickComponent in the order you want
One of the components is the character movement component, so I don't really that tick
Why would it, don't use construction script
๐
Make a Mesh variable, set it to Replicate
OnRep_Mesh -> Set Static mesh
that's it
and I'm trying to follow a sample from epic (GAS), they seem to have done it that way;
That is, they have a specific component that is aimed at ticketing before the Cmc (Character movement component)
theres a loop in a loop here, so that can make your iterations more, but it depends on how many items are in the arrays you are looping
usually a foreach is faster in cpp with a normal loop
why please tell me i wanted each stone to have variations
engage offload his BP loops to C++
And? That will run differently on each machine anwyay
30
so i learn the down side of construction am new
You let the server decide the variation
Client just listen to the data choosen by the server
anyone? ๐ข
Don't use OnConstruct...
BeginPlay and OnConstruct is not the place for multiplayer
30 items ?
if you want to see the same thing, you have to wait for the server to send you the data
ok so 30 keys isn't bad, what about the loop inside the loop
OnConstruct will run way before the server can tell you anything.
okay how would i do that you know i have different stones for example gold, ruby silver and so on and each player has their own
Have the mesh a replicated variable
OnRep->SetStatic mesh
call it a day
Server sets and choose the mesh
30 slots in my inventory, each slot can have quantities stacked up to 20 so imagine
if you carry wood, you could carry 30*20 = 600
600 is your ๐ชต
it's probably a piece of cake
you can just populate your item and do a test
Heavy stuff is like spawning something
now are you actually carrying 600, or are you carrying 30 with a value of 20 in it ?
what is content ?
and you use that ๐ชต to make maybe a wooden house for example, thats what the second loop is for, it's for the crafting & ingredient calculator/inspection system
content is only 30 slots
Spawning a lot of actors at once will hitch your game
BP loops run on the same frame
you want to distribute spawning large number of actors in a span of time
i dont realy understand how to set this logic but i will let it go and and use 1 stone variation to make my life easier
Create an actor, call it BP_RandomizedMesh
ehh, I will do one quickly
one way to make this faster i think is to use cache on the keys array, because as of now i think it constantly gets the keys for each loop
but what if i have few actors, but say one widget actor could create loooooooooooooooooots of tick bindings aka regular binds, say i have a lot of texts and Im using "Bind" to update them every second (rather than exposing that widget component on spawn and making it instance editable and updating it manually in the event graph), that is ticking too much right?
yet that's what most youtubers want you to do when you follow their tutorials, and that creates a lot of complexity & confusion over the long term, down the line.
so content is thirty slowts, how many keys in the ingredients that you are looping through ?
personally i don't bind variables to the widget, i just update the value when necessary
ig if you want it to just be updated, binding is np
I might end up creating like 100 craftable items, i dont know yet, but so far I only have 2 craftable items created in this early stage of the crafting system @lofty rapids
but i would definately put in c++
make a blueprint function library, and offload the loops
what do yall mean by "offload"?
okay thanks
basically just replace bp nodes with c++ nodes
how would that be makign it any faster?
c++ runs considerably faster, especially in loop scenario
@fading sentinel
oh, but its the same nodes?
you can create a BFL. you code in c++, then you load the editor and you can use the code you wrote as nodes in bp
no c++ is different stuff
Create a bp actor, lets call it BP_RandomisedMesh , SET IT TO REPLICATES
Create a variable of type Static mesh called RandomReplicatedMesh -> Set it to RepNotify
OnRep-> SetStaticMesh by passing RandomReplicatedMesh
the OnRep function
gonna work on my own bug now. If you can't replicate this, read the pinned material 12 more times.
@fading sentinel
OKAY THANK YOU I WILL GET TO IT BUT LET ME EXPLAIN
StoneBP (parent for all stones )
StoneGoldBP (has 4 variations of different shapes)
StoneRubyB (has 4 variations of different shapes)
and so on
each player will have their own stone which will spawn on their holes just like the images i shared
so what i want is that when gold stone is been spawn it will be a mix of all 4 variations
You can have any kinds of logic here, the point is the server is the one to decide what mesh it will be and client simply Sync the world by the data given by the server (e.g. setting static mesh to the incoming static mesh ref set by the server)
just understand the basic then you can incorpoate what ever you want to do above
okay thank you so much
followed u on X
yes and it was well worth it, i was slowly migrating more and more into c++ before i took a break
I said it CAN, depending on the scope of your inventory, your crafting system and ingredients
we talked about a hypthetical 3000 slot inventory system
and with the loop structure you have, it means that each recipe item will worst case loop the entire inventory
its a worst case hypothetical.
I suggested making the Inventory the "outer" loop, so your worst case is reduced to O(n)
meaning worst case is only a single full iteration of the inventory
pretty sure your current setup is n^2 or close to it
feel free to refute it ofcourse, I may be wrong on some parts of this
it's quite easy to setup a test for this
If your inventory is max 30 slots then this can be negligable, depending on how your code gets structured and when and hownoften you call the different functions
"If the inner loop's bounds depend on a different variable (e.g., m), the time complexity would be O(n * m). However, if both loops depend on the same variable n, like in the example above, it is O(n^2)."
My suggestions removes the inner loop
And with a Map lookup cost of O(1), the only thing remaining is , as I see it, the O(n) for the only loop thats left
idk much about O notation, but O(1) is great, and O(n) not so bad
O(n) is way better than O(n*m) ๐
If you pay some more memory and code complexity you can make it cheaper
Down to something close to O(1)
either way c++ is a good choice
just for future proofing
in case you have a bunch of stuff
No doubt , but if its not in their skillset , it limits that option
also #multiplayer <-- theres a channel specificially for multiplayer stuff because it's thats difficult
C++ just to add attributes and then I can continue using BP, right?
it seems simple, if I only use C++ to add attributes then I can use it ๐
I can't update the lock thing
I have this problem now....
This is where Im changing the state of the button at the bottom of the crafting menu
it does update the numbers but it doesnt update the button, unless if I go click on the slot again
"unless if I go click on the slot again" What slot ?
check when can you craft? is running
check with a print string
weird its not updating untill you click again, i'm guessing it just isn't running or maybe something with the display
so the first time you click on axe it says locked ?
these visuals are impressive btw
because it's not made to update until i click again, but the tricky part is how, because I already tried to hide the dirty mess by collapsing or ***hidding ***the dirt under the rug, temporarily until you update it again the next time, so you only will see this window if you click on a slot each time you open your crafting menu, it will be reset back to nothing, and every time you open your window you have to click the slot again to refresh the button
I have a suspicion that this might be related though.
because you recreate it every time ?
https://www.youtube.com/watch?v=sdqJy3JzFzA&list=PLoReGgpfex3woa35rnoXRyF9N3_p7QVQ2&index=9
I would have to do the calculations in C++
Unreal' s gameplay ability System, better known as GAS, is a fantastic system to create actions for your game characters. almost any real-time Combat system could benefit from using it. It's just sad that there isn't much documentation from Epic games to make this easy to learn. Which is why I will try it myself, to take you through all this ste...
No actually I stand corrected. I tested them, and they are both valid but somehow they still dont make the collapse thing work
I dont recreate everything
So the Crafting_Menu is this
Then we got the WB_IngredientsView
when do you run CanYouCraft ?
can't this be done with BP?
Then we've got the slots that are being created, and inside of those only when you press one of the slots, thats when the update on the Craft button happens
And then on clicked I have this binding which Im not sure im ever using it anywhere, idk how it owrks
I think I was supposed to use that binding but i actually ended up maybe using another one. I followed the advice of a guy called @dawn gazelle from this channel
idk how it works
๐ค
HOW IN THE WORLD IS THIS BUTTON WORKING THEN????
By whatever its bound to
what does update crafting data look like ?
This is like showing that 2 + 2 equals 5, and calculators start doubting themselves
that's not the same thing lol
looks like it's a function that you made that runs when you click, here you bound it
I'm following an epic sample (GAS), where they seem to use actor-component-order to make sure 1 component ticks before another
How can I do that though? re-order an actor component before another?
yeah
Okay I tried a new thing, you guys gave me a good idea, but it didn't work again. @lofty rapids @gentle urchin
Still needs to be updated from the slots. I still don't know how the slot buttons work at all. Or what that bind is supposed to do because it's literally referenced nowhere as seen here.
So the thing that is doing the Update on my craft button is supposed to be the "Can Craft?" function
It should idealy update before its clicked
Imo anyways
Whenever crafting menu is opened, the avaliable recipes should be sorted first
Its as if you're looking through someone elses code
Copy pasting or duplicating tutorials only go so far if you dont follow along whats going on and why
So that's where it updates the button!
I copy pasted Datura's advice
and many tutorials
and edited them heavily too
Creating simple diagrams of what tou expect to happen also helps figure out why it doesnt, or what needs to be callen when
exactly
Encapsulating that visual flow chart into functions lets you focus on specific problem solving
And then we're getting back to this...
Not even the "Update All Crafting Slots" does anything anymore?!?!?!?
Although that is not supposed to do anything about the button I think
i would of probably left it how it was working, but run the can you craft again whenever you wanted to see it
it looks like a complicated process, thats a lot of copy paste lol
Can Craft is a function in the inventory, it's not really doing much with the widget, despite changing the quantity after counting the ingredients for each recipe. The inventory_system component is not really related I think. The functions that are related are those that are directly contributing to the button properties change.
i thought this was doing the logic
for craft or lock
atleast it sets the text, i don't know about lock image
i've been trying to make this little graph to spawn free/opensource vegitation on a voxel world.. located at 0,0,0 but i cant seem to get the voxelworld actors particulars such as radius.. probably because there blocking it as they do with every thing ...
but it does work well enough with the just current characters location makes a nice spikey ball of meshed together items .. but i need to figure out the vector of the voxel planets center .. Narator: surely they will not block that.. right stanley?
Correct. C++ does make some other things easier. But the entire point of GAS is to also be designer friendly so that gameplay scripters can create things easily as well.
but yeah if you did a line trace towards the top of the debug line it should collide with the planet surface giving you a defonate location
to spawn what ever the f you like
the way i am trying to work is the 20000 random areas would then be getting some spawned actors/meshs/etc
I can't edit last property for the data table i made, it says its not editable and im sure as hell it is. Any idea why?
What is a save game checkbox?
because is object ref not a class ref
change it from object ref to class ref
It's a marker used for serialization. If you use an Archive without savegame, it'll save every single property on the class. If you use an archive for savegame, when you write this object to it, it'll only save the ones marked SaveGame
Thanks that did it
Pointer wasn't set at the time it was accessed. If it's okay and you don't want it to do anything you can simply IsValid it. If it's causing problems you'll need to run logic on different events.
this is handling my crafting menu
well im already doing IsValid?
Validated Get is the same as IsValid, right?
It is. But you're plugging in the not valid side too.
Thanks for the help
yes because earlier it would stop at the is not valid
aka if something wasn't valid, the entire line of code after it would be terminated
**necessary **line of code
Which is fine. You can use sequences for that.
sequences why? sequences where?
If you use C++ at all, I have a blog post that might interest you if you're into SaveGame stuff.
- Sequence
- Check IsValid and do something if it is
- Do something else even if the IsValid fails
I am not fully utilizing C++ for the save system, but it would be beneficial to learn C++.
These might help a bit. Understanding the method makes your savegame code extremely easy to use, and even project portable, cause it doesn't really care what objects you're saving. It all just gets written to a byte array and pulled out based on what you call it on.
https://brandtborges.wixsite.com/authaer/post/saving-games-smartly
https://brandtborges.wixsite.com/authaer/post/uobject-serialize
ฮ don't wanna do something else if the isValid fails, I wanna do exactly the same
- Sequence
- Check IsValid and do something if it is
- Do other things regardless of whether the IsValid is true or false
The links don't work.
then there is no use for the isvalid because you don't do anything different after
๐คทโโ๏ธ They open fine on another PC here.
weird, I think it's internet issue from me
yes but isn't it supposed to get rid of those log errors????
Also, doesnt that mean that the sequence would also be not needed in that case? no use for the sequence either
possibly if you use it the correct way, it doesn't make it valid if it's invalid, it's still invalid
so if you try to use it and it's empty then you get those errors
so because you try to access it even after if it's ben invalidated so you it pops up
yes but if its invalid it will use those nodes? and is supposed to continue with my function forward
the circle i circled will do the same thing if valid or invalid, and if your trying to access an invalid well thats the point of isvalid, you don't access it on the invalid path
what do you mean you dont access it?
if i put a break point in this line of code
all of it will look like it's completing its course properly
but the last thing will not work
on the invalid path you don't
my function would end waaaaay way too early and exit this code through a "is not valid" execute if the "Is not valid" doesnt get hooked up to anything
which is a problemif you need to access that variable
it's empty and you most likely need to fix that
and the reason why I get through the trouble to do all this is because im trying to make this set visibility collapsed thing work
this is all too much at once
if your variable isn't valid you could make it valid
what is this variable ?
Im trying to set hidden or collapse this widget
and only have it visible when you press the button
slot button
i c
Why isn't this working?
the value is 1 but after setting it when I print like this its showing 0
Also the array length is showing 0 when I added an entry just here
the array element is a struct
how?
well by the looks of it you misunderstand what is valid is doing
you use twice the wrong way
can i force a variable like that to become valid?
i mean a lot of times thats what you would do, on invalid, make it valid
but it depends what you want to do
Find is a copy. To affect a Map entry, you need to Find it to copy it. Alter a local copy that is saved. And then add that copy back to the map with the same Key.
Thank you!
@lofty rapids this is what im trying to do
but these invalids are confusing
i'm not getting it really i see you want to show hide the widget widget i would figure you can just use visibility
step 1) create crafting menu. aka all this entire thing
step 2) create the ingredients widget , aka the 2nd box on the screen on the right side
no
thats step 3
step 2) create update via clicking on one of the slots
step 3) create the ingredients widget , aka the 2nd box on the screen on the right side
and update the button down there
I have a question, for some logic I need to access all actors of class in event tick and I honestly don't know how to avoid that. In short: an actor is allowed an action when a condition on all actors of a certain class (which are 64 of them) is true (so now I do on event tick a get all actors of class and do a foreach and set it to true or false and then break when its false (and then it tries again obviously) or when all are true then a main variable gets set to true and then it stops cehcking until I tell it to make it check again.
I guess this is a bit vague. I can explain further if anyone wants to help. Any help is appreciated
ok i just realized I can just set that ingredients widget to invisible
from the craftingmenu itself
is visible? false
i mean from the designer -> details
oh, It's already collapsed
64 is fine probably for testing purposes. Or even small projects. You probably won't notice it. Keep in mind the GetAllActorsOfClass will only pull the specific 64 of that class you have, it doesn't go over EVERY single actor to get them, so it's kinda quick for smaller sets of actors.
That said what you can do if you want to avoid that, is make a setter for your actors in some sort of global place. Manager for them, somewhere like a gamestate component or something. What they can do is register to two arrays. All of them in one array. And then all of them that are true in another array. At this point all you have to do is compare if All's count is the same as True's count which is a much faster comparison.
Another alternative is making the true/false setter call some manager where the function is ran to iterate over all of them. That way you're only running the logic when one of them triggers to true.
I see, thanks!
Also, on top of this. One piece of advice I would take to heart is not to care about optimizations until you have issues. I can almost promise you that a BP iterator for 64 actors doesn't cost much for checking a boolean. It probably registers as less than 0.05ms on a profiler. Optimizations are always good if you know how to do them, and if you're on a learning path, for sure go for the harder route. But also try not to get stuck in optimization phase because it'll kill your design progress.
Yea Im noticing that, I've been stuck in refactoring for weeks now because I kinda let it ran and now I can't stop ๐
I had sizemaps of 1gb so I definitely needed some rework, but the sizemaps are 80mb max and those are just a couple of classes. Also reduced dependencies a lot so maybe you're right and should let this one slide
The profiler you're talking about, where can I find that one and at what treshold should I be careful?
Unreal Insights. You can access most of it from the stuff here
Just write optimized code, so the profiler stays useless
I want to like StateTree, but I'm not sure how much of a fan of it I am right now. Like I love the UI. But making simple AI turns into a disaster quickly without custom stuff because parameters are annoying to use.
I too like the ui
If a variable like this is invalid, that's almost always because that variable has no value set in it. To "force it valid", you need to SET it with a reference that is valid so that it has a valid value set in it.
Not to much else
Didn't realized I got replied, but basically I'm trying to make a ledge grab, and while in the air state I'm not sure what the best way to detect if I've hit a wall
I guess is there a way to detect if I'm physically interacting with a surface at all?
usually i think done with a line trace
so then I can run some traces to figure out what surface it is
not sure if it's cheaper than just tracing every frame
another issue with tracing every tick is then it's prone to loss of precision at low frame rates
if something has to be evaluated every tick then so be it
you will need to apply sub stepping for closer result
Lower fps computers applies more sub-stepping, the result will be more accurate but at the cost of more cpu power
question, how do i access the material boolean parameter in a widget BP?
look into dynamic material instances
ah but you cannot access the static bool, the entire point of it is to cut out unnecessary parts of the shader
you will need to use a lerp node instead
as long as the value you pass in is 0 or 1 it will work like a bool
Super simple problem I'm struggling with. I'm using a very simple fade to black/fade out widget animation which I want to have trigger certain actions once the widget reaches full opacity. But I don't see any way to add an Anim Notify, only Event Triggers, but those don't seem to be used in the same way. Anyone see what I'm missing? Note that this is for a Widget Animation, not a mesh animation.
ohhh ok thanks
play animation has a return value iirc, I am sure you can just get the length of the animation from there and then stick it into a delay node
You'd use the event triggers. You bind them to events in the widget and have them do what you need.
oh nice
I tried this but couldn't figure out how to reference them from the blueprint?
that's a little odd, opposite of how event dispatchers work
but to be fair, they are called event triggers, not event dispatchers
Hello got a issue I'm trying to resolve, would be nice if someone helps out. Thanks
My goal is to get the cursor centered with an object in the map.
I have a object that gets projected to screen 2D vector. From there I get my viewport size and save it for later.
I need to figure out my actual cameras viewport size which allows me then be able to determine where my cursor will be set.
Using a equation from online I take the camera H FOV and divide it by 2; input that into a TAN node too then multiply by my desired camera distance. This gives me my output that I multiply by 2 to get my Cameras Width. Except I seem to be off on the X axis by a lot.
Any clue on where I did my math wrong or am I calculating this wrong?
if you don't get answers in here #game-math might be a better place to ask
This worked, thank you!
wait question, for the dynamic material instance on that screenshot. Is charge radial a texture or sprite?
sorry not charge radial
i meant image charge
I'm not sure what you mean, it's just an UMG image widget
it doesn't matter as long as you can assign it a material
right
guess wrapping my brain a bit on figuring out where to slot my sprite in that
though i know sprites are basically just textures with UV Coordinates
question (unsure if it goes here) is there a way to just desaturate images in a slate UI?
hello, my charcter seems to shrink after ive opened a door? how would i find where to fix this?
look for nodes that set the scales
you can open a blueprint asset, type set scale on the search bar then hit the binocular button
look for classes that you think responsible for setting the scale of the player
okay thank you. its so weird he just halves in size after entering a room
you want to note when the character start shringking and track down the events that lead to the player shringking
ok new question, is there a way to extract this from a sprite datatype in blueprints?
where is even this?
got it, my teleporter scale sets it back to 1, and it had to be 2 to maintain the same size, thank you
you asking me or Raidz, ColdSummer?
others have answered but basically you need to do a multi trace system on tick.
It won't cost much but it gives you real time accurate data.
First a trace in front of you, it can either be at chest height or above your head. -> on hit, if true, there's an obstacle.
Second trace is slightly forward of that first hit and this time from above down by a magnitude that you judge to be your ledge grab tolerance. For a UE mannequin, 100-200 units is more than ok. If it also hits, you have a ledge.
Third trace, if you want it, is to trace at the second point for a capsule trace as big as your player capsule. This checks if you CAN climb it or just grab it. If it hits anything , then no climb.
Was thinking of trace, but there would be some odd scenarios, such as approaching a cliff from an angle that could cause it to fail
add more traces that cover critical angles
that's what i use for a 2d ledge grab, wall climb and such
@frosty heron did you ever manage to retarget in 5.3 with ALS and VRM? There seems to be tons of rework needed with VBs
Compared to them? Sure. But there isn't really much comparison going on. If you need a box trace, you need a box trace. You can't replace it with line traces.
I forgot what this blueprint type is called, but it's used a lot for interaction systems. Like, you can add the interface to a blueprint object, implement the method, then locally implement the logic on that object. Then you can just check for that interface?
i think it's actually just called an interface right lol
you got it
@autumn pulsar basically as expensive as a penny on a dollar.
on top of this, say i have multiple interaction interfaces on a blueprint object
i can call the interface implementation method on the object, change data on the object, then have another interface implentation method on the same object that'll use the changed data right
like two interfaces, separate implementation logic, uses same changed data
on the same blueprint object
For an on overlap event, is it possible to generate overlap events for specific collision shape?
Sphere overlap actors, box overlap actors, etc
Trying to understand unpossess,,,, To the best of my knowledge the player spawns an AIController then spawns and possess a Player Controller.
At this time the AIController is just dorment. But, if you unpossess the PlayerController it falls back to the AIController?
Is this correct?
A player is a player controller - that's the basic thing that represents a player. Pawns are possessed by controllers.
But, when the game starts theres is a dorments AIController sitting aournd?
When you unpossess a pawn, it's disassocating the control a controller has over that pawn.
"Auto Possess AI" is something set on a Pawn. You are saying with that setting currently "Whenever this pawn is spawned, spawn an AI Controller for it and possess it". So that pawn is spawning its own AI Controller when it gets spawned, and if you happen to possess that pawn with a player controller, that AI Controller could still technically linger.
So how do you get back to the AIContoller?
You'd probably have to store a reference to it in order to keep track of it before possessing it with a player controller, and when when you'd want it to swap back, cause it to possess that pawn again.
So I have to make another actor?
Here an example, when I set the AI Controller Class to None, no AIController is Spawned to just hang around. My understanding is it was suppose to revert back to the AI Controller when you Unpossessed.
Of coursei if you set the AI Controller class to none, no AI would be spawned as the class isn't valid.
There's no logic that I can see within the engine that would make a Pawn automatically get repossessed by the AI Controller that spawned for it by this auto-AI possessing pawn setting
No just type it in. they're nodes
I could be wrong, but I don't think its getting repossessed by the AI... I think the controller is the AIContoller and when the Player Controller Possess a pawn its using the Player Controller... Then when you unpossess it just falls back to the default which is the AI Controller normally.
I can be worng...
Right, there is nothing in the engine that makes the AI Controller repossess the pawn it was spawned for.
If you posess a pawn with a PlayerController that was posessed by that AIController, the AIController is no longer possessing that Pawn and the engine has nothing built in means to re-possess it - you'd have to build that out yourself (would involve creating a custom AI Controller class, keeping track of the first pawn is possessed, and keeping track of what is possessing that pawn, and if nothing possesses it, possess it itself)
When you say, there nothing in the engine. Do you mean you've looked through the code? Not sure what you mean... Thanks
Yes... Looked through AIController.cpp, Controller.cpp, Pawn.cpp, PlayerController.cpp
Ah thanks
Here's what this would look like in blueprint for an AIController to repossess its first controlled pawn (and also destroy itself if its pawn no longer exists!)
Ok, thanks... I know there's a video of switching characters... I'll go have a look at that... ๐
Looks like I was led astray by AI... ChatGPT said I'm correct and two other AI's say you're correct. For the record Epic only barley mentions Unpossess in their documentation... ๐ข
It just weird they keep the old AI Controller around by default.
Not really... Most of the base classes are set up to allow you to configure them how you need without much in terms of behavior built in. Like in your case, it may be important that the same AI Controller is possessing that same pawn, but also maybe not and in that case, you could destroy it when it no longer possesses a pawn, and you could actually cause the pawn to create a fresh AIController for itself if it ends up with no possessing controller.
Like this?
Do I also need to validated get it and direct it in both cases to execute the rest of the code??
Why is target of that Set of my Character Movement requiring reference to AC_Crafting??? It shouldn't have anything related to that. Target should be compatible with "BP_First_Person_Character" reference
No.
If something isn't valid, you can't use it as a reference to itself to then make it valid.
This is happening because the particular SET that you got here would be for setting that value within an AC_Crafting component reference, not within the current object class.
So I need to find one that is coming from the character?
No. You probably shouldn't be messing with storing references anyway.
You have a reference to "First Person Character". Assuming that is valid, then you should be able to always get the "Character Movement" from it.
but you told me I should use set, no?
You asked how you make a reference valid.
get or set?
If you want a reference to be valid, you have to have a valid object set in it.
why not make it valid? sounds like thats what i gotta do
Again... if you know for certain that "First Person Character" is valid, then its "Character Movement" reference should be valid too (only because it's a component that is built into the character class, so it's basically guaranteed to be valid)
If "First Person Character" isn't valid, then you can't get it's Character Movement from it.
why would it not be valid?
then should I just set "first perosn character" too?
that sounds hillarious but wrong
It would not be valid if you didnt' set a valid reference into it.
Or if the reference you had set into it is destroyed at some point.
nah it wouldnt be
so i guess the character movement reference should come from Variables > Default or from Pawn > Components > Character Movement right?
but I didnt find GET character movement there, only SETs so I guess ill get it from Variables > Default
This is a "GET" of the Character Movement Component that exists on the "First Person Character".
You do not need to keep track of it again if you have a valid "First Person Character" reference.
alright then that works
so from there I need to get that character movement or set it?
You tell me... What is it you want to do?
Any ideas why the AI MoveTo is not working. No On Fail or On Succes... Just coninues...
My movement point is at that red arrow:
I'm using 5.1, not sure the differnce
only used ALS V4 and VRM on UE4
rolled my own simple movement abp for UE5
Print the Movement result on Success or On fail
You also leave the Pawn empty
There's no success or fail.
print string before the node and the top
see if it get called
if it didn't get called at all, work your way up. Find out why the event is not firing
Maybe the pawn is the issue... One sec.
Its working now... I'm so use to leaving the target blank, that I forgot it wasn;t the target.
GetController -> Get Pawn
Feel like I've made that error before.
wdym by the widget should be overlayed on the current level or separate level
if you do hard travel (open level) your widget is poof
create widget
and then shut it down
and at the same time also do this disable thing at the end for the 2nd box
So you have two boxes at the screen of the wb_crafting_menu
This ingredients window needs to be hidden because the transition will not happen smoothly
i tried to find where that thing gets updated so that I can call it directly
because it seemed like that Hide Ingredients function didnt work properly
I put break points in EVERYTHING, and it goes over them
but somehow it still doesnt hide it
well.... the first time that I boot up my widget it does work, it is hidden, but thats because it is supposed to be hidden at first, thats the default stage of the crafting menu when you start up your widget
and only create the second window when you press in one of these craft slot buttons on the top left, like axe, hammer etc.
thats ONLY when the second window should be created
and so I tried to call this function but it seems like it's the same thing, one exists in inventory system, one on the ingredients view
also I have trouble understanding what your binding is doing, i tried to go over it but cant understand how my slot buttons work at all
@dawn gazelle This is the binding you told me to create
I need to update this somehow
or Hide it
hide it and then create it
Alll this was working
something broke now in my code
Well that spontaneously exploded from "Do I do a 'set' or 'get'" to an all of sudden "HOw do I make my entire system work".
and it all stopped working
i mean, the hide thing stopped working, thats it
I can either update it on spot
or hide it and recreate the slot again
because this button code doesnt update automatically
well, that's the reason why i need to know how to work that out
its either that being a reference problem
or something else
there's more than one ways to skin the egg
No... You explained everything you're trying to do without even referencing anything to do with thing you're having trouble with at the moment.
You have a reference to "Character Movement Component"... What is it you want to do with it? Do you really need to set it?
Can you just get it?
this is not very important
as long as it gets the widget to either update
or hide
That's what you asked me what you should do.
Without explaining what the problem pertains to... I am trying answer something specific and then you've asked me to solve everything else.
yes, set character movement component itself
so that i can keep it valid
alright then lets take it one by one
Is there a way to keep a blueprint component active permanently?
But the question then is, why do you think you need to set it?
thats exactly what we are trynna figure out lol.
or at least, a way to keep it active until something turns false
to keep it always valid
That's not what setting does.
ok then what do I need to do?
You cannot keep something permanently valid.
If it gets destroyed... It is no logner valid.
but character movement is character movement
If you don't have a valid refernece to begin with.... It won't be valid.
it is supposed to always be a valid component, right?
otherwise how would i be able to have movement
ohhhhhhhh wait
wait a minute
So specificially I need a component to be active as long as certain widgets are activated, and once on game start, I've got the on game start sorted, but then it seems to destroy itself, so I need a way to bring it back on certain events, and then stay active until that event finishes
It should be valid component of a First Person Character, so long as your first person character reference is valid.
I dont think its about the reference
because in this widget logic
When im pressing the button
It's all about references if you're talking "valid" or not.
im also turning off character movement at some point
because the widget is in your face
and you shouldnt be able to move
so i literally actively turn it off!!!!!
because thats what I need to do, but then why is it invalid if i also turn it back on?
Ok, but activation state of a component doesn't change a reference and would not make the reference invalid (or valid for that matter)
ok so why is it then getting invalidated?
What tells you it is going invalid?
the error log at the end
And I've given you a copule of reasons why it would be invalid...
The "First Person Character" reference could be going invalid, and therefore you can't get it's "Character Movement" refernece because it would no longer be valid at that point.
Either that, or the "Character Movement" itself went invalid because it was destroyed or somehow removed from its owning character.
does any one know why my mesh is disapearing at certain angles?
Itโs like showing fish can climb trees
It's only one really... It's because the first person character reference is invalid, and attempting to get anything from that reference and use it would also be invalid.
im finally glad to now know that were getting to the bottom of this at least
(this is a major learning in unreal.... dealing with references)
but the first person character doesnt go anywhere?
wait
can i also do validated get on the character ref
Obviously something happens to it, or it was never set with something valid to begin with.
and then hook up both execute conditions on the rest of the line of code
and have it forced to go to the next node anways?
that seems like what i wanna do
You cannot just do a "validated get" and expect it to work on the "not valid" pin.
Not valid = it won't work.
references are sometimes just kinda stupid like that and they give you some random errors but i feel like i could bully it to force it to go where I want it to go
Not valid = "waht I have stored in my variable does not exist"
just intimidate it
The next node if you try to access it, it's like saying "Hey you, do something with this "NOTHING" please".
When you are expecting it to really be more like "Hey you, do something with this First Person Character please".
yes but in the non valid case it will still take you to the next node
oh okay
then if its nothing that means the next reference (character movement) will also be invalidated
You usualy don't hook up invalid things to the code because you don't want that empty thing to be accessed.
and in a domino fall it will invalidate everything in its course
Correct
so the question becomes, how do we "Abracadabra" make it always valid from the start?
What I can think of is somethign like this
- get controller first
- get character from that second
- now get the rest (character movement)
but this tower of references should have strong structural bases so that it doesn't fall in on itself @dawn gazelle
sorry i went to fry some bananas ๐๐ฅ delicious.
So imagine like Two Point Hospital. When you go to the map, you can click on other hospitals, and you go on that hospital.
See?
I feel like "Get Controller" should be a strong stable enough structural base to hold our ***Eiffel ***tower of references
If you open a new level the widget is poof, thats right...
But the level could be MapLevel. So it spawns the actual widget. You get me?
If you're already in the controller, you don't really need to get it... "Self" is the controller, no?
oh true
You could get the controlled pawn of self.
You may want to check if it is valid.... and if it is.... get component by class "character movement".... and again check if that is valid.... If the stars align and all things are valid, then you should be able to access them all along their path and plug them where you need them.
check if pawn is valid now?
Well, what happens if the player controller isn't possessing a pawn?
It's going to be invalid, isn't it?
hm, thats a good question
And thne if you're trying to pull a component off of it.... Yep... it's invalid ๐
Sup unreal bros!!
you are the expert after all
not me
but I feel like in my game it should never unpossess anything
because I haven't made any weird possession code logic for that
I'm really new to unreal engine 5 and I promise I will get better at C++ programming within 2-3 months!!
Hard problem here... I used the AI to Move to the Chair where I'm sitting, but the Camera stayed in the starting location. I've tried a bunch of things, but I'm not sure how to line things back up?
I'm looking to make some friends and do some programming
Well, that's on you to manage, but usually it's best to be aware that it could happen where that reference may not be valid.
And that's why you may want to do valid checks, and you could print strings on not valid to log that there was a problem.
so why when the game is paused will a blueprint component not receive any triggers even if the tick is set to execute on paused? I can however trigger events inside of it from the playercontroller...
"Get Controlled Pawn".
I never expected in my life reference variables to be so hard
"Get Component by Class"
This getter, is literally looking for a "Character" type of reference.
"Pawn" is a parent class of "Character", so you can't use a "Pawn" reference where a "Character" reference is needed, but you could use a "Character" where a "Pawn" reference is needed.
ie. All Characters are Pawns, but not all Pawns are Characters.
What triggers?
button clicked in a widget calls a function message in an interface. The receiver in the player controller registers it, but the blueprint component doesn't
Drag character movement into the BP...
But I can't get character connected to both at the same time
#1 is the widget, #2 is the component, #3 is the playercontroller
character can't have target connected to that "Get Controlled Pawn"
What BP are you doing this from?
You didn't tell it to run OptionLineSwitch. You told it to run SpaceEvent
Cause you said get all actors with the interface. And run the interface event on those actors. That does not propegate to it's components. The Controller at least is an actor and would run the GraphicsLogic components SpaceEvent. But you haven't run the interface function on the component anywhere.
nice example, but what If I dont wanna use a cast here for performance purposes?
Interface... Cast isn't a performance thing... Its a scalability thing...
You dont' need anything other that what I've told you.
"Get Controlled Pawn" > "Get Component By Class" (preferably with checking if they're valid before accessing them further)
Im making a simple point and click game.
When i exit my house, it should go to a map of village (WIDGET).
Where i then can click on to go directly to certain buildings.
Then you click on the building and goes to that level.
Can this just be a widget overlayed on the current level?
Or should be a separate level, called VillageMap or something
This happens because you're selecting from the "Variables" list, which is usually the "Variables" present in the current blueprint.
It can be just a widget over top, sure.
If you decide to stay on the current level, then that gives you the option of forgoing a map travel.
Two weeks not working. I should make a reddit account and go on a crusade against people saying not to cast.
๐
thanks. though what worries me is that the game keeps running below this widget, right?
thats the thing
isnt it better to create a level for the map itself
You can pause the game or set time dilation really low* (*thanks squize) (slowing things down to extreme levels where it would literally take thousands of real life years for 1 second to pass)
Any idea how to fix camera/boom position after AI Movement?
no, so as you can see in the ss, the one that calls the "space event" is the playercontroller, and that event is in the blueprint component, my test that I can trigger events in the componenet. However the 3rd image shows the component trying to execute code on receiving the interface event
No where in your screenshots are you running the interface call on the component.
Ok I realized what the problem was
hey guys, Im very new to unreal and Im trying to procedurally generate terrain using wave function collapse and would love any assistance in debugging this blueprint its purpose is to check the neighboring cells and remove invalid modules from the available modules array by checking the neighbors' sockets. Im not quite sure what the issue is but I think the Socket List sets are not updating even though in the blueprint debbugger it shows me the corrects sockets in the neighbors but when try to get those Socket Lists it doesnt return the correct ones. Here is the link to the blueprint: https://blueprintue.com/blueprint/vgb5lw3o/
But now for some reason I also have another problem