#blueprint
402296 messages ยท Page 413 of 403
can anyone help me with online name tags?
There's two steps to solving your problem. The first is making a consistent fire rate, so that the right number of shots are generated. The second is Interpolated projectiles, so that if multiple are fired in the same frame they don't all stack on top of eachother.
The first is easy, fortunately.
Warning, it is loud.
I got a mower, which has a collision box, and a foliage, which collision should I set to the mower, and which to the grass?
@astral fiber I recommend reading up on blueprint communications listed in the pinned post of this channel
@crystal mural I see. You want a consistent fire rate.
That's right.
@odd ember I did very much with blueprints, but the collision thing is new to me
Okay let me think this through. You will want to do this using variables, and not using delays.
exactly why you should watch that video
@crystal mural Do you have a variable that sets the rat eof fire?
because collision is how blueprints communicate
I do.
Is it "shots per second" or is it "seconds between shots"?
One that can be upgraded. It's going to go all the way from 1 up to 400. But now that I see I'm doing it wrong, that max 400 might not be correct.
ms between shots. It's a Gatling gun.
Milliseconds or seconds?
Milli.
Ah, that will probably mess you up since most Unreal timing uses regular seconds.
You'd want something like 0.01 seconds per shot
Though honestly, counting up is easier.
So 100 shots per second is weaker than 200 shots.
guuuuys
me again with push problem
how do i push ai around, since i cant add force to capsule componet (it sais it`s not simulating physics and i cant turn it on obv) but appying impulse on it works but in suck unrealistic way, so how do i PUSH other pawn actor?
Anyways, you'll need the following variables: Shots per second, and a float that represents seconds since last shot.
@hardy merlin If I do this properly then I can reconfig my whole upgrade tree to whatever max I can get it to handle.
TimeSinceLastShot will be private.
OK, ja I'm listening.
I press space. Then the whole thing happens. It's a one tap, not a hold down.
Then a variable "firing" switches on to stop any more input for shooting.
So there is a certain amount of "bullets" too.
Ah, so you want it to be a toggle instead of holding the key?
That's right.
That makes things easier.
PPRRRRRRRTTTTT until the magazine is empty.
@crystal mural can't see your code, but you could do an Input key > Do once >Set timer by event with (1/fire rate) time while looping
Then he goes into a reload animation. Then you can fire again.
then check ammo count or input on release >reset do once node
This is what I'm currently doing.
I don't use While loops very frequently; what is the code NOT doing that you want it to (or doing what you don't want it to, I guess?)
@left bay I had the fire rate set to 400 per second. But when putting it down to 200 or even 100 it feels pretty much the same. So it's not actually firing as fast as I intended.
Hey could someone help me understand why a simple hit event isn't firing?
I have this on a projectile
The projectile's collisions:
have you set generate hit events?
@crystal mural fire rate variable is the amount of time before the while loop starts, I believe?
lemme open up ue4 and read the tooltip
My fire rate is how long to wait before doing the loop again. But that's obviously now wrong it seems.
for overlap you have OnComponentBeginOverlap
I also strongly urge you not to use the custom collision preset, as it is buggy as fuck
Okay, in that case I've set my collision on my pawn to block projectile, it's still not working.
create your own collision presets in the project settings instead
The loop is spawning a projectile, counting up 1, and playing a sound.
When the count hits where it should be then the loop breaks.
phone call, sorry.
Is it possible that this loop now isn't actually completing before the delay is over?
Delay is weird. You're better off doing something like that on tick.
well ue4 is doing it's regular job and taking awhile to boot lol. What is the tooltip for the 'while loop with delay'?
Actually I think that's exactly what's happening.
First, add a boolean variable for "Is firing"
I made it.
ooooh
uhh
You want to avoid doing delays inside of loops. It causes all kinds of weird behavior
why are you making loops with delays
Here's what I would do:
@odd ember I read the article, I set both Collision to OverlappAll, but there is no Overlap which gets triggered
@odd ember For exactly this purpose.
- On tick, check if "IsFiring" is true.
no man
And here I am learning why that was a terrible idea ๐
it absolutely is
best case it holds up the game thread, worst case it crashes the game
- If so, add the deltaTime to TimeSinceLastShot.
- Calculate how many seconds should be between each shot, 1/fire rate.
@astral fiber did you use the events? did you set the correct collision settings in the project settings?
collision is a two way street
both collision components need to be able to respond to each other
- In a loop, if TimeSinceLastShot is greater than SecondsBetweenEachShot, spawn a projectile and set TimeSinceLastShot = TimeSinceLastShot - SecondsBetweenEachShot.
@hardy merlin would there be a reason not to use a looping set timer by event, with time as the fire rate variable inversed?
I used this node
because that takes care of the timing without needing the timeShot variables?
If you're already doing things on tick, it's much safer to resolve immediately.
timers are framerate independent
this isn't on tick I thought; just on click?
on tick is per frame
Plus, keeping TimeSinceLastShot allows the fire rate to stay consistent across frames.
ah, FE
IE if you have enough to fire 2.5 shots in a frame, the .5 will carry over
@astral fiber did you go through the checklist I posted?
Thanks everyone for the help ๐ I'm putting this in a notepad for when I get up.
grug are you and Cranz not saying conflicting things though?
ye but Grug said 'keeping TimeSinceLastShot allows the fire rate to stay consistent across frames'?
but if the timer is framerate independent then it should allow for consistent fire rate?
he is using the tick event
@odd ember what do you mean with project settings? DO I have to activate overlap events?
you have a project yes?
yes
that project has settings yes?
yes
so in those settings there is a collision page
ah oof I thought the code snippet he posted was in on input
so wouldn't that mean NOT the tick event? .- .
You
well if it's gated or whatever
You'll need to use both. OnPress to set the IsFiring bool, and tick to actually do the firing
Ah OK.
but I do enjoy timers for their elegance compared to using event tick
yeah, so Grug's suggestion is use tick with time variables
mine is to use a timer to not need those variables, but they should both accomplish the same thing?
I haven't done much with Unreal Timers, but doing things in tick is better for stuff that needs to occur really rapidly, like this machine gun.
hol' up lemme pseudo code this rq and see if I'm missing something,
My loop isn't finishing fast enough I think.
@hardy merlin timers can trigger rapidly as well
Plus he's eventually going to need to interpolate the projectiles so they don't stack on top of eachother, which requires deltatime info
it's just a stand in event that can be called as fast as you want
framerate independent
you don't have to rely on the tick function
which I prefer not to
you can set your timer to be per frame as well
by using GetWorldDeltaSeconds
@odd ember I am looking through this page, I dont have any custom collision Object CHannels or Trace Channels.
I have the grass (Foliage, I guess Static Mesh) and another static mesh which gets crontrolled by a VR hand
Sure, but consider this: You fire 10 bullets in a frame. By default, they will spawn on top of each other and reach the target at the same time. If you have the deltaTime info, you can offset each one a little bit to ensure they hit sequentially
I suppose you could use GetWorldDeltaSeconds. Didn't know that existed.
@astral fiber you have that page, now look up what your settings are for the two elements that need to overlap
and adjust accordingly
BOTH of them need to have the same settings
so if one has overlap, the other MUST have overlap too
@crystal mural Now here's the other big question: Why simulate them as projectiles if you're going to fire hundreds per second?
Why are they so slow?
@odd ember thanks for your time.
I used the "OverlapAll" Collision for both of my objects.
The foliage has "OverlapAll" and the Collision box of the mower also has "OverlapAll". Sadly no overlapping event is triggered
@astral fiber have you set them to both generate overlap events?
@crystal mural I would go ahead and delete that macro
It's a stylistic choice to have them go that slow. So you can see the line you're making. At the beginning of the game you only fire 1 per second.
ah, okay
https://blueprintue.com/blueprint/0g8k2kxq/ this should work as a modular system, yes?
@odd ember I set both to this setting
I believe glowbeard mentioned wanting it to be modular; this uses variables that set the fire rate, max bullets, projectile to fire, sound to fire, and cooldown/reload time
@left bay Thanks, I'm checking it out now.
that means if they wanted to have multiple weapons or a tiered upgrade system it would just be applying a modifier on the corresponding value, and if you have multiple weapons each can have their own default values (higher fire rate, but lower ammo size for instance?)
That looks decent. The only thing is that having variables for things like IsFiring and TimeSinceLastShot allows other systems to inspect those values.
Nope, I just have the one weapon.
I'll be changing its appearance throughout the levels though.
yeah, and if isFiring is used as a variable for animations and what not it makes sense to be passed in. timeSinceLastShot could just be added as setting the value via event tick
@left bay I think this will solve it. The delay isn't dependant on waiting for the projectile fire to finish!
@odd ember My foliage has this settings
like so @hardy merlin ? I normally encapsulate deltaSeconds from Tick but if you just grab the node reference and drag it to wherever you want to set that variable
Urgh, that is one nasty screenshot
@astral fiber you need to find the GenerateOverlapEvents for foliage
I can see it's not there
NEVER use variables from different execution paths
oh also @crystal mural Decrement and Increment (the -- and ++ nodes) already set the variable; earlier you had an increment and then set
the SS is via snipping tool but I didn't feel the need to reupload the code. Also, why? I've found that the variable is recalculated whenever the reference pulls from it
Also, you have to Add delta time to Time Since Last Shot, rather than Set
if you added wouldn't it just get infinitely large? (+~.0167 every time)
because deltaSeconds is already time since last frame, ye?
where do you get 0.022 from
I've implemented the code from @left bay and WOW does the game stutter!! HAHA!
lol
thought that was off the top of my head the time of one frame (1/60?)
so the timer is more performance heavy?
1/60 is .0167
So it's calculating it correctly but it's heavy.
@odd ember AH ok, where can I find this event?
Normally I use the Collision Events on the Details Panel and connect them with the blueprint
I usually work in C++
oh also @crystal mural Decrement and Increment (the -- and ++ nodes) already set the variable; earlier you had an increment and then set
@left bay OMG REALLY!!?
@astral fiber it's a tickbox
Damn there's a LOT I've got to fix then ๐
Okay, rename "TimeSinceLastShot" to "TotalFiringTime"
Oh wait, it can work better if reversed.
Let me write some psudocode
I'm just a student for game design so scripting isn't my forte; always good to learn more. o 3o
just spell out how many frames you want, multiply that by (1/60) and done
and glow if the problem is from instantiating the sound and projectiles, you can look at object pooling
if the projectiles move really slow then they may also be colliding w/ eachother.
I've got their collides set correctly, they ONLY interact with the bouncing walls and the enemy.
ye we look into C# and visual scripting but so far I don't think I've been wrong other than the frame rate calculation? Can only learn so much in a limited time when the focus of the program is <20hrs of blueprinting a week. What would you consider 'knowing scripting like in and out' to be?
Whoops that's wrong
@odd ember I added a box collision to the static mesh which the foliage uses, but the foliage still seems to have no collisison. Where can I find this checkbox?
Shit I messed that up
@left bay knowing correct architectural structures, being aware of frame rate based actions, knowing inputs, knowing delegates. have a cursory knowledge of math at the very least
Clearly I need to focus
then you can add to that areas of focus like camera
definitely know inputs and that tick is frame-rate dependent, we haven't touched delegates at all though.
is it only for the C++ scripting?
Unreal blueprints use the word "Event" too often in conflicting meanings.
haven't used event dispatchers either based off of the ue4 docs; haven't had a use for 'em yet, what're they typically used for?
and by inputs I mean you should be able to set up events that cater to different inputs, like double click, analog controls etc.
you should be aware of the ergonomy of a controller vs. keyboard as well and take that into account
but that's less scripting
yeah we've had a few discussions on platforms and control schemes and whatnot, but we haven't made any games advanced enough to require analogs or double clicks; I'd suspect analogs use trig and/or InputAxis, and a double click could be simply made via a retriggerable delay? Cool stuff to look into though, thanks for the info!
also @crystal mural 'fixing' (IE streamlining) has been something I've done a lot for our group projects, but if you're mucking about with stuff and testing the advice I was given is to just make it work first, before you worry about refining. If the Timer is too performance-heavy, you can try with Grug's logic (tick check)
Thanks for the help again. Now that the fire rate is correctly working I feel like I need to fiddle with some numbers. I put it down to 50 and it still "feels" the same but it's not suttering. It's bed time. Close to 2am here!
dunno if it'll work better or if there's something else killing performance though.
aighty aight have a g'night.
Cool, I'll give it a think tomorrow ๐
{
fTimeAvailableToFire += deltaTime;
float fTimeForSingleShot = 1/fShotsPerSecond;
if (bShooting)
{
while (fTimeAvailableToFire >= fTimeForSingleShot)
{
fAccumulatedFiringTime -= fTimeForSingleShot;
ShootABullet();
}
}
// Clamp time available for firing to no more than one shot.
if (fTimeAvailableToFire > fTimeForSingleShot)
{
fTimeAvailableToFire = fTimeForSingleShot;
}
}```
Fixed it.
Fixed it.
not quite perfect but it;'s coming
@odd ember Can you please tell me were I can find this "GenerateOverlapEvents " checkbox?
@astral fiber like I said it might not exist on instances of foliage
read up on it
use google
Thanks @hardy merlin I'll check it out tomorrow.
Thanks @hardy merlin I'll check it out tomorrow.
Hey folks, I'm having a slight issue I can't debug - been at it for over an hour ๐ฆ I'm trying to make "fixed" (predetermined) bullet spread patterns for my shotgun pellets. I've tried a number of different options, and this has by far worked the best - it works perfect actually, adds 5 degrees to each direction and makes my bullet trace go up and to the right. Only issue is, when I look 100% down or 100% up, it completely changes... move the mouse slightly away from 100% up/down and it works fine again, and I can't figure out why :\
Sorry for the duplicates, Discord was having an issue..
I also tried this, which almost works perfectly. The yaw adjustment however falls off the further up/down you rotate the camera - the pitch offset works perfect and the yaw does when the player faces straight ahead, just yaw falls off as you look up/down
(in both examples, the in vector is the player's "look at" vector)
MFG quietly googles quaternion
if you want to know what math hell looks like, it's definitely quaternions
@odd ember thanks! Given that I had never heard of quaternions before your message, any tips on how I'd go about setting up the formula? :P I'm assuming they're generated from rotators?
lol nope, no tips
that stuff is hard math
I barely know it myself
but good luck
honestly if it's only an issue while at gimbal lock I'd say it's probably worth living with?
I have a ledge grab and climb setup using 2 sphere tracers, one for the ledge's height, and one for detecting the wall's forward normal. It works well enough for static meshes, but I'm trying to set it up to work with moving platformings as well. When I attempted to create a loop where the "move component (player capsule) to" keeps updating, it sort of works, but very poorly. Does anyone have any ideas of a more effective way of doing this?
My best guess right now would be to find a way to have it detect whether the ledge actor is a mover, and if so have it temporarily attach the player to the actor. It's the part of the detecting whether the wall's actor is part of a mover that I'm completely lost on.
Is a sphere trace capable of detecting if the collision is with a mover?
@odd ember thanks for the information anyway :) I'm off to read up on them and try to figure it out haha
@odd ember last question, you don't happen to know the issue with my second screenshot do you?
That issue honestly seems easier to fix ๐
I think I'm just missing a small thing
I've been experimenting ๐
perhaps use Acos instead of Atan
basically the +5 to the Atan2 result is applied to the yaw fine at 0 pitch, but the closer pitch gets to 1.0 or -1.0, the yaw adjustment seems to fall off
It's as if the +5 is being inverse scaled by the absolute value of the pitch
ie. when pitch = 0, +5 is intact, but when pitch = 1 or -1, +5 is completely cancelled
do you know what the nodes do behind the scenes?
It's been a while since I covered sin/cos/tan etc in school so I'm a little rusty, but in general, yes
they're all inverses so they take a position along the unit circle as a parameter and spit out a euler angle that corresponds to the angle between the position and the x or y axis
Any idea why this is showing up..? it wasn't earlier
if i set it to static, then i can't move it..?
nope
You're trying to attach a static mesh to a nonstatic mesh, you should be able to make the static mesh (Box) nonstatic
because you're trying to attach something to something that is static?
or vise verse. Either way, make it moveable, error goes away
OH
i didnt even see that
i didnt see my box was static as well
fkn parenting got me fucked up for a second
๐
i was so confused
@odd ember the part that's messing me up is the yaw parameter being reduced by the pitch value :\ I was a long, long getting the math right on this part, I'm honestly stumped :\
i had it set to movable, but i guess this BP messed up and got set to staic without me even realizing it
@timid lotus well consider using acos instead
@timid lotus this isn't exactly a pretty solution....but can you just figure out if you're gimbal locked, if you are, add a small value, then process
I just tried this and no luck ๐ฆ
instead of complicating things, just add a degree if you're gimbal locked
hm
@timid lotus I mean take one value into acos, not both
actually maybe I could just clamp the pitch value on the rotator
I was reading about them... man they're confusing
It's not often I find a math concept in gamedev that I've legitimately never heard of before
I may not fully understand it, but I've legitimately never even heard of quaternions before today
you'll solve all your rotation issues indefinitely
also clamping should work too....at least i gets it "just working"....until the next bug lol
what's throwing me off with quats is I can't seem to make them from rotators, just from vectors
yep
so I'm making a quat from my player's forward vector, but then what am I supposed to do with it
yep
the question you're asking is "what is the rotation between vector A and B"
because you need to cast it to pawn (or a class that inherits from pawn) first
It does
then cast to pawn
not that reference doesn't
evidently it's not this simple ๐
@timid lotus For quats, trying to learn it in editor by just messing around is going to be really difficult. It's best to look up some tut videos or documents related to quats first. Get your head wrapped around it, THEN experiment in editor
Just my 2 pesos
Yeah :\
Does anyone know how to have different vault animations over the same object based on if you are running or not?
....what?
oh vault animation, like jumping over something. I was thinking vault like...you have animations in a vault and you pick a random one
I mean if you are using charactermovement from UE4 you can tell if a player is running or not
Or at least you should be setting the movement speed somewhere, use that
Can I possess a character then?
anything that inherits from pawn, you can possess
and the character class inherits from pawn
Does SphereOverlapComponents return components that are part of a bp that would be in that location?
Unfortunately it looks like the clamping isn't working ๐ฆ
Sorry, isn't fixing the issue - the clamp itself is working ๐
I noticed the Random Unit Vector in Cone in Degrees BP node doesn't suffer from gimbal lock ๐
I suppose Epic is using quats in that node
I wonder if I could be using curves for this... hm
I have a traceline that sets a material when it hits an actor, and i added a flip flop so it changes the material every time the trace hits it. But for some reason, I aim my trace line, it changes the material, then I pull the traceline away and touch it again, it starts rapidly changing, and it's random whenever I pull the trace away.
Hi - Is there anyway to get New Anim to Play in Play Animation from a variable?
anyone know the difference between these two nodes?
Well for one, Make Relative Transform seems to actually have a description, but the other doesn't
Hence my confusion... ๐ฆ
Anyone know how to get around this? Character's feet sink into the floor when halfway between Idle and Walk animations in the Blendspace.
I know IK is an option but I feel like it doesn't address the problem
Walk to Run transition works fine. All animations in this blendspace are from the same anim pack from the marketplace
It happens to all of my blendspaces (all of them using animations from their own anim set)
I feed a variable into a function which has the parent class of a widget as its variable type... in that function I want to assign a child class to it instead... is that not possible?
Can you show that?
Hi y'all, what is this "value" thing, is it a seed for the noise?
@surreal peak
What exactly does that Value pin expect?
Like, what type?
Also does it make sense to set the Parent ref like this? Shouldn't you rather call "AddChild" on the new Widget, passing in the old?
Probably this...
ok... my use of parent child in this case is wrong... it should be subclass instead of child... but I'm too much of a newbie to know what a "parent class" is called
what I want to achieve is the ability to stuff any child class I happen to create into a variable that doesn't care what it contains
because whenever I use that variable, I use casting
but I don't know how to set it
I think you need to rethink this, what are you trying to achieve in practice? Technicalities aside
what I said... the ability to put any number of child classes into the same variable (and then determine what it is by casting)
I mean, what UI are you trying to make?
just a bunch of menus... all saved to a single variable, because only one of them can be visible at the same time, so I want to use the create/destroy way of displaying them instead of the show/hide
I suggest creating them and storing them in a different way, in a map for example
then you have a reference to your menu and can destroy it whenever
displaying them is not my issue
that works
only storing them in a single variable is
that's where my problem arises, because I don't know the syntax or type of variable to choose
You can make a UserWidget variable
That is the ParentClass of all Widgets you can create.
That should be able to hold whatever menu you want to save in it.
I have multiple characters with varying stats which I'm storing in an Enum/Struct map and I'm trying to use Data Assets to store base values for each one but I'm having trouble finding the right nodes to extract the info from the data assets like you can from data tables using Get Data Table Row. Can someone point me in the right direction, please? ๐
The problem with Inheritance in UMG is that the actual UI part is limited to one Widget.
So if you make a Widget, create UI in it and then make a child class of that and you want to extend the UI, then you will notice that it doesn't want that.
You can however, if you want, make a "WB_Menu_Base" class and NOT add any UI elements to it, only code, variables, functions and then inherit from that for all your menus.
Then you can save the menus in a WB_Menu_Base type variable
Parent and Child in Inheritance is not the same as Parent and Child in a Widget Hierarchy.
So maybe that is confusing you? @late cave
@surreal peak I should not have used those words, sorry for the confusion... yes, I'm doing exactly as you say, a base class with no ui, only functions, and the subclasses contain the visual stuff
@frail plaza DataAssets are basically just classes that you can't instantiate.
So you can make a DataAsset Variable, put your DataAsset into it and then cast to the specific DataAsset class to access those variables
Or you make the DataAsset variable of the correct type to begin with and save on the casting
I'll look over my exact project tonight and see if changing the variable to userwidget makes a difference, otherwise I'll post a screenshot from my real project when I get home instead ๐ thanks!
@surreal peak Thanks so much!
One more note that might help understanding a DataAsset, in case it's still a bit foggy: You can compare them to a Texture, Material or Sound. Just that the info in there is not some art or audio but the data you defined.
Thanks, that does help clarify a little more.
@surreal peak https://puu.sh/FceK7/849fc29c62.png
The table is just basically display names as rows tied to their base stat data asset. Is there a simpler way to go about this? Or would this be an acceptable way to go about setting base stats for 20-50 units?
Dumb question.
If I have a save game data with a fairly large number of characters. And each of those characters have an inventory of items.
How do I save the inventory of each character?
Its like I need array of arrays
I have a weird question for someone
Basically I have run a line trace by channel every tick to see where the player is looking, and it works great
Only problem is I get these errors?
Should I ignore them..
Other half
How to get variable from child actor and set it?
Hey guys, anyone on 4.24 and finding that the "Adjust Volume" node no longer works?
I'm finding none of my adjust volume works anymore which kinda sucks because thats what we primarily use to fade in/fade out
If i'm missing something obvious, any pointers in the right direction is greatly appreciated ๐
@amber marsh would a map be appropriate for you?
What is the difference between macros and functions?
macros are shortcuts, functions perform... functions
Which is better in certain situations?
Thanks alot !
@unkempt harbor For me this still works in 4.24. Alternatively you could use FadeIn and FadeOut nodes
Huh, thats weird. Maybe its the specific engine version i'm using
have you checked that you're referencing the correct sound too?
Is it possible to change variables of an unspawned object? etc i have an actor, but i want to change its variables before next level is loaded, where the actor is placed
@pastel rivet if its placed on level you can set it as Instance Editable and set it for each actor on scene, if you want to set value for spawned actor you need to check Instance Editable and Expose on Spawn
as spawn you will get a new pin in Spawn node
and instance editable will let you set it in details of scene
But yeah i cant spawn these actors dynamically sadly, as all their options are not exposed
so it will have to be an placed actor
but thanks, ill try to see what i can do here
so all you need is instance editable and set all values on scene
so i need to edit the variable with those settings on, but it needs to happend at event begin play of that level?
and this will happend before the constructor?
@cyan lion
Tried it, and that doesnt work, its output is now 0, cant get the variable set before the constructor
are nested arrays of structs a bad idea?
for example, if i made an array of a struct, within which one of the variables is an array of another struct
when i try this end throws this error
Blueprint Runtime Error: "Accessed None trying to read property K2Node_DynamicCast_AsBP_Interactive_Engine_Part_1". Blueprint: BP_EnginePartHolder Function: Execute Ubergraph BP Engine Part Holder Graph: HighlightHolderMesh Node: Branch
but it worls how intended
its prob your casting that is not valid?
dont need those valids on the first one there @thorny cedar
can place them on the last ones "casting" ones
what do you mean exactly with the last sentence
i have some objects i wanna higlight when i grab or hover some objects
but thats likely the error your getting, try resolving that first, but as it seems, how are you trying to achieve this?
Is it possible to make actors let click events go through? I have a board game where the tiles of the board can be selected by a mouse click. if there's something standing on the tile the click is not received.
comparing the integer of a bitmask
@pastel rivet yes, i don't need collision. would that help with mouse input?
havent tried it, try it ๐
go through as in to succeed or go through as in to ignore and continue on?
@pastel rivet it's surprising, but it seems to work. thanks
@jade gull go through as the tile below the actor would receive the click event instead of the actor clicked
Hey guys! Having an issue with navigation mesh. If anyone could take a look at this video and offer some suggestions I would greatly appreciate it!
@keen bay Great video, covered everything you tried, had an example of working vs non-working, wow
Most people give a generic "Please my shit is broken how do" without proving any additional information
Most people aren't serious about Game Dev. I am โค๏ธ
GOTTEM
Right?
Sure thing, sec
hey guys im trying to do a stronger zoom for the character when he aims his weapon in ALS V4 but i dont know where to start?
i cant even find the camera??
@wintry schooner the camera should be "childed" to the spring arm inside your character blueprint
I think I found the issue. Will let ya know
Sweet, ok
I should have known to do that to begin with lol. But I was getting frustrated
if you have troubles with nav mesh, always delete the recast nav mesh and rebuild the nav
Sure, no worries. It's on my list of things to build a navmesh at runtime, so maybe you can help me when I get to that heh
To smaller, so it gets inside the small tile?
@thorny cedar screenshot the error
@pastel rivet i think i got it
Do share!
@pastel rivet What program are you using to make those sexy-ass arrows:
Mine be like
@wintry schooner Start on Youtube my dude
don't know ig this is a good solution @pastel rivet
maybe check if my hovered actor are correct?
import the screenshoot in substance painter for arrows ๐
Ah, ok
are nested struct arrays a bad idea?
@jade gull Not at all, unless you're going like 7+ deep
ok cool, is just 2 deep lol
Yeah, that's fine. I've got like 5-6 deep, and that's probably as far as I would recommend taking it
i did try in the past in like...4.14 maybe, but had problems with the inner array so thought i'd ask how it is now xD
@fathom portal lightshot
I mean, it gets hairy the further you go, you just gotta make sure everything is commented and structured to work instead of hastily thrown together and the first thing that works
Ah @pastel rivet, So lightshot or @fossil linden suggested substance painter
I usually just use snipping tool because it's fast
tbf its just meant to be a data sorting app so shouldnt be too bad hopefully
substance painter would be a overkill xD
@thorny cedar if it works, thats alright, just do valid checks.
I would have considered making and atoring those casts into variables in the bp
@fathom portal why the hell would you use substancepainter for screenshots or arrows ๐ install lightshot, hit printscreen there you go
When my pawn is overlaping with a box in my grabable object
then it highlights all spots of interest
is it multiplayer?
nope
show your code then for the overlap
@keen bay
lol
I wish discord had an awards system like the forums do
@fathom portal so where would the camera that should be "childed" to the spring arm be located usually its in the main BP but for some reason i dont see it
what would you consider to be the main BP?
@wintry schooner Most of the time it should be inside your Pawn:
Under a camera boom/spring arm:
yes exactly it should usually be there but this is specific to the V4 ALS bp
Can you screenshot the component section of that BP?
I have no idea what v4 ALS is
Me neither, but we're getting there lmao
Is there a camera being added at runtime or something?
looks like you need to add the camera yourself
What's in the "BPI Get Camera Pa..." function?
there already is a camera @odd ember what i want to do is be able to change the positioning of this camera (increase its zoom when the character aims his weapon)
@odd ember im changing my call to a event that is called, when i pick up my object, then it calls to highlight all spots. Seems more efficient
@thorny cedar but... wasn't that your issue?
@wintry schooner yeah I see there is some camera system going on
The way ALS has it programmed just seems alot different then what i usually work with @fathom portal
you should probably show us what's inside
my problem was that my casts failed and accessed none
im a complete noob so i thought i'd just ask it here which node is this?
somehow i got this to work, but calling at event tick seems unefficient
@lament junco "Armor" seems to be a float (a number that can have a decimal) variable
@thorny cedar yeah if you wanna paste your code I can take a look
but talking about it without seeing the code isn't really something I can help you wiht
@odd ember give me sec
@lament junco Drag a variable out from the variable list and choose set
@odd ember thats how i highlight my fitting objects
ah thank you!
is it possible to change variable type based on enum? only way i can think to explain is like the =Indirect function in excel
@thorny cedar you shouldn't execute class specific logic on cast fail
yeah thats what i thought. do you have a work around?
i want to call the highlight function here in my object that i can pick up
@jade gull you could always use a switch
@thorny cedar it's not really clear why you're casting twice to... the same class in the first screenshot?
i have two Interactors in my Pawn
also since I can't see how you performing the "hover over" I can't tell you what's wrong there
well show those as well
I see
I still don't know your logic for how you hover over
you're not painting the entire picture
@odd ember its for a data table, was wondering if its possible to filter one enum's options using another enum current selection (finally thought of how to word it properly)
not really
find my hover object
eh oh well, just a bit longer on the input lol thanks for replying
pretty sure there's a better way of doing that
but again, where is it called from? how do you get the array of actors to hover over?
at event tick in my Interactor
the best way to refactor this would be instead of using event tick, only execute logic when there is an overlap
instead of asking per frame to return all overlapping actors
so call this function from my actor that i can pick up when my Interactor overlaps with iit
but why aren't you just creating a collision component for your interactor
and use OnComponentBeginOverlap
im still using the VRContentExample from Mitch that i found and adding the parts that i need
so is there any reason you couldn't use a trace that hits the object that you are "hovering" over or use a collision shape to overlap?
I recommend using that instead
because I think a lot of the errors you are getting are from the setup you are having
will keep that in mind!
and simplifying the setup would make it easier to debug
you can do something like a visibility trace on tick
per interactor
yep i will sort out the function that i need and then try to simplify
and whatever they hit (it's going to be a single actor), you can highlight
the highlighting is for the spots i can put in a object
so they only highlight when the user sees them anyway?
yep
yeah so they will have a forward vector
you want to multiply that forward vector by however long you want the trace to be then add them to the location of the interactor, respectively
got it
that's your trace
initally just getting it to highlight is the first step
but it should be a lot easier since it's only one actor that will be highlit at a time
so you were talking about how it is "spots" you're looking for and not visible actors
you probably want a new type of trace then in your project settings
I guess you can call it something like "highlightable"
yeah i allready done that in the past
i did sth like opening a door when the player views on it
new tracechannel
so whatever you want to highlight, you need to make sure has highlightable to block
so you can create something like a sphere collision with highlightable on block
but it will only highlight when my trace is hitting my actor, right?
if my forward vector is sth like (1,1,1) and starts from my interactor location it is a simple line
what is a simple line?
my trace
it will always only be a simple line
tracing in the direction of the forward vector
yep
when my trace is attached to my motion controller it will only highlight when it overlaps with the to highlight object
yep
understood
thats not what i want, but would have done it that way. OK i want sth like i pick up a tire and all four wheel suspension are highlighted while i overlaรผp with my tire or hold it
Thank you for your explanations ๐
Hey friends, I'm getting a compiler error:
Basically, after updating to 4.24 my blueprint is yelling at me that what I was using before isn't valid anymore. Which is fine, but after removing all instances of that variable (replacing it with the new, valid "Tile to AHHHHHH" variable) I'm still getting compile issues
The original variable no longer exists (as proven by the left side "Tile to" search I'm running)
But the interesting thing is if I control+f for "Tile to", it does say the original variable exists in two places, but when double clicking those to try to get to them it doesn't go anywhere:
When attempting to see if I can use said variable (right click on open blueprint area and typing), it doesn't show up either:
I've:
1: Deleted every reference variable to the original TMap variable
2: Right clicked the blueprint and selected "Reload" under "Asset Actions"
3: Closed and reopened the project about a dozen times
4: Duplicated the blueprint (Same errors)
@thorny cedar then you're after the same thing?
I mean it doesn't sound any different at all
if you want to highlight them on pickup you can do that too, then you don't need to do a trace at all
in either case, you don't need the current logic you're doing
@fathom portal exit editor, delete intermediate folder, see if you still get issues
@odd ember Attempting
@odd ember Same errors. I'm going to delete everything unnecessary and rebuild the project file
have you fixed up redirectors?
being*
that's all I got, other than redirectors
well, actually, try deleting the variables and recreate them
That's the thing, the variable doesn't show anywhere
In the variable panel it doesn't exist, when I search it comes up with two values, but they don't lead anywhere when clicked/double clicked
they aren't by chance cpp variables?
5: Duplicated the functions that used to have these variables and deleted the originals, no change
@odd ember I'm 99% sure they're not but let me double check
Nope, I have no cpp variable or function that contains the word "attached"
It sucks, this is the last error that came up with when I updated
Like I'm so close
To fix this issue I duplicated the project to avoid corruption and loss, went into the autosaves of my original project, replaced the MainInstance asset with the autosaved version, and replaced all the nodes that needed replacing.
Any idea what they're talking about?
no idea
Is that just version control back to a past version?
@odd ember how would it highlight several objects at once? Just highlighting all objects of the same type?
yeah I mean if you already know what to highlight, make it event driven
like on pickup -> highlight these 4 objects or whatever
Too simple
so on pickup -> allow these objects to be highlit?
Where would I do that? In my level blueprint, or where do I get the information to all objects?
well what do you want to do
As long as i overlap with an object i want to highlight the spots where I can store the objects.
only when you overlap? not when it's picked up?
Both I thought overlapping includes picking it up
not necessarily
I don't know your setup
some games overlap to trigger an interaction prompt first
so you overlap first, then pickup as a separate player action
Just give me a idea how you would create a solution to my problem :)
Then I can try to adapt to it
if it's on pickup
then just highlight the 4 things you want to act as "spots" on pickup
same with overlap
if you only want those to be active when you pick up
then activate them on pickup
or overlap
same logic
Can I do it with an event dispatcher?
Yes that's what I'm looking for. Highlighting when I pick up or overlap with it.
so they are highlit, or you CAN highlight them?
this one matters because you have to think about detection in one case, but not in the other
It's a simple switch not you are able to highlight them
Sry for the misunderstanding
I still don't know which one
ok let me just put it down
if it's the first one
use an event dispatcher
If I pick it up they highlight not can highlight them
yep ok
so the cool thing about event dispatcher is that you can get them to create a binding event in the level blueprint as a shortcut
and that's what you want to do here
so you want something like "OnOverlap" or "OnPickUp" as a dispatcher in your item to pick up
then in your level blueprint, with that item selected, in the right click context menu, select "create event for On(whatever)"
then from that event in the level blueprint, hook up the elements you want to highlight and highlight them
Got it! Thank you
you can equally create another dispatcher like "OnDropped" to make them not highlight after the fact
Is it possible to spawn actors from another class as a child of current class?
If not, what would be the way to spawn and transform child components / actors
I currently am spawning this grid (looks like a solid block because of closeness) from a separate BP, the issue is that I want to individually have each grid square checking for the same parameters that the house checks for (land slope and existing building) but if I enable any collision on the grid since it is from a separate class it prevents the building from being placed
why not just set the grid to overlap
Overlap all prevented the building from being placed because it (I assume) always detected the collision with the grid thats being placed with it
I mean all of this is custom setup so can't you just rewrite that?
I dont have issue rewriting, just sorta unsure how to fix the issue. I wanted to have them as child or other components so that it would detect self with the grids and the house
just make your own collision presets
like fix the problem at the root level instead of creating workarounds
especially since that option is readily available
That makes sense, of course. Ill give that a go for now ty.
I don't recommend using child actors
@odd ember What's the issue with child actors? I've never heard of that ebfore
I also had lots of bad experiences with it. So I always try to avoid it
I had packaging problems with child actors
very weird stuff
Hmm, interesting
A child actor component is just a component that spawns an actor. You can just spawn the actor directly and co trol it's lifetime manually to get the same end result without the weird edge cases.
What would be the best approach to a global message bus? I know dispatchers are close but I'd like to set up a system where senders and receivers don't need references to each other. Just route through GameState?
U mean Gameinstance?
What would be the best approach to a global message bus? I know dispatchers are close but I'd like to set up a system where senders and receivers don't need references to each other. Just route through GameState?
@faint pasture Event dispatchers don't need to reference each other
Unless I'm misunderstanding what you're saying
no @faint pasture , the subsytem UGameInstanceSubsystem
@frail void Ah yeah that makes sense. I'm already considering a subsystem for projectiles so it wouldn't be too hard to make a message/event bus subsystem
For prototyping I have my projectile system set up as a component on GameState, so that can presumably work too until design is buttoned down and I move it all to a SubSystem.
I made a component for the objects and unreal initializes the system itself
it's actually very neat
@fathom portal child actors break very easily and when they don't they have massive performance overhead
and really it's just a workaround for not understanding system architecture well enough
and unreal unfortunately provides a few too many of those if you ask me
What's a good guideline on reposting a help request? A couple hours?
Same thing, yeah
I'm going through pages of google trying to find out who's had the same issue and fixed it
Because I really, really don't want to have to revert
I've done enough that it's worth spending a lot of time on it
If I spawn an actor from class in a separate BP, can I change the material from within it or do I need to create a function within the BP that had the spawned actor that handles that?
@snow geyser You should just be able to pull from the newly created class:
You like that @odd ember? I'll just include my errors in screenshots when I help other people lmao
lmao I'm not the authority here
I think you might be better off asking in a different place
Oh, I know, was more like "Hey look how clever I think I am lmao"
seems less likely to be a BP issue
Well that half solved my problem, will keep digging for the other half lol
What's the other half, share with the class
Storing and accessing the reference to them, since each actor being spawned is through 2d grid execution macro and saved to an array
simple enough, I already store and move them with mouse cursor, but thats all at the same time in their order
1: Drag off the "return value"
2: Do "Promote to variable"
3: Change that newly made variable to an array
Wait, if you're already storing them, what's the problem?
somehow the way I reference them to change material on tick events isnt working, essentially.
Ok 1: Using tick for something like that isn't advised
But 2: Can you share the code? Maybe someone can spot the issue
Well I want to make a grid that spawns with building and each grid square checks validity of placement to help the player better plan without actually having to manually check each spot but can visually reference
so on tick seemed like the only way to do it with each mouse movement right?
Hmm
Maybe
Making it update every time the cursor moves seems like a better idea
Maybe, but that's an issue for another time
Share your code where you're changing the material, lets get that solved first
kk
Mostly just how you're storing them in a variable/array variable and then how you're actually setting the new material
I have an idea for a fnaf fan game, a mechanic is one of the enemies stands at the end of a hallway, and his eyes are white. When his eyes turn red, you have to flash your light to stop him. But if you flash your light when his eyes are white, heโll kill you as well. How would someone go about making this?
@tribal axle Which part? Or all of it?
Just the ai, I have a trace line to hit the character, I just need the logic.
Like, what do I use to simulate the eye change, I donโt have a model atm
Ah, I think I see
the second is the actual called event for material changes
Top = spawn and collect, middle = move grid with mouse and try and condition material changes
Well, what I thought was the issue isn't
bottom = material change events
And which "Set materials" aren't working? the 4 inside "GridMaterialChange" and "MaterialChange"?
Yeah, When I try and enable the grid material change ones it ends up screwing with the ones for the ghostbuilding
Have you set the debug filter to this object, to watch the lines light up?
Like to make sure it's actually *reaching the code
This thing:
Alternatively you can just add printstrings to the ends of each code piece
in the material changes?
Yeah @snow geyser, I'm not seeing anything that sticks out as the issue
I mean I swapped those to != and on true and it didnt seem to make much of a diff
It's the same thing, just some devs get triggered over some stuff
I get triggered over using strings to check for settings instead of enums
Its the grid material change that is somehow messing things up
I broke the link after set actor location and the ghostbuilding behaves properly again
Something tells me its the target-self in the on-tick somehow but I cant figure a way to plug in the object reference to that self
that self should just be referencing the "GridMaterialChange" event not the BP unless I misunderstand
And if you add a print string after the "set materials" it is actually firing that code?
Not getting lost in the "true" of the equals check
ill add prints to the grid ones
Just to narrow it down to make sure the code is running
Or do the whole "debug filter" watch the light show thing
Yeah its def doing them all but its like not everyhings updating each instance? The ghost-building will go red for a while and then if I clip from a different direction will go blue and stay that way until I clear some other direction.
Normally it goes red then back to blue as soon as it clears the collision
Well, are you updating everything every instance?
Or are you just checking the one you're touching
it should be every instance? The ghostbuilding operates perfectly when the set material for grid isnt enabled. When I hook those back up all of them will change just not accurately each tick
Are you getting any "Loop exited" errors in your output after you play?
no
The loop limit per tick is crazy high, it shouldn't be, but trying to narrow it down
The limit per tick is like 20 thousand loops I'm pretty sure
The chances you're hitting that are slim
I shouldnt be anywhere near that yeah. Ive got a 10x10 grid looping once on each tick
hey man I appreciate the effort either way
Sure, sure
If you want, we can screenshare and we can try to narrow it down further
Without the branch after "set actor location" on tick the ghosthouse will perform its checks and change appropriately.
With it enabled I get something like this:
where the checks arent happening each tick seemingly, because they are changing to true or false and then staying that way instead of changing back with next tick
I mean, it sounds harsh but what you showed wasn't a crazy large amount of code, maybe just rewrite it from scratch, try to see what's going on?
your "check overlap" functions you have, what exactly is going on there
Rubber ducking is important
I'm assuming this is something along the lines of an is valid to place this structure step, before clicking the mouse and starting building right?
yes
have you looked to see what the content of the array is at runtime?
I havent, but I assume it checks out because I am moving the entire grid around per mouse tick with its contents?
do the red "error" cells stay consistent while moving the mouse?
yes, until they have a new collision at a different angle that makes them happy enough to go blue
your "grid material change" function after the branch...you're calling the same function on both true and false? what's different there
one has "is error" checked one doesnt
The "grid material" ones dont
oh, not in the screenshot, I'm assuming the screenshot is wrong then?
oh I probably forgot to click it while re-hooking it up for the screenshot
ah
got it
just out of curiosity, unhook the "completed" pin
what does that change if anything
Nothing really, which is odd
still acts the same?
yes
also what's the difference between Grid Material Change and Material Change
including the house which should be getting its material change there
sorry for the amount of questions, trying to understand the flow
can I suggest swapping the tick out for a Do N just to test. Run the next loop after the completed stuffs
target for material change was the difference
or, intended to be
The fact that the house is changing with the completed branch taken off is confusing since that calls the material change for house
Do N?
I recommmend merging the two functions
And then when you want to change "ghost building mesh", simply pass that in instead of the actor
I mean, simplifying the code base could go a long way in figuring out the error
true, however based on my experience...because I do this all the damn time, it can often create other errors that hide the original one
You could screenshare with us, remake this bit of code, and rubber duck for us each thing, maybe we can spot the issue
Cant screenshare with current connection unfortunately
Rip
Congrats!
are there supposed to be 2 variants of the red color for the "ghost" box thingy?
No. That there are gradients appearing is weird
I'm betting there are multiple boxes in the same spot
You think they are moving their placements?
I only create the grid once, so it shouldnt have more than one
put a print string on beginplay of spawning that actor, simple way to check
This is where the grid is created and arrays collected for reference
oh each little box is an individual actor...nm the print string then. Better off printing the length of the actor array to verify that. I would assume the lighter colors are overlapping translucent materials. Just a guess
so...as an aside. why not use a single overlap volume set to the size of the object, and use that to check if the building can be placed?
the for the "ghost" of the building, you can just add a duplicate static mesh component with a different material to show the "ghosting"
just set each hidden/not hidden to switch out
Im trying to build a grid that extends beyond the building placement itself that checks each grid square for validity to help speed placement
fair enough, a single volume could be made the size of the building +20% or something
yep, that's probably a single check, not 100 separate cube checks
even though each grid checks?
if the single large overlap did indeed overlap, then you could get your error state
I get what you're saying, but I HIGHLY doubt that was done with individual cell checks, but rather a given "extent"
Im open to reading material etc on how to make a a single item do checking in a grid like that. im not chained to 2d grid macro execution ๐
I wouldnt even know where to start
Would it be easier to have something inside the GridPanel BP that handles its checks / color change instead of doing that in GhostBuilding_BP ?
think of it this way. If the Command Center were in UE4, there probably has a set "footprint" mesh. A plane with a material to be as simple as possible. It would also have a box collision volume fitted to it's "footprint".
When it's in place mode, it's visible and if the ACTOR is overlapping another building, then the planes material is set red and bCanBePlaced = false. If it's not overlapping, then bCanBePlaced = true and the material is green.
What about all the grid checking happening in places not part of the building though?
you mean the screen-wide green/red telling you where you can and can't place?
aye
That picture its screen wide, but in others its more localized around the building in placement-mode
a system probably similar to the navmesh
The screen wide one would be a bit harder as you'd have to have something to query against that's like...level wide.
Yeah I dont actually need the screen wide one, I just ask to help understand what you are offering
hold up, setting something up to see how full of shit I am
almost done
No rush my dude. Any guidance and help is much appreciated and at your leisure lol
Im noodling with some stuff in code to try and track down issues still
@hollow cape That's how I would do it as well
just seems so much simpler
And then simply when you move it around, snap to a grid if you're going for a grid system. So it can only move 50 units at a time or so
yep
I was doing in simulate since I didn't have that system set up
but yeah, exactly
Ill watch this here in a sec and give it a go, thanks in advanced
sure sure, no rush
Quick question on a c++ conversion. What would I do here?
fTimeAvailableToFire += deltaTime;
I mean converted to Blueprint.
Oh
drag a set TimeAvailableToFire
You can add time to time still, yeah
It's just setting? Not adding to itself?
OK cool adding to self. Thanks!
Got a code example last night so just trying to figure out what's going on ๐
Yeah that + a slope check is all the house does. essentially
this is far leaner
^ And no tick required, just update when they move it
yeah, I did tick for simplicity
Of course
The problem is it doesnt exactly accomplish what I want in terms of the grid outside of the building itself
The footprint can be whatever you'd like, it doesn't have to match the structure itself
yep
Like from Harvey's example, the footprint is different than the actual block:
Damn now I want to make this system for my game
^
Aye I get that, I just mean that I still want to have a visual indicator for valid placement in the immediate area. So it would show if it can fit in a place its not currently sitting for example
extend the plane, bounds extend
that's a far more complex system, but the same principles apply
standby....this is a good excercise
How can I change only partial grids of that footprint you are establishing though?
Like not a perfect square/rectangle?
you mean to make it not a square?
Sec lemme doodle something to help explain
you may need to use actor bounds or something like that
