#blueprint
1 messages · Page 136 of 1
I think this needs a re-think.
If all you're changing is a single field in the structure, you'd easily cut the number of nodes and wires by using a select statement based on int where you then feed in the values for all 98 values. It would be cleaner than what you have, but it's still not great and requires a lot of manual entering into that select node to do. Not very easy to change values around if needed, but neither is your original method, and this method is also less prone to mistakes.
I think what you really want to look into is using a weighted selection system. Ryan Laley has a weighted loot table example that does this. His utilizes a String > Float map, but you could easily use your custom enumerator > integer and set up something similar. This again is assuming you're only changing that one particular field in the structure.
https://www.youtube.com/watch?v=_jWxH-rVmTA
Learn how to implement a loot table component for your enemies to drop random weighted loot.
Become a Patron to gain access to these project files: https://www.patreon.com/posts/project-files-32789634
Support me on Patreon and get access to videos early, join our developer community on Discord, get exclusive behind the scenes videos on my pro...
Trying to make an RTS camera where holding right click will just pan the pawn (like the Sims 3 Camera) but for some reason the pawn will only move one direction still regardless of the mouse position! Any ideas?
This is to move a camera pawn with the camera above it, looking downwards?
Its to move the pawn in WASD movement regardless of the pitch and yaw of the camera and pawn
trying to replicate something like the Sims 3 camera where you can hold right click to move up down left and right
Am not familiar with Sims 3 controls. Can definitely help, but need more info. Does cursor location or WASD decide the direction?
cursor location! when the player is holding right click itll get the cursor location on the screen to determine the direction to move
And this needs to move them in the direction that the cursor would project to them?
yes, the middle mouse button when held will change the pitch/yaw and the right click will move the pawn around based on the direction of the pawn and the mouse's position on viewport
im sorry if im describing it terribly LOL
First question is that I'm inclined to ask why you're not using enhanced input? It looks like you're using UE5?
I'm not using enhanced input i suppose because it looked like i didnt need it if i already had the inputs available and they worked okay
Just a note that the old system is considered deprecated. 😄
this is a funky example video but this is what im trying to get https://www.youtube.com/watch?v=SBTta3waupE
Ohhh i dont use the bindings i didnt create any
i just use a right mouse button event in the event graph
@wicked cairnSomething like this would suit. You could replace the input action with a tick and a check if the right mouse button is down too.
Oooohh i didnt think of this
For completeness the input action is nothing but this.
I'll try this out!! thank you
If I have three boxes, say Box A, B, and C in incrementing sizes. How can I get a random point within Box C that's also not in Box B or A? I'd like to use Random Point in Bounding Box, but then would I just check if that point is within the other boxes and keep retrying? Does this seem right
I'm inclined to say that that a while loop would be the easiest way to manage it. Probably okay for like a procgen maybe if you safety the conditions to never get stuck, it's already expected to be a bit slow.
The more secure way is probably to find a way to boolean your boxes from one another by constructing smaller boxes that represent the same space but without the other two.
EG something like this. You have the green and two blue boxes. The blue need taken away. So you construct the yellow boxes for the remaining space. Then you pick one of them at random and find a location within that one.
I think there was some miscommunication sorry, here's my current set up based on a debug test. I'm asking, how can i get a random point that's inside the white square while also being outside the red square
i'm building the dungeon from green -> orange -> red etc
in a radial pattern if that makes sense
it's like masking the red square out of the white
In this case will the red square always be centered to the white? Like can you consistently make rectangles out of the sides?
yes
Add a branch with a boolean that cancel out dodging keys or the activation of dodging~ ghetto way or you could add velocity checker or a while jumping ~ cleaner way
each square has the same center
It works perfectly! Though, I'm having a different issue now where having Use Controller Rotation Pitch and Yaw enabled keeps rotating the pawn while its panning because of the right click input. Unsure what to do here
I'd generally say the same thing. Make four rectangles out of it, randomize them and get the location within that. This at least makes it easier since it's consistently four rectangles. You can just use the corners of the two to reconstruct the four rectangles.
wouldn't it be easier to keep choosing a random point until it fits within the masked-out white square
the green scribble area
Easier, sure. But less secure. Also potentially a ton of iteration. If you get a really bad luck roll, you could take 300,000 iterations before you get a valid point.
yeah that's true, although I might be willing to take that risk since this dungeon will be generated before the game starts anyways
shouldn't be too long of a load time
Anyone know how I can properly disable the rotation of the pawn whenever I hold right click to pan my camera? I'm not seeing anything else that might work, but disabling the Controller Yaw/Pitch when panning just sets/teleports the pawn's position to where it would be when i release right click
you can try locking the rotation of the pawn by constantly setting its rotation to what it was as soon as you pan?
idk lol
true LOL
@craggy flickerThing is. The rectangles are very easy to make. You just need to make yourself a few static library functions and decide how you want the rectangles to be made. If you just consider that X is left/right and Y is UpDown
With those, you can make the rectangle functions. EG this function would create the purple rectangle.
Then you just pass in your boxes, and GG
Guess youd want separate corner boxes so they dont double the spawnchance
In the overlap
Yy
You don't even need to construct all four to randomize. Pick a 0-3 integer or make an enum for Top,Left,Right,Bottom, then just construct it after that randomization.
random x within bound + random y within bound
- Random inversion of bound
Nah not that easy^
X and y bound depends on the other result
Guess just doing it im that order would be fine
Y bound is ofc full bound
Yepp that should work
Nah.. x is full if y < min bound
Y is full if x < min bound
This should be all you need after picking a rectangle. Set Z to whatever the dungeon is working at.
How did they get a reference to an actor in the level?
I am making an elevator and it works, the issue is that I have no way to set it to "Raise" false, on the backward movement
Any suggestions on how I can do that?
You can just drag it in from the outliner.
select it in the Outliner, then go in your level blueprint > Right click > and you will something at the top of the context menu having the name of the object you selected to create a reference to it
this is the other side
I think what you already have there should work. On finished, if direction is forward, it's raised.
I mean to set it using that enum check.
so, even when it is up, it sees it as down
and tries to raise it
I could do a branch.. and check the value and then jsut flip it I guess
Does this work?
It returns forward when it finishes playing backwards? O.o
wait, you want me to swithc it to forward
okay.. one sec
okay, so ... now it kinda works
I have to enter it twice for it to see that it is raised
and then it lowers the second time I enter
so, it is sorta working 😛 Just need to figure out why it doesnt understand that unless I go back in
couldnt I also just set the value at the end of those events?
wouldnt it do the same?
lol, nope it has to be on the is finished node
k
Unsure, but I tested this to pingpong it back and forth and it's working fine. I get a print every 1 second for the correct direction.
k, let me see what is going on
so, when raised, walk up to it and I get a false
wait
I forgot to change it back to forward, one more check 😛
I would also change this check here.
I would put two branches maybe. One for whether it's activated and the overlapper was the character. If not then do nothing. Else branch on the IsRaised check.
so.. it seems like there is a delay
before it gets set to true
it doesnt happen right when it reaches the top
Track too long?
maybe
I thought the track determined how fast it went from point a to b
oh
nope, you are right
value is 3, but track is 5
damn.... good call! ❤️
and it is working! ❤️
🥳
Thanks home slice!

