#blueprint
1 messages · Page 166 of 1
yep, now connect that last pin to the new value
okay
and.. done
ima try now
oh okay
just connected
i dont see any change
should i have the metahuman on invisible to start off
click compile, click save, click simulate (turn on simulate), play, see if the event is getting called
or i wonder if i need to tag all the components of the metahumans
no
mouse over the button then, if its being called it will be shown in a very clear way
are other parts of this bp already doing things that work?
can you see ANYTHING executing on it?
yeah
maybe select something from the dropdown that says "no debug object selected"
outside of the event graph, look at details of the widget
enable cursor hover events
maybe
that woudl be for a regular actor though
idk about widgets much
i would just hook into clicked or something you can verify actually happens
anyhow now you know a little about accessing specific actors and stuff in the world
okay so im gonna duplicate the node and tag the other character as somehting else
but i think both of them are still showing visible in the level
I'm having trouble with my event dispatchers. I was calling the dispatchers on the character pawn, and binding them in the level blueprint. And they all worked perfectly. The problem is I recently replaced my "GameModeBase" gamemode with just a "GameMode" and all of a sudden all of my dispatchers will still bind and call just fine, but not, execute the custom event in the level blueprint anymore? To clarify, NONE of these dispatchers are directly linked to the game mode, or need to be updated, in any way I see as in (update the variable from "gamodebase" to "gamemode"). But the swap some how broke my dispatchers on the level blueprint and only those? any help?
@cold crown I will go ahead and propose you don't use the level blueprint as it is poor practice and instead, use the game mode itself or the player controller classes. That being said, not sure why it fails. Consider using either print strings to see the flow real-time or add checkpoints in the BP to see if it fails somewhere
classic, its always right after asking ;D
it did take me a good 5 minutes to find this server in my server list too so maybe i am just blind
is it possible to have dynamic singlecast delegate? and if so how do I declare it in C++ and then access it in blueprints to call and bind it? BenUI's article on delegates says dynamic singlecast is possible but doesn't say how, and the standard method of declaring a dynamic multicast doesn't compile.
this article https://forums.unrealengine.com/t/how-to-setup-dynamic-single-delegate-with-retval-to-make-it-bindable-from-blueprints/764150 provides a solution for having the function be accessible from blueprints to Bind it, but doesn't provide any info on calling/invoking it.
Alternatively, do blueprints natively provide some alternative to this approach? I'm trying to have my music stop when the player dies, and rather than trying to wrangle references between the two objects, declaring a delegate through the gameManager just seems like an easier way to do it. but maybe y'all know of something cleaner
why not just make it multicast? gamemanager::onplayerdeath maybe more than one party will care about this in the future
that's definitely an option, main reason I'm resistant to it being that as I understand multicasts are slower(?) and I also just want to learn how to do this if only for the sake of understanding things better
well, considering that it doesnt seem to be a stock feature really, id say that IS what youve learned 😄 i dont forsee 100s of player deaths occuring per frame so the cost of triggering it is not really an issue
fair enough, ty
its annoying enough to setup a multicast delegate tbh, i recent did the same for a 'actor selection changed' event on my gamestate
It's complicated but I've done it enough that I'm getting the hang of it, this one didn't take much time.
granted the fact that I'm doing it so much leaves a concern in the back of my head that I'm overusing them and misunderstanding their purpose, but so it goes
yep love that article, it's how I learned pretty much everything I now understand about delegates, and also where I got the idea that a Dynamic Singlecast should be doable
ah. i got the impression it also had some helpers for setting them up more easily
I have a question I posted on the forums Im still looking for answers to.
https://forums.unrealengine.com/t/item-list-for-spawning/1858502
I am trying to figure out the best way to list a large amount of items that can potentially be found by the player. However the items don’t spawn or count as found till the player triggers a scan event via a button. At which point the game is supposed to check the specific point of interest the player is at to retrieve a list of items that can s...
I made a timeline to have an actor do a 360 rotation after a random "AI Move To" node, but since the timeline starts at 0, no matter the direction the actor is facing due to the random movement, it'll always snaps back to 0, how can I fix that? Am I correct to assume a timeline is not what I should be using here?
ive never used a timeline for anything at all. id assume those are for scripted sequences
and i dont know what your situation even is
Hey quick question,
I just asked a question on the unreal engine forms and got a reply, and I cannot find the documentation for the SetSkeletalMeshComponentPose function, could someone point me in the right direction?
Thanks!
Can you provide a screenshot of that function? Like does it say it has a target?
Hello, I'm having some problems with Loading and unloading levels, specifically game level and main menu level. whenever I load a game (from the main menu), everything works as should but for some reason when I exit to main menu, the level doesn't seem to load the main menu, it just keeps showing the loading screen. I can share a short screen recording if needed.
hi does anybody know how to edit visiblity for metahumans in game on a widget?
Hi
I am not at home
But does anyone know how to ease in and out without using timelines? (Float)
Stupid question?
Hi all, I'm new to the server (and UE5!), nice to meet you all! I had a question about level streaming, not quite sure where to put this but here goes...
I'm looking at setting up level streaming within our game, and I'd like help choosing between World Partition and World Composition. I believe these are the two choices, given the docs, but if there are more please correct me!
The game is a hub-spoke type game, it's fairly small scale (think 12 week game jam size). The hub has 3 spoke choices maximum, each of the spokes a small room.
Could anyone give me a high level steer on which of the systems would be best to use, and why?
World comp was replaced by WP
Use the newer one
hello, does anyone know how to fix this?
LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/UltraDynamicSky/Blueprints/Weather_Effects/System/Ultra_Dynamic_Weather_Interface.Ultra_Dynamic_Weather_Interface_C:UDW State Apply:State'. Unknown structure.
LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/UltraDynamicSky/Blueprints/Weather_Effects/System/Ultra_Dynamic_Weather_Interface.Ultra_Dynamic_Weather_Interface_C:Get UDW State for Saving:UDW State'. Unknown structure.
LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/UltraDynamicSky/Blueprints/Ultra_Dynamic_Weather.Ultra_Dynamic_Weather_C:UDW State Apply:State'. Unknown structure.
LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/UltraDynamicSky/Blueprints/Ultra_Dynamic_Weather.Ultra_Dynamic_Weather_C:Get UDW State for Saving:UDW State'. Unknown structure.
LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/UltraDynamicSky/Blueprints/Ultra_Dynamic_Weather.Ultra_Dynamic_Weather_C:Get UDW State for Saving:State'. Unknown structure.
Have you try using “IsVaild” to check if your variables are null?
Is it a bp struct by chance?
Yes, it's from Ultra Dynamic Sky plugin
i remember i added a variable in the struct then deleted cause i don't need it
Ah fun. Well bp structs tend to break as soon as you edit them, especially at runtime
i read that i can just duplicate it and it might fix itself
Yeah, give it a shot if you don’t have source control/can’t undo
Am I going crazy but wasn't there in the engine "Tutorial" asset that you can click and it would highlight pre-defined parts of the editor, like buttons, viewports etc. Is it still in?
By getting a ref to your button and change it's properties (brush)
hey so i have this error thet says "accessed none trying character movement" is there a way to reset charachter movment virable or something like that to fix it?
how to do that?
Show codes/picture
If you don't know how to get reference, you probably want to look at some (as much as I hate to say this) tutorials
hi everyone, is there a way to remove the content of a set variable?
Wdym by removing the content of a set variable?
if i get to false on the branch
there is no code that is related to the thing all i got is this error message and this mayby
The variable you declared there is a pointer
it says its valid
Click on your Character Movement and show full picture
i dont know where to look now and i am realy want to finish that
can you help me fix the code
No and that's not the way to do it.
i cant click on character movment
You might encounter a bug that occurs on 5.2 onwards then.
where CMC is missing and the detail panel is empty.
come on pls
so what to do?
is there any way to fix it?
how do i remove it then?
Learn how to get a reference to an object and modify it's properties @remote rapids
remove what? You want the pointer to point at nothing? simply pull out the set node but don't assign it to anything.
do i need to anounce the variable once and then just remove from viewport and add to viewport?
I think you are a bit confused, removing and adding viewport does nothing to your object ref.
but i have buttons here and not objects
Your buttons are objects
basically get your button, access it;s properties and modify it.
maybe you just didnt get what im trying to do
Eg SEt Brush etc
but i'll try alone and update, ty
Source control, please tell me you use them
dont know what it is
if not, set one up to prevent further damage in the future.
As for the fix (not guaranteed but since you are fucked anyway). You can try to reparent your base class to something else then back to the character base class again.
is it that bad?
if you don't want to lose your entire project, start using one.
i fixed it, ty
it's really bad to not use one yes, you won't even be considered for a job if you don't use source control in any industry.
ColdSummer pls can you explain me?
i try look for tutorials and i cant understand and connect to my situition.
pls try explain and help me
Guys, I have a hard question:
My character is moving in the level (incredible, right?), and I'd like to construct a mesh that would be the precise "tube" where the person was, as it moved.
a bit like this image, but extruded along the path where the skeletal mesh moved, and taking its animations into account.
Anybody got the slightest idea on how to do that?
This is actually for engineering purposes, not for gamedev. I need the tube mesh to be precise, not to have a very performant solution
ok thnaks for the help i will start using it, i kinde fixed the issue by reparenting the character and parenting it back, thnaks for the help
Even that fix can potentially make you lose hours of work from what I heard. With Source Control however, you can revert back to working commits.
I never encounter it because I am on 5.1
ye me charachetr wasent relly complicated so it only chnaged possiosn of some ibjects but ye its wierd
Yeah but imagine if you put months of work into it 😔
you would give a lot for a time machine.
I would say you are lucky to learn it the hard way early into the project.
? @frosty heron
I can't man, you are lacking the basic of blueprint communication. It would take a hand holding session for me to explain what you are missing.
skim thru videos and try to understand what they are doing.
what you want here is to be able get a reference to your objects (buttons, etc) and change it's properties.
Need help. I create a simple blueprint. which spawn an actor each x second. with a Timer Event.
I spawn my actor at a specific location. and i print that spawn is done.
but now i'm looking at the position and there is no actor spawn
so i put a print to see if the actor was spawn
Check your Spawning Rule (Collision Handling override)
If your spawning location intersect, it won't spawn the actor if you don't set the collision handling to Ignore Collision, Always Spawn.
a collision can block a spawn?
Read the Collision Handling Override
if undefined use actor class settings. i don't see anything related to spwn into the actor class settings
try setting this to alwasy spawn
Read >_>
that works with always spawn. but i don't understand why it doesn't spawn if there is a collision
What don't you understand tho?
why they will decide to not spawn if there is a collision
It's a protection from spawning things that already collides
So again, you gonna run into problem if you spawn something in the same location. The spawned actors gonna overlap each other.
It's a legacy from Unreal Tournament Days. You want to ensure you don't respawn your character if therer's something at that spawn locaiton
ok, because in that case collision was not an issue that's why i didn't understand why . but ok
Hi everyone
Im having this problem where when i spawn a box collision in beginplay and walking over it, it doesnt fire overlap events but when i add the box collision as a component then it works. Do i have to change any settings when spawning the box collision or am i doing something else wrong?
thanks in advance
i do have enabled overlap events and set to overlap all dynamic when spawning
Click on this node, you will see the component settings in the detail panel. Make sure the collisions are set accordingly.
i did set everything exactly same as the working collision box, but still its not firing the overlap events
and how are you calling the overlap events when adding the component in Run Time? I don't see any binding there.
this is how im calling the overlap events
Btw you never attach that box collision?
When you play in Editor, Open Console -> Show Collision
make sure that the box collision is where you want it to be.
just from the little material given here, it seems your box collision is spawned at the world origin 0,0,0
just checked it. not sure if its visible in the screen shot but the collision is there as well. Also just to test i changed the collision responses of the player to block and it does block me. so ig the collision is there but for some reason overlap events wont fire
got it fixed, apparently the component wasnt activated when spawned and i couldnt activate it in beginplay either so had to set auto activate in cons script.
i wonder why tho, its the first time i had this issue when trying to spawn a component inside an actor
Hi there,
I need an advice/help with kinda a simple feature that I want to implement.
So what I have are 2 same BP Actors on map. BP Actor is 3D Widget; and the BP Actor has a public variable of Tag.
Each actor on map has a different Tag value and what I want is that when I get the Tag value of one of the BP Actors I want to change a value of custom Enum. What do I need to do and how?
I know I may do an alternative to this kind of problem, but I want to try it with this kind of settings, I guess.
In Editor Time or Run Time?
idk, what are those? 💦
Do you want the change to happend when you are in the editor or when you Play the game.
Play the game = Change is not presistence, only for the duration of the game.
I guess in the Editor
Not with blueprint then.
And if I want the other option, BP will work with it?
I mean, that wil just be checking if Tag == X , set Enum to Y
what do you actually struggle with if you want to set the enum at run time?
what I want is
when I click on button in BP 3D Widget Actor by Widget Interaction, I want to get the Tag value of the of one of two same BP Actor (3D Widget). When I get Tag X1 I want Enum X2, same with Tag Y1 to Enum Y2, e.g.
Get a ref to your actor, get the tag and set the enum accordingly
ok, but idk in which assets' event graph I should put in
w/e object you actually want to grab
what is w/e? 😅
stands for what ever
Ok thanks 👍
if you want to iterate over all of the BP actors (eg the character), you can use get all actor of class. But I don't like this way and would prefer for the pawn to register it self to an array in a manager at beginPlay()
you can then iterate over that array instead
Is this only debug toll or this will work in the final live project?
I have a problem with the "Interface Blueprint" I created an Interface Blueprint which is inside the UI and after I click the button it activates that interface event in an actor but it doesn't call it how can I fix it
I'm trying to disable player input while dialogue is happening, but I'm running into an issue. Right now, I'm using the "Disable Input" node which works okay, but if I hold down a movement key during the dialogue, the input action fires all pins continuously when the dialogue ends
I think you might need to pass use the refernce to gire the event in the right blueprint.
Today i opened one of my Character child BP and when selecting its Mesh component, the Details pannel is empty. Any idea what may cause that ?
I see a lot of tutorials for minimaps but none of them go into details with how to deal with situations of internal locations. Anyone know a simple way to have the ceiling not show up? I saw there was a clipping plane option but it LOOKS like it's not the near plane for some reason?
Any idea why Radial Damage doesn't work?
The Apply Radial Damage is functioning, but the hit actor is not receiving any damage
neither AnyDamage nor RadialDamage event was triggered
anyone know how I can add a box component kind of dynamically without add them to my BP actor ?
Tried this but didn't seem to work
As that was what I ended up getting from it rather then an actually box component in the world
@raven nest I have the same issue, my current theory is that I should not have a camera above the real map, but have a copy of the map like 1000 units down. And all my actors have a sprite that is also 1000 unit down
This is what the "camera" will be filming for the minimap
did not have time to try and do that yet though
oh and, this copy of the map does not have a ceiling at all ofc
It also helps that I do not want to show actors, but symbols. And create a sprite on my actor and "hide from owner" does not work for multiplayer, since you'll see pawn that you dont own all the time
Hi, i can't find Blue node in material "ObjectLocalBounds", i have ue5.3 and it has only Red one, i need it for Fog
Is there a way to replace it?
I actually just realised that on top of having Clip Plane Base in the Screen Capture2D, there is a Custom Near Clipping Plane value in Projection>Advanced. This does the trick for me in the end.
a bit stuck. I want to play a widget text animation when I approach an interactable item and the "press E to pick up" text appears. The text appears properly, however the animation doesn't play.
(widget)
Blueprint Runtime Error: "Accessed None trying to read property TextWidget". Node: Play Text Animation Graph: EventGraph Function: Execute Ubergraph BP Pizza Box Blueprint: BP_PizzaBox
where are you setting your text widget reference
right i forgot to set it in details of the variable
That won't work either
You need to refer to a specific instance of a widget.
You can't know that at compile time. Your reference needs to be of the one you spawn
it's still a bit difficult for me to plan things out and understand how to reference things
not even a bit tbh
I'm running into an issue where I can't seem to get the widget interaction working with my actor.
I have the widget interaction component on the character and set to press the pointer key for the left mouse button when you try to interact with it, the print that I have after it is being called.
I then have an actor with a widget component. The widget being used has a button that should print out some text when clicked but it never is being called.
I'm sure that I am just missing something simple, but I can't for the life of me figure it out. In the past I had been able to get this working, on another project
Can you post an imagine of both side of your interaction?
This is the widget and the event:
This is on the character:
It prints the 'Click' but nothing else
So the actor reference is invalid. How are you obtaining the actor ref?
Which actor ref are you referring to?
Is PressPointerKey supposed to set the InteractableActor ?
Ah no
The interactable Actor is for interacting with items in world.
If there isn't one that you can interact it will try to interact with a widget.
I have it this way so you can't interact with both an item and widget at the same time
Ok so the widget is not receiving any input when it should be right?
Correct
I don't have anything special on the actor that has the widget, I just created it and added the widget
Im curious, on the button do you have the visibility set to Not Hit Testable ?
Nope
I had already checked that to be sure, but its just marked as Visible
I'm thinking that I may be missing something in order to get this working.
All that I did was add the widget interaction to the player and add a widget component to a new actor.
Then I added the Press Pointer Key to the interaction event which is being called since the print string after is being printed each time I try to interact
Maybe the interaction component isnt tracing correctly. In the class defaults for the interaction component are some settings for tracing.
Channel, distance, source.
Show Debugging, try this and see where the line traces are going
I have the debugging on and it is showing up when I look at the widget
A rather large red dot
That component is on the player controller right?
Im not 100% sure, but its prob fine on the character.
The component has an event "OnHoveredWidgetChanged" try implementing that and printing the results
When I hover over the widget, that event is being called and prints the correct widget name
Hey guys, is there a way for a BP interface to be a child of another BP interface? I want the BI_PickUpable to be a child of BI_Interctable, but when I create the child BP class from BI_Interactable it doesn't show up in Details panel of class settings
You wouldnt want to combine them anyway its just semantically wrong. Add both interfaces to an object. Interfaces are like contracts. An interactable is not a pickupable. But to answer the question, I dont think you can have subclass interfaces.
Honestly im at a loss with this. Its probably something dumb. I checked the docs and nothing has shown up that would make it obvious. Maybe someone else here can chime in and help?
so a noobie question i followed a tutorial about an inventory system i added the combination grid and made it work, i want to have this mechanic: i put items on the right grid and if the combination is correct i can press the "Combine" button and get the forged item, my question is what is the best way of saving the recipes of different items that can be build ? my items are composed like this: a Data Structure that contains all the information about an item(name, maxStack, image...) and this is contained inside a Structure that contains this Data Structure and the currentQuantity. Any suggestion on what is the best way to save the recipes of the different items that can be made ? (order in the right grid is not important)
Yhea, I was also a bit iffy on how logical it would be to have that relationship between the two, my logic was more so to Override the Interact function to directly do whatever the PickUp function would do, but separating the two makes sense, I'll just make the Interact function call the pickup method somewhere else, at that point it might not make sense to make PickUpable an interface
Thanks for the help
Not sure what your setup looks like but I would rely less on a bunch of interfaces and use a base class for pickups and an actor component for interactions. Since interactions can extend beyond picking stuff up. Handle the logic in the base class. That way any pickup actor uses the iteraction system to function and not two separate but similar systems.
Personally I would avoid data tables. They are limited, rely on buggy blueprint structures and require you to micromanage them. Use a PrimaryDataAsset for your crafting recipes. Data assets are stably named objects, so their references are always the same. They can be passed as references at edit time too.
And when you want to get a list of all recipes you can use the AssetRegistery to query from them without having to manage them in a list somewhere.
thank you , that is a game changer, didn't know that there is a way to get all the items without having a list
Adding to what Gold said, you can also include functions in the primary data asset which can be call on all data assets that use it. They can be useful for doing checks on the data stored in side or other things.
For example, you could have a function on the data asset that checks if the supplied items in a specific format is a valid match to the recipe outlined in the data asset. (However it is you store the data)
Is there a way to have a projectile bounce off some surfaces and not others? I want bullets to bounce off targets who's armor is too high of a rank for the player and am struggling to figure out how to make that work
Are you using the ProjectileMovement component?
thank you
What you want really needs to be a more abstract system of determining what surfaces to bounce on or not. Armor/level is too specific. This might be a great place to use interfaces that can perform a bounce check on an actor. Call it IRicochet or something lol. If the armor hit point has to be specific then you will need to calculate where the hit on the player was and then make a determination. Im just brainstorming but you could perform a line trace or put a collision sphere in front of the projectile. On overlap determine if the surface should cause the projectile to ricochet, enable the 'Should Bounce' bool on the projectile. Handle the OnBounce event to disable bouncing after the fact, like this:
There are so many systematic ways of handling your issue, but hopefully this gives you some idea of where you can start. You can also use a physics material and a system to make it work.
Still no answer
I'm pretty sure this is poor practice but:
I've made most of my UI logic inside my game mode, since commonUI wouldn't load properly inside my player controller BP.
Now the issue arises when I wanted to connect an interface of my player character to an event in my game mode. It seems to immediately crash when I try to call in game mode and cast it to the game mode BP inside my character classes.
Is there a workaround I don't know about or should I just scrap the whole Idea and try to do it some other way.
My character has stat component and an interface, so whenever one of the stats depletes I want to call in an event that would open up an end game menu from my game mode.
For starters I see no reason why you should be using an interface for this. Put your UI code in a HUD class. Every player has a HUD so it makes sense for most of the logic to reside there. Why is it crashing? Hard to tell without seeing all the code. Could be a circular reference issue. What does the crash log say?
no crash log, nothing, my code compiles fine, it just fails to initialize after 75%
Its crashing on startup?
it just won't go past 75%, and just stays like that
Initialize ? Is this code in cpp ?
I am trying to figure out the best way to list a large amount of items that can potentially be found by the player. However the items don’t spawn or count as found till the player triggers a scan event via a button. At which point the game is supposed to check the specific point of interest the player is at to retrieve a list of items that can spawn. Then Spawn x number of items randomly depending on chance of them spawning, for the player to retrieve.
I’m still very new to UE5 and have no clue where to start this from. Any help would be much appreciated.
I have a beginner question: I am trying to learn AI in unreal and I am trying to learn behavior trees using a tutorial and for some reason it does not work
Which tutorial and use #gameplay-ai for this
Ok he’s not terrible tho there’s one pinned in #gameplay-ai from Epic that’s best for learning BTs
So what’s failing
"Dont work" doesnt say much. What is not working in which you think it should be?
I've compiled it, it compiles fine, but when it boots the editor, it gets stuck at 75% loading. The only thing that makes it boot up the editor if I delete the CharacterBP and not add any nodes with a reference to the game mode.
ok thank you
AI character in scene will not move
I think the game mode loads after the player. Show the code.,
Do you have a navmesh ?
can I make it initialize before the character?
yes
Alright. Best way to debug AI is using the Visual Logger from Tools -> Debug
Wait for it to become available. But really this is a logic error, get your UI code out of the game mode.
Start it up, run the game. Then click on the bars on the AI controller and see what it says. There’s usually a red one where stuff has failed^
I assumed so. I followed the CropoutExample project UE has.
Thank you for the help.
I’m not certain GM boots after the player char
is anyone free to jump into a voice chat channel and help a newb out with a blueprint?
i think i just need an editor utility widget to control it, but i've never built one before
If you still have issues, make sure:
- Your char bp’s CMC’s details panel is not blank. There’s a common bug where you need to remake that bp due to corruption.
- Make sure you’re not using Hot Reload or re-instancing.
It might be before yea
Thank you guys! I'll check some of those and see if it works!
I have been stuck on this for a few days now.
Post some pics of the blueprints would help
Gimme a sec
the main reason why I suspected its a loading issue, is because my logic works fine and it compiles fine, until I turn the editor on/off, then it starts causing issues
this is literally the only thing in my CharBP, most of the logic is in .cpp and everything compiles fine
the event is also triggered when it should be.
Someone knows why my Duration variable doesn't change for the timer? By default it's set to 10 (cause I'm starting the game during the day), and when the BP switches to night, it should be set to 30, but it stays at 10
if i wanted to 'knock' a target away in the direction the 'aggressor' actor is facing using add impulse on the movement component how would i would about the vector math? i just realised my solution to this problem doesnt quite work
I'm using the Water plugin, trying to increase the depth of my rivers but it doesn't seem to work. I'm trying to change the "Channel Depth" but it just doesn't change anything. It works when i try with a Lake, any suggestions?
get the aggressor actor forward vector and multiply it by a float to control the strength
Put a breakpoint on TriggerCycle and step through the code. You can hover over each input and output pin when the code has reached that point, to see values
I would probably start in debugeditor mode and see if there’s any errors or where it gets stuck in the output , then take it to #cpp
ill try that, thanks
That's a cool thing to use! It's definitely set to 30 after the flip flop, but the timer is still taking 10 as time input
Yep, because begin play only runs once
So you would need to clear and invalidate the timer and start it again after the value has changed
But since the timer is on a loop, shouldn't it update itself with the new time ?
It is not on a loop
It loops the delegated event
Timer event itself only runs once, it takes the value you've given it as input and runs with it until cleared
i got an issue i never had before
i create a new custom object type.
on a static mesh component, collision is enabled and the object type is set to my custom one
on my player capsule, is set it to block my custom type.
i trieds tons of differents settings, i cant manage a way to have the static mesh component block my player
I am trying to figure out the best way to list a large amount of items that can potentially be found by the player. However the items don’t spawn or count as found till the player triggers a scan event via a button. At which point the game is supposed to check the specific point of interest the player is at to retrieve a list of items that can spawn. Then Spawn x number of items randomly depending on chance of them spawning, for the player to retrieve.
I’m still very new to UE5 and have no clue where to start this from. Any help would be much appreciated.
depending on your game you want to fill the list at runtime
if its a treasure hunt, you can have params like % chance to have a valuable item, and have this % change depending on the scan item used or the region you are
wdym by static mesh component. Did you take a SM and just place it into the level? Is it in a custom actor? Does the mesh have collision on it?
this is called a SMC
yeah ik, I was asking how you placed it but that answers the question
Well you need a way to store data about each item. A data asset is preferred. Inside needs to be information about spawn chance, which events it should spawn in. You could use gameplay tags for that. Then you need a spawner. Make it a component and add it to gamemode, which is a good place for SP and MP games. When it comes to the scan, query the game mode about the scan, and perform a function to find which items by gameplay tags to get.
is the mesh's collision set to block the player?
can you show both collision panels?
its all ignore.
i want the player cpasule to decide if im blocking or not
I created a simple system for item pickup.. but it's coded within that one certain BP. What do I need to do to have this as a "component" that I could attach to various BP's if I want them to be pickable objects?
Its more of a scavenger game, the idea is players are controling a vehical that does most of the work.
the player tells the vewhical to go to POI, then scan the area, A list of items found is presented. the player can choose to collect the items ( at this point a mash is spawned)
thats not how it works, it always uses the least blocking combination possible
collision is a 2 way street
yeah i found the issue
i was doing
- my actor : ignore all
- player : block
but the correct was
- my actor : block
- my player: ignore/block
thanks for opening my eyes
Make a general interaction component. Create a pickup actor base with the interact component and the handle logic. You dont want to do this for every pickable item. Thats a decent place to start.
my biggest hurdle is I just dont know what bp nodes are needed to do what. I honestly wish there was a library that I could search for what I need and get a suggestion of what nodes might be of use
and how do I attach it to items that I want to be collectable
items/BP's
use a actor component
or a custom object type (this is what i used and IMO the best solution for mosts cases)
oh custom object types.. never heard about them
It sounds like you arent ready yet and might want to take up some tutorials on youtube or udemy to get your feet wet.
whenever you want to have stats on a character, like max health, strength, intelligence, max mana etc.. what's the best way to store those on a character? Would a "stats" component with a bunch of variables attached to it that I can then put on the character to grant it stats be a decent idea? especially since I could then apply that component to NPCs too? or are there other more efficient ways of doing it that I'm unaware of?
The base class is the pickup type. For any item you want to be collected, make it a child of the pickup base class
for eg; if you have a door
attach a box collider to the moving part, and set the object type to "Usable" for eg.
then when you do your linetrace logic, you would linetrace for object type "Usable"
ah ok, that makes sense. thanks
Personally I would argue against using an interface when using a component.
if the logic is inside the actor i dont see why not using an interface
I have messed with bp a fair amount, I just havent really made any bp of my own, which is where I am at.
honestly you don't need both a box collision and a linetrace... You can limit the length of a linetrace so that you can only interact with something within a specific range
dont look at ytb videos, most of them have bad habits and dont really explain why they do X.
try by your own and ask your questions here :)
Why would you use one, the component already exists and you can query for the component instead of adding another layer that is unnecessary.
the whole linetrace interact is what I have set up for my own interaction system
the box collision isnt for overlaping, its for blocking the hit
don't need that either, you can add another trace channel in the project settings, put the interaction line trace on that channel and set up the mesh to block a trace on that new channel
most of the times you dont want the mesh collision to block it but a sphere/box/capsule
but yeah you can apply the custom object type to whatever suits for you
that way things you don't want to interact with will be ignored by the line trace because it won't block that channel but the objects you do want to block then they block that channel and it doesn't interfere with physics collisions or anything
can I get a hand with this? Is this an efficient way to do a stats system or are there better ways?
use GAS
they are called Attributes
don't know what GAS is, never used it, and from everything that's been described to me quite frankly it scares me...
you will need a bit of c++ but GAS is very easy for basic stuff
best docs you have is this :https://github.com/tranek/GASDocumentation/tree/5.3?tab=readme-ov-file
and like that you lost me.... unless it's simple stuff I can copy/paste to make my life with blueprints easier, despite the several attempts I've made at learning C++ it sticks in my head about as well as water sticks to oil...
Then maybe try again or go for your stats component
Is there any reason one could think of why my left mouse click and right trigger are not responding to binds on Enhanced Input? I have bound plenty of actions to other buttons in all sorts of ways before so the system isn't new to me, but left mouse and R2 just do not respond. I have them set to consume lower priority inputs.
what context are you trying to use them in?
My own mapping context which is set by the player controller, it's been working and if I bind to anything but mouse buttons or triggers it works fine!
nonono I mean what are you trying to do gameplay wise with them, like what code do the input actions trigger?
hey, how would i set something in these object reference values?
nothing appears
Ah I see, It was supposed to be a montage but for now I just hooked them to print string to test if they are even activated
Which they are not if they are L mouse or R2, but they are for any other buttons
my guess is something at engine level is taking over the inputs, a lot of things in UE by default have "onclicked" elements to them
I have a weird suspicion it's something left over from the default FPS template with that stupid gun, but I can't think of what would be referencing it since I already changed the relevant things in my mapping context and game mode to refer to my own input mapping context
in that github document that you posted, does it go over all the needed C++ required to make GAS work or am I going to need external C++ knowledge on top of that in order to make it function?
at the beginning there is a "how to setup your project for GAS"
but there are probably steps where you need extra knoledge (you can ask #cpp )
how do i cast an actor to my main charachter?
what do you mean cast an actor to your main character?
i want the revolver to be a actor virable
the thing plugged to the object is a virable set up in the charachter
all i get is this error message
what are you trying to achieve here with the revolver? like why are you casting to it to begin with?
i want to get the rovolver so that i can call to custom event that is in the revolver actor
and where is the revolver prior to this event being triggered, does it exist in the world already?
yes it does exist
and is there only one of these? Because you could always just do get actor of class
yes there is only one revolver in the level
so instead of casting do get actor of class
but i cant trigger the custom event if i do that
yeah you can, select the actor class in the left side, then you should be able to do actions from that actor class's blueprint
?
left side, what do you mean?
like this
the actor class is selceted
ahhh
I put a custom event on my box blueprint called test and then set this up in a different blueprint
worked fine
works thnaks for the help
👍
can a child class have multiple parents?
if you want to future proof it against issues put an "is valid" node between those 2 nodes I just showed you and have the custom action come out of the valid execution pin
like this
ok its a wierd issue but when i cast this and the revolver is out my charachter slides around its wierd, i had this issue before it has to do with the charachter movemnet or something, any idea how to fix that?
no, but a child class can have grandparents... like child class inherits from parent class which inerits from its parent class
👍
nveremind it was jsut the collision problem
Hey guys!
How do I just straight concatenate two arrays of the same type? Surely there must be a way that doesn't involve a for-each... right?
what do you mean? like you want to add the values of 1 array to another array?
Guys, I have a platform which float from left to right back and forth from -400 to 400. But these platform start almost from one point - from zero. So when i pose several platforms they move simultaneously. How can I add random to that starting points? So for exapmle one platform should start moving from 0170, another one from 30 and another one from 260?
You can have many parents yes. Base -> Child -> Child -> Child
Just make an array that's all the items from Array A + all the items from Array B
This, but as a generic library function
make the starting point a variable and then at the beginning of the code set a random amount clamped between 2 values (aka your min/max range) and set that as the variable
yeah thats what i thought too but where i should plug that starting point?
Cant you use the Append node?
look up the append array node, it looks like the image below and it will add all the items from the source array (in the bottom pin) to all the items in the target array (the top pin)
I tried to add some random values but after that platforms started flickering
I KNEW IT hell yeah
you want to set the random starting point off the beginplay event of the platform because beginplay runs the code whenever the object in question first is created in the world
I cant jsut plug Timeline like its is on the second image
on the first pic thats exactly what i need but those platforms are not moving
what you want is a lerp node like the image below, your timeline output goes into the "alpha" of the lerp, and the A is the randomised starting value and B would be the starting value + whatever you want the end range to be, then the return value would go into your Y location
oh, let me try
You might be able to keep your setup and pop a random number into NewTime on the timeline
it will just make the platforms move with different speed
Plug the Y output from the timeline into the set actor node. Might need to add the current actor starting location to it. Edit the timeline so the X value is between -400 and 400. Give NewTime a random value.
now the platforms just dissapeared
the timeline node basicly has a curve from 400 to -400 in 3 seconds
Is there any reason your platforms start on the left everytime and not in a random location
ok so the lerp node as you've set it up would have the platform moving between y = 400 and y = -400, is that what you intended?
no
i mean yes
but idea is that when i have many plaforms all of them will start moving from Y 400
Alpha on a lerp takes in the values between 0 and 1
what does your timeline look like?
ok instead of the values of the timeline being 400 and -400, set them to 1 and 0
like have it start at one and curve down to 0
How many entries can/should data tables have? can I have a data table with like 10,000 entries?
I guess I should just try
Or use a Normalize To Range node
use data assets instead of data tables, they start lagging like hell if you go beyond a certain number of entries... I had this problem myself to where after about 200+ it starts crashing the engine
doesn't affect the game at all, it's just the engine itself is really unoptimised when it comes to data tables
Im not sure , i need them to go from -400 to 400. Its quite a small range from 0 to 1 , not even noticable
This is all engine based stuff for tracking assets editor only @hoary junco
hard to explain context
but literally I don't ahve a game im making
I like that approach with lerp, i feel im almost there
ok think of it this way, 1 and 0 here aren't literal values... that's what you set in the lerp, 1 and 0 here just represent beginning and end point....
And it's not going into some oneelse game, just weird tooling stuff
so once you reach 1 you're at the end of the lerp and 0 is the beginning of the lerp
i will try now
Here is the idea. When there are many platforms spawned most of them move uniformly
I mean sure but regardless of context, data tables are terribly optimised and adding too many entries makes them crash the engine... they are horrendous to add large numbers of entries to
Hmmmm lame
I know... I had an item stat system put in a data table and it would take 10 minutes for the data table to let me put anything in whenever I tried to add a new line once I got past 150+ entries
and it would regularly crash
data assets are easier to create hierarchies with because they can inherit from eachother.. and they don't crash everything...
heh
I'll look into that
basically I have a bunch of assets im making and need to track/update certain thing in a table would be super helpful
I mean, you could just set up a folder structure in the content browser...
and save the assets in their respective folders
I've done that but what im building needs something abit different DT's seemed like a good fit but i'll investigate other things
Hmm i made my curve 0 to 1 and connected it to the lerp node. A is random value from -400 to 400 which supposed to be starting point. And B is 400 which is final point. For some reason when i pres play i got ugly platform flickering. What did i do wrong?
what do you mean flickering?
ok, so what you want to do here is create a second "set actor location" node, have it come off beginplay, plug the "get actor location" into the X and Z and into the Y plug in the random float in range node. Then run the timeline after that and in the LERP correct the A value of it to -400 and try that
Here ya go, its aint pretty but it will do.
because it seems to be generating a new random value every frame in this current config
the method I just put in there would work a lot better than this...
so much less moving parts
Probably but at this point explaining isnt helping. You suggest doing a lerp node, ill hook that up rq
but its not event tick, its begin play.... thank man i will try it really quick
The curve values at from -1 to 1 to -1
even if it's not event tick timelines update every tick that's how they work
Yea and the timelines will give you more adjustment if you want varying speeds during the timeline
I'm not sure I did it right.
The platforms are moving in a same way
i think the problem is here
what are you trying to do ? move the platforms up and down ?
or side to side actually
get a bunch of platforms to move from side to side but each one start from a random position within the movement range
i feal like they are all at the same y with that code
yeah
thats exactly what is happening
so on begin play set the random
and on tick move it back and forth
or have an event that randomizes the start so you can call it whenever you want
and im trying to randomize somehow their starting points
get a random number in range from min to max
and apply that amount to the y
if it initially starts at 0 ?
meaning do they spawn at 0 ?
you could put the start logic in the spawn
and the movement on tick, you can just flip a boolean like goingRight
if it's false go left, true go right, and if your platform hits the min/max flip it accordingly
well, in the beginning it was like that. Kinda bootlegged randomization
but it worked and platforms moved back and forth
Did you change the timeline?
here is -400 to 400. On previose one we discussed it is 0 to 1 to work with lerp
you could also use a timer to switch it back and forth
0, -1
1.5, 1
3, -1
but i would move it on tick or timer
and when you hit the y max/min set it to go the opposite direction
sets its initial y random on spawn
from min to max
i also do speed for things going back and forth so they are not moving in the same amount
looks weird that way, adding a bit of variance in the speed helps make them look more unique even if it's just a small amount
Any reason you just just do it on tick with a bit of simple sine math? Adding a whole timeline component to pingpong seems like overkill.
I assume for more flexibility in the platform movement
Mike offered me a solution using lerp. I'm trying it, but it doesn't seem to work. Where is the error here? I mean I think it's in lerp and that's why all platforms move the same way.
There's no real flexibility change. You specify a distance max. Sine goes from -1 to 1. Timeline goes from -1 to 1.
Sure there is, you can make the platform movement unique and varied over the distance
Im trying your option
it looks like because your setting it from -400 to 400 it's just doing that
what should i set there?
i mean i do understand that the issue is there
just not sure what exactly i should connect
For mikes solution your timeline needs to be 0 and greater. No negatives. And between 0 and 1. and add actor start location to the value after lerp
Ontick is cleanest. You could still use a curve if you wanted variations in the movement.
if you just want a smooth back and forth tick or timer
where you set the boundaries so it goes back and forth
you would have to get the half width of a platform because your starting point is most likely the center
Dont even use the branches, use lerp and multiply by -1 when u hit the boundary
Ok, this is what I found on youtube where a guy was explaining how to move the platform.
if i have a bp class of type static mesh with default values setup, and i want to add it as a component to another bp class of type actor, do i have to do that via construction script? because i am not seeing that named bp class, static mesh component, in the add component dropdown
uh specifically the add component dropdown within the bp designer, with the actor type bp open
at least what i have now is way better that i hugew enormous tree of branches i had before
Can always refine it later down the road
Is this a component or an actor?
ship_carrier is an actor
ship_carrier_mesh is a static mesh component
or thats what i thought it was
Add a ChildActor component and set its class in the properties. Careful with over using this tho.
actually it just says "static mesh" um i guess its actually a mesh asset
so that answers my question actually
about why im not seeing it
Is there a way to tell, from a given location, what percent of a given actor is visible? This is for basically taking light-based damage from a distant light source. Stick your toe out, you're 1% visible, so you take 1% of max damage.
You want to add the ship carrier mesh to another bp actor?
not likely to no. but i do have sockets defined
Im not sure what you are asking, sorry lol
i have figured it out, thanks for being sounding board anyway. might have followup in a min
One thing you could do is setup points (scene components) around your actor and actively line trace or test if the light source is visible to that point. The more points that is in view of the light source, the more damage to inflict
That was my first idea actually
I just wanted to make sure there wasn't, like, a system for this or any prior art, before I did all that work
Good question I would like to know as well
well im an UE noob but the general graphical programming technique for doing this is called occlusion queries
There's nothing that is gameplay usable. To get the percentage of a visible mesh you would need renderthread access to do a costly check against vertexes. Which you also should not rely on as it's not on the gamethread. And would require some fairly in depth C++.
That's what I was afraid of
perhaps search some about "unreal engine occlusion queries" they exactly give you the % of pixels rendered that are not occluded, for a given draw call or set of them
occlusion queries are nearly free
idk if they are hooked up to be easily accessible in UE or not
but its something supported by all gpus
The good news is it doesn't need to be that accurate. It's a first person game so there's some slop on where the player's "body" actually is. The important part is being able to "peek" into damage areas and take a little damage, as a warning that you'll get fucked up if you go further.
Nearly free isn't free enough. Even occlusion culling can very easily get out of hand on some platforms with some map designs. It can cost a few milliseconds on some scenes.
Maybe I can just fake it with interpto lol
occlusion culling is its own process and happens on the cpu
or often does
occlusion queries are very very cheap, and only a problem if you block for the result on the same frame
Sounds like the practical answer is just to perform a few line traces hehe
Ya, though actually mapping from that to damage amount is non-trivial.
doing multiple raycasts on the cpa is going to be very inaccurate and far more expensive
again i dont know how occlusion queries are exposed in ue
The only thing is now platfoms go way too far even coordinates 400 and - 400 were mentioned. I placed two lines crossing pink ground to show 400 and - 400 range. And it looks like its just adding something and it tornes out that the limits on Y are even higher than just 400 and -400
but they ARE what you want here
If, say, the front-left-top, back-left-top, and front-left-bottom vertices are visible, that implies a triangular visible area which etc etc.
this assumes that the "amount visible" is actually from the perspective of a viewport already being rendered
And it's not.
Did you want from 0 to 400 then?
I believe its because it stores not 0 0 0 coordinates
I feel silly asking for such small things but everybody starts somewhere.. I have created a parent class for interactable items BP_ItemParent, and inside my BP_Player I want to call a custom event from the **BP_ItemParent ** - DestroyItem. what is wrong with my bps'?
It's also tough because the "viewer" in this case is literally an astronomical distance away
its probably because there start location is different for each one and your adding to there start
totally
transparent boxes are the spawn points
Yeah thats the part we cant see is how you are placing the platforms. Try making the LERP range 0 - 400
so your just adding the lerp value to the start point so it's left/right relative to that not center or far left
you could probably use a large number maybe clamp it
but everything will be relative to it's location on spawn, you could make it relative to center but then they would all probably be going in the same movement
Do the platforms always start on the far left side?
no, I have kinda randomized spawn points which may be from - 400 to 400
so like Engage said its just adding those amounts to my movement
it's basing the left right off that pivot point
and since for example it was spawned in Y -60 it it goes -460
The original function will have it go -400 left and 400 right of the spawn location
if i add clamp then the platform goes to 400, wait some time and then go back and that way i lose that sooth transition between going back and forth
800 units you mean?
width yea
the bounds in lerp right now are -400 to 400
I mean your spawn range is it always between -400 and 400?
yep
I just have to compensate that offset somehow
but not sure how
clamp doesnt wort as it should
Bad questions, im confused why this was a problem in the first case. Why do you need the plats to start at a random time in the timeline if you are just going to spawn them in random locations to begin with?
nope i dont need them tho be spawned at a eandom time. They are spawned in random positions
Is the center of your game always 0?
no
i mean the center of level yes its 0
but the platform could be spawned in te range Y -400 to 400
Some kind of sidescroller?
Spawn relative to what tho? World coord = 0 ?
I made a fishing game and in the fishingrod BP i have a rod, cable (fishingline) and a lure. It works so I can cast and return t the socket on command, however the cable component acts a little funny and it goes through my landscape sometimes and appears to visually not be connected after I cast it (I use a physics constrant).
Any ideas?
the platforms spawn in those bounding boxes
Is the center line on the Y always 0 tho?
These platforms come to 400 or -400 and wait for a while while time mentioned in the timeline is over then they go back. So I got that idling which is not good and i loose that smooth transition between going back and forth
yes
Try that, again not optimal but made it quickly
What is the least effort way of porting some bp functionality from one blueprint to another when doing some refactoring? Specifically when that logic relies on a bunch of local variables. Right now I end up having to copy the variables over one by one, then copy the logic over, but I'm wondering if there's a way to have it somehow infer that it should be copying all of the dependencies automatically for me as well? Or is the manual slightly laborious approach the only option at this point?
I suppose what I'm looking for is some sort of smart refactoring/move functionality within blueprints like what you might see in a code IDE.
Man, that works perfectly. Thank you so much
Is it just a function? You can copy and paste the function directly.
haha glad its working out
It's a few custom events worth of logic relying on a few local variables.
i have to understand what you made there that it makes it work
It just calculates the amount of space from each side based on the relative position you are.
I'm trying to destroy an actor/item (for education purposes). I have implemented item interface, and I'm trying to call a custom event (destroyItem) that's located in BP_ItemParent. I'm trying to call it from BP_Player. Unfortunately I'm not referencing something properly as I keep getting the "accessed none trying to read property item) on the DestroyItem node.
Please help. I know it's a simple thing for many of you but I've been stuck on this for about two hours and I'm just walking in circles.
@waxen quarry
how is item set ?
I don't think it is
yeah the problem is I don't know how to do it. Basically there's a part of the blueprint that's responsible for displaing a widget on overlap with the player object
WHICH item should be destroyed?
and if I put the "destroy part" at the end of the overlap it works
but when I want to invoke it by pressing E
nothing happens
because you know which item to destroy
its the one you overlapped
Set "Item" on overlap
Overlap -> Item is TheThingWeJustOverlapped
E -> destroy Item
yeah, but how can I get that "overlapped component" and put it in the destroy function?
First off, who has the overlap event
the pawn or the item?
it's on the item
disregarding whether or not thats a good idea, the item needs to tell the overlapping character "hey, your Item is me"
OtherActor -> cast to YourCharacterClass -> set its Item = self
Thats cool!
Character should be detecting the overlap tho
this bit confuses me
do you know the difference between an actor and a component?
is component something in the blueprint "hierarchy" and actor is something in the "level"?
why does an item have a property OverlappingItem?
your code is all confused
I would do it all in the pawn, the items don't need to be doing any of this
well it looks super blocky and simple but for me as for beginner its just a breakthrough
@waxen quarry thank you so much for help dude
the PAWN can do it like this:
Event Begin Overlap -> cast OtherActor to ItemBaseClass -> is it one? -> set Item -> tell the Item to show its widget or whatever.
E -> if Item is valid -> destroy it
I wanted to have an item parent so all items can be picked up and when approached they display a text message above it
yes, and you can still do that from the character
So the media player right. Why doesnt stop or close work? Only play / pause is working for me even with the proper references
who's calling the shots here, the item or the character?
I'm still having issues with the widget interaction.
I just made a widget that has a canvas panel and a button and set the button to print text when its pressed, but when I try to click it in world nothing happens
well the character but how can I define something as an item without it having a parent, how other items will know what to display if I want them to or how to act
it can still have a parent class
read what i wrote
The item can still have the show/hide UI functionality
but it should not be telling the character that it's the selected item. Let character decide that
ok :/
it doesn't really make sense to me that I want to have this in the pawn blueprint rather than the item itself. https://blueprintue.com/blueprint/ux-oh0jl/
What is the best solution to build a logic of picking random platform from a library? For example, i have a library with 5 types of platforms. And i need 1st type of platform to spawn with 60% chance, 2nd type with 20% chance etc. Thats how i made it(just gonna work in this direction), but i believe there is a better way to solve this. Just drop me an idea and i will google it
You can have that in the item
that's not the problem
its the character knowing what item it cares about at any given time
the character should decide that
the item should just show/hide UI when told to
okay, I'll try to add overlap events in the character and work from there
Easiest, quick solution. Make a map with the platform and a float. The float value will be the chance (0 - 1). Use node RandomBoolWithWeight.
Sum weights, roll random number up to sum, add up weights until you cross that random number, last one is the choice
something like that
Weighted random selector would be the better solution, but for his purposes he needs something simple and easy.
Thanks!
oh yea great idea
1 1 1 1 1 1 2 2 for your 60% chance of 1 and 20% chance of 2
shuffle that array, pick the top element
sure yea but we spent 5hrs today making a platform move left and right, start small id say lol
is it one? <- what do you mean by that? how do I perform that check?
cast
thats what casting is
is this thing an instance of ClassWe'reCastingTo?
is OtherActor a BaseItem?
No need to shuffle because get random would have the same effect right?
yeah i forgot we had get random
Did you get all that ^
well I see some c++ and it scares me but i will start on youtube watching stuff about weighted random
will figure out
At least I have a starting point.
The easy solution is to create an array to hold your different platforms, but add each platform multiple times. Then use the Random node on the array to get a random platform.
How many times you add a platform to that array will increase/decrease the chance of it getting picked.
yeah i saw that on youtube. I just got feeling that its not the best solution
but i believe its the easiest one
that worked, thanks @faint pasture
Ive seen it done in professional projects. Its an easy solution to a small problem.
i will get back to that solution if i wont be able to tackle that method posted above
referencing things and knowing where to put what (which blueprint/pawn/actor) is super difficult for me.
When in doubt, just put the data and the code modifying it where it makes sense
it makes sense that Character holds SelectedItem and sets SelectedItem
in most cases
there are some cases where something else might want to clear SelectedItem
not many where other things should set it tho
yeah I got fixed on having everything item related in the item BP and just calling it from other places
I guess it's practice
The items job is to respond to being selected (show/hide UI), and respond to being used or activated
ummm. well first off, its not inherited? this is the base bp class and the mesh component and the widget component are both from it. secondly, i DO need to have a known socket of name "center" here regardless of the specific mesh currently assigned
interesting stuff happens when you have two items that are overlapping
but lets leave it for now I guess
@faint pasture can I get your opinion. Why would some people use UObjects for their item? Can't an inventory and item simply be represented by an array of struct?
My question is I am not sure how object is used in this context.
Seems awful
It's easier to manage an object as a thing rather than managing it as a thing contained only within an array.
Thats what data assets are for
Hmmm
are sockets not supported or something for widget components?
Well I can pull out default info from DT or DA. But what do we actually do with the object
Right now in my old game, using dynamic combat system, it simply have an array of structs for the inventory.
Construct object to make an instance
No object ref at all
Youtube tells you to do it this way and I personally dont recommend it.
Are you able to give an overview on how the system go?
Using plain ole UObjects is just not a good idea when DataAssets exist. Use those and dont question any further 😆
Well my confusion derives from the fact people use DA and Uobjects hand to hand.
So when do the uObject gets created and what is it use for.
UObject is a low level type of object. UClass -> UObject -> DataAsset, Actor, etc.
Just like you can make an actor, you can make a uobject. Its bare bones. Low footprint.
I know that, my question is the purpose of Uobject in an inventory system.
I see people have a uobject inside their item DA
Oh my bad, idk the purpose thats up to whoever coded it.
Its a class like any other. You can create instances of it that hold variables and functions.
Yeah but it felt like an extra steps and I am still not sure of the purpose when the item can be simply represented with an array of structs. Without the need to construct a new object and committing to any assignment
It might be used in cases where you want to specify a type of object but that object could be anything really.
I'm sure they have their reason and this is what I'm trying to figure
Whats the name of the object variable?
uobject is lowest level so they probably just want the freedom for the inventory system to use any object in the game
instead of planning ahead of what objects they will use they just make it a uobject and do what they want later down the line
Hmm perhaps. Thanks for the input. I will try to skim some docs or sample projects before I jump into my own inventory system.
just use c++ lmao
I am ser
The the variable named "Item" or something
oh okay, in that case all you have to do is make a base object class of whatever ur inv will use then create an array and store that base class type in it and then the rest is ui based for ur inventory
thats basically all an inventory system is, just an array
Does anyone know this problem im having?
I am using Advanced Sessions with steam and I am trying to get proximity voice to work, I have done lots of things and this is the closest I have been to getting proximity to work.
the picture is how i replicate/use my voiptalker and settings
The way I use push to talk is in the player controller which is just a simple execute console command ToggleSpeaking 1 I have also tested using Start Networked Voice and both give the same result but my issue now is both players can talk and everything works with attenuation but after a few seconds or a minute some sort of audio stutter or something happens like its been garbage collected and then the attenuation STOPS and becomes global. I have no clue if this is a bug, I am using Unreal engine 5.2.1
Please help if anyone knows anything about attenuation just randomly breaking like this.
it seems like my construction script is not triggering when i click play, for actors that i have in the level already, though it is for ones i spawn during gameplay
Print string?
Sanity check, drop the target actor into the level again.
What's up with your socket problem anyway.
wait maybe i see it now. bunch of garbagte in output
What are you trying to do.
sigh why is there no clear log
I would just print one to the screen for quick check.
I think construction scripts run when you compile the blueprint or place them in a level. Which is different from being spawned. Makes sense since those changes are meant to be done when creating the instance, like those in a level.
i mean, that sounds like a terrible workflow, if you have to manually recreate any in-level actors if you change a construction script
You dont
Its probably just per instance in a level tho.
Move the actor around in editor and see if it prints string. If not try to make a physical change in the components list or something.
in any case, i am not seeing "ship_carrier" but
Are you trying to do it in child class too? Make sure to call parent/super
this is the base class ship_base
neither ship_fighter nor ship_carrier have anything in their construction script
Right click the construction script and select call to parent
Or something like that
In your ship fighter and ship carrier
no change
Show code
also fighter is getting called already
I dont think youre going to see Print string in-editor until you play the game.
So no issue with fighter? Show the carrier construction script
You should be able to see it if it's in construction script
Even moving the actor in editor should run it afaik
Or pressing compile in bp
I just tested, it does not print string in editor. However the construction script runs every time you compile, or make any change to the actor in a level. Even moving it around.
im creating my own combat framework and am encountering an issue where when i roll the characters sword leaves his hand and then returns upon rolling. cant seem to figure out if its collision based or how to fix it
well, that doesn't work then, because i need the carrier class to assign its overriden mesh prior to running the construction script
And instances in level do not run the construction script on play either.
any help would be greatly appreciated
To be fair the construction script should be reserve for specific uses only.
I never have issue with this. That's as simple as getting the skel mesh comp and assigning a skeletal mesh
Done that in construction script too
Try debugging?
But in-level its not going to run outside of changing it in editor.
Only place carrier in the level and add break point
i have a duplicate static mesh component, because i need to specify a transparancy render priority for this second draw
Cant do it on beginplay?
and rather than having to now override and match the mesh between the two, for every subclass
i thought id automate it in base class
i guess, but id rather they looked right in the editor too, when not playing
that is how i had it setup before
I mean you could do both in a single function
suppose ill just set its visibility in editor to false or something, well. theres hidden in game, prob not for in editor
Sounds like a bandaid
i agree, but then what isnt?
Well setting the skel mesh comp in construction script should just work.
its not a skel mesh comp, just a static mesh
I would try to debug and see what happend to your cruise bp
Its a type of effect you are going for tho right?
so three things need to happen
Same thing, construction script. Get static mesh comp set static mesh
the subclass which is a specific real ship type, in its bp will set the value of its static mesh component named "mesh" to a mesh asset
then the static mesh component named overlay needs to be assigned the same mesh
then the widget components named .. the 3 things .. need to be attached to the mesh socket named "Center"
im not seeing either of those 2 things done
Is there any reason this all cannot be done in-editor tho?
Im guessing that you have a single ship type but multiple 'skins' for it?
Let me ask another question. Why do you set the mesh during construction instead of setting it directly in the properties?
the big squished cylinders are carriers
the squished cones are fighters
the have different everything, except all ships (ships_base) do have a static mesh
and the reticules used for indicating selection
note that the carriers reticle are showing as if selected when they should not
and started in that state, because the construction script, which calls clearselection and affects the visibility state of those ret.components is not being called
anyway ill shuffle some stuff to beginplay since apparently (construction script) it doesn't even get called at runtime when you load a level?
Ok but that type of code probably shouldnt be in the construction script.
which is absolutely stupid if true
Depends, if you need the SM info from somewhere then construction script is fine.
But if u already know what mesh to assign then just edit the comp right away.
If your game is data driven, you can set it in construction script.
From what ive observed is the construction script runs anytime you move or change an actor placed in-level. But does not run when you play the game. Its meant to be a period of time between the object being created and spawned.
yea the thing is i only have the carriers in the scene so i can test
i have no plan to actually have the final game loading levels with already allocated ships
but w/e question answered i suppose
I mean you could place the code in a function and run the function on construct and beginplay lol
yea
for bp classes without C++ code do they call parent::beginplay before or after their own?
Wdym bp class without cpp code
Everything is cpp. Blueprint node is just cpp code wrapped and exposed to bp
That's up to you to decide
If you want to call the super first, call it right away on begin play
If you want to call it later, you can do stuff before the call to parent node
that's the same in C++
Construction script runs in the game. Just tested it
Elaborate more on your setup
Is your actor in the level or spawned on play?
@waxen quarry
ship_carrier is not a C++ type, its base class is ship_base which also isnt a C++ type, its base class is AShip which IS a C++ type. in AShip::beginPlay i call Super::beginPlay at the top of the method, therefore, its going to happen before -- the question is, what order is it for ship_carrier::beginPlayer and ship_base::beginplay
spawned
then that follows what we thought so far already right?
I didn't read that part, will try to place it in the level now.
Yeah spawned it runs fine.
If you override the begin play in blueprint, then that's the only thing you have to worry about
its not the only thing i need to worry about, because i have dependencies between the two
also the same question, but for construction script
#blueprint message
But you are overriding the event, so that's where you have to look at.
you can do stuff before calling the super
in the bp i can?
super is just a function
in C++ i know i can, because calling the super is a line in code
not sure if calling parent is even mandatory
ok. but isnt it going to call parent regardless? and when does that occur, before or after
and if you call it manually, does that override the normal placement or cause a second call
Parent:function is just a node as any other one
When you call it? there is no calling to parent regardless, it will only call if you call the parent since you are overriding the event.
Dont need to call parent if you dont want the parent to run. Its not mandatory but good practice.
There are times when you have to call to parent
the point of having a base class that has this code is to have it occur for all subclasses
especially when using other people codes where the parent initialise stuff.
Ye I always call it because its bite me in the ass before lol
yes but you are overriding it X_X
in bp
if u want it to behave as the base class, don't drop your begin play there
ok so your saying if i override it, its up to me to call the parent
Yes
that answers my question
Goes for events and functions too
I like items as structs but there's reasons to use objects. Makes it a lot easier to do Item.DoThing
@waxen quarry You are right, it doesn't run if the actor is pre-placed
I prefer structs but YMMV
I wish there's some sample project I can look at 😭
if you want a behavior for your item, i'd say that a UObject is better ?
always find it difficult to wrap my head around something.
Why would you want to. That sounds painful.
This trigger a light bulb
I would make items a DA and have an optional UObject that can be created anytime I do something with it. Like start a decay timer when its added to an inventory and such...
🤔
well, let's say that your inventory contains, i dunno, a shotgun. Do you store a struct with just data, and spawn an actor when the player get the gun ouf of its inventory ? or do you store the shotgun object directly ?
There value in separating what is an Item and what is an ItemType. The item might be the real actor class. The ItemType might be what you use throughout your code base to reference the type of item.
and the ItemType could store a reference to the Item class.
Is there an inbuilt way to stop a player's animation montage from being interrupted? Of course I can just set a bool on start that is set to false "on completed" but just wondering if there is any tidier way
You can probably create your own Play Montage Function which adds a check before playing the montage. The check can be what ever you want
Depends on the behavior. I like just having the struct contain raw data + a ref to the behavior thingy, if it needs it
eg if there is active montage, if some boolean is set, yada2
hmm. Ok i get the added value of that I guess @waxen quarry . first, it makes it easier to serialize the inventory I guess
Yeah figured on that, that works
Well, how would you guys handle usage on the items?
Is that when uObject comes into play?
Populate the Item Data, Create new Object for a sword.
If Player use Sword Item -> Get it's UObject, Run the Use function?
Yea and you will reference the item type in many areas which is very easy using data assets. I call mine ItemData and prefix their instances with ID.
Then use ItemData as the type for anything. Spawning, inventory etc
nice. Thanks for the info
your item data is just a blueprint with a parent 'PrimaryDataAsset' ?
Yes or if you use c++ its just UDataAsset.
To create instances of it you will find it here:
@waxen quarry @frosty heron Btw, I have found that an explicit call to parent begin play is required even if you aren't otherwise overloading to do anything -- if you want it to be called for things placed in the level and not just when spawned.
Ok. Actually you CAN delete the begin play node entirely. I thought it was always there.
So i effectively did have it overriden without meaning to.
well, i didn't drop it there
there is one automatically when you create a bp class
.. at least sometimes. but yea i get it now. also the construction script node you really cannot delete
hence my confusion
Heya folks, having a bit of a trouble with tags; feels like I'm missing something very basic.
Here is a blueprint, breakpoint'd, at the moment I'm checking for tags.
You can see that the target, when viewed, has an array called Tags that contains "Player". Then, the get Tags node returns an empty array.
Seems... odd
i guess make sure the target of 'get tags' is the same object
That's the same node being inspected there
left side is the second picture, right side is the third picture, it's like the variable when going through "Get" becomes empty
What is the issue you're trying to debug?
Get Tags is empty when asked for, but when inspected it is not
Cause the blueprint debugger is a pile of scrap. But what is the issue that led you to try to debug this?
I am trying to get the tags from the target to compare to
to have gameplay implications, I can explain the whole context but it's this single node not giving me the tags on the target that is the issue
put the breakpoint at the actual get tags node, i doubt inspecting the target pin's tags will show anything different than the nodes return value
You can't breakpoint a get node can you?
oh, idk?
hm guess you can't. anyway. you see what im trying to do though right? verify for 100% certain that the 'target' pin is the object with the tags
Er, I don't understand how I can do that any further than the actual inspection that I displayed above, mousing over the target pin which contains the object which I can scroll to the tags array and see that it has the tag that I want
your screenshots dont make the full situation very clear to me at all, but yes that sounds pretty conclusive
Can you give a better overview of the logic and where the breakpoint is?
including the debug object
Sure, one sec
Show your entire function.
i can try to figure this out by myself (well have already been for 8 hours), but if someone has some time, i could use some help fixing my power up randomizer system. preferrably in a voice channel so i can screenshare, would be alot faster. it works but suddenly breaks. i can also post pictures, but would take quite many pics.
cant say i have time for that, but my immediate thought is: if the way it breaks could be attributed to the random itself being not very random, look into a replacement random number function instead of any ue stock rng
Here's the whole function
The context is that a projectile is calling who it's overlapping to make sure it's not shooting the same person who fired it
since it was doing so haha
where team is a tag i guess
Yeah basically
Is there any reason you don't just check the instigator that you have set?
I planned to extend this so that the NPCs can shoot certain things also depending on the tag
but yeah it'd be essentialy team 1 can shoot team 2, team 2 can shoot team 1 or team 3
i believe there is a node for 'has tag' so you can do this with only one loop
Has tag does work in this context yup but it felt a little hard codey
or a little redundant since I would need to tell it what tags are acceptable in a different variable
nah, you get the bullet owner's tags, loop, for each does hit-actor have it?
soon as you hit yes, done
if you reach the end of the loop, there was not
randomness works, im using random bool and a branch going into 2 other branches with random bools. that part works. it works by giving me 2 randomized powerups from which i can choose by pressing a button, at predetermined score values. and i have a system that something already picked cant be picked again. but damn, i MAY have a solution. writing this out gave me an idea.
That's how mine is set up, isn't it?