#blueprint
402296 messages Β· Page 527 of 403
sure, thank you
@mortal cradle
you need to save the return value of the interp so it can be used as the starting point (Current) for the next iteration of FInterp
man I was so close, I've tried something similar but without float variable on current interp
thank you a lot, will test it out
nice
also remember that you are going to have to set that float somewhere also
to make it not start at 0, or if you can just change its default value idk what your gonna have todo for your specific case
and also remember this will work perfectly find on an axis event also
I think I will be able to figure it out now, thanks again, it's been a while since I wanted to use interp with floats but without success and always moved to different things
gl then
guys need a bit guidance, how to do two key presses like shift + space to do action
thx man, will do with this first then will se if i have any problems
@trim matrix thx man had to put my Shift action on Flipflop, works like charm now π
np
I'm not even sure where to begin getting these two actors to see eachother. If one is infront of the other I want them to deal damage to eachother. What would be the best way to go about getting them to detect eachother do you think?
@quasi frost add some aiperception to them and split them into teams
Announce Post: https://forums.unrealengine.com/showthread.php?109449
In this Live Training Stream, Ian and Alexander talk about what we'll need to create MOBA Minion AI. In part one: we'll start with an overview of observed behaviors, then create a new project, and finally mo...
Ian Shadden is a legend
While would definitely need some variable to determine which team they are on, Ai perception would definitely be a bit overkill. If this is a turn based grid game then you should have way to input a Grid Space Coordinate and return info about that grid space. If you are able todo that, you can simply translate the grid coordinate to get the space in front of the the unit.
Im assuming your game is turn based and not live action based on the end turn button.
might as well just do a line trace forward one square
Hi, when using the console do you need to activate a setting before the commands you type shown up? if i enter a command to show the collisions i do not see the black outliner also not when checking the capsule in a network test example: p.netshowCorrections 1 gives nothing
That would be a good short term solution yes, if you donβt have the proper infrastructure setup for a grid based play field yet.
@quasi frost
Yes the grid field fully works, it supports spawning, movement and even combat against the player, I am trying to implement combat against other summoned units now. I have a grid array set up for spawned friendlys and enemys, I am just not sure how to say "Check the tile infront of you and if there is an enemy deal damage to it"
Do you have a function that can take a grid cord and return the grid peice?
Or are you even using grid cordinate at all?
I would assume your units all have a grid cordinate right?
They have a grid index yes
Oh an index I assume for your array
correct
Hmm well itβs really important for grid games to use an cordinate instead of just storing an index
Every grid coordinate stores an unique index so it works more or less the same
Hm well it would work that way, itβs would just be slower.
Oh wait no it doesnβt
because you only have an index you don't know what's around you, if you convert the index to a coord you can then check all sides or just in front depending on what you need
Yep
summons can only move and attack forward so it shouldn't matter what is around them.
ok that makes it a bit easier
You have to think about the future of the game though.
Itβs very important for any grid based anything to have two functions
Right now I am thinking about doing it here in the movement event. If an actor is on the tile it is trying to move to "check to see who is on that tile" just not sure how to translate that
- Grid cord to Grid Space Info
And
-Grid space info to Grid Cord
If you skip out on making those two functions I promise you it will create a world of hurt in the long run
βοΈ
zars one hacky way i have for your tile problem is the following
let me draw it up on paint
@trim matrix Is there an easy way to set up this grid coord or is this an all day thing?
@crimson swan That is actually hilariously simple, then I check colliding actors and deal damage to it? lol
The only real challenge is to make the function that takes in two numbers. X and Y. And convert that into a index in your array. It requires some thinking but itβs not super hard.
yup
name each cylinder a direction and problem solved
for your grid coord system
one hacky/proper way (idk which it is tbh) is to create a mesh
say 1x1
and replicate it with distance 1 in between in an array
like a tile, and on beginplay of your map just dupe it all over the field you need it to be in and voila, grid system you can refer to to get positions and x,y coords
Yep
for clarity let me refer you to my amazing paint skills, brb
I also tried using timeline with lerp and it snaps to lerp A value instead of going through timeline length first (I guess it just needs ticking and there is no other way)
@mortal cradle https://youtu.be/KBE7ZbWBMa8
In this tutorial I'm gonna show you how you can do gradually increase and decrease sprinting with interpolating.
Thank you for watching
Like and Subscribe
I think the cylinders thing will work perfectly on this type of simple grid. Gonna try it real quick.
lol
It should would work perfectly. There are a million incredibly simple ways that will work just fine for that specific task.
tetris inventory? Those are neato
Oh oof those arnt super simple
Nice
@quasi frost why don't you attach a collider in your character and when the collider begin overlap is player then attack
I want to create the main part of my multiplayer game (killer vs survivors), I can't code that in the level blueprint because I will have multiple maps, I can't code that in an actor BP because it will be linked only to that object, so in wich BP (or something else) should code in please ?
The coding I need to do is to set up 2 teams, set missions for the survivors (object to pick, mini-games, killing script for killers,...)
What is the correct way to get variables from this actor? I can't grab the health vairable of the colliding actor doing this
What's is the difference between using a Interface, and calling a Custom Event on a actor? They are both 1 to 1, they both require a reference, and they seem the do the same work.
Is there a benefit to use one over the other?
@flat raft I have multiple enemy AI and an interface for attacking I can use the same AI controller and Behaviour tree for all of them and then in the Attack function it can be different for every AI
@flat raft it's more that you have a defined set of functionality applied, yes you could duplicate the custom event and it would work in a similar way but when you edit the event you have to edit it everywhere, whereas the interface is a single change across all of my AI enemies for example
Using a custom event so I can call it at any time
it's a design pattern
Ahh..gotcha
@quasi frost I'm talking more about the GetOverlappingActor
that makes sense. My Events are defined in a parent class, so when I change 1, they all change, but I suppose if it were in the child, then I'd have to change each one.
Thanks! @dense peak
@main lake i think you can make most of that in playercontroller
teams would be via tags
and missions and everything else can definitely be in playercontroller or on the character itself
I'm still not quite sure how to get variables from the overlapping actor event. Even using a class filter I can't seem to set or get variables from it
@quasi frost use casting
Can you explain? I am looking to overlap with a parent of the same actor. So two cards which have the same parent but may or may not be different children overlap, I can't cast to self. I am just sort of confused on how to do that.
zarz have you tried foreach?
@quasi frost what ya trying to do?
@flat raft I am trying to get the collided actor get the health so I can subtract from it to do damage to it.
yeah so overlappingactors->foreachloop
How many actors are colliding ?
then cast the array element as your parent class
2
You can use a OnOverlapEvent
used whatever i had handy but that's the general idea unless i'm understanding wrong
I mean that would work but I have tons of cards so I would have to cast like 100 times like cast to 1 cast fail cast to 2 and so on. I am sure there has to be a better way
No. It would always be 1 at a time. But it could be any 1 of many
The event is better, and more efficient
you can always sphereoverlapactor
all you need is a reference, which the event gives you.
wait no i think i just got what you meant by cast to one then to the other
a for loop is definitely what's going to handle that anyways
Yeah they would have the same parent but be different children. Just not sure how to get the right one and then get variable from it
i showed you how though
if the parent has the health or event that would need to be called then the children all have it too
I can't grab variables from this :/
cast it to the parent and you can access that event
arrayelement -> cast to whatever your character parent is
Hmm I will need to move this event somewhere else to do that though. This is being done in the parent. Maybe it is better to do this in the controller or game mode or something?
yes
Is there a way to avoid doing this?
Wow that's a lot of casts!
Do you have a Good Guy class, and a Bad Guy class?
Parent class, I mean
hmmm no I don't maybe it would easier to clone the master card class and make one enemy?
How are you determining which cards are good, and which are bad?
Bool
Hmmm..
This kinda thing usually uses a parent child hierarchy.
Like a MasterCard, from which you make a Enemy, and a Friend class.
From your enemy, you have your bad guys class. From friend, your have a good guys class.
hmm well this isn't working at all lol.
This way you group 'Like Functionality' and don't have to have weird things
But since you have it like this... just cast once to the parent.
This isn't printing string. So these casts aren't working somewhere
okay
This isn't working
it's not returning any elements?
no return
was doing some final adjustments on my code lol, decided to pop by for a visit before bed. Weird
you sure your front colider is set up properly
?
I mean it's a collider lol. I can double check
i closed UE so can't remember what you can call
but try something other than overlapping actors
getcollisionsphere or something
This is printing
ok well you can use that
give some inputs to your deal damage to enemy card and do your magic in there
or just do it all in the overlap
anyways i gotta go for real. I'll check up later
thanks cya
Question: Anyone know why when I shoot twice and the first projectile is not destroyed yet, the first projectile stays alive indefinately? how can I change that?
the target of destroy is being set immediately which means subsequent calls to the spawn function override the target while it's waiting for the delay.
maybe put the destroy inside the projectile itself
on begin paly - wait - die
Can someone explain to me in simple words what casting is please ?
maybe put the destroy inside the projectile itself
@dense peak The problem with it is that Its a multiplayer game and I would not know how to set different delays in the projectile. Like this I can set the delay on the player and if he has a powerup I can extend the delay right?
Can someone explain to me in simple words what casting is please ?
@main lake well from what I understand, if you want ANY interaction between two blueprints, you need to cast from one to the other.
hey guys, did anyone else had issues with spring arm if you set inherit yaw from blueprint? it goes crazy on movement
@stray rain yeah so if inside your projectile you have a variable called duration, you can pull a node off return value of spawn projectile and do set duration
@trim matrix how does that look?
@stray rain yeah so if inside your projectile you have a variable called duration, you can pull a node off return value of spawn projectile and do set duration
@dense peak thanks, I will reconsider putting the code in the projectile instead of the player... I thought that's the correct way, but you are right imma rewrite ^^
@stray rain you're not wrong at all, it's just timing. You could add a function inside the player that you pass the newly created projectile, adds a timer and destroys it
you could create a generic function destoryAfterDuration have two inputs an actor and a duration
but how would I tell it what projectile it should destroy?
But I will go with "inside of projectile" like that I realised I can also put the damage number and various other things inside of it and expose those variables
call the function after the spawn node and pass it the return value
ah thats it? mmh I still need some time to make more mistakes and come up with solutions ^^
ha
@dense peak like this I guess
Bool
@quasi frost Macros are your friend. Not?
something like that @stray rain, just trying to replicate but can't add a delay node for god knows what reason
Yo, could someone help me out? I've recently been trying to emulate a trick system seen in games like Energy Hook, Spider-Man PS4 and Tony Hawk but I can't seem to get the rotations smoothed out - Essentially, on a button hold and with a subsequent movement input, I want my player's mesh to rotate based on that axis input! I've set something up which is sorta what I want, but very rudimentary and the rotations are all off! I'll pop in a GIF of what I've been working on, and what I'm trying to achieve! Any help would be greatly appreciated, cheers!
oh @dense peak was that for the grid thing?
@trim matrix yeah, it peaked my interest
ah i see.
Well the real one to be worried about is the opposite of what you did
Inputing a cord and then gettting an index in the array
I'll give it a go
yea try that one
something like that @stray rain, just trying to replicate but can't add a delay node for god knows what reason
@dense peak works perfect btw, thanks for pointing me in the right direction π
Other way would be as I first suggested, let the projectile take care of it's own lifespan
I think actors have their own lifespan function and a "set lifespan" node
Don't need to roll your own
Now that I did not know, that's actually awesome, thanks @tight schooner
sorry @stray rain ignore everything I told you, just add a Set Lifespan node after the spawn projectile and you're done
everyday is a school day
@main lake A cast is a check that determines if a provided object reference is of a certain class. If the check succeeds, then it transforms the object reference into a reference of that class. And once you do that, you can call functions and manipulate components and variables that are specific to that class on the referenced object.
Casting is one of a few methods of "blueprint communication", an umbrella term that includes BP Interfaces and event dispatchers.
@velvet viper if you can't get spiderman to forward-summersault then maybe it's a gimbal lock issue, in which case you can try quaternion rotations which is a type of 4D rotator that avoids gimbal locking.
That aside, to me it just looks like you're rotating on Z (yaw) when you want to be rotating on pitch (Y?)... It's hard to tell what's going on under the hood based on your video.
ye, i did think about quaternion rotations, never messed around with them tho and don't know where to start with regards to them
(either way I've never tackled these issues myself so I can't suggest much beyond that)
Yeah I never tried quaternions either.
everyday is a school day
@dense peak indeed π
Ye, in the vid it's more of an issue in regards to smoothly rotating the player back to their original rotation, can't seem to rinterp it in game and it looks really jarring
Why is this getting called twice when there is only one player???
and one locking volume
@thin apex Ik on begin overlap can be strange sometimes and can call multiple times. A simple fix is to use a Do Once
You can reset it on end overlap if thats what you need
it works for the first 2 times but then it doesnt reset
oh is your end overlaping checking to make sure its stoping overlaping with a player also?
yes
ah then the last im not exactly sure
The last thing i can recomend is how i would normaly do it.
I normaly save the overlaping player(s) to a variable on the object
Making sure that the variable is clear on overlap
and making sure its set to the overlaping player on end overlap
I never done it with a do once before i just assumed it would work.
i dont see why it wouldent tho anyways.
but why does on overlap begin happen tweice?? it was working fine a few mins ago and i didnt even change anything
Its just some glitchyness ive ran into a million times
Im not exactly sure what causes it todo that i only have theorys, but i do know that sometimes begin overlap/ end overlap will run more then once for no random reason
Every possibility that you have two components on the actor with collision response that generates overlaps.
E.g, if both a character capsule and the character mesh have overlapping response
that would be a good thing to check also
Have you ever tried custom channels / objects?
well maybe next time that might solve ur problem too
hopefully yea
I've just started working on an AI spawn manger type thing, I started with distance checks but didn't feel like it was the right way to go so added overlap but wow, that's a world of fun right there
need help
i'm creating widget animation which play from right to left, but i want to hide from right side, and i want to only show from left side, how it possible
hi is there anyone who can tell me why this code isnt working?
@stray folio just post your question to the #blueprint channel and if somebody knows the answer they'll chime in
i understand im just having trouble getting the screenshot XD
l3 sorry
okay
this is my stats
I want BP to be raised with a training function
the input
and its not working
(the print string does show up when pressing Y)
anyone have any clues?
Try connecting the "false" on the branch node to the print string at the end of the function
it'd be helpful to know if the function is being called at all
(Does the function exist on the same blueprint as the one setting the timer?)
and yes
same results
stuck at 69
so now theres a print string at the end of the false
now what ;n;
well, if you don't see the value of "BP" being printed, then you know the function isn't running
okay ill make BP the vaule of 999
and see if it hits when hitting 1000
so its my UI
thats my UI
well, if the value is updating, then the question is... is your UI update script being called
i dont think so
If it is, then what's the point of failure? Does it pass the cast? etc.
idk, I thought that screenshot was it
yeah, construct only runs on... construction. When the UI is spawned.
hm. Im a novice and the video only shown me the construct
IDK if you're pressing "Y" on the keyboard to alter the value and then opening the UI...
no
im not
im pressing enter
its a pause button
(would you like screen shots of that?)
does it actually pause the game?
I don't think timers run when paused...
But the value should still change right
when not paused?
what about the
UI update
Yeah. So let's say the game isn't paused. You're hitting Y and the value is going up. And you have the UI open and you want it to update in real time...
You'll have to make a custom event in your graph. You can call it UpdateStats or whatever. And then connect it to the script that's attached to Event Construct.
And then you need to figure out some way to call UpdateStats whenever you change the stats.
Wherever you want really. Just right click on the graph, Custom Event, put it underneath Event Construct or something. I mean it'd necessarily have to be in your UI graph.
just as long as it dont loop inf correct lol
I've never dealt with a live UMG UI so I don't know the proper method of communication between the UI and your player-pawn.
well
I understand the update stats. But i dont know how to update the UI
like is it a hard code, or is there a node
imma have to look it up
no I'm just talking generally. I suppose I meant update the stats.
i understand
in my old game in DM coding (before i went to unreal) I put it in stats where the player stats was, where it updated every 1.5 seconds
well Stats() is what it was called
it was a proc
but
im still a little lost
i dont know the right way to update the UI
(yet lol)
You could maybe update the stats display on a looping timer provided the game isn't paused, lol. But ideally it'd be done on demand somehow. You press Y to increment the number. The "Training" function would have a reference to a spawned UI (if exists) and call UpdateStats on it at the end of the script.
disconnect Event Construct from "Cast to BP_Mannequin..."
create a new custom event called UpdateStats (or w/e)
connect that to "Cast to"
and on the Event Construct... event... simply call UpdateStats
it'll produce functionally the same outcome, but at least now you can potentially update the stats UI on demand
imma try it right now
having trouble calling the UpdateStats
(think it has to do the with the UI to the characer Blueprint?)
It constructs properly, right?
yup
The player-pawn needs a reference to the spawned UI object. Does the player-pawn spawn it?
I mean you push a button (enter?) and the UI pops up. Does the script that spawns the UMG widget reside in the player-pawn?
the "Melee"?
try get player pawn instead
can someone explain to me why get an error with this script (it's in a level blueprint) and also it doesn't want to switch to Input Mode UI only , I can keep moving my character even if the UI is displaying my Widget
@stray folio So here's a node from my current project. You must have one of these somewhere (create blah-blah widget). The "return value" data pin on that node is a reference to the widget. You can save that data to a variable (right click on the pin, "create new variable").
Now that you have that reference in a variable, you can plop the variable on the graph and call functions/events on the widget. For example you can make it UpdateStats on demand. This is all assuming your player-pawn is the one spawning the widget in the first place.
can someone explain to me why get an error with this script (it's in a level blueprint) and also it doesn't want to switch to Input Mode UI only , I can keep moving my character even if the UI is displaying my Widget
@main lake that happened to me too, did you try setting the input to UI before the widget is created?
@shut torrent nope as you can see, I create first the widget then set the input to UI only
it does?
yep :/
Idk how to call them, those little spheres for sorting paths in your BP
@stray folio there's two conversations going on so I'm not sure what you're talking about...
l3 im a little confused myself
did you see the screenshot/description I posted?
yes im looking for it now
@shut torrent If I put it before I need to get reference of an object if I cast to my widget BP, wich object should it be ?
yes ?
Try that
but these something missing in the widget to focus
Oh that's true
Damn
Just set it like meπ
I don't understand why it is not working for you
set it like you ?
Like in my screenshot
It's the same as you but I can't select my widget as I'm goind this in my level blueprint
Any ideas on how do I start character dismemberment gore system
so if i have to call update Stats from the Widget, how can i call it to update the stats when i train?
im still stuck on that
Reread what I wrote earlier β if you have a reference to the spawned widget saved as a variable in your "melee" pawn BP, you can call UpdateStats on the widget from any graph in the pawn BP. Just drop the variable on the graph, pull the pin out, and in the search box you can find UpdateStats (provided you compiled and saved the widget BP).
okay
So in your Training graph, you put a call to UpdateStats after it alters the value.
Anyway I g2g... If you have other questions just ask the channel
Calling functions & events with object references is a basic form of "blueprint communication". You should look up a general primer on that sometime.
i changed it to UpdateStats
Hi, I have a Character system I made and when the client tells the server to load the character in, it spawns the character of the specified class and updates it's information then tells the client to possess it after thats all done.
but the character dosnt spawn on the client until a few seconds pass after it has been told to possess the new character.
Is there a way to remedy this?
And if so how would I go about doing that?
~thanks in advance! π
A few seconds is quite extreme. Would expect a short delay though.
Maybe the client is loading all the assets for the first time so it hitches
the characters do have a saved inventory that is a Replicated array of a Structure of item information. I'd figure that would be the reason why but putting a delay there would really just fix it sometimes if i'm not mistaken. because slower computers would load it in a slower times possibly taking more time then the delay
Any way to reset a "Material Parameter Collection" to default values in one step ?
my issue was causing my hud to draw before it had a valid reference to the player's character so I needed to draw the HUD widget after the character was spawned.
I fixed this by having the Master Character class 'event be begin play' checking to see if it's current controller was == to the player's controller and if it was then the character would draw the hud widget providing a reference to self to the widget.
I do appreciate the help though! it helped me get on track to find this solution! Thank you!
Yo, can someone please help me out with recreating this stunt system, it's really doing my head in! I'm trying to replicate this and so far I know that in order to achieve it I'm probably going to need to delve into quaternion rotators but I have no idea where to start! It looks like some axis input (i.e moveRight or moveForward) driving a rotator on two axis, and then interping back to a set rotation (maybe?) - Every time I've tried doing this it just results in horrible spasms (maybe euler lock hence the quaternions?) - Any help would be greatly appreciated, cheers!
Not sure how to add force to all of the static mesh components I spawned....
Aren't you just referencing one on tick?
can someone tell me how to pull a widget into your graph
any suggestions on how to prevent an overlap event on a character
any suggestions on how to prevent an overlap event on a character
@thick plover what you mean by "prevent"?
The scenerio is that I am I spawning spheres that do damage to the player but want that damage to be prevented if the character blocks
Check for a boolean / do an interface call if it is true, don't apply
something like
IsBlocking
I can turn off collision to prevent something that does damage on hit but this does not work for overlap
Ok good idea I will try that
You could also use a GameplayTagContainer for such status like effects (which is like a multitude of booleans)
To prevent it forhand the sphere cast would have to know upfront the player is blocking, which could work on larger systems by passing in "ignoring actors"
Hello everyone!
Can anybody help me detangle a delegate in blueprint? I have a blueprint read/write delegate with 3 params.
I want to update a widget based on one of these params.
I got the delegate into blueprint (just search the name), but I don't know how to detangle the data.
I get a red "pull tab" which is of type delegate -I was hoping to see the actual channels of the delagate.
Aren't you just referencing one on tick?
@velvet viper I figured I was getting every mesh because I was getting it at the end of the loop
and to be honest I am not sure how to accomplish what I need here
@dusk flame drag of the red pin (cube pin)
then you can create an event that has the proper parameters. Which is your actual listener on that delegate
other ways are using "Create Event" node, so you can set any other event/function as listener and don't have long wires in your bp
@opaque blade, OK, so when I drag the red pin off, I don't get too many options.
then you can create an event that has the proper parameters.
OK
So custom event exists, but it isn't "connected" when added
I am a code monkey trying to learn Blueprint π¬
What I expect is the ability to bind this delegate in some way that I have access to the paramaters.
Oh
Oh.
This is wrong
You have to use the "Bind to abc Nodes" not use it as a plain variable (didnt even know that this is possible but seems it is)
The delegate is assigned in CPP like: UPROPERTY(EditAnywhere, BlueprintReadWrite...
When I search in the context menu I can create that "delagate" node, but then Im stuckk.
Hmm ok. So BlueprintAssignable, and then follow the suggestion above?
Which actually makes it Assignable like "binding" to it
yes
then you can just use the "Bind to" "Assign to" nodes
just launching a project to make a screenshot
Note that the UPROP needs to be a Mutlicast Delegate for this
Thank you so much! Ok I edited the CPP. Just quickly running again
Ah yes now I find this π¬
We use it for listening for character customization here,
imagine the "Create Event" just being normal Custom Events - but with Create Event you can bind Functions or Events, and also do the binding in Functions which cleans up your blueprint overall
The Get Mampfistate is just like your object you try to use in your widget, basically the owner of lots of delegates
@mental robin set it to an array, you're just referencing one mesh from the loop
Oh just saw your message nvm
I have pre-placed actors that I want to update variables on with construction or call-in-editor scripts, whats the best way to save the data so its not lost on engine restart?
Hey everyone, I am working on various projects right now and one roadblock that continually causes problems is having a decent animation system for our characters. Everything from retargeting to getting the animbp working correctly has driven me up a wall. Could anyone point me to a good anim bp that I can use and add onto or even have someone build one correctly that can be used for various projects? All I need is a basic humanoid that looks nice while moving about.
To be fair. Your animBPs should be targeted to your project. One for all projects is probably going to be badly optimized. Unless your projects are nearly identical. It's worth putting the time in to learning how to set them up. You can make simple ones in less than an hour once you know what you're looking at.
I was wondering, is there any way to get the controller or actor that clicked a widget from within said widget?
@urban zodiac Is this for local split screen style?
no dedicated server widget screens. I need to find an actor that has authority in order to actually do anything
The playercontrollers have authority so if I could find out who clicked the widget I could use that
I'm not exactly sure what you're trying to do. Widgets should generally have nothing to do with networking. They should be client side only, displaying what that client has access to currently.
If I want to make an interactable computer screen that players in multiplayer can interact with then in order for anything to happen I need to send an RPC from an actor that has authority. Widgets don't exist on the server. So I need to find out who clicked the widget and call the RPC using him instead
if youre trying to make a multiplayer interactable widget that somehow exists on the server..... you might want to make an actor that just contains all the values that would be involved in the widget
that would replicate to clients.. and then their screens would change
sort of like a virtual widget data holding actor.. that holds all the logic for happens in teh widget maybe?
well the screens dont need to change. But I do need to have widget interaction call something on the server. Like pressing the "Open Door" button, which needs to call a server RPC so I can multicast opening the door to all clients
uhhh oh
Gotta route that through an actor
if you're talking about a multiplayer interaction system
there's plenty of stuff on that
teh widget wont control the door
the widget just says "press E to open door"
Yes, that is why my original question was if there is some way to tell from within a widget which pc or actor clicked it
the door actor could contain the value of who
as an object
and you could replicate that i guess
The door is a bp. The door bp contains the widget component. The widget component knows that the door is its parent. So the widget has access to the door and can call functions on it
oh you'r edoing it that way
That doesn't work though
i just throw something on my characters hud that tells me about the door
You need to interact with the door through an actor that is owned by the player
i do use widget components for health though
Otherwise you can'T RPC
yeah but how would I know what actor interacted with that specific widget. I am actually using c++ but thats another matter. also, nice network compendium π
Why do you need to know who opened the door?
Because whatever actor opens the door will have network authority so I can call it over it instead
I think
it also just makes logical sense that I can say "player 3 opened the door"
instead of "A player"
on the door BP have an Actor variable that you set whenever someone does the thing
I could call a function on the pawn that clicked the widget (from within the widget) and then this pawn can call the function on the door
By default all clients have two basic actors that can RPC. Controller and controlled pawn. Make your widget have one of those do a server RPC. You're now on the server. How you get the actor that can open the door to multicast to all is up to you. Also might be worth checking into replication if you allow new people to join or whatever since multicasts won't open the door for others. As for telling which player opened it, you could compare their controller on the server.
this is what I am talking about
a widget component being interacted with by a pawn with a WidgetInteract component
@maiden wadi 3 Actors, PlayerState as well
True! Didn't consider that one. Used to just using it as an information bin.
i like to attach it to the PlayerPawn
then it can hold the widget components other players can see without 2 extra layers of indirection
this is a console. Like Doom3, Quake4, Prey(2007) and the new prey have. A blueprint with a widget that is positioned in the world and can affect said world. Its easy enough to do in SP since authority isn't really a concern. But for multiplayer its another question
Well, okay, so the Button to Open or Clase has to route back to the Player itself, passing the Door along, then the Player can RPC and the Server can tell the Door to open.
yes
Yada yada, that's the first part
The "who clicked me" is something else
Your WidgetInteractionComponent might give some info about that
But I haven't used that outside of VR yet
I checked through the header for it but I couldnt find anything that would give me the information
It's been a while since I've used it, but if I recall correctly You can set up different pointer indexes for the WidgetInteractionComponent. Which you'll also need if you want to see who's hovering over what.
each are per user i think
at first I figured I could use player_id and set the virtual user index to it but there was some reason why that didnt work
What you could try is
In your Character
Where you have that InteractionComp
You can get the "HovereredWidgetComponent"
Which returns the currently hovered one
And then interact with it that way
hmm, lets see
Because theoretically you don't need to simulate a button press
UWidgetComponent was for the entire component. I suppose it would work if I could return what widget within the component its actually hovering
Might become weird when multiple peeps hover it
But instead of calling PressPointerKey, you could manually get the Widget and say "You were pressed!"
And pass it the Player along
At that point, however, you could also just throw this all out of the window
And just use the Widget to show the state
π
But do the interaction just through a normal line trace
Can't type
Put two collision boxes where the buttons are
And perform a normal line trace
etc. idk
yeah that would work
I don't like 3D widgets :D
you make it so every player has its own instance of the widget
and then you don't have to wonder who clicked it
I can feel the pain already
or about multiple hovers
honestly...screw finding out who clicked it
how about I just use the localplayercontroller
@twilit heath A 3D widget has no owner by default. So inside of the Widget, you have no idea who you are. Depsite getting "GetPlayerCharacter0" or so.
since the widget itself is local to each client anyways
oh
I try to avoid that
I have an idea
you should split the hover and click, and make the hover local and the click replicated
i use that only to iterate through all players from blueprint
widget knows its owner is door. How about I just set the door to be owned by local player 0 when something happens
In Unity, you can edit values of variables directly in the inspector during gameplay.
Does Unreal Engine have support for that? If not, will it in some future update?
ummm, no @urban zodiac
live editting or w/e
oh right...because the RPC still wouldnt work
you would have to send a server RPC through an owned ActorChannel
for server to SetOwner
at which point it becomes a little impractical
hmm, how about adding a actor var to the character and then telling from within the pawn filling said var when it interacts with the door. Then when the door calls its open function I can call the local player controller 0 instead and then open teh door from within the pawn as RPC
@proud cipher anything marked InstanceEditable
...
can be accessed through details panel when you play in PIE
you usually need to Eject first to get to those
how about puytting an interaction interface on a door
and having your player controller send the RPCs required for interaction interface to work
then you can use same RPCs for windows, chests, w/e
I already use that system for everything...except doors...since my plan was to have them controlled with the widgets
so instead of pressing E to open the door you have to click a widget to open a door
doesn't change a thing
you still call interaction interface functions, just from a different starting point
Hey UKaosSpectrum, I dont want to pin you since I dont want to distrub you, you sent me this screenshot 2 days ago, today I tried to implement it but I couldnt understand what "Customevent_01" for, if you are here, can you explain?
So the flow is
Pawn presses Widget -> Widget calls function on door -> Door does whatever
and the interaction flow is usually just
Pawn calls interact -> targeted actor does whatever implementation of interact interface it has
@dense mica its an event that gets called when move is completed
he just didn't name it, left default name
that is because you're trying to do it inside a function
c/p the event handler (custom event) to the event graph
and use create event node to link the event dispatcher with the handler
the player needs a way to line trace to its crosshair and look for "can interact"
on the door button side set up a trigger box and do a on begin overlap, cast to player class, and reference itself and set it to can interact while it overlaps.
then on mouse over you can trigger the display of the switch, it will only display for the character using it.
then on a interact event (button or click triggered as preferred) then it calls a event in the switch to activate it, replicated over the network.
you can use the same player side interact code to interact in different ways with different objects
@urban zodiac so the only alteration you need is Pawn presses Widget -> Widget calls Interact providing Door pointer -> Door does whatever implementation of InteractionInterface tells it to
Well the door would need to know what function it needs to execute. And what function it executes is determined by the widget the pawn clicks
and widgets will animate. I would have to some super annoying hacks to get custom collision boxes to work with that
so what can a door do, aside from open if its closed and close if its open?
be bolted shut so it cant be opened. be electrified, have its widget disabled...
whatever I can think of I suppose
and thats just for a door
There is going to be a lot more widgets "computer screens" players can interact with that do all sorts of things
so add another DoInteract function, this time carrying a byte payload
as a very simple example
door has enumeration of actions on it
you call DoInteract, and turn your action's enum into byte
that goes through the RPC and when server side function on the door receives it, iut will know what to do with it
basically, instead of making 50 different code paths, you figure out a way to send a generic payload through the interaction interface
yes but how would I know what payload to send with the interact
if widgets context is a door
it knows what action you're taking
and knows what to send
on the other side (server) when door's function handling interaction receives the payload, it will know how to itnerpret it
it doesn't matter that door can't interpret the payload for a computer terminal
because interact RPC for computer terminal should never end up handled by an instance of the door
widget for computer terminal knows how to encode the payload for computer terminal, and computer terminal knows how to decode it
same goes for door, or any other class
HEllo, i'm trying to understand how the "perception : Prediction" work, and the doc is not very helpfull. does someont have a good site or video explaining it ?
which reduces the generic interaction to figuring out what payload is ideal to handle everything
hmm I will need to come back to that tomorrow. I just had a wisdom tooth removed so im a bit woozy. Thanks for the help regardless @twilit heath
What is this node? (plese)
trust me, you don't want to maintain 50 similar code paths
as that is a bug incubator
yeah I will think about it...I am getting another wisdom tooth removed tomorrow...so ehh maybe on the weekend
when my face is no longer hurting
zlo do you know?
thats the half height of a capsule
if that is a pattern, you might consider taking up boxing
capsule component is a collision
its faster, and you get your excercise in along the way
I mean the node that goes from the component to float
if its 64 units in height then the half height is 32
@twilit heath well I can ask the doc if he just wants to punch the tooth out
best thing is you get to punch him back shrug
btw, @urban zodiac one really effective way to handle payload for almost anything
is a pair of GameplayTag and a float
say, Action.LockDoor 1
then you just add tags instead of creating enumerators and shit
Hello new to unreal im pretty good with c# have a little experience with C++ from an old college course my class now is making me use blueprints and im not really getting the help I need from teachers. Could someone help me run through some homework im having trouble with?
its probly real simple for some of you just a blueprint for an array and cycling through with a for loop i just cant grasp the visual scripting thing
@unique dagger still need help?
ty
Please can somebody explain, in plain english, what 'exposing' a blueprint variable does, and why we need to do it? What are the pro's and con's and what is the c++ equivalent? thanks
expose on spawn?
Yeah
it makes it so its a pin when you SpawnActor and its that class
and then it can be used in the construction script
Ah ok, so why would all the variables not be automatically exposed at all times? What are the benefits to keeping it un-exposed?
i dont really know how it works in C++ but I think you can put something in the Constructor so it takes in variables?
the more code one piece of code knows about.. .the more overhead
when you look at C++ files
Ah performance?
and you're looking at the includes
ya performance
so i think until like 4.19 there used to be a lot more included
in base actor class
but then they stripped a bunch of it out
and you have to include it yourself if you want access to it
in blueprints you can actually make a variable "private" which means that other scripts/blueprints wont be able to access that variable directly
you could still set up a "SetThisVariable" function
when you're doing C++ you can make a variable private (only this script can access it), protected (only this script and children of it), or public (everything sees it)
in blueprint you have to manually click private
Awesome , thanks man
when im setting blueprint variables to expose on spawn its usually cause i want to use it instantly in the constructor script... like when i fire an Arrow in my game, it could have any static mesh.. and i have that exposed on spawn.. so in the constructor i set the mesh
no problem!
Hi guys! I created a new project in unreal with the TopDown preset. There I created a new PlayerCameraPawn and new Playercontroller. I want to use my own camera (its an rts-style camera that pans with the mouse) instead of the preset one.
So my problem is whenever I hit play that its not using my new camera. It just shows a top view perspective. I changed the default Pawn and the player controller in the world settings. I also selected my camera and changed auto possess to 'Player 0'. I also removed the standard mannequin in the scene
i'm kinda lost, does any of you have any idea what the solution could be? I just cant figure it out π¦
im printing a ammo on screen into an editable text box but it doesnt change??? the number of bullets change and my gun stops firing but the ammo count on srren doesnt change what am i supposed to do about that???
is there a way to change text already printed???
Are you updating your textbox when the ammo count changes?
You're probably settings the value on creation, but never updating it whenever ammo changes
how to??? thats what i dont know how to do...i thought since its editable it should check the value continously
I have an array of wind vectors on x/y in blueprint. How do i access all elements of an array? I am trying to draw a debug arrow for each element. I can do it easily on begin play..but I need to see the arrows update as the vectors change..but I can't figure out how to do this
i can only bind a func to the text and not a tick func
You don't need tick
then how am i supposed to change it??
how to get actor from primitive component
@thin apex what you could do is bind your text box to a function that gets your ammo, say from the ammo variable in your player/gun/etc class
Then all you have to do is update that ammo variable in that class whenever ammo changes
that is what im doing
but apparently i was trying with live coding and all i had to do was restart...thnx for the help tho @thorny willow
Np
I have a problem with blueprints and need help. Where is a good place in this server to get help?
awesome!
I am trying to use the sequencer to trigger an event that is on my level blueprint. I have been trying for like an hour to figure out how but i just cant seem to do i
t
@trim matrix stop trolling plz k thx 
After I load my level, I see the cam at 0,0,0. That's before the player gets loaded and placed at the desired location. WHen the player is placed, the cam moves to the player. Is there a way to fix that?
@north bay explaining all the steps would take a while so i will refer you to this youtube video https://www.youtube.com/watch?v=vNjxEdMYSCI&feature=youtu.be
Just a quick rough draft for a tutorial on how to build a RTS style gameplay, with selecting a character and moving with cursor for multiplayer. Demonstration video: https://www.youtube.com/watch?v=sWr1cvOyZYU
Multiplayer section starts at around 11:20
Will hopefully get so...
After I load my level, I see the cam at 0,0,0. That's before the player gets loaded and placed at the desired location. WHen the player is placed, the cam moves to the player. Is there a way to fix that?
I second this, i would also like to know
thanks @crimson swan I will check it out!
@true valve are you loading a savegame or just your level?
bah, I thought I made it through most of my issues with the 4.25 upgrade. I didn't get this warning in 4.22, not sure what I did wrong. It isn't a complex rpc
Check if your emitter migrated properly. Esp. important for Niagara cuz they're always changing stuff
I don 't know how to check, will have to google
is there some meta data to look at?
Hmm dunno then sry
@cobalt temple set a breakpoint on the Spawn emitter at location and Set max draw distance to see what exactly is None (null) here
If I read the warning correctly, the return value seems to be None here
And run your game, the game will pause when the breakpoint is hit
And then you can inspect the game at that point in time
So you can see what the inputs and outputs are
ok, I don't get the warning in the editor, so lemme compile and see what happens, should only take 10 min
Ok, I gotta go though, hope you get it resolved, otherwise I'll check back in the morning
thanks
the game plays
I just don't know how much the warnings impact it
and would rather fix
thanks for your help
hey i packaged my game and i cant launch it
do you get an error?
Hello, i am creating an inventory following this tutorial series. I have a HUD widget which is empty (But i added a border with a color) and it houses the Inventory Window widget which has a grid for the slots and some text. The tutorial shows how to toggle the Inventory Window with a function like this and creates the HUD widget in the Player Controller on Begin Play. The problem is that since i added the border with the color, the black tint of the HUD stays on screen indefinetely. What i want to do is toggle the HUD with the Inventory Window together. Any thoughts on how to do that? Hope i explained this well enough.
Thanks in advance!
In this new series I go through a method of creating an inventory system, similar to a survival game. In this first part I introduce the system and go through the process of setting up some key assets that we will need going forward.
There are unlimited ways to create a tutor...
damn, when I ran the server.exe it went right through the break point
So I have these arrows that draw the direction of wind. Now I need to add noise to it...this I have absolutely no clue how I would do it. I am not even sure how to explain what I mean. Is there a way I can 'sweep' values across the surface of these vectors and lerp between vectors to have a smooth gradient from one wind strength to another
Guess I need to dig into some big boy math
Is there anyway to read from a texture to get values
@mental robin what defines the direction of the wind?
@trim matrix if the inventory is a child of the HUD, then when you toggle the HUD, the inventory will as well.
Hello, i am creating an inventory following this tutorial series. I have a HUD widget which is empty (But i added a border with a color) and it houses the Inventory Window widget which has a grid for the slots and some text. The tutorial shows how to toggle the Inventory Window with a function like this and creates the HUD widget in the Player Controller on Begin Play. The problem is that since i added the border with the color, the black tint of the HUD stays on screen indefinetely. What i want to do is toggle the HUD with the Inventory Window together. Any thoughts on how to do that? Hope i explained this well enough.
Thanks in advance!
@trim matrix well the border in the HUD should be invisible i mean the brush color alpha should be 0 and you should actually add the border inside the inventory widget
In this new series I go through a method of creating an inventory system, similar to a survival game. In this first part I introduce the system and go through the process of setting up some key assets that we will need going forward.
There are unlimited ways to create a tutor...
I've made this inventory referring this tutorial
Is having generate overlap events on many objects bad? Like 100-1000 objects.
It's very optimized from what I hear
hmm
if they're all moving around and colliding then yeah you should keep an eye on performance metrics
Could someone pass me a quick tip on getting the world transform of a static mesh inside an Actor's static mesh component?
i would this this would work
but im not having much luck
you're trying to get a specific socket location right?
GripPrimaryRight?
I think you can just "GetSocketLocation" on static mesh scene components..
^
ya
im confused on what youre using this for tho
let me try that quick. failing hard rn : /
just trying to get that sockets world location
so i can move something to it
always confused me what that or is about
there is no toggle, or does world-space = bone location : /
oh
well sockets and bones are kind of the same thing
thats all that means
you can feed a bone name into a "GetSocketLocation"
can anyone spot the error in this?
the number of traitors is set to 2, so there should be 2 traitors, but sometimes one player is assigned to both traitor and crewmate
im thinking its something to do with the random integer but i cant see the error
you're using Arrays right?
yes
i think remove will still remove all instances of an object
use a Set
and i think it'll work
i dont know if that's your problem for sure
but just a hunch
like set the array after removing an item?
no
Sets are a type of variable
like the little drop down that you click
to make it an array
ah right i gotcha
after that there's Sets.. and then Maps
you can't replicate a set
or a map
but they're really handy
you cant add the same thing twice
and the object itself is the index for getting it
also you can convert it to an array easily
and when you remove it will only remove the specific instance
hey, wondering if anyone can help out with a new issue I have in my project.
To preface, here is movement as of yesterday:
https://streamable.com/hsvvqq
and here is what is going on now:
https://streamable.com/rzxu8h
it's telling me that the movement settings are being read as none, and also there is an initializer that sets char movement variables from the basechar bp and puts them in the combat component, but they are also being read as none. I am thoroughly confused, because I thought the component that it can't find was being accessed in (self), but obv not. Any help would be appreciated, I am stuck
hm ive never used sets before so i would have to look around with it
actually i think i just fixed it by setting the random integer to a new variable
i suppose it was getting a new random number every time i used the connection
yep it seems to be working properly now
i'll definitely have to look into sets tho because they seem like they can be useful. thanks for your help :)
@thorny glen its really hard to see the issue without seeing the structure of the project more closely
whatever you need to see, i can show
well you said it was working yesterday? did you change anything significant?
oh right lol.. yea pure functions fire off seperately for every connected pin
that's the thing, i didn't change anything significant. i applied physical animations today, but then removed it all.
the variables that aren't loading i definitely didn't mess with, or anything near it
lemme link somethin'
this is in my als_base_char bp
my b, this is it
so, the char movement component is there
inside this bp, this is where it originates
but when i initialize it and set it in combat_component, it reads as none
yesterday it worked fine
this is another example of a variable not being read, this time the curve referenced in current movement settings
my b for massive influx of pics, but lastone
errors
try setting current movement settings before where it gets accessed
like set one of the values of it
i assume that gets done by alsv4, i never had to set it or mess with it
but i can look around
well its telling you that what its reading is empty
yes, i understand
have you tried simply deleting the node and then dragging it back in?
sometimes small changes can mess with the blueprints
i deleted the references and dragged them back
what's weird to me is that it reads as none when, i thought, both properties were set within (self)
click on the errors and follow it to the node where somethigns being found null
isAttacking?
i did that, that is what the images are
yes, it says that char movement is reading as null
char movement is set in als_base_char
it is set by initializing
i dont see a branch in any of your images
and thats where its coming back null on some of that stuff
CanAttack
and uhh
combat component
i will link you that but i don't think it is relevant
right, but the beginning is als_base_char
all these references originate from (self)
i move in reverse
the references are to components in (self)
are you doin this stuff in multiplayer?
no
ok
you're doin this stuff on begin play
?
have you tried putting a small delay in?
well never hurts to try something
even if its not the approach that you wanna take
it might show you whats going on
if it randomly works by adding a delay
if there's a race condition happenign where the component isnt initialized yet
when you're begin play happens
then if you didnt wanna do a small delay.. you could do a broadcast kinda thing with delegates
to run your code after every component reports in as initialized
i think i am seeing my problem
it may be possible that i've altered an enum that deals with overlay states, and the als v4 operates heavily off of that enum
not being rude, but it's definitely nothing to do with a delay
the exact same layout worked yesterday
all good
so i know the loading order was proper, as i've not messed with it
i'm still not understanding why this single stretch of code isn't functioning, though
if i follow only my initializer
this is the beginning
all of those components in the called function are already a part of this blueprint, right?
the initializer
so then how does this not work
that line of code ends there, essentially
the referencing part of it
i have my blueprint, i begin play and call the initializer with components of (self)
the initializer never sets the errored reference without being called (no need for delay)
but then i still end up with those 3 refs being 'null'
what i would do... is first check before you pass it in.. to see if its valid
and this is gonna sound funny
but sometimes in blueprints
literally printing if its valid or not...
fixes it
i think i am misunderstanding how that works, are they not automatically valid if they are components of the blueprint?
Use the Debugger, and Watch Values
well ya they're suppose to be
but thats where i would start
just start followin that trail
cause ya
wtf it should be valid.. is it valid before i pass it in? if not.. fuck .. if so.. FUCK
lol
but two different fucks
then you find out why
when shit's broke i just startin pullin levers
LoL
lol
the struggles
I'm dreading Ai and Multiplayer
seriously though about blueprints returning null on something that's totally valid.. and if you check if its valid with the classic one that gives back a bool.. and print it..... IT FUCKIN WORKS
sooo
be aware...
shit'
not perfect
sorry
pardon my french
im french.... canadian....
lol
You sure it's not operator error?
is that what it is? i dont even know what that means
i just know ive had that problem and what i said fixes it
π
You making your own game? What ya making?
a sorta simple medieval multiplayer RPG
Nice nice... witcher like?
im using the assets that were the better PBR version of some free modular fantasy hero assets from a while back
i needed modular.. it was cheap... lets rock
lol
so no.. not witcher like
way more lame
Coolz
but i do have a working levelling system and perks and all that fun stuff
and its replicated
and im putting real world music in it
cause im a musician and i used to host open jams at a few local bars.. so i know a lot of musicians that would love to have their stuff out there
and i even got a hold of some stoner rock bands im in love with
Yawning Man... Elder..
its not gonna be super awesome
but its gonna work
and be complete
and i feel like thats the most important thing for me right now
@flat raft what are you trying to acheive and why do you loathe multiplayer and Ai??
damn wish i was using unity when that character pack was free
i really need to learn modeling
sidenote, yay for tetris inventory! No more random deletions or can't insert issues! 3 days lol
finally have it working with 1x1 and 2x1
a little bit yeah
i tried finding a tutorial for ages and couldn't, then tried finding some paper explaining the logic and couldn't.. then just bashed my head against a table with a metric ton of debugging and have a semi working version
still have an issue where the last row will get items added to it that are 1x2 and that's no bueno
solving that now
What's the basic logic?
ok so you create a grid (the numbers you see)
each one of those is a separate widget
the way i did it is probably way suboptimal
but anyways, so when i drag and drop an item i compare the id of the one i dropped on, the one above it and the one below it.
if both are empty then i can place mine and delete the old one
so on so forth
Oh
sounds simpler than it is, i just maybe oversimplified it a bit lol
That's on my list of things to attempt now π
it's really satisfying
but now i still need to solve how to swap items when i drop one on another etc
i'm just trying to make a shitty diablo clone, been at it for like 6 days
This is a tutorial for the advanced jigsaw inventory system available in the UE4 market place.
https://www.unrealengine.com/marketplace/en-US/slug/advanced-jigsaw-inventory-system
Try out the demo: http://tiny.cc/jigsawdemo
More tutorials: https://ue4jigsaw.blogspot.com/2019...
Maybe some tips in that tut
Also #umg might be helpful
yeah no that tut is just someone showing how to use their marketplace system
it's basically 99% what i'm trying to make just i had to do it from scratch
i found one in japanese that goes over the logic but doesn't show code but then again it's in japanese
LoL.. fun
yeah, i was considering making a small tutorial series for like the 10 people like me who would be interested in doing this. But then again it took me 3 days to get it semi functional, i can only imagine how long it's gonna take me to clean up the spaghetti so that i can actually present it