I haven't found a tutorial about getting the return value from a function that is set to fire every 1 second
how do I make it work?
I tried using the Set Timer by Event node instead
but that does not work in Function Library
A return value is retreived from calling a function. so your flow could be smth like:
In your BP Graph have a timer -> call the function -> process the return value.
Otherwise the function it self needs to call smth where to write the result to so someone can process it. but a Return value has to be read after calling the function.
one sec
here's the whole function library
and here's the TimeUp function
I'm deffinetly gonna need to also grab the timer handle in case I need to pause it or something
this Timer function library is called inside any blueprint graph
so it should fire off the Set Timer node and return the integer values
I haven't read the conversation, but typically when you want to call a function with an input and a return you don't use a timer by function name, you use a timer by event which calls the function manually
but that doesn't seem to work
just said I tried that
custom events don't work in function libraries
well you can have a function that does not have a return value which calls your function with a return value and processes that.
I don't understand what you're trying to do
what you want to do isn't possible, but maybe with some info we can help you figure something else out
you can't set inputs, or receive outputs from a timer, but I don't get why you'd want to put a timer in a function library
so that I don't have to reuse the same node setup over and over
and to keep the blueprint graph optimized
what dispatcher
that's also a possibility, but it wouldn't get him the output
the CreateEvent from the SetTimerByEvent
it'd end up being like an infinite loop
it seems he wants the output, as well as the ability to set a timer?
My question would be why is this in a function lib
sounds like it has little to do here
what you could do
is bind to the timer
and get your current time, wherever that resides
whenever it triggers
but i'd still think it's misplaced in a BPFL
I'll try to figure this one out
all I'm trying to do is have a function library to be used as a timer and be set into a text
so that I won't need to redo the blueprint setup over and over
sounds like a very strange thing to do
all I know is that I need a timer node and use the integer variables from the umg graph into the function
since you can't use variables in function libraries either
well best of luck
Can't you create some sort of Timer Object which uses delegates to notify and that can store internal state?
what is umg graph?
widget graph presumably
ye but I don't know what a graph is 😛
so just variable from the widget? gotchya
yepp
i mean what he is trying to get
which ofcourse is not a good place to store state
was thingking if he needs to pull a value from the Widget Timeline
cuz that is doable
I use a Text box. How can I set the Username in the Text box by fetching the name from PlayFab
I'm guessing you want to check if you are successfull after getting a response
then break down the respone struct, see what data is available to you
that and reading the documentation I guess, if there is any
What fresh hell is this?
an attempt
I may be mistaken but I'm pretty sure this Timer function won't do anything you expect it to do.
thats the issue
Timer will switch on enum then set a timer to call TimeUp, which will run with the default paremeters and have no side effects at all (might as well not even run)
its even set with looping on, yet its still executing only once
Functions can't really do anything latent so I'm not sure what you'd expect here
when the function returns it's gone
which means I gotta use the timer outside the function, that correct?....
cause I can't use custom events in a function
macros were a no go, this is the best approach for functions
works the way its intended now
Is there any reason you're not just counting up on tick?
A timer can call multiple times a frame to catch up making this inaccurate
That doesn't answer my question
not sure I get your question
Timer will run and exevute the function but it goes nowhere.
Theres Time structs in engine already
this?
I only needed a simple timer system where I can set it to either count up or down
Timers can run multiple times a frame making them inaccurate for time precision.
So why don't you just count up or count down the delta seconds on tick.
you're saying I should use the delta seconds to make a timer?
What is the precision for this time increment ? 1 sec?
yes
Is that what you want ?
If so then timer is fine
If it fires multiple times in a frame the game should just force quit being < 1 fps 🤔
Id still personally opt for the precise method
It's not like adding a number on tick is any impact on performance
Timers for stuff like this ain't the best
I severely doubt by anything measurable
If I'm tracking time I probably want the one method that doesn't suffer precision issues.
If you cant use existing time tracking methods
Isnt delta also float?
Not that kind of precision issue :P
I mean precision as, the actual amount of elapsed time.
:p itll fire on the first frame after elapsed time, just like tick
You'll still be able to desync with a timer
How
Because again, their funky catch up mechanics
Care to elaborate or provide some sources on that? :p
tested the timer with lower framerate and its still counting at the same rate
Timers are funky for sub frametime timings
You can look into FTimerManagee to see what it does.
But say in the example somewhere down the line, where you could possibly hitch, your timer could desync, versus just counting the interval between the last frame
Which is possible in this case. A hitch or a tab out is likely to desync the timer
It'll run catchup
So multiple calls on a single frame
Which for edge case like tabbing out cant be all that horrible
As long as you know it happens
And have code that supports it
Sure, a minor desync isn't awful, but I'd rather not have it
Plus I may be slightly biased but you can have that cool millisecond view you get in racing games :P
Personally id pause the game on tab out
Yeah thats true 😂
Just do rand() on the last 3 decimals lol
If it's working for you, great.
Keep an eye on it though.
Are you able to have a for each loop within a for loop?
But bp looops are slow
So it quickly stops if you got high counts 😆
ty both! For some reason, the outer "for loop" doesnt seem to do anythign
would share a screenshot but i keep getting "no video memory" crashes\
Is it possible to get all variables within a category?
I need some help with setting an animation track for a blueprint in sequencer.
I´ve got a blueprint with a bunch of skeletal meshes in it and I want to be able to set the animation sequence for all of them using blueprint, accessing their skeletal mesh component like in this screenshot:
How do you mean? It's certainly possible in C++, but what do you want to do
But only think that works so far is setting animation data with a for each loop, but that variable type isn´t exposable to cinematics and I can´t move the animation sequence in sequencer etc:
I want to create a parcel delivery system in blueprint. Parcels always leave from locA, but they will have to be delivered to various locations accross the level. Each location is tagged with a blueprint actor that returns the location name (locName) and its coordinates (locCoords).
When accepting a new delivery I want the delivery location to be randomised from some sort of a data structure - what should I use for this purpose?
Sounds like a fairly straight forward filter. GetAllActorsThatCanBeDeliveredTo->FilterByTagsBasedOnWhateverConditionsYouLike.
hm
After that, just pick a random one out of the array and assign it as the end point of your.. quest?
I mean essentially a delivery system like that is just a simplified quest system.
okay but how do I store the locName/Coords?
unless I don't.. and I could just have the objects from the hierarchy in the array, and then I can pull that data out of them
man I'm so bad at this. I had 2 months long break and it feels like I've forgotten everything that I knew about bp's. this hurts
I would go with just storing the actor you already use.
I don't think I understand
You said you have actors placed around the world that can be delivered to.
Each location is tagged with a blueprint actor that returns the location name (locName) and its coordinates (locCoords).
If you have an actor there, no point writing out it's location and such to a struct or anything. Use the actor pointer itself. This also saves you headaches if you decide to do moving delivery points, as you would not need to constantly update that struct, because you'd be pulling from the moving actor itself.
yeah I needed to figure out how to store the 'address'..
because when you get a delivery you will need to know where to deliver it, and there's no gps or minimap
my "delivery spot" marker stores the coordinates (in a variable) when the game starts so I can move it around freely
I accidentelly closed the PR a while back and cant be bothered reopening it cause epic basically never merges in PRs
but if you are running source editor, you can merge that in, and always force your BPs to open fully
would it be safe to use a for each loop with break to check if any of the items in the array were previously rendered?
hi,
I need to get the data that the user sets directly in the widget. Will it be ok to create a widget on the server side just to get the data that the user has set?
anyone able to help explain why this For Loop doesn't seem to do anything?
the intent was that the array in the 'for each loop' would play, flip flop to change which array to use, and the 'for loop' makes it play twice in total, one for each array
You cant really delay a forloop like this
what do you mean?
you cant use delay inside a forloop
oh what
modify the "For Loop" node
it seems to work on the for each part though, i thought. you mean specifically for "For loop" rather than "for each loop"?
(or forloop, just replace the necessary part)
either, both
neither
a foreachloop/forloop is designed to run through on a single frame
so the internal short circuits will ignore your delay
add "Delay" directly in "ForLoop". copy the "ForLoop" macro and add "Delay"
Why do you need a widget at all?
Widget is something that exist locally , they don't replicate. But apart from that , you shouldn't store gameplay data there anyway
Is there a way to set the default control rotation on a controller? I can't seem to find it in the details panel.
thanks, will check this out!!
Thank you!! Ive never opened up the macros in this view before, great to know
user UE5 sets data directly in the widget and I need to get this data on the server
dont edit the default ones! 🙂
haha probably a wise choice. do i have to create a copy and rename it to call specifically that one?
The data shouldn't live in the widget
You can tell the widget to set the data that live somewhere else
yeah, you can make a macro library if you want
gotcha, ty!
No, you'd need to pass the data through a player owner actor
the data is set in the DataTable, and there are also those where I need to set references to another widget directly in the widget.
Data table is read only or at least it should be read only
nor widget refs
but I need to read only constant data
from this widgets
nothing more
but it must be done on the server
Where does the widget get its data from?
I get data from DataTable, where I set the table and row directly in the widget.
and from a reference which is also set directly in the widget (reference to another widget)
the user simply sets the DataTable and row in the widget, sets references to other widgets, and that's it\
@dark drum
Hello everyone, I am looking for material that can help me find a solution to remotely control Unreal based on real-time screen reading of my own game. Does anyone have any guidance?
I'm creating a kind of Self Driving Simulator, so I would like to read the camera screen in my vehicle, process some data and return the command to the game simulator again.
need pixeldata from camera view ?
If I create a widget on the server, and get initial data from it, what might happen?
I would use an event dispatcher on the widget where the player updates the datatables and row name. You would then call the event dispatcher and pass the new data to it when they player changes the values. What ever creates the widget can then bind to the event and store it somewhere.
depends, what you want to do? what do you think will happend?
Servers can't create widgets. Granted listen servers can but that's for the player not everyone else.
well, I don't care about a dedicated server and I want only create widget and get initial data
ok, I'll just check it out
@dark drum
void AController::OnPossess(APawn* InPawn)
{
const bool bNewPawn = GetPawn() != InPawn;
// Unpossess current pawn (if any) when current pawn changes
if (bNewPawn && GetPawn() != nullptr)
{
UnPossess();
}
if (InPawn == nullptr)
{
return;
}
if (InPawn->Controller != nullptr)
{
UE_CLOG(InPawn->Controller == this, LogController, Warning, TEXT("Asking %s to possess pawn %s more than once; pawn will be restarted! Should call Unpossess first."), *GetNameSafe(this), *GetNameSafe(InPawn));
InPawn->Controller->UnPossess();
}
InPawn->PossessedBy(this);
SetPawn(InPawn);
// update rotation to match possessed pawn's rotation
SetControlRotation(Pawn->GetActorRotation());
Pawn->DispatchRestart(false);
}
I take a look at controller. The control rotation is set to match the actor rotation, at least at the time of possessing
I'm just gonna assumed that's how they implement 'default' value for the control rotation
// update rotation to match possessed pawn's rotation
SetControlRotation(Pawn->GetActorRotation());
Refer to my other comment. This would be the best way to go about it.
Yea, i figured that was the case. I ended up just calling the set control rotation on begin play in the player controller.
but these are large amounts of data, I would not like to send, for example, 300 indexs in an Array
but yes, I already use this solution
but for a specific index
You only need to send the selected datatable and the row name.
why do u need to send 300 array elements?
Initial
maybe, how it worked? I'm creating a kind of Self Driving Simulator, so I would like to read the camera screen in my vehicle, process some data and return the command to the game simulator again.
What data are you sending?
I'm creating a kind of Self Driving Simulator, so I would like to read the camera screen in my vehicle, process same data and return the command to the game simulator again.
I have no idea then, good luck
im already lost
what's a button in a widget has to do with any data being send
again those data shouldn't live in the widget
widget can read from somewhere else
might not be what you need , but you can read each pixel's RGB of a Render Target
Only thing I know of
I would imaging behind the scenes Linetrace/Box trace would be better tho
I need to get the data what i set here on server side, So what do you suggest?
this is where I set the data and I need to get this data somehow @frosty heron
I will suggest the same thing, have the data live somewhere else
Data Assets or Data table if static
Widget simply create the button based on the number of entry
Eg skill A , Required level X
but it's more convenient this way :/
not really
i wouldn't even do that for single player game
you just add entries in your data table
and your widget should handle creating the buttons for every entry
manually placing it in the widget already limiting your self to only what you can place
not to mention the data cannot be read if the widget doesn't live
Again, the variable shouldn't even be in the Widget
imo you should totally avoid multiplayer at this stage X_X
anyway I don't want to be toxic
but maybe I already have
good luck with what u want to do, but If I am in your shoes, I wouldnt dip my feet in multiplayer with no experience in creating Data Driven gameplay
I'm just trying to figure out what would be best
but creating everything based only on data will slow down the work, e.g. when I want to set a specific position for each widget, etc. (Canvas Panel)
@frosty heron
like placing 300 buttons by hand?
yes
okay
in canvas panel
yea, fuck me dead if I have to do that
I would have to store 300 positions in canvas panel, widget size etc
This would be terrible to work with 😄
and then when you want to get the req level for Skill 285. you will look for button 285 and get it's value?
no, I will do it using the data obtained during initialization
i will encourage you to give up on doing 300 buttons manually
anyway you probably should ask other opinion
my advice right now is to leave multiplayer and make a game that is data driven
Can do something using the widget utility? that it get all the settings to the data table and then based on this data.
...
I set all the buttons manually and get all the data that has been set and put it in the DataTable.
@frosty heron
is there any way
\
so as not to work only on data when creating a layout, etc.
@tight pollen other way around
data should be available from the get go
Have some sort of data structure
Widget created -> Read the Data -> Create the buttons
anytime I want to add new hair (or skill for that matter), just add more entry
yes, but you have everything here in WrapBox / Scroll box, and I have it in canvas panel and I also need to put the location and size of a given widget
Why are you putting 300 widgets in a canvas panel?>
RIP slate prepass.
Rip user
instead of giving advice, RIP 😅
it must be in the canvas panel, I have no other option
how can i delete asset from Widget Utility?
Why must it be.
Why does it have to be placed by hand
It doesn't have to be by the way
I know
but it is more convenient to do it by hand
so how can it be done differently, better and more conveniently?
Really depends on how you want them laid out initially. It's mostly just some rectangle math
@tight pollen Like are you looking just to order them left to right, top to bottom? Or More clustered to the center of screen? Or is it more of a crazy mess style with them partial overlapping, or?
Hey guys, just a quick question, what is the actual difference between the add force and the add force at location? I am currently using add force with a vector pointing to the direction I need and it seems it’s working ok, what would be the difference on using add force at location instead?
AddForce can be thought of as moving from the center of the object. You'll always move in the exact direction of the force.
AddForceAtLocation, consider hitting a cube in the center of one of it's faces. It will fly fairly straight for the direction of the force. But use that same force on one of it's corners, and the cube is more likely to spin more as more force is from a more angular direction. Not to be confused with AddRadialForce, which would spin the cube in place without adding a real directional force to it.
Is there a clean way to call a function or event the moment a variable reaches a certain value? For instance when the Health variable reaches 0, kill the player, etc.
You make setters for this. The thing managing health should have a SetHealth and SetMaxHealth function which internally sets health and then checks state to call delegates.
I'm asking because there can be a lot of factors that can change this variable and I'd like to make it clean now for later scalability
Adding to what Authaer said, Event Dispatchers.
Ah, thank you. I'll look into delegates.
anyone know how to get this collision box to overlap with things when its spawned on the item. for example when its spawned and a enemy walks into it works fine. but when i spawn it with someone already inside of it, it does nothing.
Event dispatchers? I'm not sure, since this is all handed by the own actor so far.
Er. Yeah. In BP they're called Event Dispatchers as Pattym said.
Yeah, same thing, different wording. 😄
Thank you for the clarification 🙂
Could still use some help here as I can´t figure it out...
Half of the reason for creating this blueprint was that I could simply assign one animation sequence track in the sequencer through this blueprint to all included skeletal meshes, instead of having to add every single one of them and add the sequence one by one...
OnBegin play, check if it's already overalapping with something.
When doing stats stuff, its usually best to do it in an actor component. That way you can use the same system for NPCs as well. (assuming you have any)
@dark drumThere is actually a boolean for this somewhere, sec.
That'd be useful if the system wasn't something designed specifically around the player's moveset. But thanks regardless, I will keep it in mind
With actor components it always bugs me because "Hey, just how many components should I actually have?"
@abstract locust@dark drum Check this out. If memory serves, turning this on will cause it to run overlaps early enough as you intend.
So a bit more about the current logic I'm working on
As many as you need. 😉
It's a stamina system for special actions. If it runs out, the player ends their current action and calls all relevant functions involved.
Have them modify the variable through an event instead of just changing it at will
then you can hook the checks in to that
That sounds close to the event dispatcher method. Which one works better?
instead of:
OtherPawn.HP -= Damage
just do
OtherPawn.TakeDamage(Damage)
I've not really used level streaming hence why I missed it. If it does what you say when not using level streaming, that's amazing lol.
Also currently I handle changes to the variable via a function.
ok so have that function call a dispatcher OnVariableChanged and you can also hook up other ones like OnHPReachedZero or whatever
or you can do it really dirty and just use BP OnRep since they're really just OnChanged
GAS makes life easy. Abilities just listen for attribute change, and if it goes too low, they end. And then you can't use them again until that attribute has enough value.
I'd like GAS if it wasn't for all the boilerplate and how opinionated it is about certain things.
Opinionated?
From my experiments with it it's not a great fit for things where you have a ton of things that want to have stats. Like vehicle parts.
My pawn doesn't have a hp, it is made up of 100+ actors with thier own hp etc
I mean you have to put the float somewhere. Can still put it on a component on each part actor.
Also I never could get an out of ammo click to play replicated lol
The way I see it, GAS is a universal template.
Like all of them, it's not actually universal.
There will always be some specific system that doesn't feel satisfied with it.
I wanted ammo to be a stat for reasons, and to be an ability cost, but since the ability didn't actually activate then playing an out of ammo click as a notify or whatever they're called didn't work
Yeah that sounds somewhat more lenient when doing it from scratch yourself...
IMO it works for 95% of cases. And if you're the 5% it doesn't work for, you're doing some innovative stuff.
A hacky workaround would be to code some connection between ammo as a stat and as a resource, but that sounds buggy just thinking from it.
yeah if I have to add all these extensions and hooks to other systems then what's the point
lyra ammo isnt an attribute though
I don't like Lyra ngl.
as a whole? maybe not, its more of a technology showcase
certain stuff? makes sense to do it those ways
I'm a fan of most of it. Specially the data handling and UI frameworks.
Is there a good example project for a small and tight game? I think that's a bit of the problem I have with Lyra, it feels like a starting point for a 10+ person project, not a 2 person project.
Like I'm glad it's super modular etc but how many files do I have to create to add another gun?
lmao
You can still take a lot of the systems they have and just ignore the game feature stuff.
CommonLoadingScreen and GameplayMessageSystem are perhaps the only thing I'll dive in to steal and then run back out
I backed away from the mesaage router lol
AsyncMixin for sure is a necessity.
Maybe a point of reference for commonui usage, but there's probably easier resources for that
Ok regarding the thing I asked before
I found a slightly more efficient method for making the stamina loss work
I make it a macro instead to return a different event based on if ran out or not.
This doubles for flow control. If the player sprints and runs out of energy, there's no need to call all the relevant functions that increase velocity or generate partciles, etc.
uhhhhhh
one funny thing about macro in bp is, i havent found a good usage for it..
Me neither tbh
Forloop i guess
there always seems to have a better way to handle it
It always seems redundant
You can have the spend function return a bool or just use the dispatchers
except for the stock ones yeah
For big bp loops slightly modified ones
I mean I'm not an excellent coder
But I feel there are certainly plenty of good uses
ForEachLoopWait
For example, imagine you want to use the Gameplay Tag switch
oh yeah i have made one macro, its ForEachLoop(ByRef)
However, your actor may have multiple of the same tag at once.
ForEachFrame
A macro lets you create a custom switch that assigns priority to each tag.
macros are just copy/paste with the good and bad that comes with that
Is that how categories supposed to work?
gameplay tags switch dont have branches though 🤔
Like look at this, it makes me cringe.
oh that
Gameplay tag switches are kinda broken when the actor has 2 of the switch tags at once.
That might be indicative of weird tag setups
So if your switch has OnFire and InAir as output, and your character happens to be both OnFire and InAir, it doesn't work.
if I'm switching on something I want it to be exclusive state
Can someone explain why Button "Save Game" on another category?
I mean. Those are same categories but save game not apearing in where I want
Hmmm, okay that's a good suggestion.
i think you dont want spaces in the category names
Like currently the character has 3 movement modes, jumping, flying, running.
I don't have any spaces
Each one has different tiers of movement.
It was just a logic example to explain what was wrong with my uses of the switch.
But yeah, the jump has 3 tiers for example. CanJump, Cancel Jump, and BufferJump. Each jump input does something among those three on press/release
Hi everyone, could somebody help me pls? I'm trying to make transition from idle to walk for my bot character, but when i'm trying to walk in the game, animation of walking just playing once and that's it, does somebody know's how to fix it?
JumpInput -> switch on MovementMode -> Running -> switch on CurrentJumpState -> do the 3 logic paths
assuming your logic is that you can even consider jumping only if running
although CanJump is a weird state
apparently blueprint category is fked 😅
that's implied by other state I'd guess
Well I also have to do an extra logic check to store whether or not the player pressed Jump already
Cmc already does that 😮
no, apperently sub-category is fucked for callineditor functions
Am more likely to make a custom k2 node for that. But I've never wanted to switch on gameplay tags personally. The closest I've ever been to that is making maps.
Hey all,
i am trying to do a simple score mechanisim.
Its a time based game and the score is to be displayed after the level is done
i have 3 levels ( main menu > game level > score menu )
in the score menu there is a widget with a text binding to display the variable
i think i am having a hard time taking a snapshot of the score at the end of the game and passing to the other level
help >_<
this is the binding score retrival
I just used gameplay tags as a way to pack player relevant booleans to make it cleaner to handle.
Good use, but what do you switch on them to do?
You either need to put it in a SaveGame, store it somewhere global like gameinstance(not a fan), or pass the score through the openlevel arguments.
What is the cleanest way to access other components inside a character blueprint? I have a weapon blueprint component and I would like to access niagara effects. The weapon and the niagara are both components of the player character.
So far I have been calling the fx from the player character however I would like to have this functionality inside functions of the weapon
A "weapon blueprint component" sounds concerning.
Do you perhaps mean a child actor component? Those can introduce some nasty bugs, so you may want to avoid the.
Is there a node that would target a specific component instead of a class?
I am not sure on what the correct terminogy is, I use a skeletalmeshcomponent as the weapon objects to run its code like shooting
that wouldnt make sense. if you already got the component's instance then there's no need to "get" it. you already got it!
if you need a specific component that is a child of some component for example. then you'll need to walk through the hierarchy yourself afaik
Cast?
In my game I want to have delivery spots placed on the level during level design stage. Each of those will have coordinates, and name variables. How should I store them if I want to randomise a delivery address when I collect a parcel for delivery? Data structure? Have some sort of a function that iterates through all of "delivery address" actors on the map and adds them to a data structure?
Nothing to worry about then. Just specifically an issue regarding child actor components 🙂
This is my current setup, the baseweapon is running code where I want to access the attached niagara components. If accessing the niagara things was done in the player class it was no issue, however I am not sure how to get code in one component to get information from another component.
Weird question, but is there a way to make a function check for which event it was called?
this is the code I copied from the player class. And the weapon does not know about them
I could do it the messy way and just do all the coordinated weapon effects from the player class, however I feel I should learn how to have components communicate
@rugged aurora Realistically I'm inclined to tell you to leave it in the character by using delegates.
@rugged aurora Component can have a delegate like so.
You click here to implement it
Then do things with your particles
Then just call this in the weapon component when you need the particles to run, make a different one for stop, etc. or whatever.
This all said. I'm with ACuppa on this. A component is a terrible place to have a full weapon. Usually you would make an entire actor out of your weapon which contains it's necessary sounds and particles, and meshes, etc.
That is something I was thinking of earlier, if the weapon was its own thing and attached effects would be components then I could access them without much easier
Gets even more fun with weapon modding.
So then I would use delegates to tell the player blueprint to call functions on the gun?
You mean if you make it an actor?
What would be the best actor type for a weapon if it is a 2d game? The gun would have to have transforms like rotation and moving. It would only exist as an object carried by the player, not as a dropped objects.
would a staticmeshactor suffice?
just actor
actor containing components
Yeah, just basic actor class
basic actors have transforms?
yes
the transform of an actor IS the transform of its root component
which is just a scene component that is considered to be where the actor is
Technically actors don't have transforms at all. 😄
yeah it gets goofy but for all intents and purposes
I heard some talk about a new actorless architecture?
Can I imagine events to be something similar to a "goto" in normal programming?
That said. For input. I wouldn't even touch the pawn. Just put it in the weapon itself and enable input on it when equipping, disable input when unequipping.
event is a function that can't return but can do other special stuff
so you can run input code on objects that are not the player?
like have automagic RPCs called on its behalf and also do latent actions (timlines etc)
I was able to get different firemodes to work and it was very complicated at first to "imagine" timers and how they work
I literally have no code in my player controller on two projects except some input context mapping handling.
I like to do it more like:
Pawn:
Input -> call DoThing on HeldItem
I never imagined imput code to be outside of the player class, I think it#s how I model my expectation around real life
oh when I mean player class I was talking about the class phjysically representing the player, which would be the pawn/character
yes that's where I like to put most inputs.
So technically I could just have the gun be a thing attached to the player that can have its own input code
I really wish there was a way to have AI directly effect inputs
Yes or you can just route inputs to HeldItem which can be a gun or whatever. up to you
that would be through delegates?
And then you use GAS and the weapon mesh is just a visual and technically your pawn is spawning bullets. 😂
so far I only used events a few times.
I hate that
If there's some way for a gun to fire when dropped, damnit, I want it to do the thing just as if it was held
It makes sense in a way though. To abstract it out to abilities. In reality a bullet is no different than a fireball.
I think gas was likely made for mobagame structures where players are walking spreadsheets full of magic spells
modeling the gun as its own thing with its internal mechanisms seems more appealing
Fireball with mana that remains in the item representing the ability to spawn fireballs when droppd
idk, gun doing the shooting feels best to me
one cool thing I really like in unreal blueprint is the timeline
Bullet with the bullet inside representing the chunk of metal and gunpowder
Now we're thinking with Godot
I was able to animate weapon recoil by attaching the axis used to a timeline graph. Before that I spent a few hours trying to do it with normal vector math
Bullet scene within Gun scene within Character scene within World scene
I'd pay $10k for that in Unreal
Appealing, and wieldy, plus optimized are two different things in game design usually. 😂
my tendency is to stick with code concepts I already know (until I reach the limits of what it can do).
I'd pay giga bucks for the ability to just add an actor to an actor without child actor components, just as a first class thing
I want door to be able to exist on its own, and I want House to be able to imply a Door and be set up within the actor BP editor
That's the one thing I want for Unreal
Grouped actors
In an unlimited setup, ideally
Not because i need it but why not
So a house can have a door ,
And the door can have a handle and a lock
Or smth
Yeah I've looked at that but it doesn't quite fit the bill. I wonder how hard it would be to actually do.
Is a prefab an actor?
Collection of actors basically.
Prefab in a prefab?
It can do that but I'm talking about more like ChildActorComponent without the extra component and jank
it just contains an actor
at runtime it's the same as spawning 2 actors with one having the 2nd attached to it and with a reference to it
Id like a prefab type blueprint thing that allows you to spawn actors in construction script type thing.
You can do that too. 😄
Pretty sure prefabricator does that. If memory serves it was just a prefabricator actor with the other actors attached to it.
I'm just lucky my project has a modular vehicle builder as a core mechanic, I can just use it to make my prebuilt designs.
that sounds like a lot of fun
Have you played pacific drive?
nope but I know about it
It has a car modification system where you swap out doors, hood, tires, attach extra batteries
and the car can have "quirks" which are defects that you have to diagnose
so I'm trying to figure out how the enhanced input system works? I'm looking at the thirdpersonplayer blueprint but I dont get how the game can tell what direction each button sould be liek W is forward and such
You believe you can bind to the click and hoover events. You can do this from an actor component. You could get owner and then get the capsule component.
Look at the input context mapping for the inputs. It controls how the numbers it outputs are manipulated.
this here?
or am I looking at the wrong place? this is from the setting behavior
They would all fire, yes.
That's it yeah.
do I have to do it for every key or mapped input?
Depends on what behavior you want.
I use this for a topdown camera to move relative to the camera facing.
I'm essentially trying have my player float in the air like this, W floats up, S down, and A being left and B right https://youtu.be/cWiT-VuPgMk?si=go0383s7cC2rMg1Y
Sin & Punishment: Star Successor gameplay for the Nintendo Wii.
Played on the original console and recorded with Elgato Game Capture HD.
► Wii playlists:
All my Nintendo Wii videos
https://www.youtube.com/playlist?list=PLljauD_hVEDKLPInzEAxvJvyDc4ZUe15y
► Facebook: https://www.facebook.com/10minGameplay
#SinAndPunishmentStarSuccessor #wii #ga...
would it be this for all buttons then?
Maybe. To convert my controls's X to a Z, it would need that, yeah.
should I do Axis3D?
Any have any other ideas? :0
Either or. Largely the same in the end. Judging that game trailer you're going to be projecting the input onto a plane and normalizing it anyhow probably.
yeah I'm trying to figure out how I can do that with the camera and player, I have no clue
I imagine that a game like that would move your camera and character along a spline. I'd imagine that you'd be saving some sort of 2D offset to keep the character at along the spline, and your input can just move that offset.
so the camera is attached to the player but is programmed in a way where it will keep the player infront of it while not moving
Unsure. Can do the camera however you like. But I'd assume it would be placed along the spline at a fixed location somewhat behind the character. I also just made a similar comment in Multiplayer too. 😄 Instead of relying entirely on the camera, you can use a camera manager too. Which could get your level's spline and set the camera at the correct distance behind the character along the spline. Then no need to manage a camera component directly.
you mean like make a camera objecr and have it be trapped in a plane infront of it?
Not exactly. PlayerController has another actor it manages that is called a CameraManager. It's what actually manages the view you end up with. It's what makes interpolating between viewtargets possible, etc.
In the middle here of the PlayerController's details
You override this function here.
This lets you return a FOV, Location and Rotation. If you return true, this will be where your camera ends up.
how did you get the player camera manager componet just created to be selectable?
Then you can do something similar to this. And now you have a camera that follows along your spline just behind the character.
How do you mean?
all I can find for components is Camera shake source
you can use getCameraManager if you're looking for the current one
I think, let me check
getPlayerCameraManager*
You can.
Can also pull it off of the PlayerController directly too.
You can do some really neat gameplay camera work with it though. Even remove cameras from your pawns, which saves you a component transform update.
Two if you're using a camera boom.
Trying to test my game in standalone, but it's compiling all the shaders again. Is this going to happen just once or do I need to do some form of PSO caching or something?
Another little thing that unreal could've shown of in ome of their templates
Some simple yet understandable camera calcs and usage
For sure. But they'll have to stop using ConstructionHelpers first.
So many try to do this super specific things hacking away with spring arms and 40 cameras
Oh man. I remember seeing this one video example. Dude had like three TPS cameras, half a dozen cameras on tracks for cinematics or something, and then FPS cameras, more cameras on the guns.
FFS dude, you never released on an XB1 if you're that careless with scene components. 😂
I'm pretty stuck on this issue (setting an array positions of collision boxes) why the blueprint works in construction script and shows in the blueprint-viewport. But it doesn't show in the gameplay viewport in runtime or not. Is there something I'm missing?
Prly should've googled it first 😅
I'm so used to compiling shaders at this point I don't notice it.
did you speed it up somehow?
what do I need to select to overide?
Yeah, going to get coffee.
In your PlayerController class.
Faster hardware
This here
what about cheat manager?
I'm assuming the actor for (get actor of class) is the player?
also do I need to dowload a package for the get distance?
The actor I was getting was just an actor with a spline in it.
Cheat manager is optional. Just a useful class for using cheats to test stuff.
hello, I;m trying to figure out how I can make my player character to move but somehow I'm not able to do so, anything wrong here?
first thing i would make sure the cast is succeeding in the begin play
guys
but you cut off the rest of begin play which does make a difference
how do i make it so that only pressing shift and w makes you sprint
or make stamina only go out while moving
you can check velocity length on tick to see if your moving
i have no clue what that means
looks like your missing the context as there should be something after isvalid that the subsystem is plugged into
from third person template
you can see your missing the context
do you have a key setup for sprint ?
or you have not done sprint yet ?
enhanced input ?
yea
so you want the other key to do the same thing ?
hi, i've been trying to spawn additional pawns to the level using Spawn Actor from Class, but the ones spawned have glitchy physics. an identical pawn when used with the gamemode works perfectly fine. i'm spawning them in the gamemode's event graph. any hints about what i could try? i'm spawning them with the transforms of playerstarts i have placed in the level
the issue is that my stamina goes down even if im just standing still while pressing sprint
well based on your code there's probably a better way to do this, but you can get the character movement component, get velocity, and get length
this length will tell you how fast your moving
so just > somenumber with a branch will tell you if your moving
k
Hello there, is there a way to actually have some 'minimum' turn radius on a character so it doesn't turn in place and wind up forward a bit while turning ? Been managing so far to go forward and have a Rinterep, but i'm totaly unable to make it for A and D 😮
still not working for some reason
is the cast succeeding ?
put a print string on success and fail, see which one it shows
Didn't see the text appear
well ok put on one the failed on the cast
see if it shows up, but a print string will do
isnt that what I did?
no you put it on the isvalid, the cast says "cast to"
stull no text
so put it on succeed and you should see some text ?
so comming out of the top line of the cast, put a print string and it should show up
if that works then the cast is working, and it is valid
if thats not showing up, the event may not even be firing
basically first thing i would check is your cast is working, then i would check that the other event when you press a key is firing
yeah I put it on succeed and it worked
ok so now put one at the beginning of the other event see if that is firing off
at event begin play?
the one where your trying to move
when you press the keys to move
see if that is firing
with a print string at the beginning, it should show up when youu press the key
where is that?
the green things going into your add movement input
see if they are changing like they should be
you can format text for a good view of it
just plug the two in and display there values
just to make sure they are working properly
they should be moving when you use that input
they shouldn't be 0 i think
so if they have some values then thats good
by the looks of it so far the begin play part is working
because your firing of the event
so the context should be added
how do I format it?
y: {y}, z: {z}
when you put a thing inside {} it becomes a variable
you can plug something in and it puts in that spot of the text
hey guys does anyone buleprint for drivable boat ??
wait I cant do that in blueprints?
can't do what ? format text allows you to do what i'm saying
no I mean do I have to open a script? U'm right clciking action value but dont see format
you should see format text
you put that in the format
the node is actually called "format text"
good node to know about
it helps in a lot of situations if you want to build a text output from values
when you put in the format and hit enter
it will create the pins
then you just connect you data to the pins
now plug result into the print
and see if you get values when you press the key or whatever triggers it
Now here's the problem, no matter what key I press it's all like this
also have you possessed the character or set it as default in the world settings ?
so theres something wrong there i would look at you input setup
but even then i would assume because y is 1 that it would move on the y
so you may have a couple issues
I believe I have all the keys be world scale
start with a simple setup
or get that part to work correctly
then you can check why it's not actually moving
which tbh idk, but those numbers should be moving accordingly first
Is there anyone that can help me with this widget issue im having, i feel like im over complicating something
https://forums.unrealengine.com/t/getting-a-widget-slider-value-into-actor-components-for-both-server-and-clients/1793162
I have a slider on the lobby screen where the host of the server can set the damage multiplier for PVP. Right now this writes to game instance where the value is pulled in by the Base Characters weapon component. However this only works for the server user as game instances dont replicate to clients. So if the server sets the multiplier to...
well it seems to be only using the last add movement input
but that parts actually moving ?
ya because your y is 1
idk much about the inputs, but you should be setup to run if it's actually moving
you just need those values to come out correctly
because z is 0, the scale is zero so it isn't doing anything
and I have no clue how, I'm just copying what thridperson player did
As usual, I'm inclined to say not to ever store game state on the game instance. For any reason, even level transitions.
The GameState itself should probably house something as global as a damage multiplier.
You should pass that in to the game via options. Cause then this will work either with listenservers or dedicated servers, and it can then be set on the GameState at the start of play by parsing the GameMode's options string. And then replicate to clients as a property holding state.
yea they work but only for the server, so if its set to 2.5 then the server user can do 2.5x damage to other players, but the value doesnt replicate to clients since its pushed and loaded from the game instance
ill try getting it into gamestate later, but im pretty frusturated at the moment, i will literally pay someone to explain to me what im doing wrong at this point
am I using the wrong nodes to copy the Sin and Punishment movement?
your inputs are f'd, if your moving on that one that pushing a number everything in the beginplay and event is close to correct, (not like the template) but should work if those numbers are comming out correctly
@zinc vessel How do you transition maps? I'm assuming you use a ServerTravel call somewhere?
yea server command with the map string added, so when i tried with gamemode it was just reinitialized to the default value
can I ask for suggestion then on what it should look like? since I cant do what the thrid paeron controller did?
you just want the regular wasd ?
did you look at the template because it looks different than what you have
that was my goal, also I had to change to y and z since its up down left right, and the player wont be going forward or back
Just pass it through the URL
"MyMapName?Listen?GlobalDamageMultiplier=3.5?"
so i create a variable in Game mode called GlobalDamageMultiplier and then I create a call in my weapons components that reads that variable
Im sorry im like 2 weeks into this
you really do that with two ?
thats odd
a normal url doesn't have two ?
but you don't have to change to y and z, you can have a 2d with x, y, and just add the input to be up/down left/right
thats just the scale not the actualy y, z
just a scale number based on what you press
How can I modify Physics Asset colliders during gameplay?
I would need to have a skeletal mesh with deforming colliders
this is the move from the template
ok its back to 2D
this will give you the numbers you want
and then you just plug that into the right movement type
you can also use the up vector, right vector for your movements
so the scale your getting just a number representing the press
you then plug those into the proper add move
but use a format text and print out the values once you have it set to 2d
hey so i jsut want to make a media player and put in it a video but when i try i jsut get this message, i tried chaging DirectX12 to DirectX11 and the plugin but nothing will work, any help?
im using a normal mp4 file
when I go left, y and X are negative, but right are positive but both are stil y:0/-0 and x:1/-1
im still a little confused on what goes where
you want the x to be 1,-1 when you press a,d
and y 1, -1 when you press w,s
you got your x and y flipped, but you should see 1, -1
when pressing the keys
is this moving at all ?
0 -0 basically the same thing
but you want those ones
to push into the scale value
yeah I still dont get why its not moving, maybe I accidentlayy messed with it setting to much? I had to turn off a ton of options figuring out how to disable gravity
maybe just move him in the world
up down left right
or switch to flying might help
already there
I'm just gonna add a camera to the scene and make it the main camera
like vector up and such
are you rotating ?
the camera around ?
or is it fixed ?
fixed in place, camera doesnt move period
0.0 now
he's not moving any directions ?
yeah my character is just staying still it seems
no clue why
@maiden wadi Im passing it into the game mode correctly now as a server command and I followed your blueprint but it still doesnt replicate to clients
Would need to see what you're doing to comment.
I'm sorry for screwing my character up
lol idgaf but idk why it's not even moving left/right
atleast you know whats working
Widget - Getting variable and passing to game mode from
GameMode - Setting the Global multiplier off the string passed
Weapons Component - setting the multiplier to the amount in game mode
is there a simpler way to get my character to float but not using enhace Input?
The replicated property needs to go in the GameState, not GameMode. GameMode doesn't replicate.
you could just move the world location but you wouldn't get things like velocity and stuff
there must be a way to fly around up/down
Game mode only exist in server machine.
Hello, I am new to ue5 and I am stuck at getting some basics at PlayerController BP.
I tried to replicate third person WASD moving from the template inside a PlayerController instead of doing it in PlayerCharacter BP, due to multiplayer and multi pawn control.
The forward, backward, left and right movement works fine, but the pawn does not rotate accordingly, despite having "Get Player Pawn" or "Get Player Character" connected to target. Can someone help me on that?
this is making me feel like I'm the problem
i'm gonna try it out see if i can get it to work
thank you so much
Ok, so, still struggling with setting up and controlling animation for multiple skeletal meshes in sequencer using a blueprint...
Came across an epic page that suggested using livelink component to get an easy editor tick event.
Amazingly, using that I got my idea working (controlling animation sequence in sequencer using play position for example) and got live feedback in sequencer.
But I was wondering wether it was maybe not super effective to do it, even if its just for rendering out cinematics using MRQ, so I added a branch to only proceed to the animation function when its set to true...but after addding that, the compiling takes forever (hasn´t finished yet):
Any ideas why or wether I should even bother or should maybe consider something else?
Like creating my own editor tick blueprint interface?
Could you dm me the results? I feel like the q and a is taking too much room in the help channel here
Got a question, how "expensive" is the "GetComponentByClass" function and is it comparable in memory cost to something like casting?
Both will have the same memory cost. They are both linkers. You either return a component of a type from the GetComponent call, or you cast to it which returns the same type through the cast node.
Also technically an invalid question unless this is a rarely used runtime spawned class. As it'll probably exist on an actor CDO somewhere anyhow. So the memory cost is already paid.
@maiden wadi Holy shit it works I love you so much right now
it seems it works fine for x,y but i'm having an issue with z
Passing options is a nice way to handle dynamic properties like that. Cause even if you switch to dedicated, you can still pass it through the startup command line. 😄 One other way is to set it as a config property on like a data asset. As you can edit that at runtime, as long as it isn't garbage collected, the edit will remain until game restart and then read from the config again.
Going up and down?
ya left right forward back works fine but trying to get him to move up on the z just isn't working out
Hm, ok, seems like it compiled ok. Force closed Unreal and restarted it and now the switch works fine.
But if I have to now foce close everytime after compilation, I´m gonna go nuts...
Yeah thats why I had to deviate from the template and do my own thing
Hey
I am creating a procedurally generated map. I have a map where I have Walls actor placed. I load this map using level streaming and this Walls actor has BeginPlay where it creates wall meshes at points that are inside this Walls actor BP. It works fine in editor, but when I create android build, and launch it, the walls are placed at zero instead of the coordinates where I placed them in my map. Any ideas how to approach this issue?
i figured it out
set this to flying
it's in the character movement component
This was what I was going for: Have actors be empty and be used as containers for actor components (which would hold said actor's functionality), and allow actor's internal components to communicate with one another using event dispatchers, BUT allow actors to communicate with OTHER actors only through their components, IE, one actor's "weapon component" would check to see if the (outside) actor it is colliding with has a "health component" and then that weapon component would communicate with the (outside) actor's health component via an "IDamageable" interface. However, I envisioned a lot of using "GetComponentByClass" when having actor's components communicate with other outside actors (and their components). Just wanted to get some outside opinions on how good/bad such an architecture might be.
what does the blueprint look like?
i was just testing it out
but i got z to work with that setting
even setting it to flying didn't work
i had to set the default land movement mode
input axis?
I normally do composition based as well. I use get component calls a lot.
In this case, don't worry so much about memory cost. You deal with memory costs by softreffing the things that won't always be needed.
A case is like a fighting game. You make data assets for each fighting character, but you softref their portraits, and actual actor class that has the skeletal meshes, particles, and sounds and whatnot.
When you start a match you simply load the two/four/six whatever fighters out of 12-50.
Similarly is like a dungeon game where you can have hundreds of monster types. You softref them all and only load their class when you intend to spawn them for the dungeon.
This is how you'll manage the majority of your memory costs. That and telling artists to fuck off with 8k textures on a character that takes up 128 pixels on screen.
i didn't write it to what you would do, it's just a test
you would be using the axis value comming out of the event
and you can use up vector
i just was testing to move z so i hardcoded it to 500 and used the axis mapping
I've been developing an art style that uses no textures for anything beyond terrain / architecture and it's really nice seeing the projects stay tiny
small mesh + nanite is a thing = just vertex paint masks and use solid color material layers
Haha, I imagine. I've literally dealt with people telling me that they need this as a 4k texture on a character that is smaller than my thumb on screen. You can't even see the details it provides until you zoom in to the face. And even then it looks identical at 256x256
Is it necessary to do a "set" operation after promoting something to variable to the variable works?
insanely fast to iterate, you just say what X material looks like once, and make a material instance per thing, and you're done.
ML_Wood looks like this
MI_Weapon_Civilian uses ML_Wood where its vertex color red channel is near 0.1
Slap MI_Weapon_Civilian on ANY weapon, and it looks consistent.
Just paint the stocks 0.1 in red and you're done
I would also like to thank you guys for the advice earlier on setting the gun as its own actor. I learned how interfaces work and its like magic
Well the game is gonna be like a bullet hell, so velocity isn't really needed thing
it's nice to move fluidly like that tho
it can be not so smooth if you just move the location
just set that setting and you'll be able to move up as well as in the x y
as well as keeping gravity disabled
and the scale set to 0.0
Well, that's good to know I can do some get component calls without having too big a knock to performance. But would you personally implement the "interface communication" within the components themselves (and possibly only between the components), or would you keep any interface communcation between actors only within the main parent actor and have the parent actor then pass any (incoming) interface event calls to its components to then do their thing? (say within the context of the weapon/health component example I gave)
Might have found the issue...seems like it doesn´t like compiling it while a sequencer referencing the blueprint is open...
I would only do that if interface communication with the component makes sense
Can someone help me on this one?
A component can be thought of AS an interface with state if you want
see how it's smooth ?
How do you envision your multi pawn control working?
Do you control multiple pawns at once?
or just hot swap between them
no just respawning, but I still want all controls in my playercontroller
Oh that's very smooth, does it halt quickly?
all of youtube guides are either using player character bp as controls
That's kind of going against what the engine gives you but fine, just forward any inputs to MyControlledPawn
no it's smooth and if you add the x, or y it'll be smooth together
What is the base type of your pawns?
it's only halting because i'm colliding with the ground
isn't playercontroller designed this way? where most basic inputs should be?
Nah, I only put inputs that make sense without a pawn there
If it's GTA, you'd put your pause menu input there
but not throttle or jump
I mean in the air when not moving
I've read that it is more convenient for multiplayer and less buggy when implementing it inside playercontroller. otherwise I would have to create for every single pawn or character? maybe i am wrong at this one?
What I was hoping to do was have components be the only "real things" on my actors, and the actors would likely only have structs (or maybe data tables) containing fixed values (things like character health, weapon damage, speed, etc.) that their components would reference. I would then have it set up that actors would communicate with other actors ONLY through their components (and through the combined use of interfaces and "GetComponentByClass" calls).
That's fine, but why is health and speed not on the StatsComponent?
does it slowly move when you stop moving up, like how in space once your pushed in a direction you cant stop
It could be. Should I have a seperate stats/attributes component for actors?
I still use actors for the glue. A good showcase of it is inventory and crafting components. The amount of ways you can use the components together is staggering. You can have an actor that takes in one type, crafts one thing when it has the stuff, and outputs it as a drop when done. I don't personally want to write all of that logic into my inventory or crafting componets. I want the inventory to transfer and store items and I want the crafting component to use items to craft things.
By default my crafting components will deposit into the first inventory it finds.
But on say the actor above, I can bind a delegate and handle it differently to spawn the drop actors when completed instead of depositing it back into the inventory.
Similarly to an ability component. Normally you do stuff via inputs as a player with abilities. But consider a trap actor that needs to use the ability it has been granted. It is easier to make a B_TrapTriggerActor that just has a triggerbox and handles the ability granting and using logic in a small little tidy blueprint.
Actors are meant to house and use components, so making actors for purposes that use their components is perfectly good design.
no it's not constant, it's just the regular movement based on velocity, if you want to keep moving in a direction thats different
You can think of it like 3 types of approaches. Take Damage for instance.
You could have the BaseActor type have a TakeDamage event, that you can override for child classes. Hit thing, cast to BaseActor, call TakeDamage.
You could have TakeDamage be an interface call, that the reciever implements their response to. Hit thing, does implement interface?, call TakeDamage.
You could have TakeDamage be a plain old event or function on HealthComponent. Hit thing, get component by class HealthComponent, call TakeDamage on the HealthComponent.
you may be able to mess with friction and air control
Still very happy with that mimic component. 😄 That was a weird experience to learn how to gather blueprint generated components.
The component approach is the only one where the actor literally has to do nothing. Damage is just something that effects HealthComponents directly, but the actor can respond. That would be an OnDamageTaken dispatcher or something. I prefer this route, just slap a HealthComponent on ANYTHING and it now has health and is damageable.
ok perfect, because I want to make it so the player moves only while the buttons are pressd
ok well it slows down normally but you can mess with the settings
in the character movement component
to get it right, just get it working first
Hi guys, I got one small big issue for the past 4 days, uhhh what refference, I mean when I put it the message interface on the player and on overlap the other actor works but I dont need it in that place, I have no idea what refference I should get in this case (for each level, the border limits are updated
I am trying to return an ENUM in a bind function of UI, however it wont allow it. why?
did you do input axis for left right?
What thing wants to know about LIMITS?
why cant it just convert like other variables?
the border
so tell the border object
how it knows about that border object is up to you
why is this an interface? Do a lot of different things need to know about you hitting the border limits?
I tried with casts also, getting the ref is my problem
Now, I was still going to use inheritance for my classes, like having a BASE_Character class that my CHAR_PlayerDefault would inherit from. But the only things that would be inherited would just be component composition from their parent. Now that I think about it I could just have a stats component as well, likely, and leave the actors totally blank (at least in most cases). For example I think I would still need some connection/reference to an actor's collision in the case of giving one of my characters a sword, since their weapon component would still need someway of getting back at least what the sword static mesh was hitting.
The sword just checks if HitThing has a StatsComponent, if it does, it calls TakeDamage on that StatsComponent
I greatly appreciate the answers there, Authaer. Thanks, man.
ya i used y and i can fly around
If you're talking about the hit detection to begin with, WeaponComponent can have a property HitCollider which you can set in the actor.
I do that for my TireModelComponent, it has a Collider reference which tells it what thing to listen for event hit on, and what thing to apply forces to.
Can components have box colliders? I thought that was only on actors.
a component can have a reference to whatever it wants
A Component can BE a box collider.