#blueprint
402296 messages ยท Page 436 of 403
I'm spawning a sphere to detect enemies and then a particle system which attaches to them, but I want it to only attach to X amount of enemies, and the enemies should be the ones who are closest to the character.
How do I go about doing this? I guess I need an array to make sure it doesn't attach to a enemy twice?
after some experimenting, I figured it out all I had to do was compare the forward vectors of the actor and projectile when they collided
@strange stream Array Element in a For Each Loop is the element in the array that is at that array's current spot in the loop's current iteration.
Hmm, so how would I go about doing what I described?
Depends. Do you want to attach every actor that is within a range or always just the single closest one?
@nocturne holly if you're using hitscan you should use traces, not overlaps
I'm not using hitscan stuff here, but I'll keep that in mind for the future
@strange stream More or less you need to take the large array, the one with all of the nearby actors. Make a local copy of it, run it through a function to find the closest actor, return that actor and then remove it from the array and attach it. And you'd run that all on a loop five times, or for how many ever actors you want to attach at a time.
Ladies and Gents, Who would like to help solve a mystery that makes absolutely ZERO sense. TopDown/TwinStick I will be in the support chat and sharing my screen Kudos!
Well attempting to share my screen
Everything makes sense. You just need a bigger shovel for digging.
Hello, i have a problem. I need a complex collision mesh to be able to simulate physics, is there a way to make that ? I'm making a sort of box that holds other objects, and should be moved using a PhysicHandle
Hello, i have a problem. I need a complex collision mesh to be able to simulate physics, is there a way to make that ? I'm making a sort of box that holds other objects, and should be moved using a PhysicHandle
Hello, i have a problem. I need a complex collision mesh to be able to simulate physics, is there a way to make that ? I'm making a sort of box that holds other objects, and should be moved using a PhysicHandle
Here is an example : https://youtu.be/uHbMYRzIQE4
@rough jacinth not in editor. you'll need to create complex collision in a 3D package
what does your complex collision look like when viewing it in the mesh viewer
It looks like the real mesh, but the complex collision is preventing physics simulation
So i will not be able to test the game in editor anymore @odd ember ?
I don't know what you're asking?
As Cranz said above you need to fix that in an external program
I think i don't understand
I made the model using bledner
You can generate simple collision in the editor. But for Complex Collision it needs to be done in a 3d modelling app and imported with the model.
or you can try setting use complex collsion as simple
https://i.imgur.com/OrqxkPJ.jpg It looks good to me ?
none of us know what you want to do with it
@burnt rivet When i do this i get this message https://i.imgur.com/hstG6bf.png
He wants to inert a cube into the hole in the front
Yes and that works using use complex collision as simple
But then i get a message saying i can't using physics on this object anymore
is the object set as moveable
Yes
you can always use a physics asset to override
and try that
or you might ask in #legacy-physics
I was just about to suggest that
a channel made for questions like these
I see, i'm going to see what a physics asset is and then asks in physics if i can't get it working
Thanks to both of you
No problem, now to find a solution to my own problem lol
what is your problem
I will attempt to describe but i may have to show you. First my control system for a twinstick works flawlessly. Now the problem, only when I rotate the character toward my AI while moving does the aim jump left or right of the Target as if a magnet was repelling it. Think of it as my character absolutely refuses to shoot the target. However this does not occur when standing still or when im not rotating toward the target. I even built in aim assist and that did not fix it.
Also I completely removed an tick functions to eliminate performance interuptions.
Need to see your rotate towards target and aiming logic.
yeah I'd need to see some logic
simple put look at hit result under cursor -> lerp
have you debugged using breakpoints?
yes in several different ways
so what did the hit result say?
hit result of cursor, jump in rotation,
but you checked you actually got a result
indeed
You really should just screenshot what you have. It'd be easier to read through it. Otherwise we're throwing random stuff out.
I even set the target to ignore traces from the mouse
i set custom collision methods to ignore everything except the ground, same result
I created a blueprint (BP_Object) that extends Object. I've created other child blueprints (i.e. BP_ObjectDerived1, BP_ObjectChild2)
My expectation was if I created a variable of type BP_Object on an ActorComponent, that I could then configure that component with one of the derived classes. However when I browse I don't see BP_ObjectDerived1 etc. in the drop down list.
What am I doing wrong, or what is the error in my understanding?
@night grotto you'll need an instance of that object
Ill give you a screen shot
what you're trying to add is a class
@odd ember Ok silly question, how do I convert a blueprint class, to an instance of that class?
or is my mental model wrogn
an instance of a class is that schematic being used dynamically at runtime
ok so I have to create the instance dynamically, that makes sense
im listening
haha yah i know I was in a hurry
same result even using tick and not a time
if you try and break blueprints you will break them
the same thing happens if you try and break code
there's no gain in trying to circumvent the system
I don't even think anything else is wrong
I think it's just that
you're spawning 100s of timers
but only the last one has the handle
its fire and forget, then reset
yeah but you're only resetting the very last timer
not the 100s of timers before it
the way you set it up
timer only executes once
nope
since it calls itself, you execute a new timer every 0.01 seconds
that's a little more than 1 timer per frame
that's a LOT of timers
oh damn i was looking at it differently i see exactly what your talking about lol
usually this would have been curbed by infinite loop detection, but since you used timers the code can't track it
it's not only bad because it's an infinite loop, but running the game long enough would eventually cause a memory leak
the handle has no reference this way
you can't mix execution threads with pins like this
that's another violation
lol dammit
This advice is all find and dandy but it doesnt resovle the issue
Much appreciated fixes
try visibility channel instead of camera channel
already tried
then debug it
with breakpoints
see what you get from the hit result
actually just to be sure, save the hit result as a variable
as the first thing you do
oh I forgot
another violation, you're using the controller from another event
that is likely why
you need to see the actual issue, the controller is fed directly from the player controller
even if i replace it with a reference the result is the same
I have attempted to resolve this 100 different ways, works on a gamepad, works without something to shoot at
use get hit result on mouse aim, not on tick
because you're getting hit result more than every frame
if you get it every 0.01 seconds
yeah that has nothing to do with what I showed you
Hey so I'm using a player camera manager and I'm trying to add an ads for my gun. I can successfully use set view target with blend to use the camera on the gun, but what exactly do I use if put in for the new target when I want to go back to my player camera manager. I've tried to plug in my camera manager that I made, but It doesnt do anything.
the event node supplying the controller pin has nothing to do with the node using the controller pin. they don't share execution
so, a violation
PLUS
you're getting hit results more than once every frame
it's almost guaranteed that your hit result will be null
you need to get hit result directly on mouse aim, not on tick
yes
same result
did you read what I wrote?
ill set that up real quick
and use visibility trace
not camera
everything visible blocks visibility traces, not everything blocks camera traces
I noticed something you wrote, I am not getting targets with the mouse, i am only using the mouse as a look at rotation find targets is irrellevant
yeah but you're using it to get actors that you want to rotate to
what if there are no actors under the cursor?
only as an aim assist
okay where is the code that does the rotational movement then, if that is not it?
was never intended to be added
So your ship only rotates when there's an enemy?
yeah I don't even understand what you're trying to do now
was the aim assist then not what you needed help with?
nope
the controls work as intended exept when I try to look in the direction of a target while moving
and you think this is because of the aim assist?
no, the aim assist was used to lock the rotation onto the target if the cursor was over it.
I see, so the aim assist was the branching part of it
yes
you should still have a branch and only execute rotation on hit
if the object under the cursor had an enemy tag then use that rotation
rotation is set to look at result of the cursor, no matter where the cursor is the character will look at it while the aim button is down.
if your cursor doesn't hit anything, impact point returns a vector 0
it'll pull you to the center of your map
Is it possible to have input on a pawn prioritized above the player controller? Apparently "input priority" does nothing in this case
whether i hit the floor in front or behind the target the result is the rotation jumps to the left or right of the target
@rugged carbon probably not, but what is your case that you would need this behavior?
Trying to let the player sawp between top down and third person perspective. In top down I use click to move, in tp click attacks. Causes conflict
@burnt rivet Just curious, have you tried printing the look at rotation results to see if it's drastically changing while this glitchy rotating is happening? If that remains steady but you're still rotating heavily, it's probably the Rinterp node outputting odd values.
@burnt rivet yeah but that is you thinking that you will always have a result. in reality that is not always the case. and you were complaining about being pulled around. this could easily be one of those reaosns
and what you're doing is mouse rotation
gamepad doesn't use this function
thats what i said, its isolated to the mouse
yep
so put a branch on like I suggested
and see if you still get an error
like I don't know why you're arguing
So what is the most ideal way to do a player teleport that works in multiplayer? I am getting a weird rubberband issue on clients
no errors
not errors, but like if the effect still happens
still occurs
@amber marsh try teleport, set world transform or just spawn the player elsewhere
How about them rotation prints?
teleport? Is that a node? hmm
@odd ember I was thinking of using branch node, I just felt like it was a "duct tape" solution and not the proper way to do it.
@burnt rivet then I'd suggest printing your location values for where you are getting pulled, like suggest by that other guy
@rugged carbon ?????????
or rotation values, sorry
but either way, understanding what your values are, are key to fixing this issue
if you're getting pulled the wrong way, then that means the game registered something that it wants to pull you towards
@rugged carbon yeah good luck with that, you will need to fix several things before you can make that work. I released a top down template with click to move to fix a UE4 bug
if it's not origo, it's something else
@zealous moth How do you mean? Everything is working smoothly in my project, both moving the character top down, and in third person. I just wanted a better way to switch
@burnt rivet Is the Z from the look at rotation on the true of that branch wildly changing back and forth when you print it?
@rugged carbon just to clarify, if you're worried about duct tape solutions, go study software architecture. a branch for a single value change in one class isn't something that will cause massive repercussions down the line
worst case, you delete it
Let me restate some info, If i am standing still aiming works as intended no avoidance when aiming at the target. When im moving there is no jumping or distortion of the aiming when no target is present. If the target is present aiming is only affected when trying to hit the target.
best case, you turn it into a camera system
the problem is that he is changing his inputs
the UE4 engine has a capture event on play that messes up the top down click to move if not set up correctly in the controller
so even if he manages with a branch, his controls will be wonky at best
I'm not using the top down template, nor the third person one. I use my own
@zealous moth are you speaking about my controls or someone elses?
I mean if it's working for him then there's no issue?
@burnt rivet talking about expansix
gotcha
he's right to consider whether or not it's a duct tape solution or not
i am way too far down from your initial question to know
It's just me getting stuck in my head trying to find the best way to do something since I've burned myself on subpar solutions previously
it's okay to do that but don't tire yourself out if you don't actually know how to implement better solutions
plus it's always easier to get feedback on a solution than getting a solution in the first place
in the case of a single branch, it's a very low risk solution
It's my exam so there a little extra pressure. And yeah, you're right
pretty ballsy to pick a system requiring two different cameras for an exam
Well, yeah and I'm doing multiplayer too... so I might have overshot a little, but haven't met any major problems so far
I'm roughly 2/3 through the groundwork
ah cool, so you only got 8/3rds to go ๐
It did break once, but that was my fault for a careless delete. And, yes 8/3rds sound about right ๐
How do you make a transform from floats once again?
make vector
Thanks ๐
You can only make a transform from a vector or rotation.
you can also right click the pin and split them
Also how do you like just move an actor from world location A to location B (without pathfinding) over a set amount of time?
using pathfinding ๐
With what node then?
I think you're looking for linear interpolation. There's a lot of quick tutorials on it.
took about 50 seconds of video while moving, different cursor location, rotation not aiming at the target etc.
@burnt rivet it's firing at origo
in your branch from before, drag out the boolean pin from the branch, use an AND node
then pick a pin from that, write vector != and pick that node
put your impact point into that, and GetVectorZero in the other
@maiden wadi Is this what you meant?
can almost guarantee that yes
Doesn't seem very performance friendly ๐ค
Is there really no node that just lets you move an object in a straight line from one location to another?
AI climbing once it hits a wall
It will happen quite frequently, and there will be quite a lot of AI
if you're really worried about performance, use cpp instead of blueprint
(Its a block game, so I dont need a climbing animation)
Generally Im not, but this solution worries me a bit
but generally AI is among the biggest performance hogs in a game
No node is going to do that any less performance heavy. If you want to move an object from location a to location b and do it smoothly, you have to do it a little at a time every frame.
Okay
all released games will have some limit on how many AI can be alive at any given time
So stuff like AIMoveTo also update location pretty much for each frame as well then?
yeah
Huh well okay, then I guess I have no reason to be so concerned then, thanks
How would I like move an actor X distance in the direction the rotation is pointing towards?
(StartLocation - EndLocation).normalized * distance
Like, how would I get the location of A distance in a certain direction (The rotation output of the node in my screenshot) from location B
what I gave you would be exactly that
except faster because you don't have to convert to rotation and back to direction
Howdy! Is there an "elegant" way to do a conditional switch node, where I say "if X == 1, then add 3 to X, if x == 2, then add 6 to x, etc, etc
I guess, I just use "switch on INT" and call it a day.
@spark robin yea that's a slower version though
@flat valve could also try a select node perhaps?
@flat valve What is your use case?
I dont get what you mean tho, how would I get the end location if not like that?
you asked for direction
what you get there is direction
you have a start and a target
that's the same as a start and an end position
under the hood it's doing the same in the find look, it just converts it to rotation too
@spark robin It's the same as what you're doing, just without the rotation conversions, keeping the math in vectors.
how to i make a line like this from 1 point to another so i can spawn instance meshes?
I have a list, 0-35. That list, is made of up 9 "groups" so 36 divided by 9, therefor each group consist of 4 items. When I want to say "go to family 4, I will reference item 12 on the list" . Basically I'll just do a switch and add. So.. if 4, add 8", etc, etc
Oh now I get it @odd ember how would I get the distance tho?
It's hard to explain, and I could do it with a long branching mess, "switch on int" should work. So if INT item is 4, I will just execute off item 4, and add 8,
Multiply after the normalize.
You guys do some cool stuff!
Oh, so you just mean the distance I want to move the character, not like between the 2 locations?
why don't you make a structure variable that have index and family index
@spark robin the distance between the two vectors is the length of that vector. if your normalize it, it becomes a direction. you can then multiply that by an amount x to move x distance in that direction
Huh okay
@flat valve You should check out the select node like Cranz said too instead of rerouting execution. You can set your multipliers on it.
@odd ember I cant say I really get it, so I have to ask, would this work then?
@maiden wadi Okay, I will. I saw that and then got distracted typing up my little story! Thanks!
yes
@spark robin you used plus, you should use minus
oh, yes that makes more sense
Does anyone know if theres a handy material node that'll help me get my material to react to other meshes? So if a cube comes in contact with the material a cube outline will form in it.
@odd ember I took the idea you mentioned and it gave me a new idea. Instead of just firing forward vector i now fire the projectile at the location of the cursor, this eliminated the issue
@maiden wadi @odd ember - Thanks, select node is perfect, works great!
Are delegate bindings automatically removed along with an actor, or should I make sure to unbind before destroying something?
how can something, that subscribed to something, do anything about it if it gets destroyed?
I'm more wondering if a binding will keep it from being destroyed
well.. try it and let us know ๐
Ok, will do ๐
my guess is no since the 2 methods do not see each other
but since one depends on existing (subscribing) if you don't exist, your subscription is null
Hello, I have an issue for my 2D top down project, I am modeling a car with the FloatingPawnComponent
in the first part of the video, I press forward and left/right (it's working nice), in the 2nd part I release the forward key then when I left/right my car don't follow the orientation of the car, like on ice :/
Can someone tell me how to simulate the physic of my car when I release Forward?
@zealous moth Actors are still destroyed. Still learning the ins and out of delegates, so excuse the noob-ish question ๐
Can't be entirely sure, but I think you also need some vector math to update your movement while rotating. To 'slow' the car a little and simulate it turning. You might be able to use it's velocity with the axis value somehow to set it's movement towards it's left or right.
I tried to use AddInputVector, the only problem is that the car accelerate instead of decelerate
I'm spawning a sphere to detect enemies and then a particle system which attaches to them, but I want it to only attach to X amount of enemies, and the enemies should be the ones who are closest to the character.
How do I go about doing this? I guess I need an array to make sure it doesn't attach to a enemy twice?
You still don't have much choice other than creating a function that finds the closest five out of the array.
Yea but I'm not sure on how to approach that
Working with arrays confuses the hell out of me
Haha, better get used to it. You'll be using them a lot in programming. I can help with that though.
I have a function in a library that'll help you start.
Like, this doesn't even work and I have no idea why
Are there any AI masters in the sphere when the level is loaded? If so, you may have a collision detection issue.
This sphere spawns when I press a button
AI might be in the sphere at that time yes
Instead of spawning a brand new actor for that, there's a sort of trace node you can use instead. SphereOverlapsActors.
Okay got the loop to output the names
I strongly recommend putting together that function I posted to get the closest actor from an array. It'll save you some hassle.
Now, how do I make sure only ai_masters get included in the array?
Yeah I will thanks, just need to construct the array properly
This is the closest I get
Try this instead of overlaps. Overlaps is going to be a lot of upkeep for the array.
Class filter is where I should put the ai_master?
Yep.
You may or may not need to change the object type, I'm not sure what collision type your AI is.
Put a print before it, what is it printing?
Is there a way for me to rotate my player to face the center of my view port?
i check. im running that on gamemode. with dedicated server
This actually worked
oh. maybe i got it
cause the server reconize the map as Entry and not as Lobby or whatever
Not sure how For Each Loop works in a tick tho..
Yo bois, Does this node remove an item from the input list in project defaults or just reset the keybind to the default. The tooltip is whack
https://docs.unrealengine.com/en-US/BlueprintAPI/Settings/RemoveActionMapping/index.html
Remove Action Mapping
@strange stream Kay. You'll want that function I linked earlier. You'll want to make a second function with two local actor arrays, one of those takes your overlapped actors, then you'll want to loop the function I linked five times, when it returns an actor, you'll remove that actor from the already filled local array and put it into the second local array. At the end of that loop, you'll have a local array with five actors which you can return to do whatever you want with.
@maiden wadi
Yeah, but I need it to update when a enemy leaves the sphere or a new one enters..
Aren't you executing this on a 0.2 second timer?
Yea, but I've heard a for each loop is not smart to have in a timer
Depends on your use case. Many people abuse it for stupid means. You need to check an array often.
The ability idea is:
Basicly the player enters a state where it fires a beam at maximum 5 enemies, but if they leave the sphere it needs to change to another target.
Also if I use it before any enemies are within range it needs to update as soon as an enemy enters.
If that makes sense
Has anyone here ever made a QTE (Quick time event) In game ?
I am envisioning something coming at the player and when it gets close to the player it slows down, giving the player a couple of visual prompts that they have to do reactively in a set time,.
there would be an animation for success and failure.
getting abit more advanced, I would even like to do 2 QTE in a row, once the first is done a second begins immediately in quick succession...
would that be more of a cinematics question ?
@strange stream Sounds like a perfectly acceptable way to use a timer. Specially at 0.2 seconds, that's not bad at all. That's not even close to tick. You're looking at 5 calls a second, tick is usually 60-120 a second.
Hello everyone.
I'm comming back to UE after a long break and i forgot how to reference pawn's variable (That are not player controlled) so i can show it's value in the HUD
Like displaying enemmy unit's Health bar and sort
I know the documentation shows how to get the player controlled pawn variables but not the others
@dapper cradle It's pretty program based. Of course you'll need to play animations, but you also need to figure a way to do the character positioning. The rest of it is just using a widget to display the correct button to press. On press, send key to an event and if key == correct key, do something, false, do something else. And some time dilation.
@dry pewter You can get them a number of ways. A mouse click, a line trace, Overlap, collision hit events.
Just by the pawn existing on the map? they're all child of a single pawn class
Thank you @maiden wadi ! something i hope to tackle in the coming days.
@dry pewter Can you explain your use case a little better? Are you using a specialized widget for each enemy? Are you using a single on screen widget that switches based on a mouse click, or closeness to screen center? To help, I need to know more of what you're trying to do and how you can easily get your enemy reference.
@dapper cradle I haven't done a lot of it, but look into the sequencer. I think you might be able to make great use of that for something like that. Unsure.
Alright @maiden wadi Fisrt of all thankyou for your attention
I have a party of 4 characters the player will cycle from one to another with given keys for each one
Also in the map there are 1-8 enemmy characters
I need the HUD to show the name, health and other stats from each character (player party on the bottom, enemmy on top of the screen) such stats are stored in Variables on each character, all of them are child classes to the same pawn
So, something like Divinity?
in 2018 there is a variable called Track. What is it called now?
I guess so, never played it but google says yes
Also i remember a workaround to this by sending the variables to a gameinstance to make the variables "golbal"?
@dry pewter There's a lot of different ways to handle it. In Divinity battles are localized, so you'd draw a large sphere and use the ones in the local area. You could add them all to an array at level start too if you levels are small. Is your game turn based or real time?
@maiden wadi Real time, the map is large but the characters are not allways present, the player contorls the #1 in the party and when it comes to certain locations in the map the enemmies and the rest of the party Spawn in place
In that case, you might be able to just do this stuff on enemy spawn. You could probably keep the variable in the controller, or make yourself a manager actor for it. Either way, you can make an array somewhere with the class type, and on the enemy begin play, get player controller, cast to your custom controller, and add self to enemy array.
Does anyone know if ue4 has any input smoothing options for mouse / gamepad
i can't find any
i can make my own, but i want to see if there is something built in first
@narrow kelp Not sure if it's what you are looking for bu in Edit>Project Settings there are some settings for input and controllers
@maiden wadi Then using the gameinstance to store the array is viable?
Mouse acceleration is on by default.
@dry pewter Sure, it's doable. I might recommend game mode though unless you're never switching maps. Otherwise you're going to be needing to clear that array every time you switch maps.
I thought GameInstance was persistents beetween level loads
But yeah i might use Gamemode too
Hey guys; I'm struggling with connecting some dots here. I've followed an archery tutorial and customized it to fit my needs. However, I'm struggling to cast to my Actor and reference one of it's static meshes. If anybody wants to help out, DM me and I can send images, so I don't flood this chat with screengrabs ๐
@dry pewter game instance persists above all else. game mode you can switch out dynamically, but is otherwise persistent
Thanks for the clarification
Allright it looks like i'm going the right way, managed to get one specific actor of class based on a variable, and show it's info in the widget
Thanks @maiden wadi @mild pine
I feel like this should be really simple, but is there a way to stop variables from being accessed outside of the class?
I have a lot of stuff that only the class itself needs to access, and it's creating clutter when another blueprint tries to access it
privatize them
as in, make them private
not as in, make the government sell them to the highest bidder
I don't know why I thought that would hide it from the blueprint itself
since the tooltip set derived blueprints I thought it just mean 'don't inherit this if you're a sub-class', but looks like that also has the functionality I want, thanks!
if you want it available to all derived classes (but no one else), protected is what you're looking for
Why doesnt my text widget show up in graph editor as a variable?
Do i have to enable something to show it?
On the designer tab, there's a "Is Variable" checkbox. You need to tick it for most things that you want to show up in the graph.
TY
is it possible to have overlap events in screen space?
basically I need to check if an object is within a certain radius to the center of the screen, and run logic on entering that radius as well as exiting it
Is there a max distance in mind for this? A rather simple solution is to attach a capsule to the camera, give it the proper rotation to extend away from the camera, then give it the radius and height you want for the interaction limits.
no max distance in mind
@formal blade there is very limited screen space collision. I recommend setting up your own math, especially if you're looking for more complexity
capsule attached to the camera seems like a better option
that way I can hook into the overlap events and make my blueprints significantly cleaner
not sure what you're talking about
since I'm meant to be intersecting with stuff in the world, it makes more sense to have a really long capsule attached to the front of my camera so that when the items I'm looking at overlap with that it triggers the right events
Keep in mind that a perspective view is going to reduce the accuracy at further distances.
but what do you want to do?
generally I wouldn't recommend doing anything like that
your results will be very inconsistent
if you're just looking for the center of the screen you can project screen coordinates to world
run logic upon begin overlap and end overlap when the object gets within a certain radius of the screen
that's what I was doing before but I can't hook into a begin or end overlap event there, which is what I need
there isn't really any shortcut here
overlaps tick every physics tick anyway so you're not saving performance, you're just setting yourself up for some very inconsistent behavior
especially if you consider that stuff like FOV or resolution can change
I'm more worried about readable code than better performance atm
I'll try it, if it sucks I'll go back to my previous method
I'm just saying you're setting yourself up in a position where you are going to paint yourself into a corner
only one way to find out
anyone know what this means?
looks like it's in animation mode
it wants you switch animation mode in order to use the animation asset
Is there a way to get the primitive component out of an "Actors in Selection Rectangle" node? I'm wanting to put an object outline around everything the user clicks and drags over.
I can do it just fine by mousing over it, but as I think about it, this is a little more complicated
are you setting up your cable component manually @rough wing ?
Yes
I mean with math?
because it seems like a question best aimed elsewhere than here. perhaps #graphics ?
or perhaps #legacy-physics
When adding a widget to screen, can i make it have an offset along X or Y axis?
how would I make a collision preset that ensures colliders will only generate overlap events with another collider of that same object type?
set both to overlap to each other's type
I can't turn off the overlaps for the other object types though
you can make a new custom collision type or channel
an object channel you mean?
yea
oh I'm dumb, it has to be either ignore, overlap, or block, you can't just untick something lol
with the 'CollisionEnabled' parameter, if that's set to No Collision will that still generate overlap events?
gotcha
Is there a way to call a post processing volume that's in a scene in blue prints ?
sure in the level blueprint
how do I call it
@inner ginkgo thanks for the suggestion, works great.
@odd ember thanks for the help with collision, also works great
select it > open level blueprint > add reference to post process volume
alternatively,
select it > open level blueprint > add post process volume event
Thank u !
I have it right now where a UI pops up depending on how mad the player is (madness). I want to change it to this ppv. Like when they're more mad, I want the motion blur to go up. I've never worked with ppv before. Is this possible ?
If you want to have two different game modes for a map is the only way to do that by having two copies of the map? There is no way to load a level and say "load with gamemode A"?
Hey! Is there a node for resetting conditions?
@rose spire cameras have postprocess settings, you can use those instead since it's a property of the player and not of the world
@stuck hedge there probably is... in cpp
@atomic prairie that's too ambiguous, what are you trying to reset?
I have a lot of conditions which activate gradually, after my condition R14 I want to reset to start again with my condition R11
if you want to reset your logic you'll have to turn off all your variables and start again
THANKS!!!
hey is anybody able to use GAS in combination with ALS?
Hey can anyone help me? I packaged my game and everytime i open it... it just blackscreens... idk if this a package thing or blueprint thing?
Can anyone explain this behaviour?
The cube is the DefaultPawn class. A regular pawn can be jumped on fine, but for some reason the DefaultPawn bounces my character controller off of it?
@empty fiber Maybe somecapsule component for the box is colliding your character?
Question, do "get all actors of class" works only with already spawned actors? can't i get an actor that has not been spawned (a child class in my content broser) from it?
Get all actors of class will only work on spawned actors. What are you trying to do with your child class?
I've made a widget, and i have some variables in my gamemode blueprint,such variables are "thirdpersonpawn" as every chracter im gonna use is a child of "thirdpersonpawn", the variables are P1, P2, P3 and P4, if P1 is anything other than "nullcharPawn" (a child whose only purpose is to be a flag) then a copy of the widget is placed into the screen
i was trying to target a "nullcharpawn" but non has been spawn, so i used another methood to stop aditional widgets from appearing
Why not just set P1 to null?
I'm using this setup to assign the P1, P2, P3 and P4 according to the value of a variable called "ID"
IDK how could i set the variable to NULL
NULL, Empty and Valid are kind of interchangeable here. You just call set and don't give it a value, then it's null.
oh, didnt know that
However, that code you show is kind of wonky. At the point you assign P1, Array Element shouldn't be defined. Unless it is giving you the last element?
Yeah i iddn't think it'd work as i need it but i tested it iwth 3 different pawns, ID 1, ID 2 and ID3 and it worked... might be torublesome in the future
Kinda got lost earlier, but does anyone know how to get primitive components out of an array of actors?
@dry pewter If I'm reading the code and intention correctly, I think what you would want to do is set P1 to nothing prior to calling Get all Actors. Then run your loop and set P1 after the True of your branch with the Array Element and break. And then remove the set after the completed.
Then for your widget logic, where that is, you check if P1 is valid with an Is Valid node.
Thanks for taking the time to do such thing! Will try those and report back
@vocal urchin Actors have a Get Components by Class. I'm not sure on your use-case, so at a high level, you'd probably loop through that list with a for each loop. And then call Get Components By Class, setting the class to PrimitiveComponent. You'll then need to do something with those results (which might be an empty array if that actor didn't have any primitive components).
It's a selection box RTS-style.
Basically, as you drag over units, I want them to highlight.
If your method of highlighting them involves a component, then that should work.
Like this?
Cause I'm still not able to get the array element to connect to the set render custom depth node
Try dragging out from the loop and creating a new one. I just tested it and it worked for me. The node you have there might be busted.
It's actually Get Component By Class, Apparently
But good call. I'll see if this works.
Both should have worked. But if you only have 1 primitive, then that's the way to go.
You'll want to add some null checks, too.
I'm actually not sure what I'll need in the end. I'm prototyping this with just cubes on the ground lol
Aaaand, it did not work.
Do you have primitive components on your actors? That's the suspect part for me.
Well, they're just static mesh actors
And regardless, is there any other way to set a custom render depth aside from that note, which has a primitive component target?
The mesh should be a primitive. But there might be others, which is where the plural form would come in handy.
Personally, I think this is a good problem to involve interfaces and messaging with.
Create a highlight interface. Add it to any of your unit actors, then they can implement their highlight method how they see fit. And in the code you showed above, you just call the highlight interface on all of the actors you found. It'll just work for the ones that have it implemented.
My other thought was that I could use a box line trace to do the same thing, but I absolutely could not figure out how to draw a box trace accurately, so that became a dead end.
Annoyingly, I'm able to draw two line traces in the exact positions I need - one at the click start, and then one at the click release for the drag, but I couldn't do the box.
@dry pewter If I'm reading the code and intention correctly, I think what you would want to do is set P1 to nothing prior to calling Get all Actors. Then run your loop and set P1 after the True of your branch with the Array Element and break. And then remove the set after the completed.
@inner ginkgo
Like this @inner ginkgo ? i don't quite understood what to put on the break
I was suggesting to keep the break on the 'true' like you had it. Although, it might not actually be necessary if only 1 object will match the ID.
Otherwise, that's pretty much what I suggested. Does it work?
At least for that part, it works perfectly, and i think it will no longer be a future problem, also yes only 1 object is supposed to match
Excellent. Glad to hear it.
Thanks a lot
I was googling something else but maybe you can help me with a yes/no, Can i make a blendspace with an animation that does not loop?
Sorry, I'm good with programming. Terrible with graphics and related disciplines.
It's ok, you've helped me a lot already
@odd ember Turns out you just need some arguments when you load the level. MyMap?Game=/Game/GameMode/BP_FFA.BP_FFA_C this in your "open level" string will do it.
I set an animation sequence variable and want to get that animation inside my animation blueprint and play it, but you can't plug in that variable to anim bp nodes. Am I going about this the wrong way? The animation is an aiming animation and will change based on what Weapon I have equipped. https://i.gyazo.com/b06d66d46144560be425e0311df989d0.png
https://i.gyazo.com/4c5bd8c22360b1d8a7917188b3cdf36c.png
The variable is set inside a data table for each weapon. I'm just trying to make the AnimBP play it now. Ideas?
how do I pass in a delegate as an input to an event?
for example, pass in an event that will execute at some point in the called event
@formal blade I don't believe that you can do it with events, but you can with functions. But only in limited cases. You create a bind to event node for an existing event, then instead of creating an event for it, drag the event pin to your function input node. It should give you the option to add it as a parameter pin.
yeah, I had to get around it by binding the event to a dispatcher on the thing I was calling the event for
Came across a problem, hoping one of you can help sort it out. This code works for the ALS mannequin character. However, as you can see, for our characters after swapping the skeletal mesh the animBP works briefly and then freezes.
https://cdn.discordapp.com/attachments/671140338521341952/694391941865144413/unknown.png
https://cdn.discordapp.com/attachments/671140338521341952/694394328897814598/CharacterSwapTest.gif
Tried setting the new master pose component but that didn't work
Is the animation set to loop in the anim BP?
how do i divide 2 world rotations?
What is your goal for the operation?
i have a rotating niagara system in 1 direction (clockwise) and when i move around with my character when its attached it rotates with the character
i'm trying to negate that rotation so my character rotation does not effect it
If you're operating in quaternions, you want the inverse. If you're operating in pitch/yaw/roll, just negate the axis/axes.
k
You could also calculate the rotation for the niagara system using a worldspace reference, and set its rotation to that value instead of adding rotation to it, then it would orient independently of your character, attached or not
that sounds better
@inner ginkgo yes, it is set to loop. It works perfectly for the first mesh with the gauntlets as you can see before the mesh swap
Question, I'm a beginner in ue4 blueprint, I want to do a ''verification node'' and I want to hide my component only if there is a False. So i made this:
i tried to link the False with a DestroyComponent, but but when the condition becomes True again, my component does not reappear, logic.. So i tried the Set Visibility and it's perfect! But i've a lot of error ''Blueprint Runtime Error: ''Accessed None trying to read property CallFunc_SpawnEmitterAtLocation_ReturnValue10''
Do you've any idea why? or an alternative to the SetVisibility? I work on my Level BP, my target is a Spawn Emitter at Location.
I think the problem come from my Event Tick?
Continuing to evolve my outlining system - got it working much better now from a conceptual level and moved the outlining to the target blueprint class itself (yay). The problem now is that I am having a hard time getting them to stop outlining. I tried setting the variable and then removing that index, but that's not working. What's the trick here?
why are you making an array of 1 index?
you're just changing the actor in index 0 everytime
Because elsewhere, it can be used to select a group.
but thank you for pointing that out. I need to just add it to the array
so this is what you wanted?
if it isn't valid ( your branch ) then the cast would fail anyway
Hmm. Well all I need to do is to see if the object that the trace is currently is the same one as before.
use the ==
But where?
it will always be the last element of the array if that what you want?
No, in the HUD I use the "Get Actors in Selection Rectangle" to do the same thing.
So potentially there could be a set of actors in the array.
you can save the last actor hit in a variable and check if its == to the selected actors if it is you can cast
with the for each loop
i mean if the last hit actor is inside that array it should work
Hmm, not sure where I'd put that, to be honest.
Cause it's only one trace event
it's not like there's a second trace to check and see if it's the same actor
But...what does that do? Sorry if it seems like you're having to spoon feed me here, but I've never had to do this before.
it checks the whole array
if there is 20 elements in an array it will fire the for loop 20 times giving you the element 1 then 2,3,4,5,6...
didn't you study java in school? its the same thing
I understand what the for loop does, I've already been using them. What I don't understand is how adding another one is going to allow me to check the same actor in the same line trace...against itself?
To see if it's the same?
And if it's not? Then what?
It's...always going to be the same. It's the same line trace.
in the branch you're checking if there is a hit or not, right? if there is no hit what do you want to happen?
To set "Unit Can Outline" to false.
I guess it's the last actor added to the array, yeah
from selectable actor array drag and type get a copy
in the index drag from selectable actor array and type array length
this will give you the last actor in the array
Ok, I can do that, but I still don't know what to check it against.
you don't need to check
just get the last element of the array and set "Unit Can Outline" to false
Off the "False" branch?
Like this?
yeah is it working?
No
The problem is that after I've moused over, they still stay highlighted
Yeah, it's not being set to false
substract 1 from the length ?
or just save the actor that you casted to in the True branch
because its saving everything you hit
Will anything even come out of going off the false branch? I feel like it doesn't make sense in the first place, the more I look at it
idk, gonna call it a night on this one. thanks for your help anyways.
Is there a better way of getting a data table index than that?
?
@vocal urchin You're going to get a nullref error on false. You need to use last index not length if you want the last index of the array. Length = Last Index + 1, which will be out of range
@odd ember Turns out you just need some arguments when you load the level.
MyMap?Game=/Game/GameMode/BP_FFA.BP_FFA_Cthis in your "open level" string will do it.
@stuck hedge seems hacky at best. I'd have it done through code
@odd ember UE4 doesn't support changing the game mode at runtime, the only thing you can do is tell it to open the level with the indicated game mode. You can't open a level and then pick a game mode after it's open as far as I've read.
sure but putting it in a string is just not something I would do
I'd do an asset reference at the least
Cool, good for you
it's just setting yourself up for having issues down the line. what happens if the game mode isn't present or is misspelled?
Then you have larger issues in your game.
and it doesn't matter how you reference it, in the end, it still needs to come out the same way and be fed into the open level node the same way.
that's only if you use the open level node
but having a wrapper for it is the least I'd do
just to catch anything
How to create a BP function in C++ that accepts multiple variadic arguments list?
so, been trying to make something for a few weeks now and i just cant seem to figure it out, but what im trying to do is make a camera movement similar to that of Zelda wind waker, where the player is moving left or right the camera will rotate on its axis
@minor cliff do you have an example?
well Zelda wind waker was the only game i can think of that does this
but basically, the character will use the camera as a pivot point to run around and the camera will just look at the character
if you can post a video reference I can probably help you out
https://youtu.be/b0PvJ4AWvWQ?t=32 so this video is pretty much what im looking for but this is in unity
We start the tutorial series by comparing a demo of the final tutorial code and our inspiration, the 3D Mario and Legend of Zelda series - two popular titles that defined the standard for third person camera control when they were introduced on the Nintendo 64.
Code can be fo...
right okay, so if you create your own version of the player camera manager, you'll get a camera that is unbound from the player character
in the camera manager class there is a function you can override called BlueprintUpdateCamera or some such
that function gets called every frame and allows your camera to do stuff as you want while being untethered by the player
you can then combine this with the normal third person camera by setting the location of one camera to the location of the other
when you set the bool return value in that function to true, it'll use the untethered camera, otherwise it'll use the tethered camera
that's the basic setup
you get a few parameters in the function you can use that'll help you out
ok il try it out
Nintendo Cameras are as old and perfected as super mario 64, you will have to do lots of work to replicate it. That tutorial has some good points you can apply in unreal since both engines use litereally the same logic
Can I ask a question about making a menu system (with widgets) in this channel or is another better ? I looked in the guide and cant really tell
it's really not difficult to replicate
the way UE4 is structured makes it way easier to focus on design than on the code behind it
here or #umg is fine
I feel like it is porbably a simple problem..
I Have looked up a tutorial for making a menu system and it has the use of a menu switcher.
problem is when i drag my widgets into it, they are all visable regardless of which is selected.
oof
I'd say that's definitely more of a #umg layout issue. I have no idea about how that works
thank you, i think i can feel a solution coming to mind actualy
๐
Hello!
Working on a topdown shooter and i want a enemy that follows the player around and shoots at the player, but if the player gets to close it backsoff, anyone got any tips? Im thinking that i need to compare the player position with the enemy position and check if it is too close. But I realy dont know how to go about this. I've tried googling it but havent realy found a solution i can understand! Anyone can help me out a bit? ๐
many ways to do it, simplest is that the enemy follows player by default and stops only when hitting the closest range it wants to be in. a really simple way of doing it is by having a sphere volume with a radius of the distance that checks for player overlaps, and when the player overlaps, it performs the backing off functionality
Yeah i tried that using pawnsense and it seems to override the overlap if it can still see the enemy ๐ฆ
How can I make a widget spawn at a certain place in the level for every time the level is opened ?
Just place it when im in eddit mode im guessing ?
I have given it an actor, so it is placeable
it won't work like that though
consider that a widget needs a screen space to spawn in
you place it in the world
which screen space does it spawn in?
are you using something like a render target?
I just attached it to an actor widget, then dragged it into the scene
ah I see, like a component
placing it in the world will work, not sure how interaction works with them
interaction usually works with owners
in this case they don't have (player) owners
Ive given my vr hands a widgetinteraction component so it seems like it now needs some BP loving
oh it's VR
I don't know if there's special stuff going on with VR, might be best to ask in #virtual-reality
I was wondering why you didn't have a UI
but it makes sense
Oh Ive learned in my journey so far, Theres not really any difference
there is when it comes to screen space effects
It's not really a VR question. It's just making the WidgetInteraction component work with the Widget Component. I had a lot of fun making world space pop up widgets a few weeks ago with those.
I don't know that widget interaction component exists outside of VR
Well, if it doesn't, I am hacking something. Was using it with a mouse. I can't even open a VR template because it'll crash my editor. No VR equipment. XD
I see in the doc there is documentation for using it outside, but I've never seen this before if I am honestly I'd say it was created for VR use really
otherwise in most cases you can handle all of that outside of VR through screen space projections
like with 3D menus
that is impossible in VR though
yes it is:
Dunno. It works amazingly well attaching it to an FPS pawn with it's orientation matching the camera. Didn't even feel hacky, it just worked.
I mean the point is they wouldn't have made this if there was a different way to access it
Hey sorry if i'm interrupting, I've got a question where i cant find the answer to, how would I access the Camera rotation and the capsule of the playercharacter's rotation in a playercontroller? ๐
get controlled pawn
get control rotation && get controlled pawn -> get actor rotation
cast to it
How can I make a procedural cube with an adjustable resolution? I want to normalize it to make a cube sphere
im sorry big noob here, how exactly?
@supple steeple those are functions in the player controller
yeah ive got those but how do you refer to the camera of the player and the capsulecomponent?
๐
Question about blueprint function libraries:
I have a blueprint BPObject that is a child of Object. It doesn't seem to be able to access functions in my library. Other blueprints can. This makes me sad as I like having a light-weight parent.
What determines whether or not a Blueprint can access blueprint function library functions?
okay let me rephrase cuz i really dont get any of this, im sorry, but im trying to get this part exactly, so not sure if i asked the right thing...
@night grotto objects don't like blueprint function libraries. you'd have to derive your own class in cpp from object and allow it to access BP function libraries
@supple steeple maybe try the functions I gave you
oh great I can do that Cranz, thanks!
@night grotto I recommend you look at what game instance does to allow function libraries, perhaps it is as simple as being as UCLASS() or some such. not entirely sure what the mechanic for it is
thx
It's kind of working now, still doing crazy weird things that ill have to look into, thanks @odd ember sorry again ๐
What Is the easiest way to make a Widget menu switch between sub menus (But preesing the options button, change to options widget etc..)
Im watching Tut's on this and its rather confusing, I already have all my menus made
This month's voted for video by my Patrons and YouTube Members was how to create a menu with sub-menus and navigation of said menus. Meanwhile i take this opportunity to also show how to fix common issues people face with widgets and especially their inputs and focus.
Support...
I have been following and trying to addapt this Tut but its not going well.
@dapper cradle WidgetSwitcher is probably the easiest way I know of. Just need to change one value and bam, new menu. Assuming your menus are of generally the same size or can occupy the same space. Full menu switching is easily doable too, just means more work associating buttons with which panels to hide or show.
Thank you @maiden wadi that is used in the tut I just watched, the problem is i cant figure out how to program it so i can click individual buttons, leading to their respective menus.
each button should have a set of events, one of which is called something along the lines of "OnClick"
as an example
I migh select "Skill support from the menu" that leads to choose equipment, of 5 pieces I choose "Floor" ( I was hoping this next menu would be a panel menu filled with all the skills for the floor)
the skills will be chosed from their which will spawn in their characters/animations.
Yes, they do, ON click will work great for me if i can use it to close the current menu and open the next.
In your Widget designer, your menus should be the direct children of the switcher. On button click, set widget switcher's ActiveWindowIndex.
Er, ActiveWidgetIndex even.
should i be able to highlight/select individual buttons from the widget switcher ?
because i cant, so i cant bring up a on clicked event
you probably need event dispatchers
that are set up from the widget switcher
so that when a child's specific button is clicked, that information is passed to the widget switcher
but I don't know
just sounds that way
Yeah, wasn't sure how to explain that one. I just know how to do it, not the terminology.
honestly if you're doing stuff in the world just spawn each menu in an individual space next to each other
you don't really need to switch since you've got plenty of real estate
Well the area that i need the menus to occupy is very small
is that a restriction you set yourself?
Ill show you a screen shot
I have modeled my work place, there is a small areas that us coaches stand when we are watching the floor, I really want the menu in that space
with the blue outline
the animations for floor moves will play here on the red floor
usually you build your space last since then you know how much size you need for everything
in this case I'd suggest trying the event dispatchers if you don't have the real estate
sorry, i know it sounds awquard, but i modelled it as true to real life as possible
yeah no such thing in games
the camera you have in game doesn't correspond to real life, so the metrics won't either
well, when i turn on VR preview it feels acurate to actually being at my work place
kind of surreal
for interactive elements in you case it would make sense, but for the general space it could be anything you wanted it to, within reason
anyway just saying you could give yourself some leeway so you wouldn't end up bottlenecking yourself
you have options either way
Can you enable complex collision for a single static mesh component ๐ค ? Or does it have to be asset-wide ?
how would i abstract something like camera stuff from the player character?
i've tried to make an actor which spawns a spring arm + camera, but wasnt able to use the spawned camera
(and attached that actor to my player)
Bois, Why are these array indexes jumbled each time
Like I wanna get the index at 0 and set that to scale 1 everytime
and then index 1 set to scale -1
but it's getting the wrong keys per axis because the indexing isn't consistent? :/
@spark steppe you could use Set View Target (player controller function) to set the camera to your custom spawned camera, or look into CameraManager from the player controller.
basically the cameramanager spawns the camera on possession iirc
i've tried that, but theres no way to pass the spawned camera to set view target
huh, but how does the top down example has cameras in it? i thought they are used actually
it shows fine in the viewport/editor, but as soon as i start the game i'm stuck on the shoulders of the player
what is the second sreenshot below it looks nothing like your character above it
thats only the "camera actor"
your character has 2 capsules around it, the spring arm traces so it doesn't clip into walls
yeah don't give it a capsule
but that was my intention
to have the camera in my camera actor, which i can then put on different characters
your characters capsule is blocking the camera
if that is what you intended then it works as expected
@spark steppe this works fine for me
oh, so the spawned camera has a collision, too?
you use the spring arm and it has a capsule probably you inherit from Character which is unnecessary
use a blank actor
whats the parent of your class?
Spring arm traces collision from pivot to attached objects by default and adjusting the length so it "automatically" prevents clipping into walls or other objects
whats the parent of your class?
@spark steppe AActor
yea that gives me another result, looks like something i can play more with
thank you
but it's getting the wrong keys per axis because the indexing isn't consistent? :/
@exotic warren Get once and store in a variable
What do you mean?
how are you building your array? on the fly or static?
On the fly, It litterally just getting these values
ohhh, set view target just moves the camera to whats passed as new view target
so it doesnt really use the camera that i've constructed in my actor
But like you would think it would make the arrays like this
But it doesn't it just gets them in a random order
wait it uses the camera.. it just ignores the spring arm
Why the weapon's plane is jittering when I just turn ?
Is there a way to fix that ?
I hate these small annoying details, it prevent me to continue my projects...
ah i figured out, the actor itself collides, neither the camera or the spring
but i cant disable collision for it
hello, is there any way to make a mesh that will work like a mask ? for example if i have a terrain and want to place a pool how to make the terrain mesh hollow ?
can i disable the collision for Actor A with Actor B?
or is it self colliding if actor b is child of actor a?
@solemn dagger You could make a simple vertex-painting system where your material turns the vertex colors into spatial offsets, meaning the vertices you paint would sink down. There's a tutorial where that's implemented w/ snow that sinks where a character steps on it, but I can't find that :/
alright sounds interesting i will google it
hey - do you know of anyway of having a "static" BP class? or do you know if the factory pattern to spawn various items works well in BP?
I tried doing the following but new object from class doesn't seem to work if said object is an actor
And I wouldn't make the factory an "actor" but if I make it an object I can't seem to access "spawn actor" inside it
^ the ss above is in the gamemode btw
@frigid salmon Unsure how ConstructBPFromClass works. Will SpawnActorFromClass do what you want?
shouldnt in construction script
@keen goblet I don't have access to it
shouldnt in construction script
@versed sun oh, I seem to have access to it in the event graph, did not know that
yah , spawning actors in construction script is bad, because it updates every time something changes
ok, got it
what about the idea of a factory pattern in BPs, any experience with it?
kinda
that's vague
Hello, I'm new to UE and have a problem with control rotation, it works with main player but not with IA pawn, anybody got an idea ?
@odd ember trying to send you a diagram in DM if you'd gladly accept ^_^
@glacial oar control rotation means the rotation that the player controller uses
i think AI always are rotated 1,0,0
so your AI won't have that control
@frigid salmon ah man can you post it here?
I don't do DMs if I can avoid it
fair enough
it's for your benefit
So basically this will only work with main player?
the lines before the view / business layer represent communication - nothing UML
I was thinking that would be a decent architecture for a items / inventory system
@frigid salmon you don't really need a factory separately for that
then what approach would you take?
even the inventory would have to be a component class, not an actor
yep, the inv is a component
seeing as you're stuck with UE4s EC(but not S) use entity component relations
spawning is relatively secondary
storing is primary
you also can't write to data tables
only read them
yep - I know
can to Data Assets tho ๐
other than that it looks fine
might change that DT in the future tho
inventory slot is also not a subclass, it's an array most likely
ideally you would want a heap
but take what you can get
technically TArray does have heap functionality
but it's not BP exposed
a heap would help with sorting, what else tho?
retrieval
if you're boggled down with performance I'd recommend doing it in cpp
@maiden field trim
ok but would you still suggest on having some class / component to extract info from the DT / DB?
@maiden field trim
@exotic warren what it does exactly?
@maiden field exactly what you said
I don't really care a lot about performance, the other person I'm working with does a bit and he is stuck with BP - just trying my best in those constraints ๐คฃ - but yeah will use an array
you also don't really want separate widgets like that, but rather store icon data in the DT then use retrieval for the widget as well
@frigid salmon what's the scale of your game?
I was having doubs about that slot thing
your equipment icons are just arrays of textures
he did make part of it, got it working - including the widgets. I'm trying to refactor as little as possible
a single widget will do as a container for the slot, then a slot widget that can be populated with icons
all managed by the container widget
@maiden field trim
@exotic warren the problem is the output of the string is:
<html>
<body>
and here the result. < that can be a lot of things:
i just want to remove
<html>
<body>
and also that space
@maiden field use replace them
yep, that's what I would do - he split it into 2 since 1 in the actual inventory and the other one is the view where you have the character behind, the slots are manually put etc.
I'm not trying to remake that part, just trying to get all the logic in one place and separate it as well as possible
@frigid salmon how big is your scale, and why do you need to use a database for items
yo, can someone help me out with implementing an addforce to my player while he wall runs? I want to mimic something seen in SM2 where the player can wall run, but the force is exponentially determined by the player's velocity - I'm not struggling with the actual wall running logic, just the add force logic I would need to achieve a similar effect
A quick comparison of the original Wall Sprint vs. the Wall Sprint Upgrade (available in the Spidey-Shop after collecting all the Skyscraper Tokens).
Created with MAGIX Video deluxe 17 Plus
i try
@frigid salmon what's the scale of your game?
@exotic warren I'd say too small for this but using it as a learning oportunity as well so meh - expecting @ 50 items
projects become extremely scalable with them
@frigid salmon then don't use Data Table
it's a combination of learning + helping someone make a game
I was thinking about using some sort of DTO so I can separate the database with the rest of the game
It's based on the general item structure
so then I can just switch between DT / data asset / mongo whenever I feel like it
So each item can just be a new data asset
I would say don't bother with Data Tables for this
you can import DT assets from .csv
Data Assets much more powerful
I'd say both of them have pros and cons
and from jason
Data Asset can also import from JSON / CSV
if you want to
And no it's not
You can base Data Asset on a blueprint class
so it can include code
Data Table is just raw tables
well I wouldn't want my code sitting with my data together
I'm trying to separate them
it's just a different way of doing it
Yes
yep
So what you should do
you're going to use the data to fill out the same blueprints anyway
Or atleast what I do is have have components based on UObject
and then I create them on the actor
or you can just use actor component
whatever works for you
๐
and then you set in the Data Asset which component you use
So all the code for your item is self contained
for example here
not sure why the code wouldn't be self contained otherwise
This is where I define my Weapons script
it's just a different way of writing it
Yeah i'm not saying you have to use this way, I'm just telling you as it might be helpful
I've built these kind of systems lots of times and this is the best i've discovered
as it's super mallable, You can make the item do whatever you want
and it's not restricted in place to predefined code
I reckon if we factored performance into it data assets would come out more expensive. they seem to be made in the case you have a few items that are well polished, as opposed to an item system
and doesn't need to load anything it doesn't need
likewise importing data assets mean you'll have to save data assets
you don't have that with data tables
just saying
ok, I will check Data Assets out aswell but other than that, how does that architecture look? Would you still have some sort of a DTO between the data / items or just make the items construction retrieve their data from the DB directly. if going for the first approach, would some sort of a "static" DTO instance on the game mode be a good idea?
They are slightly more expensive but they are way better at doing this kind of thing imo
as it's super mallable, You can make the item do whatever you want
@exotic warren I'll check it out and play with it - but trying to take it one step at a time. The game I'm working on has only pretty much melee weapons with nothing special
I wouldn't run anything like this on the game mode
then where would you put it?
use it as a subsystem
a subsystem of the playercontroller?
I just have an actor "ItemBase"
Or "WeaponBase"
That constructs the component from the data
and sets all the variables on begin play
subsystem is a separate paradigm you can invoke @frigid salmon
that's what I'm trying to avoid - but it might not be a bad idea to do so
and then you just spawn that actor in and tell it the component on spawn
it mimics some of the functionality from the missing S of UE4's EC
Why are you trying to avoid it
You only need to do it once
You make an item base that just constructs your custom code
and then for things like weapons that work a bit differently
you make a child base of item
I have that
None of the code goes in those base classes
it goes in the components that get constructed
generally the base of any item shouldn't be responsible for handling code for that item
I'm just trying to not make them access the database to setup themselves
a manager should
then we get back to an itemManager, which is pretty much a factory at that point
@odd ember why?
good SOLID principles
because it would imply you need to know what the data points to before you read the data
you want the item to be the item - that's it's own responsability
it shouldn't care about where the data for "making" it comes from
It doesn't?
if I change the datatable and link it to a SQL database later, I shouldn't have to change anything in my items
It's litterally a plugin data asset
Oh you want SQL
You mean you need to store the instanced actor states into SQL?
So like say for example an item like a weapon
you save ammo ect into SQL?
@odd ember You mentioned something about subsystems, I'm not entirely sure what those are in unreal and if I can make one using BP only (as I mentioned earlier I'm a bit stuck to BP only)
oh you can't make them in BP
@exotic warren maybe, or maybe in a mongoDB or maybe in a csv
but you can expose their functionality to BP
I can't go in cpp sadly
DT is still the "cleaner" solution
maybe I should use the gameInstance to keep the manager/factory?
Hmmmm