#blueprint
402296 messages Β· Page 836 of 403
for the wind i have a global Z float, so i imagine it would be just to get the world Z rotation of the ship and compare it with the Wind Z
but i cant think of how that actually looks like as a formula
Maybe negate rotation and then combine rotation = your delta rotation
aren't they separate textures? or are you may be overthinking? or is the ship always facing top?
probably just something like windYaw - shipYaw should do it
@high sapphire Okay. So you need three main things.
First Image - First is your Userwidget that holds the Listview itself. This populates the listview with Items. Here in this widget's construct I made a simple loop that constructs items and adds them to the listview.
Second Image - This is an empty UObject child class with nothing but a couple of InstanceEditable, ExposeOnSpawn variables.
Third Image - The EventList widget itself. Imeplements the UserObjectListEntry interface, and uses that interfaces EventOnListItemObjectSet to set a casted version of the data we passed from the first image. Then it calls a visual update function at the bottom that uses that object if it's valid to set the view.
dot(WindUnitVector, CompassNorthToWorld)
@spark steppe yea the ship is overlayed on top of the disk
What's a good way to store player variables (Health, Shoot speed, Movement Speed, ect) would a interface suffice?
Interfaces don't store things.
Hi all, noddy little platformer where the character can place blocks... I'm calculating the spawn location by taking the location of the actor (player), dividing it by 100, then using ceil to effectively round it to next whole number, then multiplying it by 100 - the intention is that the block that is going to be place will always be "clear" of the player...however, if the player close to the mid point of a grid position, or more, the block is place in the next position but the player will often now be in that spot, or partially...
Any thoughts on how I can avoid this? It kinda needs to jump to the next position across when the player is going to be in their own way... I can't use the SpawnActor collision handling stuff though as its too limited, so I need to guarantee a "safe" position first before spawning...
Second problem - I need to device a way of telling whether the spot that could be spawned in already has a block (or potentially something else) in it... again the SpawnActor is a bit limited for that, as if I set it to DontSpawn, I get nothing regardless (maybe detecting collisions with the floor, not sure)... little screeny to demonstrate...
In the case of that top block, it should have really been spawned one further grid position across.
The reason for the divide by 100 / multiple by 100 incidentally is because i have the sprites set to equal 1 unreal unit... so each box is effectively 100cm wide, was a nice way to line things up...
Open to suggestions (and awesome maths skills that I lack) π
I need to loop my custom event but whenever I use it I get an error message
some more context, when exactly do you need the blocks spawned, and how?
what kind of error?
Sorry... I didn't want to make the post really long etc....
The player presses a button and the block will spawn. At the moment, only on the right, but the intention is that it will be based on which ever direction the player is facing (I can do that bit)...
Trying to do the InventoryData->Icon, but it's not coming up for me
then it just brings me to the loop like inside
put a delay of 0 before you call your event again, that will delay it to the next tick
however, ticking stuff should most likely happen onTick
I don't have it on tick
Proof that Icon has Expose on Spawn turned on
I have it on hit
using the grid you have, check your player's position within the grid, and use that grid position to spawn a block 1 grid tile offset
and why should it loop?
The grid is only showing because its the tilemap and is taken from a pause/unposses etc...
Non casted reference it looks like. You're dragging from an Object pointer, needs to be the same type as your item.
The code in place at the moment is as follows (bit messy as testing, sorry)
well, I wanted it to call back to my custom event where it multiplies the current velocity by 1.05
Menu_ItemObject type I mean.
right but underneath the hood the grid has to exist as well
Is the way I tried to do the casting at the top not correct?
You probably don't have a escape condition
show your code
I added a MOD node to get the "odd bits" and then tested if that was greater than a specific value and then added 1 to it before using ceiling... it kinda worked, but was't great
vito, you are doing something that you most likely shouldn't do
IMO create a dedicate GridManager actor
that you can query for the grid positions
lol
have it update the player's grid position per tick
that's the multiplier
Was doing the grid mainly based on calculating positions... because of the unit/pixels etc, I can assume that each grid position will be in multiples of 100
that part is fine, now show what calls Speed
I would avoid this, as your grid becomes relative to the player. this isn't ideal
Would that hold an array storing the locations of each block etc? Then test to see if one has already been placed?
Like here in the details. Your variable type needs to be your Menu_ItemObject
you'd have two arrays; X and Y
yeah
why do you use a while loop?
why loop it
sure this will happen infinite times
well I need to keep multiplying it
for how long?
just until it hits a certain speed
Still not 100% sure on how to tell if the character is going to be in the way of the next block placement though (although the array would resolve the can they place a block at all issue - if another block had already been placed etc)
probably a tick thing
really?
you're currently multiplying it infintie times in the same frame
gotta go fast i guess π
lmao
if the character's position is updated on the grid per tick, that means that any given frame the character will be occupying exactly 1 grid space. you can then make the next grid space over be the space where a block is spawned
Guys what are the best paid/free tutorials to start learning about blueprints and then slowly transition to scripting too with them?
go fast after every bounce/hit
Yeah, but sometimes it needs to be offset by two grid spaces... in the scenario where the are already half way across that grid space etc, they'll be overlapping the next available one...
oh, then just don't loop it
okay thanks.
like when I just let it be
@trim matrix there's several ways... do you want to reach a certain speed or do you want to increase speed for a period of time?
it'll just multiply it once and done
the player would occupy the grid space only where it has the most real estate covered
Ah, I see. Thought it had already done that, I guess it hadn't
I want to reach a certain speed but only gain it after every bounce
hmmm... not sure how to code that up...
you're already doing it, floor or ceil
you can add a float targetSpeed variable to your blueprint
If I've understand it correctly he want's to multiple the velocity once after every hit
set it to the desired speed in your onHit event, (but don't call speed)
and call speed onTick
and actually, you can use a single array for the 2D grid, using array unraveling
ok
yeah, but it isn't enough... because although the actors transform is "in" the box, some of the sprite will be in the next box...
yes
to me it sounds like the velocity should increase "slowly"
you're not checking the actor's transform, you're checking against the grid tile they occupy
Hm, the empty widget is still appearing when the player's inventory is empty.
Forgot to connect update to construct and on list item object set
then it should work without the loop
maybe 1.05 is not enough to notice no idea where i got 1.05 from...
maybe you are reading the velocity wrong?
^^ in this case, they were "in" the box, so the next position was calculated etc... but as you can see it didn't work...
so if I move away from their transform to the grid position they occupy, how to I ascertain which grid position they are in? Surely that still comes down to the transform at some point?
you get it from the actor but set it to the ball
he was just reading your mind
is the ball the scene root?
Empty inventory:
Collect 1 potion:
in this case, the way it's generally handled in 2D games is that you have a delegate whenever a block is placed, and you adjust the player's position to the center of the grid tile they are supposed to occupy
So now the text is updating properly, but the icon isn't
I am confuse.
you mentioned it here^
Show the icon set in the list widget?
collision optional
And where you're creating the object and passing it to the list.
the other thing gets called every hit
so, you are right
it should call it every hit
but it doesn't
why doesn't it
hmmm, okay, I could do that... might make them "bounce" a bit though, as they'd move backwards... was kinda assuming I'd just place the block in the next available space, but its calculating that available space I cant get my head around
remove the while loop, and in the speed function add a print string node which prints the velocity that you set
and tell us if the result increases by 5%
you're looking at it wrong. defer to the grid, always
My char is looking up if i move my mouse down why? the input on this axis is on 1.00
It doesn't increase
sure, I'm thinking of the grid... so lets say at the start the player is in grid 1,1, they start to move but their transform is still in 1,1, but the sprite is overlapping 2,1 - visually I can see that, but how can I tell that they are now occupying (effectively) two positions? Surely I needed to know that they are "partially" in 2,1 so that if they try to spawn a block it goes into 3,1? I'm feeling very dense right now π¦
it just stays at 1100 velocity
bump that multiplier up
they aren't. the sprite visual gives that indication, you can, as I said, use a delegate to recenter the player once a block has been placed in the grid
wait
also show your components
quick question
what u mean is that a answer to my q?
but that would effectively "bounce" the player backwards if they had already moved across enough to make the next grid position not possible wouldn't it? Would look a bit jarring to be constantly pushed back?
Curious. If you unhook Icon here and set an image directly, does it show?
put the print string to the "get velocity"
he does
it would place players exactly where they are on the grid
threads when
not "bounce" them
Yeah, it does
What about if you put that back, unhook it where you're passing it to the constructed object, and set it manually there?
can't you set the linear velocity on the actor instead of the ball?
the alternative is that you let collision handling deal with it, at the potential cost of letting players walk through your tiles
...in the case of placing a block to the right of the player, if they were partially overlapping the next space to the right, they would get moved back (to the left)... that would be quite visable? They dont move one block at a time in the game etc... e.g. the player movement doesn't snap from one grid position to the next, they can move and be half over different blocks... (hard to explain in text)...
you mean make a variable that is a reference to the BP?
I just did it and it gave me warnings
like a lot
no I am well understood with the concept. I am offering you two choices. one is either snap them back to where they are on the grid. or let collision handle the appropriate response, at the potential cost of breaking collisions. those are your options
That's where the SpawnActor thing wasn't quite offering me enough... if I "Spawn Anyway, ignoring collision", the box appears by the player can be in/under it (as per hte screenshots) the next time the player moves the collisions trigger and they get "bounced" backwards... its quite jarring
Yeah, that works too
I'd encourage you to look at how games like mario maker handle these cases, as they are quite similar
It has to be coming out of the inventory null then. Looks like it's fine in your item you're picking up. Check where you're placing it in the inventory. If you missed a pin or something somewhere.
can I not have a third? π
Is it not possible to just calculate the next space along where a box could be placed, without the collision, and without moving the player back to the centre of the last position? Another reason for this, is that before I took these screenshots, the player was actually "bigger" than a block, 24x24 pixels, where-as the blocks that make up the scenary are 18x18... because of this, the player doens't have to move much in one grid space before their sprite is occupying the next...
Would love to find an example close to what I'm trying to do... I guess in 3D it would be kinda minecraft with the cube placement...
you cannot have your cake and eat it too, no
ok, so when I call it on tick it doesn't multiply and keep the value
I think the issue is my speed custom event
...but... surely... must be a way..?
Evidently my logic is also faulty somewhere else - picking up 3 health potions and then 3 magic potions shows this on the inventory screen
can someone help me?
You're looping over all items to generate your count and only creating one object. So it's taking the full count, but only the data from the last inventory item.
everything in design, as well as in code is a trade off. you can check against the player's collision instead, if the player's collision is smaller than the player size. I'd encourage you to make everything the size of the grid though, or at a bare minimum multiples of grid size
Yeah, I knew when I was setting it up that the way I was doing it wasn't the right way. I don't know how to set it up the right way, though.
oooh... collision... I could use a separate collision volume around the player... hmm... but what would it collider with in the case of empty spaces.... gaaahhhh!!!! this is doing my head in... its really important too (to me)... its for an experiment for part of my final major project for my uni course... gah...
cool down, start by making everything the size of the grid in terms of visuals. then you can try with different box collisions offset from that. you can have a collision that reaches the floor conventionally, but is slimmer than the visual avatar
Unless you want to restructure your inventory to hold the counts in a different way, you need to basically do a few iterations over the inventory for the display. Iterate once and get a list of all names, add them to an array using AddUnique or something. Pass that back from a function. Then use that array to loop over your inventory for each item to gather their count and create an object for each one for the listview.
Yeah fair, that'll work too.
That's weird, everything in the Add to Inv function looks right
I think I'm missing something... how does having the box collision slimmer than the sprite help here? I was actually assuming the opposite, e.g. have a collision volume that was larger, but then I need the "nothing is colliding its ok to place the block" thing, which obviously I wont get because you only get an event when something does collide, not when it isn't ....
Its almost like I'd want to draw an empty square box one whole grid position (100x100) in front of the player, as they move along, it effectively highlights the box that can be built in... I dont want the actual visuals for this, but this is what I see happening to work out where it can be placed etc... the player effectively pushes that along with it snapping to the next position thats available... sorry... probably not making much sense..
(The player has separate inventories because I figured that'd be the easier way to handle different types displaying on different menus - I'm trying to get the useable items inventory working before I copy the changes over to the other inventories)
you want to avoid snapbacks, so in that case having a slightly slimmer box prevents those cases. if you have a wider box, you'll always get collision issues every time you spawn a box
but then the player would be able to overlap (a bit) anything in the playspace because the collision volume is smaller than the sprite..
yes, but you'd have those cases anyway given how you want to spawn blocks. like I said, you can't have your cake and eat it too
I really don't see how/why though... sorry, I'm not trying to be awkward... I just dont see why I can't spawn a further position along based on a condition where the player is going to be in the way of what would ordinarily be the next position..
well you can but then your blocks aren't going to be grid based. if you're OK with not having that, feel free
For example...
the player is partially in the box to their right, so, the next possible placement positon would be the red X etc...
no no, still grid based, but "the next" grid space...
sure you can just add an offset to the grid to always +1 the position
That was where I began... but I was trying to only offset by one under the condition of it being necessary... so if the player isn't overlapping at all... it would just be the next space, if they are overlapping a bit, it would be the "next next" space...
So something like this?
the cases where the player isn't overlapping aren't going to exist. your player will always be overlapping if they are not snapping to grid spaces
next space
and I think you'll be having a harder time making players understand why that distinction happens since players won't know what the grid is or isn't
nat it's a bit more complex, you would need to check if the element exists on the map already, if so, you need to increase the count for the entry. you only add a new entry if it doesn't exist
maybe you can get around by using the find result on something that doesn't exist, not sure if it'll return 0 for non existing entries
thats very true, it will look odd if some blocks are placed further away from the player... I guess that "highlight" thing I mentioned above would help with that, as it would highlight the placeable areas... BUT... a) I have no idea how to do that b) its a single key press to place a block, so you'd have to almost have that on all the time... or... have a hold to see where it would go, and release to place... but then that leaves no "cancel" option
but overall, if authaer suggested to restructure your inventory, that's probably what you should prefer to do. instead of working around issues
Er. Forgot the +1
but again you're overengineering this for the sake of not wanting to implement a simpler solution
is this a game design assignment or a programming assignment?
So I was on the right track with using the boolean pin off of find
I just think moving the player backwards is going to look a bit weird... I'll give it a try now and see... maybe it wont be as bad as I think...
I guess the highlighting thing though, that would then require the whole underlying grid approach you were talking about and would be able potentially use it...
Its a research project... I'm doing a study on violence in video games... it actually started out as more of a "can games where you dont break stuff be fun" kinda thing... the plan with this is a simple (LOL, I bloody wish) platformer, where there are three modes that the player is taken through... the first they can only build (place blocks) to leave the environment... the second enables placing and destroying the blocks... the third enables them to fire.. althouth there isn't any "need" to... the NPCs will be passive...
the aim is to study the behaviour of the participants and see what they do and get some data back from both the game and the participants afterwards relating to what they did, why the did it, and so on
conflict is human nature, games are but a metaphor for this. QED, next
Craft The World does that. If you place a block down too close to a controlled dwarf, it'll nudge them away.
I am already behind and wanted to catch up and didn't expect this bit to be the ball-ache its proving to be π¦
turn that into 3000 words with a practical project and I'll take it π
wait you can get away with just 3000 words for a research project?
I should be milking that as a side gig
we had the choice between a 6000 word dissertation, or a 3000 word research report with final major project.... initially I was going to go for the dissertation but then I thought this would be "fun"... its now the fourth UE4 project I have on the go and its all getting a bit much..
"they adjusted their behavior to get along with the bugs in the software"
sorry for the spoiler
6000 words isn't that bad either. my dissertation, with a practical project and a full study was some around 35000 words
not that I'd wish that on anyone
jeeeeeeeeeeeeeesus! π
This feels like I'm also doing it wrong
ironically, the blog I've been keeping (as required) for one of the other project has just hit 20k words.... not that they'll actually read it... as they've alread advised...
still two months left on that one too...
π Drop the map part into a function. Create your map and return it.
i think one problem may be that you seem to have items which share one object/name but have different effects
for my emergent tech module last year I did something similar with a platformer game, three modes of play, build a sip/puff device and hooked up the Tobii eye tracker to it all to control the player in the game... that one worked well, had hoped for similar model this time
that's the beauty of being an advisor, you get to do nothing for full pay π
anyway, back to the matter at hand
if your study is design based
Right now I have two items
A Health Potion (with a red potion icon, and which heals 20 HP), and a Magic Potion (with a green potion icon, and which replenishes 10 mana)
which it sounds like it is
focus on things that make the design experience better
so in this case ensure that you have consistent and intuitive results for the player
e.g. don't do the +1 offset if they don't fit perfectly in the grid
because 95% of the time
they won't be perfectly in the grid
I'm basically using the game as a way to extrapolate some data that I can analyse etc... laymens terms (which would just be easier all round without all this academic stuff) - "was the game more fun when you could break stuff"... etc
I did have them fitting to the grid, and perfectly... it was just about the calculation of when to do the offset really... e.g. the "next next" not the "next"..
the modulus thing worked a bit...
but was if they were just 0.3 or more into the box, use the next one..
thats when I change the size of the player to be the same size as the sprites used for the environment, because i assumed it would then be effectively half way or more - +1 offset...
my point is not about the technical aspect here, but rather that it wouldn't be intuitive, and considering the probability of the cases, you'd be stuck with the +1 behavior for the majority of the time
at which point you could as well just always make it so it's +1 and have all your troubles go away
kinda feel like I'm going about this all wrong (again)...
well yes you're trying to account for the wrong edge cases
players will be overlapping grid spaces for the majority of the time
feeling a bit lost now.... not entirely sure where to go...
well choose what option you want to go with: either stick to the initial plan of having the next grid square be filled and handle collisions one of two ways, or always spawn the blocks +1 grid tile away and forego all of the issues. just don't get boggled down into the idea of trying to do both
its technically a blueprint question: what does this red border mean? i have 2 animations, it appeared somewhere
I'll go back to it and see what happens... thanks for all of your time, it is massively appreciated... feels like something easier thrashed out (to help my brain understand) over a beer with a notepad and pen...
here's a virtual one for you anyhoo... πΊ
I don't think I've ever seen this before... what kind of blueprint node has this type of graph?
Done several dozens of UMG animations and I've never seen that. O.o
(Had to step away from the computer for a bit, only just seeing this)
I'm not entirely sure what you're meaning, sorry
Its a widget
sorry still new to this, ill get there with some time
hey gang, looking for some advice -- i'm making a simple Beseige clone as a learning exercise (basically a physics-driven block building game). I have a handful of blocks that can be attached together, and some blocks have things they can do upon player input (a motor block starting to spin when the player holds 'W', for example). I'd like to be able to specify arbitrary per-block keys for these actions at runtime (player selects a block, it brings up a window, player can assign keys to the various actions of the block). I've been poking around with ue5's Enhanced Input to help tackle this, but i'm still not sure the best way to go about it (it sounds to me like i'd have to create an 'inputAction' object for every potential thing i want a block to be able to do, which is fine if it's the way it needs to be done, but sounds messy). can anybody offer any insight on how to tackle this (structurally) without it turning into a heap of spaghetti?
okay, what can you suggest to make floating damage? thanks in any case!
im learning so itll be maybe better I use the better system?
what do you mean floating damage?
some numbers above enemy's head to indicate how much damage was made to it
im reffering to this
why is it dead?`cause I assumed its dead cause there is a better system (analogy: niagara new, no idea about the old name, some particle system, which is a little old thats it π .)
#umg is the realm of widgets
you're welcome, another satisfied customer
I have these pickups in place (white one is health, black one is armor). They work as they should, but I want the player to be unable to pick them up if their health/armor value is already at 100.
this is the event graph so far
wheres the pick up button
they're immediately picked up once the player overlaps with the collision
on event tick
Well, I finally figured this one issue out - the problem wasn't in the add to inv function, it was that I changed the variable type and forgot to fix the values on the items themselves. Oops.
make a branch and for the condition get the players health and then float <= set value to 100
make a bool ''can pick up''
set it to false in the false and true in the true
then at the beginning of the overlap do a branch and condition get can pick up and like the rest of the code to true#
Though unfortunately I'm still confused by what you meant here
Upon compiling my character, all my assets disappear, Aswell as that I'm getting errors from my event graph not being able to find objects. Anyone know what's going on here? Is this a bug?
Your inventory system makes it somewhat hard to do this. Basically the idea was to condense your data down to a name and integer. But hooking that back up to your icon and name would be difficulty. Normally you do this with a key for the item. Basically you would pass your widget nothing but a key and the amount. The widget could look up the static data like icons and name through the key in a datatable or a dataasset.
you need to set Attenuation settings in your sound node in order to make sound change according distance
Trying this worked as far as putting different entries for items with different names, it looks like. I'm just not sure how to get the number to display properly
@small halo you need to create one then feed it into you node
Maybe at this point it would be a good idea to restructure my inventory setup.. I keep getting myself stuck.
Though I'm not exactly sure how to restructure it
Okay will do thanks mate
Singleplayer game?
Yeah, singleplayer
Is there a state machine for 2d animations or do I have to build one myself?
probably you'll have to build one yourself. but maybe you can hijack the animBP for it?
First stop would be understanding typical key types. Things like FName, Integers, GameplayTags, etc. All of these are basically integers in some form or another that makes them insanely fast for lookup speed and comparison. You identify your items with these.
So Health Potion could be any one of the following
Integer Item ID = 30
FName = HealthPotion
GameplayTag = Item.Consumable.HealthPotion
Understanding key types lets you link other data to your items without having to have it in the actual struct. This way your inventory struct is very lightweight and only contains gameplay data, like how much of something you have, or how much durability of it you have, or it's quality type.
This leads to you have two separate structs for your items. Using your currently inventory as an example.
ConsumableItemGameData
ItemKey = GameplayTag
Count = Integer
ConsumableItemDisplayData
Name = FText
Description = FText
Icon = SoftObject Texture2D
You can either make a datatable out of the ConsumableItemDisplayData, or make a TMap array of it in a DataAsset. Either of these are static objects you can just simply get in your widget with no need to make a complex system for.
In the object you create that you send to your listview, you would just pass it your ConsumableItemGameData struct which just has the ItemKey and Count. When the widget has this, it can use that ItemKey in that struct to retrieve the Name, Description, and Icon from the static datatable or data asset.
When you pick up an item, instead of straight adding a new struct, you will instead iterate over the current inventory of consumables. If you have a struct in the array that already has an ItemKey matching the one you picked up, then you just add one to that array index. If the entire loop finishes, you assume you don't have that item and add it as ItemKey and Count = 1
On your items themselves you don't really need more than the ItemKey.
@high sapphire
So if I were to use gameplay tags, it'd look like this, give or take?
Item.Consumable.HealthPotion
Item.Consumable.MagicPotion
Item.Weapon.Sword
Item.Weapon.Mace
Item.Armor.Helmet
Item.Armor.Chestplate
Item.Accessory.Ring
Item.Accessory.Mask
Item.Generic.FlowerPetals
Item.Generic.IronOre
Sure. You can set their hierarchy however you like.
Gameplay tags would probably be the easiest way for me to mentally parse things
Though I don't think I've worked with gameplay tags before, unless I'm misremembering
they're pretty handy, definitely worth looking at
Hi hi.
I have a blueprint named bomb and it instance used on my game which when My character shoot a line trace to it, it could be explode.
I used cast to bomb in my character blueprint to get refrence of bomb which I need for give to fire impulse of my bomb when line trace hit bomb. but when I hit a bomb, the hitted bomb won't explode, wrong bomb explode instead that not hitted.
How can I get a refrence of my bomb blueprint on my character blueprint and use it for all bomb?
Unless this counts as a gameplay tag?
Make a new property and look for GameplayTag.
GameplayTags are one of the most fantastic ways to organize data. They're basically just FNames with a bunch of coding around them that allows them to be tiered in a hierarchy. And they all boil down to integers, which makes them very fast. Not relevant here but they also replicate extremely efficiently.
The only thing I wish gameplay tags is missing is strong typing but oh well can't have everything :D
Property as in variable, or?
Doesn't look like anything is coming up?
Your line trace will have a "out hit" coming off of it. The "hit actor" would be the actor that would have been hit by the line trace. If you cast that "Hit Actor" to your bomb class, you can then call the bomb explode function from that. You may want to look into interfaces here though, as different objects may want to react differently to being shot at, so then you implement the interface on any objects that you should be able to shoot and they can determine each what they do rather than having to cast to different classes on your character.
It's a type, like boolean or integer
Oh, that explains it. I thought it was a property of a variable, my bad
It also looks like they can be added in the project settings themselves - or are those meant to be used for different things?
There is also a built in interface called "Apply Damage" which will pass a signal to "Any Damage" that you can implement on the target being hit and allow it to respond to being hit by damage.
That's great answer. thank you
GameplayTags are prespecified types. You add them to your project as you need them. Once added once, you can use that tag anywhere for what you need.
So adding them from project settings and adding them from a variable, either way they get added and can be used?
You can add more of them whenever you access a gameplay tag field.
When you add them to the project, you're adding them to an ini file. Think of it like a predefined name for something.
Seems mildly tedious at first. BUT THEY ARE SO AMAZING
They're only so good as you can keep them organized. I am struggling with that myself XD
Is there any difference between adding them from the Project Settings section and adding them from somewhere else? The fact that there's a dedicated section in Project Settings implies those are globally accessible, whereas adding them from a specific Blueprint - would they only be accessible from that Blueprint?
They get added to the ini file wherever you add them. They are globally available once added.
Ah, okay
I can relate to this π
So, like this?
Yep.
So if I want to assign a GameplayTag to a specific Blueprint, is that done by giving it a GameplayTag variable and giving it the value of the tag I want it to have?
Probably stick one more layer to it
Best part is that you can use the tag to do stuff too. π Like, if you wanted you could have a function that switches logic based on the parent tags.
If ItemKey->MatchesTag(Item.Consumable) ConsumeIt.
ElseIf ItemKey->MatchesTag(Item.Armor) EquipIt.
Since you can filter based on tag or tag parent etc π
I couldn't get it in the screenshot, but Sword = Item.Weapon.Sword, heh
I was only introduced to GameplayTags today
But dang I can already see a lot of potential
Is this assumption correct?
(This is the parent object that I'm having all collectable items derive from, for instance)
Yes, you can do that if you intend on using that variable to check what the item is.
This is genuinely really cool, and I'm upset that I didn't know about this earlier, heh
This leads to you have two separate structs for your items. Using your currently inventory as an example.
ConsumableItemGameData
ItemKey = GameplayTag
Count = Integer
So for tracking how many of an item the player has, I make a map variable of GameplayTag:Int?
Cant have gameplaytag as key, can you?
Also if its stackable to something less than max int, and you want several of them in the inventory, you kinda need some unique identifier to the stacks
It either being in an array, were ypu can have several of the same "key"
Or some custom struct with an id .. which.. gets us back to an array
Could be a map of index and struct(gameplaytag, int) tho
Index being slot nbr..
(I'm going to be afk shortly, though I will be bringing my laptop with me and getting back to this chat so I can continue fixing my inventory system
Thank you to the people who've helped me so far!)
I used interface and works great. but another question is how explode bombs near the bomb exploded?
how exactly? can you explain more?
hey yall im curious on what might be the best way to achieve a fog of war
also hi how is everyone doing
I may be wrong, but I think people use a texture and paint the bits you reveal and then leverage that to render the fow
Something like that.
this is a very very generic simplification but
Post processing material effect is the short answer
uh in what way
Using depth fade to mask out things beyond your given range.
There are tutorials on youtube or examples on the marketplace
pretty complex thing to do
im a complex man
i think i might do
hm
im looking into different ways
cause i could do the way daekesh referenced or a line of sight it seems
Anyone knows how to create a script that renders and unrenders layers while taking a picture?
i think i might do line of sight and extend it from the player in every direction? im creating a moba so
that seems like the accurate way t o do it
I think a material based solution might be faster
although
it's not cheap when it's BP based
given that it's tile based render targets
hello! i got a pretty newb question. im trying to recreate sonic adventures on ue4 and am looking on google for a tutorial on how to do that bit where the coins "drops" from sonic after being damaged but cannot find any. any tips on how to do this please? say for example my character has collected 10 coins. gets damaged, coins go back to zero or any number i choose and the coins drop away from character. thank you!
Depends. Do you want it super high resolution(polygons) or more general (grid based)
Visualizing it is the easy part. Generating the data is the hard part.
@glass magnet This is the approach I'm using.
You'll want c++ or it'll be a bad time
and that looks like polygon based?
Also read up on generalized cell based FOW. I haven't don't it but there's a million write-ups. The LoL approach seems to just do some fancy post processing on it.
What would be the proper way to convert something like a look at rotation in to velocity for a Projectile movement component so it goes in the right direction as there seems to be no option for it
where could i find something like this
Hello,
Do spline meshes not have collision in packaged builds?
if they are generated at runtime
Hey, I have an actor speechbubble that is saved via reference in another actor. Now what I want to do is access the function setAlpha inside speech bubble, but the variable is saved as Actor, and when I try to cast Actor to SpeechBubble the cast fails, does anybody know why?
wait just to confirm for myself, they essentially just used anti aliasing to break the pixels down and reduce strain created through resolution upscaling?
Get the forward vector of the rotation
this is just curiousity tbh
But you can do this without bringing a rotation I to it. Normalize(Target - Muzzle) gives you the velocity
Or the velocity direction rather. This won't solve for gravity though
I figured it out, my brains are mush today, ty tho
also it looks like riot uses grid based ofr their fog of war?
Games? We make spaghet
I think I made a function for this, lemme open VS
Hey guys, I'm probably rarted but, How does one when a key is pressed add two floats?
ha that's what I did
except check for whether world is null
maybe I should
also just noticed your library name lmao
float + float
like this, sorta?
Exactly
ah ok, thanks
I want to apologize to @spark steppe and @obtuse herald. I'm sorry for causing you trouble. I wasted your time because I forgot to mention I had clamped the speed down and that is the reason why it wasn't going up. After so many attempts of failing and all I did it. I want to show you my success thanks to your help with my stupidity.
I multiply the clamped min speed by a set amount and every on hit it calls back to it
so you got rid of the loop and it works as expected?
yes
nice
don't worry, probably happens to all of us
because nobody wants to get called out for terrible code π
that^^ and c++ stuff often is more complex than some BP spaghetti
i don't want that someone has to crawl through 300 lines of code, to maybe figure out the issue
300 lines of code is an entire subsystem for me π
yea, or a component
CMC having 12k lines as well. I mean I can't vouch for the fact that you don't need those lines, but I'm sure they're not being verbose for no reason
my first big project wasn't OOP, and it's been following me until today....
or I don't know
I kind of lost faith in the engine after seeing how half assed the AI module was
which ai module? AI perception?
I think especially perception and to some extent EQS
I just ended up writing my own system
perception is pretty newish
theres another old AI sensing stuff creeping around in 4.2x
pawn sensing?
yeah that was deprecated
I was talking about perception though
but I mean I suffer from NIH
so it's standard fare for me to remake everything
It looks like I'm able to have a GameplayTag - Integer map variable
So would adding an item to the player's inventory work like this, using the tag:int map?
Hm, it almost works
This doesn't quite work right either, hmm..
this would be the generally correct way to add things to a map
@high sapphire using add in a map overrides previous entries
I'm fine with only having one copy of the tag, but I want to track how many of the items the player has picked up. In this case, I picked up 3 health potions and 3 magic potions
Or does add not work for that either?
What is the situation? Single playet?
Yeah, singleplayer
K maps dont do well in multi
Maps can only have 1 unique left hand side value
So when you add you clear the previous
Is there a way to add to the righthand value though?
Ie, Item.Consumable.HealthPotion:: 3
Item.Consumable.MagicPotion::3
Add node.
So if you're wanting to increment, you need to get the current value out of the map, and then add to that, then add it back into the map.
Ah, so I was going about that the wrong way. Good to know
So in my case, it'd be like this?
Yep
So picking up the items works, keeping track of how many of each item the player has works
Now to get the menu showing the right values
Not entirely sure where to start, though.. working with gameplaytags/maps is fairly new territory for me
I'm sort of able to follow along what @maiden wadi said earlier, but not entirely
Can anyone help me figure out why the collision on this isn't working? The animation triggers the notify fine. Which calls for traceAttack. traceAttack gets called fine but while debugging it it won't get passed the first Branch for Return Value. Which you can see in the screenshot of the line trace it's treating this character BP as if it's not colliding. Which is why it won't pass this branch. I've confirmed I can hit at least the environment and walls around me, but it does not go passed the second branch obviously since it's not tagged as Enemy.
I've tried making sure the testdummy bp, capsule, and/or mesh was tagged as enemy. None seem to do the trick.
But then again, the trace isn't even detecting it, so probably need to solve that first
@high sapphire i wouldnt use a map for items though. Instead an array of structs.
Oh. So go with Authaer's suggestion of creating two structs - one for the tag + int, one for the name/description/sprite?
is there another way to dash besides launch character? it makes my character "jump"
@unreal tusk print string 1 and 2 at each branches. What do you get?
@high sapphire1 struct is enough but yeah
@barren tide remove friction and launch laterally then enable friction.
So we can see here that it just isn't recognizing my test dummy as something my trace sphere can collide with.
We can see in the second screenshot that the collide works against the stairs, but it won't get to Branch 2 as it's not an enemy.
@barren tide there really isnt any better way. Worst case if the problem is the animation make a bool bIsDashing and if true dony play jump anims
VInterp To
@unreal tusk sounds like your trace channel is ignored
@obtuse herald yeah but it fails mid movement and you have to deal with all movement vars.
Launch resets it
why should a dash fail mid movement?
Figured it out. I had the mesh collision set but I didn't set the capsule collision. 
I meant with vInterp
That resolved my issue.
I actually would prefer VInterp over launch character
but how?
I guess it depends on the game and style
I tried vInterp, launch and 0 friction methods. Only launch wad anywhere near smooth
Was*
temporarily increasing the movement speed can also do the trick
just telling that there are ways that do not include the character jumping
True true
But some of them are so ridiculously complex not worth it (like 0 friction)
how to print impact normal between a value of 0 and 1?
@lusty shard dot product
isn't impact normal already between 0 and 1?
Its a vector so it isnt 1 value its 3
Dot product converts it to a float between 0 and 1 where 0 is parallel
Iirc
Yeah?
yep. im trying to disable placement of a building if the angle is more or less than a value.
I would read up on it to understand what it does. You need 2 directional vectors. In your case the normal and the origin of impact
First google hit gives you a good example use case
Can we add +1 to a struck gor change is state ?
how
set member
^ Set member in struct
another noob question. how do i add this lol. not sure what to look up
select nodes and press c
that is an enum
not that one. the actual pop up
@abstract summit oh god no
ahh
I think you hover over it and click on that small pin
at least that how it works for nodes
so i can't ?
by default the bubbles show up when you zoom out
@abstract summit no no your nodes are all wrong
doesnt work on the one i made ; -;
@barren tide compile
can tell me how
Click on the comment in question. Make sure "Show Bubble When Zoomed" is checked.
@abstract summit get the variable for level then do +1 and link that to set
I am not at computer so i cannot show
yeah, you need byte add
but that only works if your levels are synchronous with the position inside the enum
oo that bubble thing worked thanks π
thansk you
is there any way to mess with the angle when I add an impulse?
Hi. Whats the logic wherein if you aim to an ai he sorts of dodge the moment you aim on it?
I assume if you can get a check that character is aiming and the linetrace hits its head, you play a rootmotion dodge animation? But how can we do that without triggering the fire logic and linetrace? Do i have to make another linetrace when aiming? Thank you
Yes, you'd need to be doing a line trace while aiming to which you could then use the hit actor reference and make that actor do something when the aiming trace hits them.
alright thank you so much, im glad I am heading to the right direction.
is there editor Console command to stop all shader compilation ?
No
I have a debugging question. I am relative new to unreal and I am currently playing with character movements. I used the ThirdPerson Template and moved the camera to the head. To have a "real" first person. However I did not attach it to the Mesh head parent. Because I got dizzy from the head bobbing / camera movement. I also set the controller rotation yaw on the class and use pawn control rotation on the camera. when i move with A S or D i get rubber banding. I don't get it on moving forward with W and turning with the mouse. What could the issue be ? What is the best approach to debug something like this? The last changes I did were not concerning any movement. I switched off anything custom by myself removing the connections...Could it be in regards of the animations? They are the default ones.
Now that I have one struct holding all of the values, and a datatable to do the same.. I'm still not entirely sure what to do to make the UI work and to save/check/add to what the player has in their inventory
In particular, I'm not sure how to approach this part
In the object you create that you send to your listview, you would just pass it your ConsumableItemGameData struct which just has the ItemKey and Count. When the widget has this, it can use that ItemKey in that struct to retrieve the Name, Description, and Icon from the static datatable or data asset.
is it possible to get the rotation of a bone at a specific time in a montage thats not playing yet
hey yall
im trying to follow this documentation on grid based fog of war
in this picture
what would be get local commander
When you pick up an item, instead of straight adding a new struct, you will instead iterate over the current inventory of consumables. If you have a struct in the array that already has an ItemKey matching the one you picked up, then you just add one to that array index. If the entire loop finishes, you assume you don't have that item and add it as ItemKey and Count = 1
Would that look like this, roughly? @maiden wadi
im looking in an actor blueprint class but is it not in there?
Your inventory doesn't need to contain all the data about every item - just the gameplay tag and quantity would probably be sufficient as the data for each item would be stored in data tables. The data tables can have rows set up with names that exactly match the gameplay tags you created. This allows you to convert the gameplay tag to look up a specific row on the table to pull the information.
You could also separate each of your data tables out if you wanted, you just change the data table you want to look at based on the tag.
Your inventory UI then is just a series of a specific type of widget that just needs to know which inventory slot (ie. the index of the array) that it needs to look at, and pull the gameplay tag from it.
Once it has the gameplay tag, you can fill in the details where you need them, such as setting the text box for the display name, setting the image for the icon etc.
nvm i didnt read it correctyly
I solved it by using "Use Controller Desired Rotation" on the character movement component
To add to the inventory, you do need to increment it something like what you have here, but structures don't quite work like this. You need to get the copy from the array, increment the quantity value, then set it back in the same index of the array.
The below example is how you can increment within a structure, but it's still not full proof as you need to be able to add items to your inventory even if they are not found in your inventory, so there's a lot of booleans involved and different functions involved to build up the inventory. The idea being now though is that your inventory is just an ID and a quantity and with that ID that you can then use to look up the data you may need about your item and then control how that item gets added to your inventory.
ey yall how can i get an update of when a characters visibility changes?
I'm not entirely sure what the slot data variable is for, in your example
Its just a temporary local variable. Any time you get a structure from any array it is always a copy, not a ref, so you cannot set values back into the array directly. By using a local variable it stores the copy so that I can the modify it before it gets reinserted into the array
Ah
Weird, when I try to do the set members in [structname], it doesn't show quantity, just struct ref
Unless I'm doing that wrong too, which is a distinct possibility
Ahh, that explains it
Though, it looks like trying to print the contents of the player's inventory doesn't work anymore.. which is odd
hey guys im trying to figure out how to make an event dispatcher fire whenever the visibility of my character changes but I cant think of a way to figure that out
Doe's anyone know why when I try to test Listen Server for 4 Players it doesn't connect each client?
Shouldn't each Client try to auto connect to the server?
These 4 clients are on my same network btw
Cant you just make a dispatcher and call that in thr function that toggles the visibility?
right- ok but
damn it yeah ok
mb
x.x
can someone help me understand a fog of war i cant
i wasnt quite able to understand the article that someone shared and translate it to my project
Is it possible to find a print node from the console? As in, get print node printing specific value? Because I've gotten sloppy with my placements and now I've got some noisy b@stard singing off every frame and I canne find him
AH, it worked. Vent, and then ye shall find it.
by default, How often does Garbage Collection run?
Is there a way to know when gc has run? like print string or something?
this is my issue, in case anybody here knows how to fix it, and is not watching physics chat π
Thanks for the reply, I found a solution that was casting to the player controller and do the logic there. Logic doesn't work I site widget for multiplayer π
How could I "get" the material of folliage instances. I am trying to set a parameter in the material
@short pawn get materials?
or maybe get material index, and then type the name of the slot for the material
however, i thought you had to create material instances to be able to modify values on the fly
@magic parcel thanks but It was for folliage instances. i got al the folliage instances but for somereason i couldnt create dynamic material instances of them like regular actors
hm.. interesting
@magic parcel I just decided to go a different direction thanks for trying to help
all good
I know we were using material instances for ours. (this was a bit ago) so good to know you got another way
β€οΈ
I'm re making a scene from death stranding and i wanted all the folliage actors to turn black
instead I scaled them on the z down to zero with a timeline to make it look like it was withering
oh... nice
i was doing something similar a bit ago
when the player walked up to the stone (altar) and placed an object there
the object would randomly change the environment to match the item placed on the altar
so it would need to change the dynamic material variable for colorVector in the base color node
sounds cool, bet it looks great!
material code is where I actually have fun π i think I would enjoy being a technical artist
Does a ForLoop within a function automatically limit what is being looped to the end of that function? I just noticed I hadn't closed off a loop properly and didn't notice any perceptible change in performance. I wasn't sure if it would try and loop everything on the exec line from the eventgraph thereafter, I guess not!
You can exit a loop early by returning from loop body
If you only return on complete then no, theres no automagic optimization going on (there isnt in either case but one can potentially be way faster than the other )
Exiting early means the rest of the loop wont be executed
So if I call a variable stored within the loop body anywhere on the eventgraph, it'll close that loop?
Not really no
For it to end, you must call return
The circumstances around when you can call return depends on the functions purpose
It loops for what you define...
You can only choose to break the loop earlier, but that has to be done manually.
^ exactly this
Ah sorry I'm an idiot, it's actually a ForEachLoop I am using
Can break that early aswell, if you want
WHen you say call return, you mean the function and not the ForEachLoop?
Yes
Well I'm not actually returning values with an output pin but I am setting values within the function that are being used elsewhere. Is this effectively the same?
Calling return will make it stop whatever it was doing in the function
Well it doesnt matter if you return something or not
If you found what you were looking for, or did what you wanted to do (and know that the array doesnt interest you anymore)
You simply set the desired variables, and call the return
Most to gain in search functions
If this was for... equipment stats, you usually cannot skip out on doing the entire loop
I feel like I'm being stupid on something basic that I've glossed over, but when you say call return what does that mean without a return value?
Not quite the same
When returning values, you decide what to do with those values. Otherwise you are just straight up changing data from the original.
Edit: both have their uses cases tho.
In functions you have a return node. This effectively tells the process to return from that function and move on to whatevers next
Right so if the out exec line is plugged in, that is returning the function?
I guess that means a pure function (which I haven't touched yet) can never be returned?
oooh, in bp they don't have an exec out though do they?
They basically start and end in between your last and next nodes
It's pretty much the same as using no pure in the same place.
Pure is just a promise not to change anything inside it
Their use case is mostly just to keep things more readable and clean.
Yeah this function isn't modular as a result but other functions where I do return values can be used for multiple tasks
Ah gotcha, so a pure function is mostly for safety?
Sort of, yes
Using pure nodes should mean that calling this will not alter the state of whatever it belongs to in any way
Atleast thats how i think of it
I just don't like using them in general, gives you less control over things π€·ββοΈ
There are drawbacks, especially in bp
Using pure nodes means you cant cache the result directly in the node
The function will be called again and again for each pin connected to it
While if its not a pure function, the return value is cached
Good to know. I had looked it over briefly but it didn't seem like something I'd be making use of
The more you know
Thanks you two, sorry it was probably basic stuff with the ForLoop. I haven't quite fully understood how I'd implement them in my project yet. So far I'm basically using a couple of ForEachLoops to check controller thumbstick positions in relation to each other (both pushed in same direction? At roughly the same length? Same or opposite directions?).
Doesnt sound like something one would loop π
Probably not, but I wanted to try it out at the time!
Valuable to experiment :)
I need to just read up and look at some examples, I just haven't thought of ideas of what they'd be used for.
And yes experiment π
This is why I'm always saying blueprints isn't different to actual coding π it's the same principles
Inventory lookup , adding etc
Yepp, definetly. Its somewhat equal to what ladder is to structured text in plc programming
It's nice having lots of maths done for you with nodes π
Visual programming
What math? xd
The math functions exist in pure code as well, they're in the engine. (and often even built into the language)
Ah so I guess if you were using something like VisualCode or Notepad++ you'd get auto-fill optiosn if you typed in "cross product" (or whatever c++ wording you need to use!)
(If you can't tell, my written programming experience is severely limited. Did a bit of HTML 4 back in the day and that's about it :p )
Yeah basically whatever exists in BPs, exists in C++ as well (and even more stuff that's not exposed to BPs)
Nice. I'd like to give it a try at some point, for this first project I've opted to stick with bp unless I cannot find a workaround for any roadblocks I might run into. The only thing I encountered so far looking ahead that I thought I might need would be physics forces being applied at substep level but I recently was informed there's a plugin to allow that at bp now!
It's the only plug-in I intend to download though, trying to keep everything as vanilla as possible
Well yeah a lot of things have plugins which just add extra nodes that do the logic through C++
Which is something a lot of people do, they write some logic in C++ and use those nodes in blueprint because they like the workflow more
Thats what i do ^
Recently started with c++, so converting my project actor by actor was a nice start
This will work if you add a return node after that ++ I think. You want to do either or. Also you can't do that from the loop, as the loop is passing back a copy. You have to use the array index and if Array Element Tag == InputTag Get ByRef the struct from the inventory and set members on it, checkbox the amount, and use that to set the struct's current amount +1
There's a export asset context menu option in content browser which exports asset to *.COPY file, I exported a material that way. Do I get to import it back? the import asset menu doesn't show COPY file in the known file list.
Unreal's material assets aren't interchangeable with anything else, so don't bother.
If you want to bring it to another Unreal project, use the migrate feature.
Hi, I would like to know if it's better to make a variable for the component to use (I'd put it just after the event), or if it's better to let it like that, or wouldn't it make any difference ?
I want to know what is more optimised
can't migrate, the two projects aren't in the same pc
In that case have to copy the whole project
Yes.
Or copy the .uasset file if references to other assets be damned.
yes, the material is pretty much self-contained, doesn't use any material function or texture, a procedural one
Looks like the export is pretty much useless then, maybe this is for taking diff or something.
bump
Timeline + some method of interaction
Overlap setting interactable object, which responds to an interface, f.ex.
Would that (at least kind of) look like this?
Sort of. You don't want to do that with splitting the struct though.
For example, this will let me change just the blue in a linear color without affecting other properties in the struct.
Make sure your Get on the array of structs has the diamond output, or else it'll be a copy.
So something like this?
I think you can modify the struct directly by that reference ? Or perhaps memory fails me..
You need to get the array index from the macro
Maybe it's the ~3 hours of sleep I'm running on, but I'm not entirely sure I know what you mean by "get the index from the macro", sorry
Ah
Yeah it's the ~3 hours of sleep
Hm, am I doing the print-inventory-contents part wrong too?
Looks fine.
Hm. Maybe my mistake is here? Not sure why the tags are showing up as "none" and the number is showing up as 0..
Also looks fine. Have you set the tags on the items you're picking up?
Yeah, I have
Hmm.
Three health potions, three magic potions, three swords
I also did create the data table, but I wasn't entirely sure what to do with it/how to use it
Oh, the add thing at the end here.
This add on the bottom right needs to use the tag and amount from the function parameter, not the loop.
Also,
Om the macro
You van make a custom one, identical to the original,
Except swap the internal get copy with a get by ref
Saves you extra get'ing
Yeah, that was it. Thanks, kinda miffed at myself for not catching that heh
That's a fair point. I don't think I modify structs much in blueprint. π
Though.. that also means I shouldn't use the others in the loop either, doesn't it
So is that where I use the datatable I made?
I try to do a smooth crouch. works fine locally, but when the server sees the client or the client sees the server when crouching, it goes through the ground. what am I doing wrong
? camera shake will be on owning client. don't look at it
;p
You can actually do one better with this table and use the Tag string as the lookup name. There is a Get Tag Name function for GameplayTags that'll convert their tag to an FName that you can use on the GetDataTableRow function.
E.G.
So like this?
Sure. But it's also worth noting that storing them here is pointless. You don't need this data until you get to the widget.
Only thing you need to store here is the tag and amount.
So I can turn the player's inventory array into just the tag/amount, and only worry about the sprite/name/etc. for the widget, and I'd still be able to connect the inventory stuff to the saving/loading system?
And now I'm trying to remember how to set up the object/widgets
Yupp
i have a question about bp and object oriented thinking.
The way I see it is let say if enemy is an object and projectile is too, and enemy shoots this projectile, the enemy is the owner of the projectile object, and the bp written for this logic is in enemy event graph correct?
And if that projectile hits something, who knows about it*, the projectile or the enemy?
*here i mean where is the bp written?
Projectile would know
Owner could be registered to a callback if desired
But does owner need to know? Probably not
Projectile likely only cares about what it hit != owner
where is the logic for the shooting then? in enemy, this needs to know and so does the enemy, does this make sense or would you do it otherwise?
You pass an instigator to the weapon. Weapon passes this to the bullet. On Damage, you pass this to what was damaged. What was damaged handles itself based on the instigator.
Even that can be checked against tags...the bullet doesn't even need to know the owner at all really
ouch so you break down even that far, makes sense, so it is okay to think this way i guess, i always disliked the idea of something happening inside of something else which has not much business with it
It doesnt need to, but its a default pin so ... π
ah i see, this is interesting
so its okay to let hp widget of player and bullet "communicate?"
No.
Player, gun or bullet should have zero knowledge of said widget.
Widget knows about Pawn, pawn has health, widget displays this. Pawn doesn't care about widget. Bullet is instigated by gun, gun's instigator is it's pawn. Gun fires, passes instigator to bullet, bullet calls apply damage on other pawn, other pawn does damage processing on itself, widget updates on it's own.
The only communication from the hit point bar should be it grabbing the current health from the player pawn... The pawn shouldn't know anything about the hit point bar
Okay, that is cool, totally "imaginable" cause thats kinda how itll be in reality if we just apply values, thanks alot guys
Gotcha
This is of course generic and based on hud hp bars...of course if your game does some fancy functions that require the player pawn to know ..such as attaching it as a child and floating it over thier head...then of course the pawn would hold a ref...
Hm, it looks like the setup here kind of translates to the new structure.. but not entirely. The widgets aren't spawning in the list
Hm, still not quite working..
The individual widget (the green bar) BP:
The list (which spawns the green bars) BP:
hello, some one can help me, i can't do the character look his head at specific location ... i tried this:
I refresh the question/problem
Yeah, no matter what I try, it's still not quite working the way I want it to.
Also, side note - I'm not sure how to make it so that different categories show up as different lists.
is there any way to get "input mouse wheel delta (how far the mouse wheel has moved/scrolled this frame)" equivalent of "get input mouse delta" node?
i'm pretty sure i've used it some time ago, but now i don't remember the name of the node, is it even possible to get it through a player controller ref?
I'm not sure, but I'd think that would be an input event, like clicking
i want to implement the input in a widget bp. the "listen for input action" does not work with input axis, the only node that works in widget is this "get wheel delta" but i requires a "pointer event structure" ref (not sure how to use it)
why is my char moving with animations to left right? i just have a normal movement ?
don't use actor's rotation to determine the forward and right direction to move. use controller rotation->break rotation->make rotation (with only the yaw input plugged in) -> get forward and right vector from that
this is how mine is setup
Or split the vector output pins and skip the make break nodes
There is a ThridPerson Template
Define "make your own"
You mean assembly the peices or extend an actor class to make a new custom character class from scratch?
Thank you very much for the answer! π
Welp, is there not a single way to get mouse wheel delta inside of a widget in UE4? (Epic bros what are you guys doing)
now i have to make an entirely new actor class to handle mouse scroll just because i can't get a mouse wheel delta inside of a widget
Why not just have it in the player or controller where you spawn the widget?
yeah that seems like the only option
i want to disable movement input in the player character, that's why
Controller would be the place to do that
ok i'll try doing it in the controller class thanks!
To be specific, I mean you can call enable/disable input on the player from the controller as well as spawn the widget and pass it the relevant information
i was doing it inside of the widget bp since most of the input bindings are there, guess i'll implement in the player controller
I suppose that'll work, but generally speaking isn't "proper".
Armor pickup's mostly set up, but I don't quite know how to set up the logic to make it absorb damage.
in your health component, have an armor stat and have a formula for how that relates to health loss
yep sorry i meant "i **was **doing it in the widget bp" but now i don't have to do that there, thanks!
Hi! quick question, enumator lower value As Byte (To Int) = 0 or 1?
Are you asking what the lowest value is, or if it will lower it on conversion?
ty
anyone active here?
you mean in the player blueprint?
I mean where ever you deal with health
I can't get this tutorial to work on ue5
https://www.youtube.com/watch?v=_Sdm_gsbaos
anyone know why?
Basically is a sun rotation controlled by a slider
Creating accurate and realistic patterns of sunlight and shadow is critical to some scenes, especially for large architectural and construction projects, and Unreal Engine's Sun Position Calculator Plugin provides a method to do this. In this Unreal Engine tips and tricks video, you'll learn how to modify the time of day with a slider during run...
sun position doesn't update, yet I get no errors on console
UE5 is early access, I wouldn't expect everything to work. try the UE5 section of this discord instead
Is it good practice to add recoil to a Player through SetControlRotation? Maybe there is a better solution?
I dunno. "better" is subjective
I'd personally do it through a timeline as it would be easier to gauge how much recoil to add. equally I don't know if you automatically want the recoil to disappear after each shot
I'm really curious how it's done in Valorant but there is not much info on this or recoil in general...
probably for good reason? it's proprietary, they don't want to show you their secrets
Yeah, it's obvious. I also tried to find any good Recoil tuts on UE with no louck. I'll try to dig Unreal Tournament source I guess
is it possible on a blueprint cast to level bp? i have a variable on level bp and i wanna cast to level to then set it.
You cannot access the level blueprint from anywhere else in the game. This is intentional, because you should not be doing logic in that blueprint that is not extremely specific to that level.
oh ok
i setup the enum actions there?
where is supossed to setup my enum?
@maiden wadi
You mean controls. Those likely go in a Pawn or Controller.
Judging that it affects a pawn, I'd say it should go in your pawn, or a base class of it.
Generally speaking, level blueprints are terrible places to do any form of gameplay logic. Reason being is that you'd have to copy it into every single different level you make.
That definitely looks like logic for your player
i just set the enum actions i already found a solution
On todays episode of simple things google wont tell me, how to I get left vector?
no, reflection in general is limited in UE. there's the CreateEvent node used with dispatchers and timers, but that's about it
I just learned now that we can use rep notify on single player to change variables when it changes value like health or stamina
yeah but that's hacky
thought it was that easy, thanks
Ow what do u mean?
you're trying to use engine specific functionality meant for other use instead of doing it properly
there is, but the CreateEvent node is better
you can use it with a select node
but generally what you want to do is bordering on not possible within the scope of UE
yes you do. but that would still be the case for any string based function
you can't call a function that doesn't exist
Call Function by Name
yep
Wouldnt this work ?
I'd strongly advise you to try and find another way of doing this
instead of banking on reflection doing the work for you
Im sure ive seen it ouside vcam
how can i check if a button is pressed twice? can i create a float that will me more 1 every time i pressed?
has anyone ever had an issue with spline meshes where the material defaults to world grid material, even if a different one is set on the mesh?
Have to check that manually, with a delay for how much time in between presses
I haven't, but maybe people in #graphics can help you more
ok thanks
can you do an exemple pls
is there a "stop" node to stop doing multiplication?
because I have it gaining speed but I want to set up something that when the velocity equals a max speed it goes into a branch which then fires something off that stops the multiplying event
is there anything that can stop an event mid go?
Hi guys, Question. Is it possible that in a loop where im instancing meshes, ie roof tiles i can "code" an exception to instancing in some kind of volume? I would like to instance roof tiles(which i already did) and in the place where i put my roof window i would like for this code to not instance meshes, so my window is not layed with tiles
ok thats good, but i want to make that only go to other animation if i pressed 2 times the button. How do i do that because on transition i cant put what you make up there
Sure. Just figure out what the rules are for when you don't want the tiles to be added, and use a Branch node to not run the tile generation for that part
@trim matrix have a greater than on the multiplication then feed that to a branch
it should check if location of next tile is in volume area if yes, then break
how would I stop it?
i will look into this
I get that when it's greater than the max speed it fires the branch
but how do I stop it?
@trim matrix have the branch be before the muliply
when x > value branch it leads to not multiply
what are this error
@trim matrix yes
π glad to help
anim notify
yeah, I haven't worked much with BP
I apologize
I am bouncing a ball everywhere in my project
I'm sorry
I have a problem with my timelines. Some how I made it so the graph doesn't show when I double click on the timeline anymore. The only way to get the graph to show is to make a new project. Anyone have this problem before?
Anyone have any idea how I can cast to whatever target my player hits so that I can grab the enemies armor values? So basically just, Cast To Hit Actor or something. Doesn't seem to be a thing
have you tried casting to this?
@unreal tusk https://youtu.be/6IOgkWv1lEY
What is Blueprint to Blueprint Communication, or how do I call functions or get variables from other Blueprints, in Unreal Engine 4?
Source Files: https://github.com/MWadstein/wtf-hdi-files
Tried branching off it yeah, but I'm not sure what to look for in this case, I mean I could just cast to the "Dyrad_BP" but, i want it to cast to whatever enemy I hit.
You want to use an interface
Ahhh casting, how you load your entire game in the main menu
is this ok for pressing 2 time left mouse?
That's literally what I gave you π
and this error says exactly what is wrong
@mild crystal what happens when you press play and try it?
you have references with no value that you are trying to use
i solve it
it didnt work
are you sure it doesn't work, have you tried printing on true or debugging
Rest assured, the double click is working. Whatever happens when it does successfully double click probably is not working. (Are you sure your mesh on your character is set to use the Flight_AnimBP?)
@mild crystal I'd add a bool off on the True end so it doesn't trigger 2 clicks yet again if someone triple clicks
I am trying to do RTS zoom to cursor, The plan was to draw a line between the camera and the mouse location and move along that. How can I get mouse location but at Z=0?
@upper mortar the convertmouselocationtoworldspace it funny in the coordinates it gives. do a print string on it to see what is really going on
i saw that it was giving location very close to camera
The values in the time line is length 2.0 sec and at 0.0 value is -180 and at 2.0 is 180 and i got this strange rotation .
ok
A timer instead of a delay to have more control, but pretty much same principle with addition like unrealwater said
(I forgot to set the bool to off in first example)
Have you tried 0 to 360? Altho I'm not sure why you are using a timeline for rotation of a coin which is probably constantly looping
You could just add rotation based on tick deltatime, with a certain rotation speed
ey yall quick question about line tracing, Im trying to set it up right now but whenever i move my character it moves them in a weird way instead of staying stationary, does anyone know the reason for htat
It's one way of doing it, but since you are basically having it loop infinite and just add a constant value there's not much use in it
When you would instead have it follow some sort of curve over time or have it stop here and there, timeline would be more useful
it is just giving me the location of the mouse on a plane 10 cm in front of the camera
Show context, how did you create this line trace?
@upper mortar yes
I'm still stuck on this, I don't know where my mistake is/mistakes are though
multiply that vector and it should hit something eventually
π
the world direction vector?
@timber knoll should i use event tick ?
End needs to probably be Location + the result of multiplication
That would for sure be the easiest solution
@upper mortar camera positon - mouse world x 1000
yeah youre right its + i put multiplaction thats dumb of me thank you 
at this point I just want the Boolean to switch to true when the enemy sees the player
#gameplay-ai for perception etc π
oh, sorry
i love you man it worked
thx