#blueprint
1 messages Β· Page 167 of 1
usually you don't need too much info just the problem, what specifically breaks ?
by the way, it would be pretty normal to need a fair amount of 'per team' data or even functions maybe events too, not just a "tag". you might preemptively consider making a UObject class for a team, thats what i have done though it was a bit of a bother
Oh, man. Y'all.
It's totally working, I just completely forgot the whole reason I even started this logic which is that it shoots itself.
It IS getting the gameplay tags it's just the breakpoint debugger is bungling displaying it correctly, but it IS actually getting the array of tags. Good ol printing it out did work to check π€¦ββοΈ
yea. printf debugging still king. unfortunately
it selects 2 powerups, pauses the game and gives me 2 button with the randomly selected powerups, this works once, but not when doing this multiple times. they are permanent powerups so i have a system preventing once selected to be selected again. BUT as i wrote some details earlier i got a lightbulb moment, implementing it rn, idk if it fixes it tho
I also implemented it this way instead, so, thank you!
Copy the power ups into an array. Remove the ones already granted. Randomize from the new array.
i have no idea how arrays work. im 4 weeks into this, under 2 weeks for this game specifically
well, your going to need to for this sort of thing imo
something like. 'make local variable candidate powerups' -> 'get all objects of class powerup' -> the result of this is an array -> foreach powerup in array -> if powerup not granted yet -> add element to local -> get random element in local var array
there could be a helper 'predicate node' or something
That function, isnt that just the 'Contains' node basically
is there any way to set the values of variables in a physical material from within a pawn?
If you don't see it then it's private / not exposes to bp.
Dynamic Material Instances are pretty easy to manipulate
Idk if you can make one from a physical material or not tho
I need some help with my inventory system I have watched the tutorial over and over again and tried some fixes However the Image Icon and quantity do now show up. Howvever the inventory still functions. I have some screenshots here of what is going on but now I am getting this error which is completely new to me and I am thinking might have something to do with me messing around.
This is the video with a timestamp. https://youtu.be/iqi-kg7n-io?t=627
We are revisiting one of my first series on the channel; the inventory system series, this time with different implementations, improvements, and now in Unreal Engine 5.
In Part 6 we create the widgets needed for our inventory display screen.
SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley
Buy Me a Coffee I buymeacoffee.com/RyanLaley
D...
will look into this, appreciate it
I'm working on a school assignment where we have to implement checkpoints. To complete this assignment I have to check if the current checkpoint is the level start, and if it is, set all other checkpoints to not be the level start, but I have having trouble getting it to work and I'm kind of lost
I am using draw debug line and draw debug text to display these lines and names. However, they only last for the duration. Is there any way I can get them to update live and stay forever?
Are you using 5.4? I noticed those functions are missing the params for persistent lines and line duration in my editor
yes, I am on 5.4.1
Yeah me too
sad days π¦
Idk I debug in C++
I just tried in blueprints real quick and yeah I noticed it's gone
You gotta put them on tick
If they last for 1 frame you need to print on tick
this works for in game, but it doesnt work in editor, because on tick doesnt run on editor
π¦
draw on tick works, not for the editor though
You want to see the lines when the game isn't running?
Oh yeah
im making complex ass puzzles here π
Damn bro they screwed us good
You know how to make custom C++ classes? I can write up a few blueprint library calls for line traces with the engine calls
I'm gonna have to do it for my stuff now seeing this
Oh wait that still wouldn't work
Damn bro do you have a light beam particle system?
You could trace those lines with a beam particle you can activate those on construct
Set the beam lifespan to infinite
that is a good idea
Your picture and the description dont seem to match at all in my brain. Can you explain a little more and provide some pictures.
I did fix it a little, it now correctly is setting the level start to true when reaching a checkpoint, but it's not setting the others to false
yeah, I will wait till they fix it.. or just test in game.
to reiterate again, when I reach a checkpoint this function will run, this function is supposed to check if it is the level start, and if it is set all the other checkpoints to not be the level start
The not equals node is opposite. Use an Equals node since you want all other checkpoints to be FALSE if they arent equal.
== will set all other checkpoints to false
I did that, and now I can't set a checkpoint as the level start at edit-time, I do have the function being called in the construction script because that's kind of required for the assignment
This logic won't work. In your for loop you need that self != check to Branch, on True set that boolean to false manually
like this?
I am still unable to set a checkpoint as the level start, so I spawn underground unable to move so
I'm doing something wrong
Well the variable itself, the default value is false and then you can make it a public variable and in your editor you can manually select which one you set the boolean to true
Click the little eye icon next to the variable and then you can edit it on each individual actor you place in the world
yeah I already have it instance editable, the issue is that the function is setting every checkpoint to false on level start because I have it being called in the construction script
but for the assignment I need it to be called in the construction script
Why call it in construction? That runs the function every time you compile the blueprint
yeah I have no idea
I don't really like this instructor so far he didn't explain anything really
Is that a literal part of the assignment
yes
Oof

