#blueprint
1 messages · Page 337 of 1
this is working now while im prototyping. when im porting into c++ ill use my tween plugin
question, using the function (forget the exact name) to get the world delta seconds
is it any less accurate than using delta provided from the tick event?
The delta seconds from the tick function will be dependent on the actor not the world.
you can change the time dilation of each actor, so yeah it can be different.
but if you never touch it, shouldn't matter.
ok cheers
https://youtu.be/wYx0DeuPlOY?t=247 << next oldschool game on my list of inspiration
Played on a PAL copy of the game.
00:00 - Start
00:29 - Classic
11:50 - Rankings
Wetrix is a 3D puzzle game, created by Zed Two (now Zee-3 Digital Publishing) and sold to Ocean Software in 1997 for publication on Nintendo 64 in 1998. The game was subsequently ported to personal computers running Microsoft Windows 95/98; to the Sega Dreamcast, ...
i think i would turn this into a micro rts game. resources as the puzzle aspect and unit management on the ground
like age of empires, but the resources come down as the puzzle, water, food
trees
then manage your ground units to farms those resources
How can i extend a bone/joint (or group, wtv) to a specific location?
Does anyone know what this warning means? "BeginDeferredActorSpawnFromClass: can not spawn an actor from a NULL class".
I try to spawn an NPC, and it spawns but this warning shows up in the log
you are trying to spawn somewhere with a null class.
Ctrl + shift + F and look for every node that spawn
I know which node it is, but it's manually defined so I'm not sure how it's null is the thing
so if you delete the node, does the warning dissapear?
yes
show screen shoots
In the gamemode I call this event after a bit of time has passed
This is the gamemode, the timer is connected to begin play
and the value of ClassToSpawn?
Manually defined as the NPC I wanna spawn
by manual do you mean you select using the picker tool or do you set it somewhere else?
I set it in the variables details
I was just setting it manually in the spawn actor node but changed it to a variable to see if it was valid first and they still spawn but the error remained
I never seen the warning, are you sure it's not caused by some other dangling Spawn Actor node where the class is not specified?
for sanity check, ctrfl + shift + f and type spawn actor
Positive, it shows up in tandem with spawning this npc's spawning
I spawn 5 of these the error shows up 5 times
I'll try that
Yea nothing pops up
I need help with destroying a spawned bp projectile when it collides with anything in the world but I cant figure out why its not working
the spawn actor that you currently have should pop up
Oh yea I meant besides that one
why are you checking if it's overlapping with it self?
I didn't even realized it, but the issue is even when its not there the projectile dosent get destroyed, it's being spawned by an enemy
you have to go past the branch
set the right condition
e.g what actor / component the projectile meant to overlap with.
if that still doesn't work, you will need to check your collision settings.
My thought exactly I'm not sure what Collison preset to use, also the print string says that the object gets destroyed as soon as the enemy throws it
here it is
you need to check with the actor / component you are trying to overlap it too.
I re-create with no issue.
The only time I get the warning is when the class is null.
only got warning if the class to spawn is null
actually I wanted it to be able to collide with any object in the level and get destroyed, its not one specific target i want it to collide with
Your collision needs to be the root.
Yea it seems to only happen with that NPC which is odd
Spawning anything else the error goes away
hmm, I have no idea if that's the case.
I think what might be causing it is that god hates me but im not sure
we spend most of our time debugging and it's a pita.
just chill and keep going forward.
ok I set it, but it still seems to get destroyed from the enemy, here is the enemy blueprint
Yeee no worries! Thanks for your help
I can't see anything sorry, btw your projectile should ignore the owner.
you don't want it to be destroyed at the barrel of the owner's weapon.
OverlapEvent -> If OtherActor != Owner then do your destroy logic
Literally just figured it out I forgot it's making a parent call to spawn a weapon it's not wielding
photos are blurry so I made a video of it
im having issues with my dialogue system
this is my dialogue component
i use it with a typewriter effect BP
how can I have it so that it doesnt loop dialogue after its finished
I want it to get rid of the widget if the player exhausts dialogue
tried making a ref to the UI widget and removing from parent but it didnt work
I don't know what I am suppose to look at.
- Make sure the projectile have the right collision settings for the thigns it want to overlap with.
- On the projectile overlap event, make sure it doesn't do anything when the overlapped actor it the owner's of the projectile.
- Profit.
i was hoping you could see if there's anything in the code that could be causing it to be destroyed before it spawned
You can check this easily by print string the other actor and other component.
normally the culprit is the owner's mesh. E.g the weapon barrel.
what you want to do is on comp overlap, branch & check if the other actor is the one that you want to hit (ie. it can't be self), and if that is true, then you can destroy.
So say you have actor X spawns the projectile, and you want to be able to hit actor classes Y & Z, you'd check if the "other actor" is either of those 2
anyone mind helping me out
I figured out how to make it end overall but
the player cant re-interact
You need to somehow break the loop. From what I can see here what is happening is that as soon as you incrememt the dialogue to the last stage, you reset it to zero, in which case when it checks next time it will just start from the beginning again
It wont let me without it just preventing interaction
And how did you try making this ref
made a variable and made the type a object ref to my UI for dialogue, grabbed it, tried to remove from parent once dialogue array index was out of bounds
i might iust be out of luck with how i set up my typewriter effect
tried to figure out how to go to next dialogue if F is pressed again but couldnt get that either
You made an empty Tupperware container and labeled it widget
It doesn’t contain anything
You need to actually create the ref properly. The best place to do it is when you CreateWidget, from the return value and save that variable
Then it’ll actually contain your ref
Yes remove from parent usually works
Hard to tell in your context tho, not all the code is shown
hoping it ends up working; this is my first ue5 project and it was extremely convoluted to find a working typewriter effect tutorial
here i have some more full SCs on my phone
excuse the typewriter BP, it is horribly organized cause the vid i got it from was just as bad and i havent organized it myself yet
ignore the E pressed in the TP char blueprint
that was for my first go around at dialogue
Avoid spaghetti noodles all over your code. Write it in an organized fashion so it can be easily read at anytime by you or anyone. Use reroute nodes and don’t be afraid to promote return values to variables and then GET those variables at anytime so you don’t drag noodles back and forth across the screen. Same with execution pins. If you need to go back and run it again, make it a function or an event and call said function/event as needed.
Don’t be one of those “I’ll organize it later” folks because that method is very prone to bugs since you can’t see wtf is going on at all times so you can easily make mistakes. Organize the code as you write it, unless it’s a few nodes you’re testing here and there
Also watch the blueprint communications video in this channel’s pins so you can actually understand refs and bp comms properly, else you’ll only think you know how they work and you’re likely to misunderstand it all as we all did at one point
gotcha, ill take a peak
would the solution to advancing dialogue with F key / exiting dialogue at end and allowing player to re interact solely be in the dialogue component though?
my brain has me thinking its somewhere in the giant type writer widget blueprint but thats just for the widget and display
Not sure but if you’re gonna remove from parent and destroy the widget make sure that whatever code you still need to execute is not in the widget
Awe. Come on. Live on the edge. See if it executes before garbage collection catches it. 😄
@maiden wadi thanks for the help the other day. I am still working on the prototype.
Trying to workout how to make the exit more graceful when more than 1 boxes needs to dissapear.
I'd probably just try an "if 0 items, don't bother updating the widget and just play some sort of fade out anim".
Looking nice though. 🥳
Is this a good way to create "time move only if you move" from SuperHot. By default, global dilation is set to 0.055 and if the player moves I set it to 1. If no what should I use .
If yes then how do I integrate the interaction system since global dilation would affect event ticks as well making the traces fires vary based on the dilation and there is no custom dilation in components.
How would I find work around this? I tried to create my own tick function that would be unaffected but failed.
It's worth noting that global time dilation won't cause ticks to slow down. Everything still ticks every frame drawn to screen. Just it's delta time is affected.
Is there a better way for me to do this?
My intent is to cycle through hair options for Character Creation using a UI button.
I have all of my hairs in a Data Table, with rows named HairStyle_0 -> HairStyle_37.
I have 2 nearly identical functions, NextHair and PreviousHair (only difference is "Gets Current Hair Style and Subtract 1 is Get Current Hair Style and Add 1 in my other function)
Is there anything I can do to make this better? Right now the only "issue" I'm seeing is that if I add any additional hair styles, then I'll need to go into both of these functions and increase the Clamp (Integer) Max value - but that seems rather minor if I'm being honest.
Typing them one by one is a straight no for me
The primary thing you can do to make this better is not make it in Datatables. If you use DataAssets, specifically PrimaryDataAssets, you can make an entry in the asset manager and simply pull all hair style data assets for the UI and keep an array of pointers to them and just next/previous like you're doing now. And at that point adding new hair styles becomes simply adding a new data asset. This has an added benefit of also allowing modders later to add data assets as well and it magically just working.
you want to make a system that scales up without any tedious work.
Oooh. I see. That does sound better.... Hmmm... Guess I'm off to the youtube to look at what Data Assets are then lol
wish I know better back then
, stuck with DT for my hair picker for now.
One of the best ways I've always thought of them is that they are like StaticMeshes. A static mesh is only one class, it's defined to hold vertex and material data for a mesh that you import. But you use that same class with different instances, one instance being a wall a second instance being a bucket, etc. Your data asset class defines the kind of data your asset needs to hold. Instead of vertex and material data, it holds a static mesh or a Groom asset reference in this case and maybe display names or icons. You create a class first and make the empty text for display name, the pointer for groom or static mesh and then you make instances of that asset for each hair st yle.
You should be able to swap it fairly painlessly though. If you're using datatable rows. Make yourself a little editor utility to read the rows and populate the data into assets. Add it to the asset manager and swap out the datatable reads for the asset manager find calls mostly. Maybe also swap out datatable row reads for direct soft/hardpointers for gameplay use.
At the very least, it's great practice for data reworking.
Gotcha - yeah, that sounds way more scalable, as I was hoping to use a similar system for my armor/weapons as my hairstyles
Seems like Data Assets are the way to go in that regard.
(If I'm understanding right, it would mean in my Data Asset I'd define everything similar to how a structure can be used to define a data table, then I would just create instances of that DataAsset and those assets would essentially be the "Rows" that I had previously created)
Then why is this happening? Why is slows down when I stop and global dilation gets slow?
Sure. You can even stick your struct in the data asset and just copy the data directly that way.
What could go wrong? 🙃
Fair question. What parent class is this in?
How not to make floating text with icons, if you have a rotating camera.
so you are changing global dilation ?
whats all this about ?
Game I'm currently playing. They have a bunch of icons for things happening, which don't rotate with the camera. :/ Looks stupid unless you specifically play at one camera angle.
lol
Cause they did it probably on a card, instead of like UI drawn to screen projected over a location.
it looks weird the numbers are doubled ?
atleast with games i think people tend to overlook a lot of things
"its just a game"
but personally i would be really annoyed if something i was working on looked like that
In this case, I've actually seen people argue for this kind of design. It's graphically optimized. Elder Scrolls Online does a similar thing for their nameplates, and it gets blurry if you use anti aliasing.
But it's a stupid thing to do. Drawing UI is exceptionally cheap. You can literally draw dozens of thousands of icons and text for almost no time at all if you do it simply and are careful with your cache alignment.
Kind of an old style thing that remains because there wasn't a good option 15 years ago.
maybe an actor with custom time dilation ?
It'd be nice to know what class that tick function is in. Cause ticks not running every frame only usually happens if you have them set to run every n seconds.
What is Custom Time Dilation in Unreal Engine 4
Source Files: https://github.com/MWadstein/wtf-hdi-files
This trace tick is inside a actor component interaction system. And I am using it in the BP_First person default Unreal 5 template.
Does it have a non zero setting for tick interval?
Like in the interval. I think yes. It is 0.3 but If I use 0, It think it would be more expensive no?
Is there no option besides using 0?
set timer usually is what i use if i need an interval
Can't do that. Time dilation, same issue he's having atm.
Expensive is a very relative term. This looks like it's on the player. It's one instance. You'd need to trace several thousands of times every single frame before this even started to be a real issue.
honestly i do so much on tick
idgaf
i just use it and abuse it
and it never gives me problems
It's infinitely easier to optimize a working prototype than it is to make a first draft with perfect performance.
Alright. Thanks for the help.
it's good to just do whatever you can to improve the performance in the tick
and worry about it when you start getting issues
move some code to c++ usually solve this problem
Is there a way to spawn a new actor and bind event dispatchers to it before its actually spawned ?
My issue is that when I spawn my projectiles, if they are already inside the enemy's hitbox, they instantly trigger the On Component Begin Overlap event, before the event dispatcher assignment runs.
Not in BP. Though it's an easy enough fix to check if it's overlapping on beginplay.
when do you assign them on begin play ?
I assign it right after I spawn them, but since they spawn inside the other's hitbox the 'Begin Overlap' fire's before this finishes assigning
you can run a custom event in the actor, that runs when you overlap
so the event in your actor that is spawning, will just run when the overlap fires, this is basically the same thing but it's just premade
It would also be better if the projectile handled it's own overlap stuff. The weapon's job is to create projectiles. The projectile's job is to overlap and do damage. The weapon shouldn't have to care about the projectile's job.
The reason I wanted the weapon to handle the "projectile's job" is because I wanted a weapon that can do multiple things
For example, I shoot a grenade, when it hits it splits into smaller grenades, when those explode spawn smoke cloud.
If I want to create chain reactions like that I can create each piece and put them together in however order I want and they can do different things when they trigger.
Similar to how UI elements have a onClick(), onHover() etc functions and you assign logic to those events instead of creating a different button for different functionalities
I'm still struggling to find a way to properly get this to kick the player out of dialogue when exhausted... I watched the vid in pinned and tried to remove from parent but it still just didnt allow them to ever interact agasin
But on the other side, why would you do any of that in the weapon? If you shoot a SmokeClusterGrendade, it should spawn from the weapon and when ready it should kill itself and spawn multiple new SmokeGrenades, which in turn just do their own thing. The weapon doesn't really need to care about any of this past spawning a SmokeClusterGrenade.
im losing my mind trying to figure this out
ive been trying to follow tutorials but theyre all completely different
and none of them are integrating the effect i want or explaining it
is it throwing an error ?
what exactly is it doing that isn't working ?
it just still doesnt let the player interact
I had an error before with a reference issue
watched the vid in pinned, got that fixed up
but it still just doesnt allow the player to interact again
this is my workaround as of past 10 mins but
same as before, doesnt let player interact after
so what do you mean after ? after you reset to zero it doesn't work ?
yea
the player can talk fully to the NPC
once dialogue is exhausted, it kicks the player out as wanted
but then the player cant talk to them again
if they wanted to redo the dialogue
is the event firing ?
is speaking still true ?
this is my only interface / first time so Im not really sure how
print string on the event see if it fires
kk
I put a print string out the exec pin of Talk
it does fire
it doesn't show the reset dialogue / widget but it prints the test string every time I press the interact button
so now put a print string out the true of the speaking of check see if this fires this time
nothing fires
to clarify, the Check Speaking is for the NPC itself
to see if theyre still outputting a message
does speaking switch on the ui ?
when you exit, does it error ?
perhaps that function is running, but there is no display of it
because it was removed from parent or something, and never added back to the viewport
the widget creation itself is in the default TP character BP
and when do you add it to viewport ?
interact trace triggers Talk which is what is in that first dialogue component I sent
event speaking is in the same interface as check speaking
i'm guessing this add to viewport is off begin play ?
yea
do you have a remove from parent anywhere ?
i do not
hmm
most of my logic is in the actual widget blueprint for doing the typewriter effect
I can send it but it is incredibly illegible
I tried organizing it this morning
the tutorial I got it from made it super weirdly made
did you try what i sent ?
I used a different vid cause I couldnt get that one working at the time
let me look at this again cause i was stuck at a certain part
i can't tell without looking more at whats going on, hard to tell from here
I couldnt figure out what the variables were + where to use this once done
cause the way I had my E press was in my third person character
i tried a few diff typewriter ones
because you don't have to use E
theyre all really badly made
mine works like a charm lol
how do I link it to a dialogue system tho?
im not using this one right now but ill show what I do have
I switched to that dialogue component I sent since it was in the same tutorial for the typewriter I found
oh ok
I'll send the other one but it is a complete mess
Should avoid the typewriter effect to begin with. Make it work as a simple immediate display first. Then you can just add in the typewriter effect when the textblock is set.
thats where I gave up with the old dialogue BP
cause that one I just sent works perfectly
I can re-interact, skip dialogue etc, does it all
Why did you ditch it then?
cause I couldnt figure out how to get the typewriter effect to work with it
From the looks of it all you needed was to replace the SetText call with a custom function that starts the typewriter thing.
Its not about the weapon needing to know about the projectile, its about using the projectile's explosion as an event.
For example what if I have a weapon that shoots a projectile that on hit
-deals dmg to the enemy
-an other that aoe heals allies around you
-one that gives you 10xp
as I said I wanted to treat things like that, projectile, grenades etc's as reusable objects, like a button, it has a functionality of a button, but what the button is doing when it pressed isnt defined in the button, its defined when you place a new button and you assign a functionality to its OnClicked event.
i might just be in over my head for this as my first project
i dont think i understand BPs well enough
The weapon doesn't need to know about any of those three. Unreal has a concept of Ownership and Instigators. All you need to do is pass this from the weapon to the projectile on spawn. Then the projectile knows who it's meant to be for and can discern friend and foe, etc.
i would definately suggest you to watch some basic blueprint tuts
You need to think of your weapon like a Judge Dredd pistol. It should be able to "shoot" anything. Bullets, grenades, arrows, fireballs, etc. What these things do is their own perogative.
Can you show your top had skeletal mesh?
the pivot is probably different spot
Anyone mind giving me a hand? Viewport is not populating with the data from my Data Table
I'm working on a digital version of my card game, and I need some help figuring out how to display the data into the screen. The viewport populates with the blank image of the card and text blocks, but it doesn't fill it with the data form the Data Table I created
The Data Table has information, so I checked that off the list of causes
Checked that the data are variables and they are visible, so my next only guess is that there is something wrong with my blueprint
The exec pin isnt even connected.
Newbie here, but you're right
Works for the most part
BUT, image is not loading, any ideas?
What is card art data type? Texture 2d?
Check if its set on the kibaru row in the data table.
Texture2D, correct
Checked
Look into your widget and figure out the black thing. Maybe something is blocking your image, hard for me to see without having the project at hand.
did you try checking match size, was it black already ? or did it change black ?
My stupid ass changed the opacity 🤡
yea i know but i wanted to know if there was a way to avoid that
make it not be colliding
not sure it came part of a template but it basically just switches out hats using a data table onto the socket
oh smart
show how you're attaching it, and show what a hat IS, its component layout
For some days i try to fix a bug, but doesn't matter what i try it does not work
I have Character that shoots a bullet outside his center towards the enemy.
The bullet itself has object type - projectile and blocks only enemy trace
The projectile has on Event Hit - Apply Damage
The Enemy has Event Any Damage
So it works if the enemy is little further away lets say 5 cm away but if the enemy is near my character the bullet just pushes the enemy half through the map until he hits a wall
I tried multiple things
- making the bullet faster or slower
- making the bullet collision sphere bigger or super tiny
- spawning the bullet outside my character capsule
- making the Hit Event trigger only targets with the Tag Enemy (enemy has Enemy Tag)
- Changing the projectile to Sphere on Begin Overlap
- Making the collision of the enemy smaller or bigger
- Making the collision of player bigger or smaller
- spawning the bullet on top of the character and flying downwards
Nothing works, it works if the enemy is like 5 cm away but if he stands near me he just gets pushed away.
The enemy doesn't overlap with my collision box his box and my box is still 1 cm away, and even if spawn the bullet directly in between us not touching anyone on spawn he still gets pushed away.
In slow motion the bullet goes into the center of the enemy capsule then pushes him away (if that helps)
I followed lot of other tutorials but they all use something similar so it didn't help either.
I even asked GPT and it just says that the **Engine **itself has collision problems to calculate when targets are near together. (But i don't really wanna accept that answer for now)
If someone can help me or lead me into the right direction would be nice thanks.
have bullet hit the enemy characters mesh but not their capsule
the capsule is the thing that movement is done on
you don't want movement to be blocked or overriden by a bullet
so i should make the capsule component only block the floor / walls and make the MESH the enemy to hit?
because the MESH is currently set to "No Collision" i basically just wanted the capsule component to be hit
One thing i managed to make work is using very hacky way of making the bullet actor having a set timer by event then fire off a sphere trace by channel and do the logic on a 0.1 sec looping.
This worked but no idea how performant that is.
Performance isn't the problem, that just won't work very well at all
You can always just make your own projectile system that uses traces instead of moving and sweeping a physical collider
I tryed now to remove the collison etc from the Capsule Component on the ENEMY and i put the same collision settings on the MESH but it does not respect this settings the bullet just flys through like its not even there. Even with Print String i get no interaction at all.
is it that bad because if the bullet is to fast it might be outside of the 0.1 tick? Beacuse with the current speed ot works somewhat i am just not sure if it still works if the bullet is faster and the enemy smaller and i dont think i should run it on loop on 0.01
You mean just Trace By Line, the thing is the bullets are like Rockets so they need to be in the world visible and flying towards a target. Its not like a sniper bullet.
just trace each frame instead of sweeping each frame
These "rockets" are using traces
Tick -> trace -> set position -> did we hit? -> do something
so they dont relay on a colison sphere on the rocket ?
no
you can sphere trace
sweep a sphere
the main point is that the projectile cannot stop a character from walking or otherwise mess with its movement in any way
although you can also solve that problem by just hitting vs the mesh and not the capsule
You mean like this, that works but only on set timer by event, on event tick it doesn't even trigger at all.
I'm talking about sphere tracing for movement
It's a new frame, what do
lets try move
ok cook up the new spot
trace to it
hit anything?
Move mesh
done
Ah you mean you don't even use Projectile movement you use like "set actor location" on tick?
protip: That's all ProjectileMovement does
it just doesn't have the option to use traces afaik
it only sweeps the root collider of the actor it's on
How bad is that in performance when having like 100 bullets on the map? Would projectile movement be better performant because event tick is like 60-120 hits every bullet on the whole map?
Ok that works without projectile movement but i feel like its the exact same thing?
Do i miss something or is that correct this way?
I can easily have 1,000 no problem
why are you sweeping AND tracing
pick one
Thanks lot it works now i will check later how well it performce but if it survives 100+ i happy :D
Is it possible to switch between two player controllers on stand alone?
You mean within the same level?
The short answer is that:
Yes it's possible. You can do anything you want to do. The engine source is available and can be modified.
The more correct answer is that no. The player controller is a generic control delegating and networking hub for a player. You should never need two even for the most dynamic and complex of gameplay setups because you handle that dynamic setup elsewhere. Possessing different pawns, adding and removing context mappings. Putting networking in components that can be added and removed.
@maiden wadi I have a strange case where I need to for testing. I have a card game that is multiplayer. But I want to use two player controllers to test. I got most things to work, but the Mouse Events & clicks on actors in the world only work on player 1. If i could get the mouse/keyboard inputs to transfer to Player 2 that might work as well.
You are meaning for local coop, not two player controllers for one player?
yes coop (local) without split screen. (Note: I have the multiplayer working fine and test on Steam. I just want to play locally and control both player controller, like playing chess against yourself)
A ton of code is in the player controller and in hind sight I should of put in player character so I could just possess it.
But why not just test with two PIE windows open in that case?
I normally do, but when playing as two clients, the mouse over breaks sometime and I have to restart the editor. I isn't something that needs to be done, I was just curious if I could get it to work.
When two players are coop, you can assign different controllers to each player so the inputs from different devices both affect the game. Is it possible to transfer which player controller gets to receive mouse inputs.
Probably. But I'm not sure how deep you'd need to go for that. C++ stuff for sure if there are no editor/project settings for it.
I'd probably dig around in SlateApplication/SlateUser areas for starts if you're C++ oriented.
I know c++ ok, but no expert. Thanks, I keep messing with it and see what I can figure out.
Heya, what could cause the BP nodes to grey out Delete option and not let me delete them?
You either have a PIE window open, or your graph is bugged. Close the BP or editor and reopen.
Gets stuck sometimes, new bug in the last few versions.
Awesome, thank you. I restarted the editor and it did clear it up
I added smooth sync to my project, i before that had my players be a mix of animation and physics, now that i disabled replicate movement and enabled smooth sync, the animations and physics dont show for the other players. Someone help
Hello, I'm preparing a tutorial based on the UE5.6 C++ FPS example, and the character is setup to have two character meshes, which I'm trying to remove so that the player doesn't see the character's arms. I have a couple of questions about this:
- Why are there two character meshes? Is this simply so the camera can be attached to the head of one character, which has head-bob removed from the animation? And presumably the other mesh is for remote players to see? This would seem quite convoluted when the camera could just be parented to the CapsuleComponent.
- Because the camera's parented to the head bone of one SkeletalMeshComponent in C++, clearing the SkeletalMeshAsset for that character leads to the camera sitting at ground level. Is there a quick way to fix this for the purposes of people following the tutorial I'm creating?
This is what I'm currently doing in Blueprints as a quick fix (I'd rather not start the tutorial off editing this in C++), but is there anything else that's recommended for this, or that I'm missing?
I already reported it. They'll get to it.
If you right click and go to Apps, you can report messages directly to mods that way.
Are you talking about my post? Is this not considered a Blueprint question? If so where would you suggest posting this?
Nah, you're fine. Someone else posted some bullshit. Probably the usual case of a derp who clicked on a link they shouldn't have and got hacked.
i messed up a bit cause I didnt know about the widget switcher. I got 2 menues and i built both in one widget and my plan was to hide and show the ones i need. but i didnt have much knowledge on widget when i started. Now i got a lot of logic for both menus in one bp_widget and I want to seperate the 2 menues.
I tried to copy everything, make a switcher and add everything there but i stil want all logic in one widget blueprint as there is a lot of both menus that effect eachother.
What is the best way to fix my mess without starting over?
pls tag on reply
The primary question would be, does it work? Cause if it works there isn't much point to change it just to stick it in a widget switcher if your logic already works.
if i put a widget switcher into my current main widget, do i have to build everything on top of eachother but i get everything in one place as i had it?
then i can just hide the one i dont want?
ty
I asked on the animation channel, but not sure if there is the right place, anyone has anyideas?
"hello everyone! Not sure if this is the right channel to ask this, but I'm playing around GASP to turn it into a FPS, I managed to put the camera on the right position, stop it from clipping in the wals by following an youtube tutorial on 5.6, and I also managed to remove the traversals that make tha character flip and managed to make the character follow the camera without you being able to see inside the character's neck. Thing is, when doing the traversals, if I look behind me, I can still see my character's neck, or rather the inside of it. That being said, how could I see, in BPs, when my character is performing a traversal, so I can limit camera movement after?"
thanks, i tried something earlier with the widgets but it failed but it worked this time ^^
It's driving me insane xD
anyone know how to get rid of these things
i get Epic thought they were a good idea but they defo were not cause it's a stupid thing which gets in the way
same
I'll be honest, it doesn't sound like you're knowledgeable enough to be making this sort of tutorial.
The reason there's two meshes is because how you might want the hands (and other attachments) to be positioned don't always look right when held correctly from the perspective of the camera.
One is for the controller of the character to see in which you could have the hands more to the edge of the screen while the other mesh is used for other players. (Multiplayer)
Not doing it this way could result in the player looking like they're trying to hug everything or have overly short/long arms.
I've installed DLSS plugins for 5.6 and it seems to work, but in the UI overlay the frame rate for Framegen remains at 0 for some reason. When I first launched it, it actually did show a frame rate, but after reclosing my program ealier, it's not showing a frame rate now.. Any one ran into this issue?
I appreciate the response, but have you read the question fully? I clearly understand that this is mainly intended for multiplayer scenarios, hence why I'm talking about remote players. I'm mainly wondering if there are other reasons for having two meshes in the template. And my other question is whether there's a checkbox I've missed for the camera attachment, because I imagine a lot of developers will want to get rid of the arms in the new FPS template and it seems strange to me that this requires editing the C++ file or another workaround if I don't want to end up with the camera on the floor. Thanks though!
We stopped using it. Haven't tried it on 5.6, but we had a ton of crashes related to it on 5.5
As for there being a tick box, no. You'd have to modify the parent class to modify its default attachment. One work around is to detach on begin play and re-attach where you want it.
Another reason it's not just attached to the capsule component is because doing so you'd lose any movement that might be imparted through the animations. This could be things like recoil or the head tilting to the side when throwing a grenade, rolls etc...
It might be easier to just hide the arms if they aren't needed.
I wish Unreal had some way to mark a node as "provisional". Like, if any of the inputs, anywhere up the chain aren't valid, don't pop an error, just don't bother with this node and move on.
I really hate it when languages require multiple layers of null checks just to avoid some noisy error when it's actually fine if something doesn't happen
Hey there, I've been having some errors refencing my HUD in my player controller. The way I have it now its saved as a variable in my character, then I refence the character to reference the HUD variable, but it reads as "none" when I run it.
I can screen share or send more screenshots if more info is needed.
To be fair you could remove at least one of those nodes by right clicking the GET Reactor Dialog Window and selecting to convert it to a validated get
What is a player, a pawn?
nothing about HUD should be hitting the network, this is a mess
lol ik its a mess and that's kind of why I'm here, I am pretty sure it needs restructuring. player being player character, so yes it is a pawn (i think)
Call it Pawn or Character, calling it Player gets very confusing
noted
Also playercontrollers don't exist on other ppls machines
read this
This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.
This is the most important takeaway
does this change much if i am using listen server instead of dedicated servers?
it's the most beautiful summary of those things
also i needed this link thank you
doesn't change at all, listen server just merges the orange circle and one of the clients
from the perspective of the other clients its all the same
dang ok i need to really change which things are sending what info. ill probably be back later when i dig myself a bigger hole
I have 15 ingredients. I have 3 slots.
I can mix 2 together. Example: Mint + Tea Leaf
Or I can mix 3 together to make something different, Example: Mint + Tea Leaf + Egg.
Order of the mixing doesnt matter.
Example: Mint, Tea Leaf, Egg = Health Potion
Tea Leaf, Egg, Mint STILL EQUALS Health potion.
Total: 560 possible potion combinations.
I want the recipes to randomize the required ingredients on game launch (whilst making sure that no 2 recipes are the same).
Question:
Easiest method to do it?
How many recipes are there?
15 choose 3 is 455 anyway
But also I dunno if they want every combination to be a valid potion. Like is someone actually gonna make 455 different potion effects?
You could make a complete list and just randomly pick them. With 560 it'd be simple and fast.
Depends if you want to ensure even distribution of ingredients.
Basic-est of the basic-est questions, I am surprised I am having a difficult time figuirng out the answer to this one. I have a Blueprint Actor and I want to be able to spawn a Static Mesh into it, under certain circumstances. Apparently this isn't a cut and dried affair - what am I missing? Illustration shows an example of a simple static mesh that I'd like to spawn within the BP.
What you're missing is that a static mesh can't just EXIST. You're either spawning a StaticMeshActor in the level, or you're attaching a StaticMeshComponent to your existing actor
This problem has its hooks in me. What you want is to define a "combinationName" which is the same for any given SET of 3 ingredients. (see below)
Then what you do is create a map of combinationName to Recipe. Programmatically prepopulate the key set with every possible combination, all 455 of them, but with no recipes yet. O(n)
Then get the KeySet of that map and turn it into a randomly-ordered list. Go down the list and for each of your recipes, assign each to that combinationName and store that in the map O(m)
That way, it's very easy when a player combines 3 ingredients, you find the combination name, and look up the recipe in the map. O(1) for the lookup
How the heck do I trigger an action in an Actor Component when its owner is unpossessed? Am I missing something obvious? Why doesn't this work?
You will need to find someone that use the plugin to begin with.
Hey sorry I had to go afk, there will be 560 combinations. I'm thinking I maybe have to do it like this:
HP Potion (Array) / get random / stores them in array
x560 times for 560 different potions as I want all possibilities to = something
Create all permutations. Randomise it. Done.
Yeah if all combinations do SOMETHING then that 's even easier
Though I still think there's 455?
He did say 2 and 3 ingredient combimnations.
I'm not sure I follow
Do you know what a permutation is?
Only from a quick google search
"Create all possible combinations. Randomise it. Done."
Ah I see
If you have an array of combinations (560 long) and a list of recipe names (560 long) and you randomise one list, you just link them via their index in the array.
And your job is done.
I see, so I have to manually create each possible recipe combination?
You could do it programatically.
But that may take longer than writing them all out if you're new.
I get you, man that's long xD
Thanks though
You've shed light on it, now I can begin the process
How would I create an array of every possible permutation though?
An array will only store a list, 1 item per slot
Not if it's an array of a recipe struct or whatever
gpt is suggesting creating an array of arrays
Don't listen to chat gpt
that's a lot of variables xD
An array of arrays is 1 variable.
how so?
is it only possible to do in c++ and not bp?
No
I have my construction script set up and skeletal meshes applied, but if I want to change out meshes for a character blueprint from widget button , how can I do so ?
For example each button is target to individual skeletal meshes, it loads one, deletes the old one
not sure where to put this bug
this doesnt seem BP related but I made my project in BPs so
I have a main world scene, and then a main menu scene for a 3d background menu
I have actors placed in a camera view and then the widget for the menu over it
after AFKing for like
maybe 4-5 mins
all of the actors just disappear
You may want to print the z of your characters on tick see if it remain the same
now this after a few more mins
i have like half of the debuggers open
not a single thing triggered except those two SCs
let me test this on standalone game mode
be back in a few i suppose lololol gotta wait for it to mess up
yeah it does it on standalone too
hey everyone, i'd appreciate some help here, i've been stuck on a problem for a couple months trying different solutions, but there's always one part that isn't working. I'm trying to "draw" a gesture with the mouse and have a projectile follow that path while still shooting forwards
things I've tried: splines, adding the mouse points to an array and setting the location to those points (and other variations of this)
anyone
it just stopped printing Z’s
the player controller spawned at the top of the camera and fell straight down tho
And does the z remain the same?
im thinking maybe the playercontroller spawns by mistake snd falls until the Z kill zone is hit
and it improperly unloads everything
the Z doesnt change
The z of what?
any of them
they all stay constant
yeah thats the player controller
i couldnt figure out how to disable it for the main menu
Player controller doesnt have a physical location
this is my first project and google was failing me
then player character
i probably have term weong
Well there you go then
player start is set in middle of nowhere
Try to stop the player character / pawn from falling
kk ill try it out rq
Im 99% sure something get destroyed from falling off the map
80% guess is your player character since the other one remain the same
You can also detach from your character by clicking the up arrow key next to the play button.
You will see if your character is falling.
Or just print the z of the player characters
This is my blueprint to randomise ingredients and create a recipe for a health potion.
I plan on having over 500 recipes. It doesn't seem effiecient to copy and paste this code 500 times just to change which variable it targets (instead of HPPotion).
Any alternative ideas?
For each potion type in potions, set it's ingredients to either 2 or 3 randomly picked ingredients depending on the number of ingredients
p shre that was it
ive let it sit for 30 mins while i did some chores
put the player start on top of a cube in the distance
no problems
im trying to make it so if im going towards a specific actor it sets my enum to moving forwards but my math is not mathing could someone help
Phone only shows me a low res version of the image, but I think the minus in the middle is inverted.
Where you are calculating the direction it needs to be Target - Origin
Sorry to interrupt, Trying to slow time during an anim montage. What should I drag off the mesh comp into? Any advice?
chatgpt told me Get World but I dont see it
GetWorld is not exposed to blueprint
What you can do there is get the outer of the comp
Mesh Comp-> get owner and plug that to the world context object.
Didnt think it would be that easy, thank you coldsummer 👍
Hey everyone,
Quick question. What's the best way to have blueprint trees in thew world, only foliage types work with the foliage tool. So is there a way around this? how is it typically done.
The use would be to cut down tree's and collect wood from them, hence the BP
You can paint blueprints using the foliage tool as well if I recall. As for how it's typically done, ask ten studios and get twenty answers.
oh really? I didn't know that was possible, thanks for the answer
to add to this, the studio I worked for used the foliage and had the instanced static mesh component on an actor that would register hits and replace the hit foliage instance with a tree that would be able to get hit
Epic released a new feature for this. It allows you to swap out mesh instances for an actor at runtime based on distance. I've not used it but it might be useful for you. Just be aware it doesn't currently handle runtime instances.
thank you! I will look for the documentation on this
Its not impossible to just make such a system yourself either
Hello,
Has anyone experienced a crash in development or any build when you get a generic actor and cast it?
Setup :
i am using an subsystem to store all the references using TMap<FString, AActor*> MyActors
And Get and Set helper functions to add and get actors from the map.
Scenario
I get an actor from subsystem to cast it to required class.
if cast is successful no problem.
if cast fails for any reason (e.g. gets null ref from the map) it crashes the build ( NOTE : project does not crash in editor only in build).
Also recently noticed this same issue when checking for valid object. (is valid macro in blueprints to be exact).
@severe terrace post your code? Its normally safe to access null in blueprint, you will just get error logs.
If this is a cpp project then just run on debugGame and see where the exception take place.
Well subsystem cant be created in bp alone so im pretty sure its not the bp side that crash your project.
Attach debugger on your build and you wouldnt need to guess
subsystem get function is like this :
AActor* UMySubsystem::MyGetActor(const FString& Key) const
{
FString LowerKey = Key.ToLower();
return Actors.Find(LowerKey) ? *Actors.Find(LowerKey) : nullptr;
}```
i call this function from blueprints validate and cast it.
I would attach debugger and see where the exception is.
Also just use FName? You wouldnt need to convert to lower or upper
Aye!
i'll try it, Thanks
I mean at this point the first thing to see is where the crash take place. You can look at the call stacks.
If you need further help the #cpp folks r awesome.
Not sure if using namespace is okay here, but I maybe wrong.
There is like a gotcha with namespace in unreal but I dont really use it so 🤔
isvalid crashes the project ?
pretty sure, cuz i checked in PIE.
The actor i am trying to get isn't spawned , so the subsystem would return nullptr.
when i remove the logic from is valid and onwards , doesn't crash.
And the crash frequency is low like 1:10.
if you just have the isvalid, and remove everything after that, does it crash ? then without the node does it not crash ?
1:10 <-- these kind of issues are so tough to debug too
Whats the actual crash message? You should still get a crash log in a dev build.
In build i just get Fatal error! popup. and in crash log there isnt anything useful.
You should make your Key an FName, they're case insensitive by default so you can avoid having to ToLower it. Secondly you can lazily call FindRef in place of Find/Contains checks if you don't mind if it returns a nullptr. Much simpler code.
GetActor should be fine if nothing else in it's hierarchy uses it.
Subsystem isn't the name of their subsystem though. It wouldn't work without a U prefix so that's something else.
i just need to know how to manually replicate anim bp animations like movement and jumping. smooth sync replicates transforms so i have to replicate the anim bp manually, does anyone know how to do that? no need to have smooth sync experience
For a start you dont replicate anim bp
They dont replicate
What you replicate is the underlying property from the owner.
i meant it as in a i need to find a way to replicate those animations not literally replicate anim bp
Your anim bp just reads the state of the owner, w.e it is.
Anyway smooth sync is a plugin, and i doubt there are many users that you can share the issue with.
For me smooth sync isnt solution to character movement component.
It will always be doomed one way or another but hey maybe I just dont know
without smooth sync my movement is very laggy and literally starts tearing my characters apart
Anything that meant to go to the prediction struct needs to go there.
Any form of attempt of doing otherwise will cause de sync simple and plain.
It's on the same idea as a weather system. You have a weather actor that has the state of weather. Wind speeds, types, etc. And those pod types get replicated and each machine sets up and interpolates weather locally.
Animations are the same in that your character has state on it, and the animations just read from that to locally update.
so what should i do
i want the movement to work well in multiplayer, issue is, in normal replication the movement is laggy and unplayable, in smooth sync its great but the animations dont play except for the idle ones.
I cant help you with smooth sync and i dont think it fix any problem if you are using character movement component.
The solution is to learn cmc framework and yes its not doable in blueprint alone
You need to pack the state in a struct (bit field) there are video that cover this.
Essentially if i have to guess smooth sync throw away the actual networked code done for cmc and just lerp values, this is fighting the system and you won't win.
Just a guess btw since i dont use smooth sync
Here is the overview of networked movement. He even nicely demonstarte how to do sprinting, wall climbing, dash, sliding, etc.
https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.
0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro
Correction.
is valid isn't crashing the build, cast is.
In rare occasion cast fails and it crashes the build. don't know why.
If you dont know cpp then now is the time to pick it up. Otherwise bp multiplayer is yeah nah, impossible in many parts.
Any chance you can give the callstack and ensure?
As for your animation you will need to figure out what drive the animation.
We dont know whats inside your abp, look at how default tps get the ground speed.
That value should already replicate by default
Any idea what would cause the ship to move like it is here ??
I have a floating Pawn movement comp on it with a Add movement input being called
like this for instance
reason there is an actor pin there is cause I do this in the state tree on a state
wdym what drive the animation? u mean the variables?
its just simple code, velocity and is falling used in state machines to play idle jump animation or the walk run blend space
Unfortunately, i cant share it , but i probably know why is it happening.
- My subsystem is derived from game instance subsystem. so image a scenario where in a level i set an actor in subsystem.
- Now i change the level where that actor isn't spawned, so when again try to get the actor again.
- It is a valid pointer , but when i cast where is no instance of that actor in current level, so it crashes.
- Technically if cast fails engine should handle it gracefully, but it isnt in my case (i am using UE 5.4).
Anyways, Thanks for quick responses
This is just guessing 😦 you dont do it when debugging. You simply look at the call stack and see whats crashing.
You can preview the anim bp, print string the values and see why its not entering the state.
E.g if your velocity isnt changing well then that's ur issue.
I can promise that the issue isn't casting an invalid pointer. Something else is happening. You can cast literally anything without crashing if the compiler allows it, it's just a type check.
Accessing an invalid pointer would crash. But if this is used in BP, the cast node has an internal IsValid check, so.. 🤷♂️
Actually even technically that isn't true. You can call all of the stateless functions you want on an invalid pointer too as long as you never access properties.
i am accessing a property in the casted actor, so maybe...
It'd be checked in the cast node though. If it's null or pending garbage it won't pass the cast node.
no u dont understand, the anim bp works very well for the player moving, but from any other players pov hes just kind of floating with no animations
You can debug the values on the other instance too (the players that dont have the anim moving)
Can't add anything else other than you need to figure out why you dont enter the state of the anim in the machine that have issues.
Yea you need to debug and theres no way for me to help without looking at the entire bp and im not planning too.
If you copy the logic from default tps, the anim bp checks if velocity is not near 0 and if theres input.
Proxies dont have input, so I bypass that check but cant remember exactly what I have on my end.
This is just guessing though as i have no way of knowing what actually goes in your anim bp.
The only thing you can do here is check the values on the client that has issue entering the state.
whats a tps or proxy
Tps is third person shooter, i made mine based on their anim bp. I am refering to epic default third person template.
Proxies are character that you dont control.
Are you using the template shit from the editor?
im not using tps
You need to get familiar with those term if you are working on multiplayer.
Look up network role
If you're using the template stuff, they're bugged. Some derp put in an input check.
Literary this lol, well i guess it wasnt made for multiplayer?
im not using any of the templates
I think we r going on circle though
If i am in your shoes theres only one thing i need to do first
Check the values on the problematic machine and figure out why i dont get the value i want.
but the problem is i am getting the values i want just not for other players
When you play in editor, open up your anim bp, you can select the preview to machine of your choice.
Debug debug debug, check the proxy value
What? you dont get it the anim bp IS working its just that no code is replicating any animations to the other clients, this is because i turned it off from the character movement component to use smooth sync meaning i have to do it manually for the animations, all im asking is how to do that. debugging wont help i know what the issue is i dont know the fix for it
Can you show your animBP's update event that is polling the velocity and such?
ignore the print strings
it works for whoever the moving player is, but if any other player is watching, it shows them moving without animations
Can you swap the Velocity from the CMC to the character's GetVelocity?
so is there a way to do an unreal insights on an actor at all ??
cause I have an issue where something is making performance chugg but only on the ship actor and wondering if theres a more isolated way of finding out rather then unreal insights giving me info on literally everything, just to begin with obvs
You can't really assume it's specifically one class though. What if the actor has no time at all and it's causing issues in UI from too many updates, or physics or nav updates from other things? Those things aren't related to that actor specifically but can still be caused by it.
Just look at the bad frames and see what is running in them.
fairs, only reason I say specific to the ship actor is it seems thats the only thing being affected or at least showing affects of something going on cause everything else runs pretty fine
I basically have 15 ingredients. I am trying to generate all possible recipes and store them in "All combinations" array but it's not working
I need it to get all possible 3 combinations and all possible 2 combinations. It should give me 650 recipes
What result are you getting?
printing length of all combination variable
If I remove this check, it infinitely generates
Check what the array index is outputting. It should increment by 1.
2 and 3, with no duplicate ingredients?
Id start simple with two ingredients and go from there.
Yeah, so for example:
2 Slot recipes: Moss, Sap
3 Slot recipes: Moss, Sap, Leaf
1 prints out a length of 15
Does this account for recipes being out of order. For example Sap, Moss?
And at 15 it stops?
it stops at 15 (unless I remove this check)
so i'm confused here cause looking at the rendering Thread it shows the fps is really bad there but render thread has nothing on it same for game thread
nevermind
That makes sense since your looping for each ingredient.
I think It's only going through each ingredient once, right?
i was looking in the region where PIEStartup was still happening
yeah
so game thread thats what I'm seeing
but still doesn't seem to narrow down what happens in that frame which could cause the frame time to be stupid high
all i can see is it might be widget issue but can't defo say
ah, ok.
So it's not checking each combination of each ingredient.
I think you would need multiple for loops.
Id start small, with 2 combinations and go from there.
I'm sure there are better ways to start this, but what I would try is...
Assuming no combination uses the same ingredient multiple times.
Loop A: index 0
Loop B: the index of loop A +1
Loop B to all possibilities.
Increment loop A by 1.
Repeat
Nested loop breakdown.
https://www.w3schools.com/cpp/cpp_for_loop_nested.asp
multiply speed by delta time
just at moment trying to figure out why performance tanks
make a copy of the folder, open the copy project up and just start removing things
Alright I'll give that a try
i've got source control so I don't mind doing that in this one cause I can just revert but just like unreal insights not really showing me really where issue lies even though I thought Epic made it so it was quite good at pointing someone either closely in right direction or at the actually issue
i have not used it yet so idk
okay so I've managed to find that disablling the widget tick I get better frames then before so thats one thing which is causing the issue, next is to see what this does
as that is something which seems to push the frames slightly into the red
560, not 650. Fun excesize though. 😄
@inland walrus
i have a Character BP that has multiple actor components attached to it.
When I spawn that Character BP I want set some exposes on spawn variable in the actor components but only have access to the Character BP expose on spawn variables. How do I get access to actor components on spawn?
Woah xD, thanks man
The short answer. A new K2 node for SpawnActor. Best you can do is an init function after spawning by getting the component off of the spawned actor. In C++ you could spawn deferred, set some data on the components or whatever and then finish spawning. You could also expose deferred spawning to BP as well.
I would double check it. But this was my output. Seems correct at a glance.
Youre right
scroll down
it's waiting for a task
find the task
there isn't one
check that you're not filtering anything out
not one that last for the same timing as the oversubscription
So checked I've enabled all filters like to make sure i'm not filtering anything and this is what I see
the oversubscription ?
the 2 second frame time
does it happen when you open some UI, when you enter some thing, when you press some button, what
so I believe this was the initial UI I did unreal insights
the 3 screenshot together is the ones I did after disabling tick on the 3D widgets to see if they were impacting things which they were but still some oddness going on
this subscription is a mystery at the moment literally
this oversubscription is really giving me migranes haha
Hey, just a follow up question, with this method of gathering all possible combinations.. How would you go about assigning each potion from a datatable a unique recipe? The only way I can think of doing it is by basically creating a variable array for each potion (560 doesnt seem like a good idea though)
Is that the right thing to do? An array variable for each potion?
Need more info on your goal.
560 arrays ? that doesn't sound right
So the goal is:
Every player's game will have different combinations, no 2 game saves will contain the same recipes (basically doing this so that people cant google and cheat the recipes, each players game is randomised on start)
There will be 560 potions, we have 560 recipes.
I need to give each potion, it's own recipe.
Example: (on new game)
Kezzy's game: HP Potion = Moss, Tea Leaf, Sage
Authaer's game: HP Potion = Frostvine, Parsley
atlast i don't think so
This would be my method, however, 560 potion variables seems inefficient
a map of structs ?
I mean, the short answer is yeah, an array for each potion, pick an ingredient set for each potion on game start and set it. So it's not 560 arrays. It's how many ever potions you have, arrays.
But realistically I wouldn't bother with this. People google that kind of stuff for multiple reasons and making it more complicated will just deter users more than it'll make it interesting.
I mean you can't even play a second game using the knowledge of your first which is kind of a large part of gaming. 🤷♂️
a map of string to struct, where the struct holds all the data for the potions, including all possible combinations, would make it easy to code, you just get the potion name, map -> get, and have an array in the struct
Yeah I figured as much, but the type of game I'm making is basically endless, so I need a lot of content. When you character dies of old age or combat, they will play as their son/daughter, reliving a life whilst continuing the family legacy of building a guild so I want every game to feel different
you need the struct because you can't just map to an array as value
makes it so you don't need a million branches
and 100 arrays
How would I decide what ingredients are required for that specific potion though?
Which is fine. Give more content. Procedural stuff is good but gameplay needs to be consistent, not chaotic. You randomize droprates and new zones and such. Randomizing ingredient lists feels about like saying your longsword now shoots arrows this game.
you would have all possible randoms as part of the struct
potion info like name,id,somevalues
and the arrays you need
so you still have seperate arrays
but it's consolidated into one map
xD I get you, I do, but I also like the idea of the player having to drink the potion to figure out what it does. This could poison them, make their stamina double etc. If they master the game once, they lose the fun of revisiting this part of the gameplay
it makes coding this much easier imo
I appreciate the help and I am sorry if I am being dumb but I dont follow/understand what you mean
have you ever used a structure ?
wdym "using a free asset" ?
probably contact the maker
thats usually your best bet with something from a marketplace
it could literally be too many things to guess
does your normal ue work fine ?
What is a Struct in Unreal Engine 4?
Source Files: https://github.com/MWadstein/wtf-hdi-files
What is the Variable: Map in Unreal Engine 4
Source Files: https://github.com/MWadstein/wtf-hdi-files
make a map variable, key: STRING, value: YOURCUSTOMSTRUCTWITHARRAY
you still need to make an array, it's just more organized and easier to manage
I only really use structs with datatables such as this
I'm fairly confident using it like this
you can code any way you like
this is just going to be a bunch of branches and no easy way to edit things
for instance if you add a potion
you'll have to go in and add a branch
so apparently this function thing takes this long to do
which seems odd to me cause not a lot happens
Exactly, I can do that confidentally but I know it's not effecient, so you recommend using a struct instead?
i tried it didnt change anything
a MAP of STRING->STRUCT
so all you have to do to add a potion is add an element to the map, set it's name, and populate the array
but it's really do whatever makes you feel comfortable and works
it should work the way your doing it, it's just really a bit more work to create and manage
at the very least use a switch on string
might be a bit easier to maintain that way
would get rid of all those branches and just consolidate it
I'm trying to follow, how would I pump the random into setting the recipe?
you would store the random in the struct for that potion
so you would have instead of recipe, possible randoms
here is how you would populate the array
yes it would have all possible recipes for that PotionName
then when you getting a possible recipe
use this find
and you have an array of all possible recipes for that PotionName
this way you can just pass in PotionName
and get the array associated with that name
so i have a question why is it when I do the Name to Text convert function on the actor be worse for performance then doing the same function but on the BP Function Libary ??
I get you, but how do I add 1 combination? as I cant figure out how to link it up
wdym one combination ?
the "All combination" variable contains every possible combination
I just need it to get 1 for the health potion
Yeah I know to get random but I dont know how to set it as the recipe array in the map
so does it print string all cobinations ?
Currently, as it is setup in this screenshot, if I hit 5, it prints every combination, which means it has added All combinations to the recipe for health potion instead of just 1
your not understanding why i suggested this or how it works tbh
check the names i wrote in my images
i try to name my variables descriptively
"Possible for This Potion" I thought you were referring to the All Combinations variable
but you would have two arrays, all possible for that potion, and recipe which you would set
Oh, I thought this method was to reduce the fact I'd need 560 arrays?
its one large data set, and your recipe wouldn't be an array but just a string ?
it structures them for easy lookup and use
it's more maintainable
you still need the data stored somewhere, but this is all stored in one unit
and you can add/remove things easily
is all possible for all potions ? or do different potions have different possibilities and thats why you need all the arrays ?
The thing I am most confused about is how do I add a string to the the map array?
basically using the map replaces needing to do this with branches
This is what "All Combinations" is
your recipe variable should be just a single string
for now don't worry about the possible array
just change the recipe to a string
Yeah it is, but I am not sure how to add said string into the recipe map
and set a random to it
okay
go into the structure
and add one
I'm following now
Yeah it's a lot cleaner
little tricks you learn along the way lol
and whats cool is now you have basically a dataset of all your potions
but be careful with structs in bp, i've heard they can crash your editor
but i think the problem stems from where theres a connection to a value, and they delete it
Got you lol
i've personally had no issues tbh
but it's a common thing i see on here it's an issue
anyone know what this would mean at all just wondering
I have a frame dip when that begins to happen and I'm wondering if theres something possibly I can do to fix the frame drop
all i know is it's probably widget stuff ? i think slate is the widget stuff
actually no that doesn't make sense cause the frame drop doesn't happen the following time this bit happens
in this case you probably could of just used a map string->string, but having a struct will let you keep info on the potions anyway lol
Thanks man, gonna look a lot cleaner and more organised
honestly i would even make this code into a function or event
usually if you repeat code like that you can make a function out of it
you could make an event, that you just pass the Name
and it creates the new one with that name
then you could have an array of strings, and this is your generate randoms list
So have an array of potion names and a function that goes down the list of names?
yes, and generates the values in the map
Using a for each loop to go down the list of names?
exactly
then when you need to add to the map a recipe, you just call the function
but when you populate at the beginning all of the base ones
you can just loop through a baseList and generate everything
basically just have the inputs of the function name of the potion to find, and all the data to store in the struct
So like this?
put the return node off the completed
your returning from the first loop
you want to finish the whole loop, you might want to also validate there is a random in the array
Ahh I see
and if not pass a fail boolean out the return
this debugging is difficult I'll say that cause trying to see why a frame drop happens is well a maze to go down like here, frame spikes but can't see what of my stuff might be causing it
this is much easier, now just add to array, change names, np
Nice man thats so much easier!
since you have a lot of potions it might take a while, i would try to populate 650 see how it handles it
for loop
1 to 650
generate a random string or use the index
and see how well blueprints handles it
loops in blueprint can be bad, you may need to move it to c++ if your struct gets large idk
The only thing I'm stuck with now, is making it get Slot01, Slot02 and Slot03 ingredients, and checking which recipe it is == to
oh man, so what is slot map ?
01,02,03 ?
So the slot is the ingredient the player has added and the interger is the amount of that item they have added (incase they want to make multiple potions at once)
this is a bit more interesting lol sounds like you may want to compare these slot keys and see if you have the ingredients ?
i see and you want to make this potion based on the slots
Yeah exactly
So for example:
Slot 1: Moss
Slot 2: Nettle
Slot 3 Dust
= Health Potion
Slot 1: Nettle
Slot 2: Dust
Slot 3 Moss
but this will still == health potion too
because it still contains the same ingredients, irrelevant of the order they are used
Hi, is there a way to make buttons that are dynamically created with custom events that are unique to them depending on the text in the button, or its tooltip? My custom event on clicked just gets overwritten by the last button for all of them
How big is your trace file? Is it uploadable somewhere?
this is an issue i ran into as well, the loop only gets the last value from the cast
Did you figure it out?
so this depends on what recipe looks like, how does recipe look look like when you have more then one ?
in my case i just ran an event on the actor
The most robust way is make your own button widget that passes Self back through it's clicked delegate so that you can look back up the data using the button as a key.
but you shouldn't cross lines like that
Hey, so I know how to apply Niagara FX to animations and what not, but what node would I use to apply it to a collectible pickup in a blueprint? Would it just be adding the Niagara System Component?
but if you do that, you won't be able to change button color or sth like that
Why?
This is my test print strings and how it's calculated
it's small enought it can go here
bare in mind its the trace with the latest stuff
like when placed into other widgets
Hmm, I see how that would work, is there a more scrappy way though? x)
you're not able to change propertys of the button itself
so you'll need to use keys for slots, does the slot hold more then one thing ?
because thats how maps work
are you just using it for one thing ?
The slot will only hold the name of the ingredient and the amount the player has added
then i would do: slot.keys,->get.0
this will give you the first item in the map, which is likely the correct one
hopefully lol
do that for each one of the slots
So like this?
yes
I'm not seeing a lot of data in this? I'm not seeing Frame or CPU, and StatNamedEvents would also help.
does this require 3 ingredients, or can that amount be different each time ?
let me grab you one
So it will either be 2 or 3 ingredients
so you need to know that difference
maybe for now just make a variable that hold that amount
but i would probably put it in the struct
so you know how many for that recipe
xD you like your structs
either that or you can split and use the count
but i was trying to avoid splitting it again
because from here you can just see if recipe contains all three, or two
Would I be creating a new struct?
no when you create the recipe, pass it the number of ingredients
same struct, just in the function when you generate them, add the totalingredients value
it's better to pre compute them in the function
then to split it into an array and get the length
you could probably also count the amount of +
but hard setting the value makes this np
Wouldn't it be easier to do it like this?
That should have the data needed
So when they hit create potion, it gets the last 3 slot ingredients used
you can do that, but it's not necessary
i wouldn't do this
Alright
check if the recipe contains each one of the gets
Also this requires me to recopile the engine : /
true
So this is what we have so far
so what you do is keep an index, and add to it when you find a match, so if there is two or three matches then you can create
thats why you need that value 2 or 3
and you have the recipe
create a new variable that will be the totalMatches
^
How do we compare the recipes to see which ones to use?
get the recipe your trying to match against using the map, find
drag out from the recipe variable and look for contains
this will check if the string is included in the other string
so you want to check does the recipe your looking to create, have this word in it, thats what the gets are for
don't use the array and contains
drag out from the recipe
and use contains of the string
string has a contains as well
"one + two + three"
contains("one") == true
contains("meh") == false
it works similar but it's just on a string instead of array
so in your race the search in is your recipe
and the substring is the first get 0
but you want a sequence as well
What would I put the substring as?
ok so your just copying what i'm sending
thats not what i was trying to show you
did you read what i wrote ?
Yeah I'm reading and following, I thought I was doing it right
you don't need to make literal strings
I thought so lol
read what i wrote, repeating in text is uselss
So substring will be the get's?
Roughly around 2 years
ok, geez
For the sequence, do you want me to do it so that each key/get has it's own?
so
when you do the three contains
your sequence will have four outputs
the three branches off the contains
one for each section
and then the last one by itself just empty for now
this doesnt trigger the niagara when I pick up the item
do you know what the white lines do ?
Got it
set totalmatches to zero before the sequence
and on each true increase totalmatches, do a get and drag off and do ++
basically if you get a match add one to this totalMatches
yes now at the end check if your totalMatches is equal to however many ingredients you have
thats the 2 or 3
that you need to know
and now at the end on the last then, you have the totalMatches
so do whatever you need to do if the matches is equal, but honestly i would start with a print string
@maiden wadi this point is where I have questions on why it frame spikes
Got you, so would this go on the end of all the branches?
no
or* not and
think about this for a minute
think about what it's doing for a second
at the end of the sequence you have the amount of matches in your recipe, to slot keys
for now, at the last sequence pin
just print string totalMatches
and run it, see if you get the matches
you should see the total matches that your slots match with your recipe
Would anyone know why my custom event does not have the input section ?
looks like your dragging off of something at the top there, in this case it usually takes the signature
are you binding ?
Its bound on an on clicked
There'n easy way to count how many actors are gotted when i Get All Actors of Class
: /
atleast afaik
I really can't figure out how to add custom events to dynamically created objects then
drag out from the return value and do length node
lenght of what?
length of the array, says how items are in it
when you get all actors of class
it returns an array
get it's "length"
I'm confused, it prints 0 no matter how many ingredients are slotted
this is the total amount of items inside the array, therefore all the actors "got" from the node
put print strings on false's
see if those are triggering
then if so
put print strings on the gets and recipe
check that the strings are matching up correctly
or you can use watch values, and break points
the length is 3, ive got 3 objects (buttons) that im running through
But they all get the same event instead of custom events with their name or somethign
ya you can't do this
It's printing on all 3 falses
Maybe its something to do with when I clear them
like i mentioned, print string the gets, and the recipe next to each other
actually literally look at them
put them up for a few seconds more then usual
I do this 3 times
and try to see what your getting
Alright
ya looks like you clear the slots ?
if you do this before the other function then your fkd