Damn bro I just used player starts
They have a playerstartname variable made for checkpoints
BP_Checkpoint is what parent? Can you parent it to a PlayerStart?
Can you even call GetAllActors in the construction script huh
As long as they're placed why not
even if I could I doubt it would work, he has this blueprint that runs on begin play that checks if it's setup how he wants it to be
Ok
If the checkpoint is placed in a level it wont run on game start.
So idk how well its going to work out.
Unless this is supposed to be an in-editor thing
Oh wait hold please
You need to drag off the actor pin off the for loop and from that call Set Start False
You're targeting only your own variable change the variable on the found actor in the array
there is no actor pin on the for loop
Guy
am I stupid
You're checking the actor vs yourself !=
Wait
You would need an interface call
Don't cast but you can make a set boolean interface event
Call the interface event off the actor
No casting
my brain is working overtime to try and understand what you are saying to me
The prompt is incomplete and the code sample is too small. Post the entire prompt and sample please.
me?
how do i copy ALL properties of all components and the actor itself, and paste to another?
Yes please
Might as well just duplicate the actor lol
yea.
Make it a base class instead *shrug
bet
What can cause this warning ?
Warning LogNetPackageMap FNetGUIDCache::SupportsObject: SplineMeshComponent /Game/Handball/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.BP_Ball_C_UAID_F02F74520411A4F601_1849238799.NODE_AddSplineMeshComponent-0_119 NOT Supported.
is that component replicated?
Disable replication and see if it still causes the problem
Is this function running in the level bp ?
no longer an issue, thanks @waxen quarry
Guy your screenshots show you he's using an interface call
Just like I'm about to show you
Well, now i need to see if all still works ? the object in question is a physic object that is replicated. It seems to still works
I'm pretty new to ue5 still sooooo
my bad gamer
and since the object does not really have an inner state, all may be good
Guy we got this I got 3 pictures for you
I'm ready
so I need to create a bpi, and implement in the checkpoint bp, and then what?
Then in your for loop
You just type the function name and look for it with (Message) next to it
call that function and the target is the actor in your for loop
As long as it's not self
What? Look at his pictures he already implemented everything as the promp asks
do I wanna make a function in the bpi?
yeah but it doesn't work
Yes but no inputs no returns
So much for the challenge
this "challenge" sucks, imagine if you had no idea how to repair a car, and your instuctor told you "well now that you know what a car is, your next challenge is to repair it" and that's it
Well
if those pictures are what your lesson includes
then it does include the answer
which is an interface call
He has the interface function already and the prompt doesnt say to add an input. Its supposed to be a basic event.
Reading comp is a good skill
That's the whole point
Gotcha
there is no where to type in a for loop, you might have to break it down like I'm 5
Do you have GetIsLevelStart function implemented? Whats the code look like?
Ok had to check lol
Anyone know how to set a physics constraint angular twist to angle of like 30 degrees relative to where the constrained object has been rotated?
Like when its released
You are looping on an array of actors, each of which is an element you can pull off of in that for loop. Drag that element pin off get you a spaghetti noodle and when you let it go it opens the drop down menu of things to type in. Start typing in the function name of the interface function you want to call, and find the one that has the name then (Message) after it. Call that function
use the spaghetti noodle off the element pin as the target
That's because you're only calling it in the construction script
How about calling it again after the new level gets set
Where you gonna put that same function so you get the same results but after the new level start gets set
it's the challenge
Where does this event even get called from?
Wait you already have it
then you can call that one instead of the BPI we just made
you already have an interface
lol I tried telling you he had it in there already
I thought that was his assignment like poster
Itβs ok, interfaces can be confusing
What code executes the SetIsLevelStart event?
soooo call "event set is level start" inside the "level start validation" function?
Look what Gold just asked
You already have an interface call set up somewhere
Wait that's set is level start true tho
how do I find out, find references does not work here
What functions are called when you set a new level start
It does, just click the binoculars after
That's the actual interface. We're asking you where do you call the functions in your code for all this
Bp_checkpoint
I didn't write this code
it's the code that checks if I have the checkpoints set up correctly
Ok right there your top line
Right after you set the new one as the checkpoint
Call that function again that you call in construction
to loop over all the other checkpoints and set them false
through an interface or like, should I get a reference to the checkpoint blueprint
cause it doesn't have that function
No
that's the glory of interfaces
you can call functions and get values and do fun stuff without casting
More like the downfall π€£
which function? it still won't let me call "Level Start Validation"
Did you put that loop call again after you set the new checkpoint
one thing at a time
Did that fix that part
Guy
Call the function
Wait
I see what you're saying
I don't understand your stuff sorry
I tried here too
doesn't do anything different
it's able to set new level starts, but not set the old ones to false
anyone know why rotation when killing the host works but not when the host kills the client?
π
as a beginner to unreal i heard casting was bad because it has the object you are casting to loaded into the memory of the blueprint you are casting in i think? However, for my multiplayer game is it ok for me to cast to playerstate in my gamestate class and vice versa since those two classes will be communicating a lot passing various information etc? My multiplayer game is a strategy card game type so it will mostly be passing simple integer and boolean values in between anyways
Casting isnt the devil. Overusing interfaces and using them the wrong way is the real devil π Ideally cast to base classes with as few hard references as possible. Dont cast OnTick. What I suggest you do for important variables like the GameInstance, gamemode etc is to cast once and store the references in a data asset. Then create a blueprint function library that retrieves those references. Eliminating the need to cast everytime.
Then I can use this anywhere I want
that makes sense, i knew this was not the way when i created a ton of interfaces just to avoid casting between two base classes in a simple game lol
lol good lord
The purpose of interfaces is to contractually oblige 2 unlike actors into having the same functionality. For example, a Tree and a Dog. Both eat but in very different ways. Where you would otherwise have to cast multiple times to many types to figure out which has the Eat function. We also have actor components, use those.
Yeah i knew i would use it like that too. Especially when a player uses a card in the game, i would just call the 'Use' interface for that card and that card executed whatever special effect it had.
Similar behavior on unlike actors belongs in Components tho.
You can make a single component that attaches to any actor with all the rich features of components that interfaces lack.
ah makes sense, and then i can communicate with that component of a blueprint from another blueprint if i need to right?
yeah
?
is that code on the player controller?
So the character ?
yep
u sure GetPlayerController(0) is returning the host controller and not another player?
yea its 100% the host
Is death event only called on the server?
Death No Rep is the not replicated event
Does it run on every player or on the server only
SetViewTargetWithBlend is not a replicated function.
i think every player... im not too good with replication
do you know any other methods besides that?
hello i was wondering how to replace old input system with enchanced
i already got the new input actions from the third person template
you are making a MP game, the character is already replicated, you just need to make that OnDeath no rep into a replicated function. Why is it non replicated?
Replace the old system with enhanced? Just copy it from the TP template
if anyone has hints or tips/advice on RTS AI (for combat/soldiers) it would be appreciated, especially on deciding which target to attac
Tip - Only allow so many enemies or soldiers to attack a single target at a given time. Otherwise the entire horde could pounce on a single target π
Happy to not be useful! π»
Have the AI increment the attacker count on the target. If the count reaches a threshold (like 20) then the ai needs to find someone else.
what type of replication? i feel like i tried every type and it didnt work
@uhr https://dev.epicgames.com/community/learning/tutorials/PBnR/creating-an-editor-tick-in-unreal-engine
This solved the issue for me! β€οΈ
You should go to #multiplayer and read the pins there
any idea how the logic gets through a branch like a drew the arrows, even after i set the variable to true (and the "not" makes it false, so it shouldnt be able to go through the true pin there)
If either of these bools are true then it returns false.
yes thats how its supposed to be
If both are false, then it returns true.
yes i know, i want it to be false if either is true
it somehow goes through the true pin the branch even tho i set the variable true
i set it here, and it goes through the correct pins here (i made sure)
as these trigger powerups, and it the powerup triggers right after i set the variable, connected right after it, and the correct powerups are used, meaning it does go through the set
but doesnt the OR with the NOT do the same thing?
Use a NOR gate.
well i also disconnected the gate completely as it was more for future proofing, as ill need the other variable later, but currently one of them does nothing, so i tried by connecting it directly to the NOT and it had the same problem
False if either is true.
Unless you mean, you want it to proceed only if both are true?
no no, i want it to proceed only when both are false
I keep screwing myself up...
looking at that NOR graph it seems to be the right one
So what you have should be correct. The only other reason could be that your values are not what you think they are when that code is running.
Hello, i'm very new to blueprints, and i'm trying to update the health of my healthcomponent from my cardinfo(widget). what should i be putting into the object which is giving an error.
also am i doing this correctly? i created an custom event called update health etc.
its updating these texts, but the healthcomponent i'm using isnt getting updated yet. and i am guessing i could do it with the update card event
Hey guys, any idea why my characters won't move? I placed a nav mesh volume and it was working before, a friend of mine changed textures and now they're all stuck
Where is that widget located?
Aka where do you create and store it
Also why are you trying to update the component from the widget
what would be smarter, other way around
Can the player change the health via inputs or so?
nah i wanna make a cardgame, so all the health attack, name etc is in a data sheet
If there is no user interaction in that widget, it almost always should only display data, not mutate it
So the Card should get the Component and the health value from it
Unless it should only show the default value from the DataTable
Then the Component shouldn't be in there to begin with
thats true
If you want to initialize the component to the DataTable value, do it where the component lives
Or in the component to begin with
okay
Are you using Source Control?
Given you work with more than one person you 100% should.
yes
Then you could simply check the commit and see what your friend changed
Or go one commit back behind their commit and check if it works again
he changed the map, he worked on it for a day so i would like to avoid revert the commit if i can, that's why i was asking for suggestions
as for the source control, is there a way to access the changed file? i'm using github desktop and gitkraken
OK, i somewhat fixed it
i have another issue, i had this before, my nps get stuck when meeting each other, and they remain stuck. how can i avoid this? i also enabled the navmeshboundsvolume to be dynamic (does this lowers the performance much?) because i need it for my spawned objects, but now the npcs move in a very strange way, i think because they are trying to avoid the very same blocking volume themself are creating on the navmesh bounds volume in real time. how can i fix this?
you can change the collision settings to just not collide with other NPCs, or you can enable collision avoidance somewhere in project settings afair
newbie question.
I have a board game i am making and I am trying to understand what can and cant be replicable from the client to the server.
my goal right now is to be able for the server to see the client click and dragging pieces around the board.
currently, only the client can see when the server does it. no surprise
most of my events are replicable or server ran. but the actual dragging of pieces is a left mouse button press and release event.
here is a snapshot of the blueprint currently.
can I restructure this somehow where the client's actions will update live on the server's side?
hopefully this is informative. if I were to attach a video, the server would move a piece and both screens would show live movement, but switching ot the client, only the client's movement would show, not on the server's window.
The best place for these questions is #multiplayer . There are also pins there you should visit
Is the only way to refresh a data table by reopening it? that seems jank
you mean after modifying it from code, or? If I recall there was a delegate somewhere that you could run that makes the datatable editor refresh. but it's C++ only I think.
All good I'll try that
any idea why I cant call this event?
Check the errors. It looks like a type mismatch. Also you're not using the cast result, which I am pretty sure is related
all work good for me but
i want to set that in 3 case so it will do case 0 code
i want that to reapet unlimited time
case 0
case 1
case 2
case 0
case 1
case 2
and go on
how to do that?
This is an exercise you can do. Create a variable, call it counter.
On Button Click -> Counter ++. If Counter > 3 set Counter to 0
i create and i call it counter
waht to do now?? @frosty heron
i didnt understand
you need to put it inside code so every time it runs it will increment counter, and if its >3 then reset it
something like this:
is the character possibly the largest size map for disk and memory, compared to other blueprints? my character is tied to most logic, unfortuable some like the inventory is not a component. So its always refernced. It is currently 1gb, I tried to lower it from 1.3 gb, do you think this range is acceptable for a modern horror FPS games with high end graphics in ue 5 targeted for PC? Thanks
The only soft stuff i am doing is for some icons in the inventory. There was a logic i needed to change which would have used soft reference to my weapons as skeletal mesh, but i needed them to be actors to add attachments so now that gone.
Now I use interfaces, dispatchers and some components, also a plugin called eventdispatcher which is a sort of global dispatcher.
This is actually a base template that i have expanded almost 3 years in the making, unfortunately when i started modifying it i didn't know about optimization, etc. Now I am trying to clean it up, it gets difficult as the refences from each other cant be so complicated trying to locate them deep in the bps and within the bp. Though the package game works ok in medium and high end pcs, i am just worried that adding more environment assets might show the problem, though i am more conscious of the texture stuff now.
where to connect what>?
What is the Multi Gate Node in Unreal Engine 4 Blueprints?
Source Files: https://github.com/MWadstein/wtf-hdi-files
hey,i want to play walk sound when the player is walking but this is very expensive ,how can i do it cheaper?
play it on the animation asset using anim notify
i found it,but is not just a sound on a frame in animation,its a 2 second sound.Play sound is the only one notify sound?
Someone know how to create wheel of Fortune in unreal engine?
hm, i'd try with cylinder actor with rotator component with 0 rotation rate and apply random rate on activation > timeline to 0 to stop
Or with physics. Constrained cylinder + initial angular impulse to make it spin until it stops due to a bit of angular damping.
ok, I can't find solution. Any idea how to spawn (drop) multiple items in the world in 1 spot but not make it look like damn explosion? I don't want to set them to ignore itself as I want them to stack on each other in bound boxes etc. Just initial spawn don't make it bursto from physic ovelap
@rose crestsomething like this? https://www.youtube.com/watch?v=bn3aDOA1JXA
Learn how to use the FREE Physical Layout Plugin in Unreal Engine 5 in order to get realistic results for creating rubble, organic rock formations, pebbles, trash, whatever you like, in just a few clicks.
Get EasyMapper HERE: https://www.unrealengine.com/marketplace/en-US/profile/William+Faucher
EasyMapper TUTORIAL: https://www.youtube.com/wat...
no, I have this one for dropping items during creation. its during play, when Player drops items it spaws multiple actors at in the same place. But It causes explosion because of physic
@rose crestGot it. You could try using some adaptive spawning to ensure there is no intersection and hence push out. Or trace to find a suitable spot where to spawn.
that's what I was afraid of. I manage to mitigate it with spawn "grow" of item, when it's spawned it grows from 0 to desired size and it mitigates 80% of that burst, it's good for now. In the future I will try to cast box to check if spot is free
@rose crestsay that your volume is W L H, you could divide into a number of smaller virtual volumes each one of which can fit one item
Then you randomly pick one of the volumes for each item and spawn it centered in it
The physics simulation will do the rest
You can also do it by layer, starting with the bottom layer and moving up as it becomes full
hm, I think I have rough idea, create map of offset/bool and use it as free space marker for items
Exactly. That should avoid the explosion effect
Hey, so I've got this object reference for my HUD widget, but it always returns none, and I can't set a default value; how would I set this? I have an event I need to call in the widget bp
Same for the weapon component from the first person template, I have the ammo count for the weapon stored there
WaveHud is a widget blueprint and when you try to set a default value their are no options?
When do you se the reference to the WaveHUD? If you don't set it, that will be why it's null.
When you call the function CreateWidget, the return value is the object reference you need. Set the value of that HUD ref to the return value.
Then you can use it
so, I have a save blueprint that keeps deleting one of its own structs whenever I restart the engine, how do I fix this?
or rather I should say is, it's missing until I hit compile on it then it just reappears
and I have to go back in and fix all the associated blueprints that write to that struct
I dont know how to fix that but I will give you some advice. Never use UserStructures aka Blueprint structures in a save game. They are unstable and if you rename them or move them to another folder it will break your save data. Use a structure in c++ instead.
Savegame in BP is hard. Honestly. :/ The amount of extra work you have to do to make a container to hold the data and restore it and do that for every single minor little thing in the game vs simply saving an object as a byte array.
hi there, I would like to know if there is a way to not reflect the "game graphic configuration of my widget" in the engine?
for example, if I try the function to lower the texture quality, when I exit the emulation, the engine follows this configuration
the only way to revert everything to default is to reopen the project
Move this post to #multiplayer
ok
Hello Im having an issue with streaming in levels in and out. In this approach I'm using a persistent level loads the menu, swamp etc as show in the 2nd Image.
when I play (I start at the menu level) 5th Image, I have a load game menu that when a slot is clicked sends a request to the game instance to load a level (by name), this in return call an event dispatcher the level blueprint is bound to. this seems to work as expected when loading the initial level however when trying to load back the main menu it doesn't seem to work, leaving the player in the loading screen.
Please find a recording demonstrating this issue.
Note: Recording is of low quality because of discord allowed file size.
Hi I'm new to saving. What's your advice on the best way to store all the states of the loot chests in one level so when I return to the level after another level and not have the chests reset to their random construction. Should I save to my Game Instance or to a temporary Save Game slot? Also would saving the chests when they change be best done asynchronously or all at one time when I leave the level? Thanks for whatever insight you can offer. I'm really trying to learn BP as well as I can, so I'm not even gonna go to C++ lol
-If the chests are meant to only persist for the duration of the game, then the gameinstance is fine.
-Save the chests state whenever a player exits the chest or makes a change to the inventory in the chest. Incremental saving.
-Async is fine, if you save the chests incrementally, I doubt you would notice any hitch's if it werent async.
-As for how to save the state im assuming these chests are placed in a level already. Give the chests a guid variable called "ChestID". Generate a random guid for each instances of that chest. Those instances will retain their IDs if you set it in the default settings. Then you can save chest data with the given ID and use that to repopulate all the chests. There are some more advanced techniques with data assets you can do but this is just a starter.
ActorTags can also store an ID reference if you want to use that without needing the specific chest type.
I hope someone is able to help you! It might help me way into the future π
much appreciated
Hello, I have two plug-ins with conflicting components- one requires a game mode (Nice interaction system) and the other needs a widget to work (Narrative 3.) The game state overrides the narrative widget so I can't click anything. Any ideas how I can get the mouse to work when the widget opens? thx!
so the sample/test level i started with had a "sky sphere" which appears to not be a special actor type, its just a static mesh -- and the effect only works if its bigger than the entire space your camera can move within -- but uh is there not a way of doing a regular skybox cubemap sort of thing that doesn't depend on the camera position at all?
im fine with how SkyAtmosphere looks, i mostly just want a ground color, which i dont see a way of specifying within it
any ideas on what I should be doing to make a spline mesh move along an object I push? The pushaable object works fine, and the spline BP works only in editor, but when trying to attach the spline to the object via adding the BP_Spline as a child actor of the BP_Pushable, the object does get made but the spline functionality seems to not happen.
On a side note to this. Learning BP is great and something I wish more people who know C++ would aspire to.
But in this specific case, BP is a disaster. C++ allows you to simply save things via their path name, and save things marked savegame in the object which writes the entire object's save data to a byte array which you can then simply restore on the object after reloading the map by finding the object via it's path name and just serializing the array's data back into it.
On top of this you can do this with any object. Chest, Character, ActorComponents, UObjects, GameState, GameMode, etc. So If you know C++, I strongly advise using it here to expose some functionality that you can use in BP instead of staying strictly in BP.
Thanks for the reply and insight @maiden wadi . I unfortunately do not know any C++. I'm basically an artist trying to make a simple little hobby game by myself and see where that takes me. π
Ah. Fair. π I mistook what you wrote at the end there as trying to learn more of BP instead of C++. If you ever do start getting into C++ just remember the Serialize function. There are quite a few guides on how to use it. Creating your own simple archive and whatnot. About 60-90 or so lines of C++ can make your life insanely easier.
yea but saving/loading isn't what i would advice someone to do first when starting their UE C++ journey π
maybe stick to an premade asset like EasyMultiSave or Savior...
@maiden wadi I've noticed in my BP for my chests that under the variables I would want to save for Structs, under the Advanced section in the Details Pane, there is a SaveGame option. Would this be enough to do what you were saying with saving an entire object's save data to a byte array?
What if instead of a separate blueprint you negate the direction the box travels and make spline after that
Im having issues with the general logical flow of my inventory system. Basically it runs like this:
- in the inventory component,
BeginPlaycallsInitDatawhich setups the replicated uobject data containers and compartments (container > compartment(s)). This setups data for any equipped item. - picking up an equipment item sets an item variable that is set to repNotify, which for instance
On Rep Tac Rig ItemcallsRefresh Tac Rig, and that checks the validity of the item var and checks if its data containers exist before rebuilding them if they dont. - picking up an inventory item will call
Try Add Item(which runs on the server afaik thru the Interact interface) - hitting tab will open the inventory, which calls
Setup UIwhich builds the UI based upon the relevant data and omits anything that isn't included.
the problem: when u pick up an inventory item larger then 1x1, as long as U have a backpack it should go in the pack right? but itll go somewhere else and the server will say it was added T_T
I think its an issue with calls to Add Item at Index
Man this why don't be in here half of time asking questions.
Weird bug with Blueprints, not sure is anyone encounter something similar? Basically have detached part of the code which corrupts functionality without giving any error. Deleting some nodes or all of them fixes the issue. But makes overall debugging process totally unpredictable . Basically trying things may actually work, but breaks something elsewhere https://forums.unrealengine.com/t/weird-bug-or-something-different-not-enabled-nodes-affecting-how-the-bp-works/1860848
Hi folks, not sure is this something specific to what I have or maybe known problem. I have it tested in 5.3 and 5.4 and same problems happening, but in different places of the same BP. I have some simple sprint function with Print String message - Sprint. So I know that character does βSprintβ. Below I have some parts I was testing, and that ...
did you delete the print string node to ensure that the print comes from THIS bp?
also the output log shows which BP does the print
Unfortunately it's not. And I really don't know why Epic won't expose a decent system for saving games to BP. It requires very little C++ effort. I guess they're fine with people charging ridiculous amounts for savegame plugins. π€·ββοΈ Then again they won't fix the Landscape either.
To use that Checkbox you mentioned. You have to be able to call this Serialize function on your object. Like your chest. And pass in an Archive that is set up to pull SaveGame data. Not sure how well you follow it. But like the second image is an archive child that has IsSaveGame = true. Which means it will write all properties with that savegame marker and not every property in the object. Saves a lot of space. The first image then creates one of those archives by taking in a memory writer, which in turn took in the byte array by reference. So when the Serialize function is called, the byte array is passed back out of this function.
What I do after that is I save that byte array in a struct along with some other data like the object's full path name, it's class type, and some other helper properties. Which I can then either find the object if it came with the level or spawn it from the class. Then I just write that byte array back into the object. Which lets me generically save literally any object simply by passing it to this function. I don't need to care if it's a component, actor, etc.
There no specific logic what to delete, it basically has some part of the code - added for instance, later removed. And it won't work unless all of those deleted or some nodes. It can be any node really
If I have a widget already in the viewport and I then add another, how can I make sure the new one goes behind the older one?
Is there a way to set nav mesh to auto scale to level or I need to scale it for whatever big it can be in the future? also as I generate dungeons in runtime I'd need to have dispatcher from navmesh when it finish its job, is it possible?
z order or use an overlay panel and manage them in there
how do I change the z order of widgets?
its an input on the add to view port function
ah thank you so much
ahh ok
Thanks @maiden wadi for the in-depth explanation. I appreciate it! You should make a SaveGame plugin π
willing to bet theres 10+ of those
Does anyone know why one of these functions would be complaining about being read-only and the other one does not? They both just SetNiagaraParameters
I've even tried disconnecting everything from the ApplyDamageType function
Who wrote these functions ?
Me
The targets donβt seem to be the same. Also have you tried selecting a damage type tag other than none?
They're both inside of the same FunctionLibrary, which is the weird part. At one point I copied everything from ApplyGlobalNiagaraParameters into ApplyDamageType and I still got the same error. I just tried with all fields populated just to make sure and it still has that error
But why is the first one called NiagaraComp and the other System?
Are you certain you selected the same type?
Just for cleanup. They're of the same type
You made these functions in cpp?
They're just BP functions
Weird
I feel like this is some kind of bug
There's nothing in this function and it's still displaying this error
Delete and remake?
I made a new function in the library with the same name and no parameters
Wonder if its the name somehow
Weeeeeeeiiiirrrrdddddd
New function with nothing to do with ApplyDamage works
I tried a few different versions of ApplyDamageXYZ
All of them caused an error
Anyone know how to set a physics constraint angular limit to the current angle of the constrained object? I am trying to make a door stop when no longer being moved and want it to be constrained to the last angle it was moved too. Currently when I constrain the angle, it constrains up to where itβs been moved, but only because Iβm widening the constrained angle, not setting a new angle to be constrained to based off the current rotation.
Yea i hit a conflict with the name of one of my function library functions too.
With the very same, after-the-fact sort of errors.
Iβll post a picture illustrating what I want to happen
I could see if I called it ApplyDamage but ApplyDamageType should be different. Unless its some function not exposed to BP and I just happened to step on it?
idk but find in files "ApplyDamage" match case, in vs
or just try to do 'call function -type applydamage'
see if there are duplicates
or any at all from outside your library
None appear for me. Boy this is a weird one lol. It has to be somewhere and I just cannot see it properly
preemptively add My in front of everything :DDD
Lol I could do that
Basically I just donβt know how to set a specific angle thatβs relative to where the door has been swung too.
I currently am able to set a max angle based off the current last rotation before letting go, which stops it from swinging more, but when swinging the door inwards it doesnβt do anything as I am only setting a max angle, not a min.
You'll have to do math and probably change reference frames
So lemme get this straight, you want to have a door swing, then when it stops, update its constraint to limit rotation between x and y?
Might be as simple as calling set constrained components. That'll update the reference frames to be relative to where the things are now
Iβll give that a try thanks
Why are you doing this though? It makes no sense
I have the player able to move the door with mouse movement in first person like Amnesia. Iβm using add force to move the door, and the doorknob is constrained to the hinge. Iβm trying to stop the door from continuously swinging when thereβs no force being added and I want to have the effect of the door being dampened and slowed down when not being moved.
There an easier way to do this maybe?
Yes angular motor
Just give it a velocity motor and it'll dampen it
It'll be like the hinge has friction
Ok, Iβll need to do some learning how to use that setting, havenβt touched it yet
Ty
how do I append multiple arrays into one
EDIT, there append node for arrays in UE
but it only does two, I want to append like 5 or 6 arrays to one
looks like you just have to append a bunch of times
Something like this. You could create a structure which is an array of arrays which you can then use an an input to the function if the arrays might be dynamic. I however, assume it would be the same set of arrays you need to appened.
How do i replicate random int in range
You would store it in a variable and then replicate the variable.
So make 2 cusom events and just put the varuable in the custom event ?
You don't need a custom event to replicate a variable.
Really?
Yes. There's the replication option the variable itself.
Ok ill try it
Rep Notify will make it call an event if you need something to happen whenever its updated. Replicated just replicates the value without doing anything else.
Yeah Im making a gen erator that turns off in a random time
Its not working
At a quick glance, I would say that the Interact event isn't being called on the server. Also, after you've set the delay duration variable, you then need call a multicast event to trigger the delay/material change on the clients.
Having said that, you only need the server to handle the delay and then just multicast the material change. No need to replicate the value at all.
I would also recommend you read through epics documentation on how to replicate using blueprint.
So it looks like your calling the interact function on every client. This only need to be called on the server. The server should then multicast anything that the other clients should need to know about.
Alr
Thanks for the suggestion, got it working.
Is there a way to get inherited variables to show up in a subclass's variable list?
yes theres a check box
show inherited variables or something like that
You can add a position motor to make it spring loaded like some auto-closing doors
I checked class settings and class defaults and I didn't see anything @faint pasture
Click the gear above the variable list in the respective details panel
Thanks!
Hello mates, I asked this also in the audio part, but not sure where its best, I need set the vector length to my metasound distance but i'm not sure how to do that, any idea ? I've tried to look around for set sound parameter/ set float parameter etc. but can't find anything
so.. the vector length is the distance between your actor and some overlapping actor? well, the origin/positions of them anyway -- and you want to what .. assign a volume to something on your heatbeat component?
also note this
Plug your audio component into this, use the name of the variable you've defined in your MetaSound and feed in the float
There's another one specifically for audio components too... One of the two will work.
is there a smart design pattern to allow one actor component to delete a sibling actor component (same owner)?
If I recall correctly, the owner has to be the one removing its own actor components
My best guess is a generic public function on the owner actor that anything can call, but is there a smarter way?
You're telling me a component cant call DestroyComponent on another component?
Hey guys, I'm trying to add a vector input to my ai for a sort of dash ability, and I have it working correctly with this. I just want to be able to scale how fast it goes, as currently it moves really slowly. I have tried increasing the max walk speed and also multiplied the vector, but this didn't work. Any ideas would be greatly appreciated!
why are you adding here?
what is alpha?
alpha should be a 0-1 range feeding a lerp
it is just a vector that points in the direction I want the dash to be
Oh yeah ignore the name of that lol
still why are you adding
the vector is correct, I just want to be able to scale it
multiply
that is so it works relative to the player
multiply by float, yep
ok back up, what is the timeline outputting?
I tried multiplying it by a float but it still is the same amount of movement
here I'll get a vid 1 sec
I'm guessing it's 1,0,0? if it's a forward dash
I'm using a vector curve and inputting that into the timeline
that all works and isn't the problem though
I think it is the add input vector which is the problem
I'm not sure what node would be better though and allow me to scale the speed basically
First off, does an input above 1.0 do anything?
I'm doubting it does
so you'll never move faster than walking with this approach
Anyway, if you wanted this to work, you'd have to rotate this vector so it goes from local space to world space
but you won't go faster than walking with this
that's the same tapping W, won't do much
Wanted it to work as in the speed being able to be changed?
because that's the one part that isn't working, the movement does
Is this meant to mean "walk forward for a fraction of a second"?
lemme get a video for you, 1 sec
The first thing to figure out is if inputs with length greater than 1 do anything
I doubt they do
you can change max speed -> timeline -> return max speed to normal walking
but that's pretty bad, I'd use forces IMO
I think i tried that and it still didn't work, but I'll try it again real quick
oh and in the video I'm just having it go right at begin play
Hey! Is it normal that I can't access any parameters of AI Perception in my blueprint? I wanted to change the sight radius dynamically but I can't find the node
Oh wait actually this might have worked, thanks!
must have done it wrong when I tried it before lol
haven't added effects yet, just trying to get the movement down
If it's meant to be a dash I'd not do it through walking but that's just me
I mean what I am trying to do isn't exactly a dash, I basically want the enemies to be able to move forward slightly during attacks, like a sword swing would move them forward a slight bit
ah yeah as long as it's fine to be walking speed or slower that'll work
I'd output a float tho
and interp between 0,0,0 and ForwardVector based on that float 0-1 range
I used a vector because I might in the future want it to be able to move side to side during an attack
So I could do that in a vector curve even if the ui isn't ideal lol
ah ok yeah so then you can multiply like this
MovementInput = VectorTrack * (Capsule.Forward + Capsule.Right)
assuming capsule is facing direction
er wait a second
you'l have to do it in local space
then rotate it
What I have right now is basically I get the vector from the enemy to the player and then just add it and it seems to work fine somehow π
I'd instead do it like:
MovementInput = RotateVector(VectorTrack, AimRotation)
assuming AimRotation is updated to face enemy or whatever
won't work for right, just forward
Oh I think you're right, lemme try your method
What's the most convenient way to get the location of one actor relative to the location of another actor in a vector? I see plenty of stuff about transforms, but I don't think that's what I'm looking for (unless I'm misunderstanding it)
subtract
Subtract in which order
DisplacementFromAtoB = B.Location - A.Location
Basically I want the position you would get if the actor I'm comparing it to is at 0,0,0 and the other was somewhere else
Would that subtraction do that?
do you want the rotation of any actor to matter for this?
If you want B's location in A's local space it'd instead be:
InverseTransformLocation(B.WorldLocation, A.Transform)
No
So b's world location goes in the top of the node and a's goes in the bottom?
Have you tried yet?
I'm trying it now
Like this?
Bottom one is the actor I want to treat as the origin
You said you don't care about rotations, so just subtract their world locations
what is the equivalent of sequence node in Material blueprints?
i need 1 thing to happen or the other
that's a branch
branch cant be accessed in materials
It's not a real branch, more like a select
but that's what you're after most likely
Subtract A's location from B?
Thanks
so how exactly would i combine this?
what are you trying to do
first off that should be emissive color
lerp between your base color and the multiplied color and plug the result into emissive
well ya im trying to connect both of them to emissive
and use your time stuff as lerp alpha (assuming it's "normalized"/saturated)
probably multiply. The light glows, and the flickering is the glowness going up and down
even better ^^
since when does the material editor have vector input fields on the attributes?
is that 5.4?
yea that did it thank you
lol i just noticed that even if it glows and flickers it doesnt look realistic, how can i make both the light and flicker go black and go back to normal
Is this what you're looking for?
Literally, exactly what im looking for
youre awesome thank you!
That 1 in the middle there is for emissive strength
if you push that above though, it might not go black.
It kinda does at 2 anyway π
works like a charm thank you
TLDR: Trying to get a Block my character pushes to produce a spline trail behind it. I am getting some odd progress where splines are finally coming out from the box as i push it, but its not the spline component i have attached( Child actor component, BP_CableSpline) some detailed blueprints and functions can be seen here: https://blueprintue.com/profile/saltybadgercubes56/
Every tutorial and forum I find all roll back to splines in editor for making walls/ or moving an actor along a spline, but nothing about moving an object and producing a spline trail behind it as the actor moves.
Any suggestions?
beside adding lighting, is there a way to easily see while im creating my map. for example i have a house but when im inside trying to decorate its completely dark
you can view the scenes with unlit mode
thats exactly what i was looking for thank u
I have this assignment from school, I'm meant to update my inventory system to be able to add multiples of an item, and remove mutliples of an item, but as is customary with this instructor he gave zero hints as to how I would do that, no hints as to nodes to use, or what logic needs to be put in place, it's extrememly annoying to be honest, could anyone point me in the right direction?
first picture is my add item function, second is remove item
Should be fairly simple with this set up. Know anything about loops?
we've used loops a couple times yeah
So right now these functions fire a single time when you call them. You might want to create a function that does it multiple times for you automatically, thus giving you a means to add or remove multiples at once.
I don't think that's how he wants us to do it. If I understand you correctly that would lead to it still showing up as separate array elements. In his example video it's meant to be one array element (i.e. picking up an apple would add 5 apples to your inventory in one yk firing of the execution)
I'm not sure if it helps but we are using a data structure for this, he gave somewhat of a hint in a lecture where he said we would wanna add a third variable to that for "Quantity" or "Amount"
Ah ok, so then you're basically creating a "stack".
So then each item in your array can be thought of as a "stack" of items with the quantity or amount representing how many are contained in that stack if you've set up your structure to have such a variable.
So when adding items or removing items you're already finding if they're in the array or not, using your "Found Index" value. So then it's just a matter of incrementing or decrementing the "Quantity" or "Amount" variable that resides within the structure at that index and putting it back into the array at the same index. The one node that may help with that is "Set Array Elem" which takes a Target Array that you want to manipulate, the index you want to manipulate, and the "item" as the thing you want to insert at that index.
that sounds like it could be what I want to use, any idea where I would put it/how I would hook it up?
You'd put it anywhere that you need to manipulate an existing value in the array.
If the item doesn't exist in the array yet, you can add it to the array with your desired quantity in the structure already.
If it is already in the array however, you'd need to retrieve the current "Quantity" from the structure, and increase the amount by the incoming amount of items you want to add to it, and then once you've manipulated the structure you can use the "Set Array Elem" node to modify the array, at the index you found, with the newly modified structure containing the new quantity.
I appreciate you taking the time to help me with this and explain it to me, but I am having a lot of trouble understanding. I am still very very new to blueprints so it's even more confusing as to why they are giving me this assignment but what are you gonna do
basically I have no idea what you mean by "anywhere that you need to manipulate an existing value in the array"
I have no idea where I would be doing that
everything I have set up right now it just me following along with the lectures
here's an example of a pickup, I added the amount variable to the data structure but it currently does nothing cause I haven't added anything else to the inventory component
Is there a nicer way to add rotators together?
hello guys quick question
This is an ezy enemy spawner
but how can i say that "Hey when that spawned enemy is dead spawn the next" i now that i can go with an reference to that enemy and put an "on destroyed" inside the enemy bp to call again an function that spawns him again but is there no way to to that in that Spawning bp?
I'm also trying to be vague on purpose as I don't know your knowledge level and I don't want to just give you the answer if it's part of your lessons (heck, you may as well be paying your tuition to me :P)
Your task is to change your structure so it can accommodate a "stack" of items, which is in effect just another value that exists within the structure of your array.
You've created some functions that can already read data about the items in it, add items to it, and remove items from it and you should be able to use these as examples.
So, you know how to check if a particular item already exists in your array and how to get the index of it, so then you just need to manipulate that particular item in your array and increase or decrease the quantity in the structure, and that's where a Set Array Elem node can help.
As for where to use it, the answer is literally anywhere that you need to manipulate an item within your array. You'll have to follow the blueprint logic to know exactly where and when you need to put it in, but it's almost always whenever the item already exists in the array.
Put an event dispatcher on the enemy and listen to it from where you spawn. So on destroy, make it emit something like BeforeDeath.
I asked my instructor for some direction and he said I just needed to use this "get a reference" thing and it needs to go where the bottom "add" node is, I'm not sure if he is telling me to delete the add node, or if I need to use both of them, if I should still use the set array elem node or what
okok thanks
the other "get" node is a copy, he said the difference being you can use a reference to alter things in the array, while a copy would just show you information in the array without being able to alter it
Yep, that's another way of doing it. If you use a "Get By Reference" on an array, you're getting a reference to the values within the array, but this then requires you to plug the output of a "GET (by Ref)" into a "Set members in..." node to manipulate their values.
The "Add" when manipulating arrays simply adds another entry to the end of the array, which isn't what you want if you're trying to manipulate an existing entry.
thank you a ton, how would I get a set members in... node for this? dragging off any of the 3 pins gives me zero options for that, simply right clicking in open space gives me a million options that don't seem relevant
Alright, getting there π
am I goin in the right direction
You need to click on the Set Members In... node, and you'll see there's some options for the pins you want to show around where the details panel usually is
I assume you mean these
Yep
You should only need the "Amount" one checked - this then makes it clear that you're only trying to manipulate the "Amount" variable, the others will remain otherwise unchanged.
Write a delegate/event dispatcher in your enemy ai class, which is called on death. Bind a spawn event to that delegate by dragging off the reference of the spawned enemy.
Youβre showing a multiplication and not of rotators, soβ¦ yeah there are better ways
right, there's now an amount input, where would I get the amount integer to plug in? cause it def shouldn't be hardcoded to be 5 or something
You're right, you'll need to drag off from the get again and this time do a "Break ..."
That'll give you the means to access the current values.
I know, because I can't multiply rotators directly. It's why I'm asking.
like this?
Ah, you wrote add initially
Partially. All this would be doing is setting the Amount to the current Amount.
It is add. You add by multiplying
You'll want to modify the value before sending it back in.
so we need to add the existing value, to the amount coming in?
Ikr
All computers know how to do is add.
Another one
The node you are looking for is CombineRotators
that makes sense to me but I'm not sure where I would get the existing value
You're "GET" ing it already through the Break π
Is this a new challenge Frosty or the same one? π
I couldn't find the code for it, so I don't know what it does. "apply one and then the other" is a pretty meh description lol
I did find ComposeRotators
am I stupid
lol they have the same description
so it's the new value I don't have yet?
One is in cpp what the other one is in bp I imagine @real notch
Maybe at this point just try it tho
Obviously will do that π
I am looking in the kismet math library, isn't that the blueprint code?
so the existing value in the array is the amount we just broke off, could I get a hint as to where we get the number I would want to add to it?
Doesn't do the same thing
You feed it into the function. From there, then you need something that calls that function and specifies the quantity.
Not same thing as CombineRotators?
Not the same as my code.
Ok so you donβt want to rotate twice, you just want to multiply rotators?
the item itself specifies the quantity, as in some pickups count as 3 or 5, and they run the add item function
Add, yeah. But I think I see the problem. The code reverses the order, let me try that
Yeah that was it
Right, so then those items would end up calling the function, specifying their value (likely a variable) to add.
I'm getting confused, you can see here this is the code for a pickup, where I can specify an amount and stuff right?
I'm probably not understanding what you are saying but I've been working on this for about 6-7 hours at this point
You need to add a "Quantity" as input to your "Add Item" function.
OR
You could use the "Amount" in your structure.
that's what I'm trying to do
how would I go about doing that
Doing what?
using the amount in my structure, again logicially speaking I know what has to be done, add together the existing value, and the value of the pickup and make that the new value for that array element
but I don't know how to do that or where to get those values
So you're reading the "Item to Add" within your function, so that "Item to Add" would contain the "Amount" that you want to add.
I'm really sorry, I still don't get it, again I just followed along with the lectures, I only have a basic understanding of how this inventory system works. In the lecture he just said "now do this, then this" and didn't really explain why
Is this school or some gamedev masterclass?
Full Sail University
hey every one
You're passing in the "Amount" from the "Item" into your Function, which you can then read.
Yeahhh... I have a degree in game art from there. They really don't teach you. I learned more from assigned YouTube videos than my instructors.
so get "item to add" split it, add the amount to the amount on the get a reference node?
i have some struggle trying to make cube rotate forward like on the illustration. i want to precise that the axis presently is at 1(center).
honestly I have had a couple instructors that I thought did a great job, but others that haven't. Seems really hit or miss
What? You mean rotate around 2?
yes
I wanna kiss you on your thick succulent lips
Frosty gettin frisky
90 degree each time on the forward face
Rotate Vector Around Axis
so would it be basically the same deal but like, reversed for removing multiples?
then set to actor loation ?
So when it says "another object" you're probably looking for either a scene component, a socket, or origin + forward * radius
Pretty much, yep.
thank you man. i will try this
this is my code for removing an item, I would assume instead of false going to remove index it would do the math to remove an amount from the array element, then lead to a branch that checks if it's zero or less, and then removes it from the index if it is?
Sounds good to me.
I didn't do exactly that
my method might be a bit jank
You'd be surprised how much code in functioning, successful games is straight up jank. lol
but I set the subtract pickups as negative numbers, so instead of subtracting them, I'm just adding a negative number, to the existing positive number
I mean... if it works, it works.
however upon testing just now, it doesn't remove the array element when it reaches zero like it should
Did you figure it out?
uh kind of but not really
fixed one problem, made another problem
That is gamedev
Probably the most accurate depiction out there, really.
anyone know why this isn't working? It's supposed to be able to remove items, including multiples, but if removing an item would leave you with zero or less it's not supposed to allow you to pick it up
I should clarify, currently I can remove items, but it currently removes the entire array element regardless of how many I have
I need to find a vector, which is the direction between a static mesh's origin and one of its socket. This is easy (socket - origin), but I need to find the vector after applying a rotation, without actually applying the rotation to the mesh. So I need to pretend it happened, and get the socket's transform in this new rotated space.
@real notchAssuming the socket maintains its relative location respect to the origin, you can use https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Math/Vector/RotateVector/
RotateVector
And apply to it the same rotation the origin will get
I'll try that. I only have the rotation that needs to be set. How do I find the difference to rotate by? I can't subtract rotators
I can subtract quats though π€
Delta Rotator
I had no idea that existed, that's useful thanks
Oh excellent! That does exactly what I want
I have a bunch of meshes I prepared, and each mesh needs to become a blueprint (BP_Part) with the mesh set in a specific component (something that extends static mesh actor). Is there a way to bulk create assets through code?
how would you go from object reference to asset data? its for a editor widget, just not clear how to change
I'm making a door that only opens if you have x amount of a key, how it works is you go to the door, if you have enough keys it'll open, if you don't it'll show a message telling you that you don't have enough keys. Currently the door opens with any amount of keys, you could have one and it would work, I'm trying to set it to 3 or higher
could anyone help me out rq
Your has item function should output the ammount the inventory currently have
From there it's just check if ammount >= 3
this did not work, it was the first thing I tried, I'll send a screenshot to make sure I did it right though
You're checking if the item quantity is 0. Where are you inputting a number that you want it to check?
Then debug, fix the function to return the ammount you have.
If putting a 3 into the "Has Item" function isn't working, then your Has Item function isn't working correctly, and that's your problem.
I could be wrong, but I'm pretty sure my "make DS_InventoryItem" is only checking for a matching name
Open up the 'Has Item' function and show use how its setup.
THe "Make DS_Inventory" isn't "checking" for anything. You're simply creating a structure of variables, which is then input into the Has Item
You should use class instead of string too
Your "HasItem" function is only checking to see if the item exists. So it doesn't care how many there are. The Find Item could return an amount, then you could check it there.
does the bp debugger freeze the editor when searching for anyone else or just me?
What I would do in this function is if the item is found, get the quantity for the item and return it. That way the function has two uses. In most cases when checking if there is an item, you normally need to know how many there are so you might as well do both in the same function.
so just add a branch and an output integer? I'm sorry I'm still new
Are you trying to do a break point while in full screen (F11)? Cuz in UE4 that locks you out of everything and you have to hit Esc to quit PIE and start again not in fulls creen. lol
im not doing any breakpoint. just when I have the bp debugger open viewing my character and try to type anything in the search it freezes the editor and memory leaks
Oh sorry. I misunderstood. I've never used the debugger. :/
yeah its quite annoying
this is what I came up with myself
Not qute.
On the "FindItem" function you need to output "Amount" or just have it output the actual item it finds.
Then you can compare that against the amount in the ItemToCheck input.
Hi guys, I hope there is someone who can help with my problem. I'm creating an online game with Steam multiplayer (I've already added the multiplayer itself and everything works correctly), it just so happens that my project is actually an online concert, so I have a lot of lights on the level, and they all work through the sequence, so who can help me with how to make sure that when I created a server, started the sequence, after that the player joined, and that HE STARTED the SAME sequence in the HIS game automatically ,
but from the place where he is already playing in my game. Here is how I have it implemented now, but now it works only when I start the sequence when the second player is already on the level, help pls
I use uobjects for my items but the general processs should be the same.
Find if the items is in the inventory, if it is, return true that the item has been found and return the quantity found in the item object.
as an FYI, you're just returning the same amount value you pass in. You should be getting the quantity from the invetory and returning that.
You need to store the sequence and the current play time (tracked every second, probably) in the game state. Connecting clients can get that from the game state when they load in and set their local sequence to the same spot.
I haven't dealt with sequences, so I'm not sure if you can just replicate it and play it on the server or not, so that could be an option as well.
Has Item, is a function in the inventory, and your picture has nodes I've never seen or used before so
I could try copying it but I imagine it would not work for me
How does the 'FindItem' function work? It could probally return the item quantity pretty easily.
I just followed my instructor on this one, he didn't explain how it worked or why we were doing certain things
hopefully next month I'll have a better instructor
Yeah. In that function, if it finds the correct item Name, then you can either store the entire item struct as a local variable, or just the amount, then output that in the return node.
THat way if the item is found, you can also get how many there are and compare that in your other function.
I was going to say, it might be worth getting a better instructor. o.O
Basically, the function loops through the Items array and checks the item name to see if it matches the item name provided. If it does, it returns the item index it was found at.
At least the wires look nice π
If it helps, the screenshot I show you is the equvilent to this.
I mean... there's nothing wrong with the way that function is set up.
I've already complained about him in the school discord a few times
that was all me, his looked a bit worse
Your instructor did fine there. But if you're required to use that function, unmodified, then there's no way to check an amount.
WELL then good on you π«‘
there's nothing saying I can't modify the function, I mean you guys know more than me for sure
Anyway you will learn most by your self
Then yeah. I'd just modify the function to also output the amount of the item when found.
Also instead of doing a for each loop with break, whenever a return node is reached in a function, it terminates the function. So you can just return if it finds the item.
But a break works the same. Just extra steps for no reason.
so by modify
is there any chance
it's as simple as dragging the "Item to find amount" to the return node?
An improved version of the last function you shared. It still returns the index its found in the inventory but also returns the number of items its found.
so if I did this, it wouldn't break anything?
It shouldn't do no. It just returns an extra value of which it's up to you if you use it anywhere.
they look really similar
That's a good sign. XD
I'm using an existing inventory struct I already have in my project.
And not returning the index. Though you might want the index to modify the inventory outside of this function.
So you could use the index to say "remove this item" or to modify an array element.
But you should definitely switch from using a string to a 'Name' var type for the item name. Strings are pretty slow to compare.
how hard would that be to change hypothetically
Especially when looping through potentially hundreds of items in an inventory. - A name variable would be better than string
It depends how much it's used as you would have to fix anywhere it's used.
If your instructor used a string, then just keep using a string for this project.
But for future reference, name is ideal for ItemID's and such when you don't need to localize the values.
Localize meaning translate to other languages.
If they need to localize, they should be using a 'Text' var. I don't believe strings can be localized.
Right right.
I can't make an equal node connect to a string
You should be able to.
Granted, I'm in UE4. But I'm pretty sure you can still use == in UE5
No, that should be fine.
just to make sure
Yea that looks fine. As an FYI, returning on the loop body of a loop stops the rest of the loop from finishing meaning there's no need to break. π If it gets to the completed, we know it never found one and does the other return.
I got an error that Return Value no longer exists in 3 areas
Make sure you compile the BP that function is in.
should I be feeding in a return value in the code somewhere
Well remember to check wherever that function is called to utilize the new amount value you made.
Compile again, if they still exist, jump to where the errors are and show what they are.
You can simply connect the correct wires there to your newly named return value. Or right click and refresh those nodes.
It's just because you changed the name of the output, so those BP's aren't recognizing them.
Index I'm guessing
Yea, just connect the 'Index' to what ever the return value was connected to.
the fixed it
so I shouldn't need has item to output an amount anymore right?
or do I still need it to
Has Item should probably do the amount check itself, then output whether or not it has enough of the item.
like this?
Perfect
I take donations. π haha (jk)
Mwahaha
I think inventory systems aren't to difficult once you understand it's just data with functions to manipulate said data. The hard part is the UI and having it update the way you want.
I'm still trying to wrap my head around the use of UObject
for inventory items?
cuz you will have to construct them at some point.
Atm I just use Struct, which saves to SaveGameObject
Yea for Inventory Items.
I have a world item BP that you specify the item class (uobject) that it pulls data from to specify how it should look. The world item constructs the uobject if it doesn't have one. (I might move this logic somewhere else though)
When the item is picked up, it adds the uobject to the players inventory (an array of the item uobject) and destroys the world item BP.
When it comes to saving, you just have to loop through the uobjects and extract the data that needs to be saved. Generally, this is just the data that would change. Unless you have really dynamic items, this is normally just the item uobject class and the quantity.
This is the bulk of my world item bp. Still a wip but I can't see it changing to much. (There is some testing logic on begin play though lol)
Thanks
You just have to make sure the item uobject is referenced somewhere or it might get GC'd lol.
So you dump them in an array or something?
Pretty much. This is 1 of 2 functions I currently have on the inventory component. Still need to add some logic that checks if there's already an item of the same class that I can just increase the quantity to instead though.
I like being able to have functions on the item uobject that allows me to manipulate it's data as it means you don't need access to an inventory system that would normally have the functions.
hey hello friends why my actor is not moven anymore after "spawn actor by class" his movement is working with the event tick and usally it works perfect but did i miss something? to give him an ai controller or smoething back after repsawn?
he doing his attacks when im in his area but do not move
handle movement is calling by event tick
SOLUTION:
if you are spawning an AI, you should use Spawn AI node, this should create and assign the AI controller declared in the bp
SpawnAIFromClass
ahhhh okok thanks coldsummer π
Does anyone have any idea why the mass of a physics actor doesn't seem to make a difference in terms of how it reacts when the player walks into it?
Hey everyone, is there something like a blueprint macro library that also holds variables?
Data Assets
Though you can also just make a BP library function that passes back a hard coded value. π€·ββοΈ
I think I might be stupid. How do I apply the offset of a socket to its static mesh? I need to move a mesh somewhere, but it needs to be rotated/moved so it moves by its socket instead of its pivot. Basically plug/socket but it has to be a transform.
You can create a Local variable node. Local Integer etc Just noticed Authaers reply, ignore my answer I misunderstood.
Hey guys, i have a problem i can't seem to fix. In my managerial game i have npcs and:
1 - they do not avoid each other, even with rvo avoidance activated
2 - i need my navmeshboundsvolume runtime generation set on "dynamic" (is this more expensive than static? by how much?) but i toggle it to dynamic then the npcs move in a very strange way, creating a hole in the navmesh and triggering themselves (i guess)
Any idea how can i fix this?
Attach it via socket name
It has to be a transform
Also you can't attach 2 sockets as far as I know?
If you're doing this in an editor window press P, if you're in a PIE window or standalone, do console and do "Show Navigation".
If your NPC are making the mesh empty then they're blocking the mesh wrong from one of their primitive components. They should be recoloring it and not actually nulling it out.
Yes I use P, they make a hole in the navmesh
You can place one in a level where there's a navmesh and then edit it's instance components until it's not blocking the mesh.
It should not delete an area of the mesh but recolor it.
Could the problem be the same reason why they bump into each other and they do not try to avoid each other?
The recolor happens at runtime though with some of the avoidance stuff you won't see that until playing.
yeah, my other npc that i control myself does that
Also on the note of dynamic vs static, there isn't a specific comparison. Of course static is cheaper as it doesn't ever regenerate at runtime. You can still nav area it I believe, but the mesh itself will not regen. So new blocking volumes will not regenerate the mesh. Regeneration cost is relative to how big the area is and how big of cells you have. More granular means more cost and time to regenerate. Just depends on the game and necessity.
someone know who to create a while of fortune in unreal engine?
Thanks for the explanation!
Do you have a suggestion on which components should i take a look at in the attempt to fix my issues of npc bumping into each other and making a hole through the navmesh?
Hey guys, I'm doing research past 2 days what is the best approach currently to do fog of war type of thing in ue5? Niagara? Texture Render? Setting everything not visible and making it visible on overlap? Any good ideas?
I can't speculate past any primitive components. Primitive is anything with an area. Capsule, Sphere, Static or SkeletalMeshes, etc.
thanks, i really appreciate it. i tried setting them the same as the other character i'm using but still not working. i'll keep trying. unfortunately i'm not expert in those things
OK i fixed the nav mesh problem. a child component had navigation generation activated. i don't know how i missed it
Now I just need to fix why the npcs keep bumping into each other
This is a more complex question than it originally seems. FOW is a very distinct two parts. Visual and functional.
Visual is of course your PostProcess. This is how you visualize the darker areas. People generally do this by writing the areas to a render target. One great way to do this is via niagara as it can do HLSL on the renderthread to draw to the RT faster. You can do this however but the general idea is the same. Make an RT that you can read in a post process material.
Functional is the gameplay aspect. Where you actually show and hide an actor based on much simpler checks, usually in most RTS style games this entails a distance check, sometimes a height check, and sometimes a cone check. Simpler games can do this on the gamethread, but it's common to make a new thread that spins to update this data as you can end up with thousands of elements in some games. The idea here is fairly simple. Iterate over every actor. If it's owned by the viewer or in the same team then it's visible. Else check if any owned or allied actor can see it. If yes, it's visible, if no, it's not visible.
There are ways in a singleplayer game to do this well using only the RT and reading from it but it's not a good idea. The reason is that this gets a lot more complex for networking because you are required to separate these. You can't rely on the renderthread stuff because if you're making an online game that can be ran through dedicated servers. Dedicated servers have no render thread started. Which means no niagara, no RTs, which is where the heavy checks on the third thread come in.
If you do not mind a singleplayer only limitation, or you want an entry point for the visual at least. I would recommend checking out Ghislain Girardot's BP only implementation. https://www.youtube.com/watch?v=exJqcDWgz00
Worth noting that even he says it's very sketchy here. But for a singleplayer game it'll suffice. π
Thank you for detailed response. I watched all Ghislain videos, yeah the problem would be the multiplayer aspect which I'm trying to find the best anserw in which option should I dive more into. Can you recommend any keywords to check if I want to do it for multiplayer?
But still when i place an object in the world in doesn't create a hole in the right way, it doesn't take all the mesh but only a part of it
Realistically, if you want the numbers you're looking at C++ and a separate thread to manage the heavy lifting. It's a costly procedure even in pure C++ without BP.
Is there a way I can get all children classes of a parent class without spawning actors. I want to make a shop system that sells all children of my helicopter class and I just want to get all the children classes to get the class defaults. Does anyone know how to do this?
hey,
can you help me debug this. I have an enemy actor, that I want to move from left to right, but right now it looks like they're rotating around a point when they reach the target location (moving the aimoveto node).
does getting the length of an array also return unfilled indexes?
Unfilled indexes dont exist. Maybe you're thinking of an object reference array with invalid references. Yes those count.
Thanks, conker is awesome!
Hello guys, I'm making a simple AI system with the PawnSensing. The issue is that, when the player go out from the Perphal vision angle, the AI instantly stops to chase the player, freezing completely on its local position. So how can I fix that? How can I avoid this? Could somebody help me please?π
Not really. This isn't something you should do in most projects for a couple of reasons. Can you get a list of all children of something? In C++ the answer is yes. Of course.
But your first issue is it also requires that the class has been loaded. If it's a BP class this isn't always the case and so it can be missed.
The second issue is that sometimes you might make classes for testing but not actually want them in game. And adding more properties and more switches in your gameplay logic for this is absolutely dreadful and tiresome.
Realistically you should consider making yourself a data asset that houses an array of your classes you want. Even better would be a list of data assets soft referencing the class, with the data asset housing all of the data you need. Then you don't even have to load the class until it's necessary for gameplay.
hi plz help i need a sequence that starts when f1 is pressed on the server while it is running in parallel with the client game i am using steam multiplayer and i want everyone who has already joined the server to get the sequence at the same time but also those who joined already after starting the sequence, they could join and see the sequence from the same place where the server sees it when the client joins (ie if I started the sequence at 20 00 and the client joined at 20 15, then for the client to see please wait 15 minutes at this point) see what I did please tell me what's wrong and why the sequence doesn't start at all if you join from the main menu but if you start from the level it should work sequence, then it starts itself, and only on the server(first two photos from game mode third from character)
so i made a door opening/closing blueprint but realized that when you spam e, it skips the slow opening/closing animation, how can i fix this
maybe put a boolean at the beginning that you switch off, then back on on finished ? @wary axle
it would make it so the you couldn't spam it while it's opening/closing
Oh hey. Many ways.
I'm doing a line trace approach. So the visible areas are enclosed by polygons.
Oh that does look amazing. Is there any documentation how its made?
Here's the documentation.
- Come up with a set of triangles in world space that corrosponds to your FOV. In this video I just shot rays at corners, my current approach just shoots a lot of rays in a circle.
- Draw those triangles to a render target.
3a. Use that render target in the post process (the light and dark area)
3b. Use that render target in the enemy material (masking)
The example was all BP btw. I have a C++ plugin I'm working on.
Another way to do the post process with the same basic setup
How do I make an actor follow along a raycast line rotation wise using the start and end vector points ? Should I use the Normal instead ? (Isn't Normals only surface related ?)
Player Controller doesn't really have a velocity. It's possessed pawn might.
hi plz help i need a sequence that starts when f1 is pressed on the server while it is running in parallel with the client game i am using steam multiplayer and i want everyone who has already joined the server to get the sequence at the same time but also those who joined already after starting the sequence, they could join and see the sequence from the same place where the server sees it when the client joins (ie if I started the sequence at 20 00 and the client joined at 20 15, then for the client to see please wait 15 minutes at this point) see what I did please tell me what's wrong and why the sequence doesn't start at all if you join from the main menu but if you start from the level it should work sequence, then it starts itself, and only on the server(first two photos from game mode third from character)
maybe #multiplayer would know better ?
Probably, but they ignore me there, and this way you can attract more people, and maybe there are those who will help
just watch out cross posting i think it's against the rules
so pick one or the other
also spamming
when looking for help patience is needed, there may not be anyone around or even anyone who knows the answer to your problem or even can help in any way
Would this approach be good for multiplayer too? Would you mind sharing blueprint of this?
for some reason, when opening the level, it'll pick a random spawn point instead of the one specified.
Specified how?
Seems there's a way to do that but I'm not really following the code that easily. Could you try to do...
#PlayerStartTag
If that doesn't work. An attempt at something like this might also work ?TestVar=TestValue#PlayerStartTag
I don't really know how to do non-visual scripting
I meant for you to do that in the options part of OpenLevel
What's that?
oh, on the node
like that or like this?
tested the latter and it works
Can you please help me, after a restart ue5, if the widget is not attached to the null one (which was added first to this widget) lost links
Hey Guys! I'm working on a scoring system for my doodle jump game here and its almost done. The problem is that every time the player cross "add score point" line the score point is added each time. But should be added only once the player crosses the certain line. Right now the player can just stay on the certain platform and keeps jumping which looks like a bug. What is the better solution here?
Are the lines instances of the same bp?
yep
Then just add a Do Once node to your function call
Itβll only run once per runtime per instance
doesnt work, i tried
Show a screenshot of the function call
With the event that actually calls that
Ah had a feeling you would do that
You want the DoOnce node outside the function
Not in it
Put it right after the overlap event
Does this function go through and check every row of the data table? or is the data structure different?

