#blueprint
402296 messages ยท Page 828 of 403
how can i check if a key is still being held down?
rephrase:
i know i can make it an axis but is that fine in terms of perf cuz its running on some kind of tick
for sprint on shift key
I see, any tutorials on that handy right now? ๐
i saw that
@quaint sigil Following that example. This is also a point. I have an array of five textures here. Absolutely none of these are loaded from disk to memory until that EventConstruct, and even then only the one chosen from the array is loaded.
if you click the keypad button, the next key you press will be selected
Thank you very much ๐ I will try it sometime ๐
i'll pass the key from input event
So if you move mouse to left then player will just rotate to left? ๐ค
I am trying to make the character look at mouse position on right click, but it doesn't seem to work. Any idea?
this is what calls this function
AI, or player controlled?
player controlled
Depends on your pawn's control rotation settings. Do your settings mirror this?
If yes, it's overwriting your SetRotation. And instead you need to get it's controller, and set the control rotation to what you've set the rotation to.
Which do you have checked?
Player Controller
What about it's movement component?
Does it rotate correctly when standing still?
it doesn't rotate at all
are you trying to replicate top down template mvement?
it is the top down template
Should add a print and make sure that function is running then. Can't think of anything else that would affect your rotation.
it is running
Odd. Not familiar with anything else that alters rotation automatically outside of AI controlled stuff.
@quiet knot At work we have a single massive file for all of our usual Enums. You can't forward declare enums or structs though, only classes.
somehow this works completely fine....
Hoping someone can shed some light.
I have an actor that is spawning another actor (VillagerNPC) that has an actor variable named spawner inside of it.
I'm assigning the spawning actor to the variable Spawner inside the villagernpc.
A few days ago this was working just fine. And I could interact with the variable inside the villager blueprint. BUT now I'm getting "Accessed None trying to read property Spawner" when I try to use the variable Spawner from inside the villagernpc.
Any idea what I might be doing wrong?
yes
i need help to do that
Is it spawning ?
It is.
What event are you using it on?
and only fires once ?
it's down the chain from event begin play
Beginplay runs before that variable is set.
Make it an InstanceEditable and ExposeOnSpawn.
if it tries to spawn a second time and can , it might overwrite your Spawner var to empty
got it, so the problem is that assignment happens after beginplay. I need to look at the life cycle again and understand it better
I dont know if it is correct way but I would take Axis Value from this event, multiplied it with some sensitivity and aplied that rotation to player
I'm not sure what that means but I'll start googlin
yeah it only spawns once ever.
yes i see, i was looking at pins backwards
Then right click your spawn node and refresh it.
didn't have expose on spawn though
InstanceEditable and ExposeOnSpawn need to be checked.
You can pass that in here, and it'll be available for Beginplay.
something like this https://i.gyazo.com/b1e0a3656df234b25c3210a158f5252d.png
@mild crystal
Oh, it's showing now in the spawnning node
it still wasn't working but I'll try assigning there instead
thx i will try
Put Self there instead of the set node, you can remove the set node.
yep i did just that. COOL! that's nifty.
My AI moveto is still not working but I'm getting an actual reference now in the spawner variable.
I can print out it's location for example
just use this event #blueprint message
so it's progress. thank you!
Are you spawning AI controllers for these villagers?
No.
what that rotation rate does?
this is what the villager is doing, the first AI move to works just fine. the 2nd one fails. If i manually put in a location though that's not a variable it works just fine
I personally hate dealing with ai movement. Literally the most annoying thing about AI by far.
haha, but i do gotta make it move
its sensitivity
Complex chain abilities? Easy. Target selection? Done. Random behavior choices for personality? Joke. Complex movement? Hell nah.
for example, if I do this, use a make vector it fires off just fine. If i attach the spawner to the target actor, OR pull the get actor location from the spawner and set that to the destination. It fails.
yeah but that wasnt what i want, i want when i look to the left my character will turn to where i am looking
Try projecting it to your navmesh.
I think my solution correct ๐
Sorry, again not sure what that means. Just started learning a few days ago.
i dont know what is echo locomotion
I never did FPS in UE
so do that, but feed the nav mesh into the nav data?
its the ancienty ue5 project the character from there
No need, leave it blank. Only need Point and QueryExtent.
That is for specialized movement finding.
I use UE4 ๐
so you're saying, get location from spawner, feed it into projectpointtonavigation and then feed that into the location in the ai moveto?
anyways, thx for the help man apreciated.
sorry ๐ฆ
Yep.
np
If that doesn't work, check your navmesh. Press P in editor, should show up as a giant green thing.
yep nav mesh is fine
Basically the 100,100,1000 draws a giant pillar box, and gets the best location inside of it on the navmesh it intersects.
hey that worked!
had to up the query, missed that at first
i don't understand why i need that
but i can look into it
thank you for the help!
i want to change the character when i look 180 degrees or 90 degrees and i made this. Can someone tell if this is correct
try it out, if its doing what u want, then its correct.
one more thing im getting stuck at 1.200 compiling shaders, anyone know why?
just wait, I think its normal
hey ๐
is there a way to get the overlap location of two box collisions? (somewhere in the red area)
Line trace on 4 red arrows that ignore yellow box and hit dark box
that will give you 4 vector loc points
nice idea! ๐
..will try that!
thanks!
I think it needs to be compiled, it depends on performance of CPU, I dont know
There's an ImpactLocation in a shape trace as well
isnt that just 1 point ?
im pretty sure this is a bug. i just dont know how fix it because i search it on internet and it happened sometimes
Is there a blueprints version of the Discord Game SDK
Could someone tell me exactly what does UnrotateVector do? Nobody seems to know and I can't find any mention of it on YouTube or Search Engines.
checking the documentation: making an inverse rotation. So if u're rotator should rotate the vector with 90 degrees on Z axis (that is a rotator with 0,0, Z value i think, but dont know much about rotators) then the unrotate vector will rotate it in -90 degrees.
Ooh, I think your right there...it just rotates it in the opposite direction then?
I'm going to try to see if I can make it so one is rotated 90 and the other -90
i think, but just try it out
Alright, for sure...I'm going to test that and see
@sturdy herald Thanks
@sturdy herald Yeah I just had it confirmed...that's what it is...just an inverted rotation
Good:))
U're welcome. What i said about rotators might be not true, but that doesnt change the working of unrotate vector node
Anyone?
@lilac hatch There are some plugins on the Marketplace but other then that I'm not sure...they aren't free either
Darn...
I wanna automatically populate a widget with buttons for a bunch of variables. I have a data table that makes and parents some Check Box & Slider widgets. The variable key is a name so I have a variable key "Size" that spawns a Slider widget and a variable key "Visibility" that spawns a Check Box widget
But in my data table I also wanna set a default value for my entries. So in the struct that the data table is based off, I would have to add a bool variable and a float variable for the default values
but then my "Size" variable would obviously ignore the boolean entry for it's data table row, and the "Visibility" variable would ignore the default float entry for its row
The redundancy is making me feel like there's a better way
So is there some standard practise for some ultra generic variable that I can use which could store data for any variable type?
Possibly a string or name, which could be converted to a bool, float etc, or is that bad practise? anyone got any advice? is the whole idea trash? kek
You mean rich presence?
Nope
I need help with resetting positions of the game whenever someone scores a goal. I tried using the node "reset level" but the camera messes up. anyone know why?
If I have multiple levels, is there a way to keep track of each level's state? Or do I just use one GameState to manage every level?
if you need that state all the time everywhere, game state isn't a bad choice
why not the actor that has the state? then when that actor isn't network relevant you don't have to replicate the data anymore
what is "state" in your context
Set array element
Well I plan on players transitioning between levels and each level is very short but I'd like each level to have its own state, as they change.
I don't need the state at all time, just when that level is active.
Like if I"m in the lobby, then there's a lobby state which manages actors/variables relative to the lobby.
Then if I'm on level 1, there'sd a level 1 state which manages actors/variables to level 1.
Etc.
If not, i can do checks in the Tick of GameState to check what level I'm on.
And allocate variables specific to that level.
Hi hi. Easy question here, happy to clarify if I don't make sense.
How can I translate the return value of my random seed into choosing an item from the list with a return value each time?
I'm not getting any result for anything above 3, so I know I need math in between my return value and index, but im not sure how to do it
whats the easiest way to make character play animation even before current animation finishes?
@pure relic are you asking how to turn your random float into 0-3 range?
I believe so, yes. The goal is to keep the random float consistent with the intention of increasing my 0-3 range into 0-50 later
I need to make sure the seed im pulling from is consistent throughout
Well the easiest way would be to set the range on the node
Sorry, I may not be clear.
If my float range is anywhere above 3, i get no result. I want my result of 7 to then factor back into option 0-3
So would I need to divide my seed into a multiple of 0-3... or something like that?
Modulo by 4 then truncate and use for the index
Or you could just use a different Max that matches
If the value is exactly 100 it'll return 4 and nothing will happen
Otherwise it'll give something between 0-3
exactly, I want to prevent that. There may be a total of 148 when done, so i need that math
I'll try that, thank you
That won't matter it just means that whatever your last index is will only be chosen if the random value is exactly 100.
that worked. Fantastic thank you.
I have one more question if thats cool.
If one item in my index is chosen, how do I prevent that index # to show up for the remaining slots?
(For example, 3 of these blueprints are on the level. If option 0 is chosen, I only want 1,2, or 3 to show up for the remaining)
You'll have to keep a list of the index number you've used and before you select an item, check it hasn't been chosen b4. If it has pick a new number
Gotcha... Do you know a recourse where I can look up how to learn this? I don't yet know how to translate that into blueprints
hey yall so im trying to set up a basic/auto attack system for my game and i have the attack range registering possible enemies in the area but how can i set it up where it actually moves until it registers the target
No, but after im done cooking dinner I can put up a ss of how to do it
make that dinner
ill be patient i appreciate the help ahead of time
Haha sorry meant PXL
You'd be my hero
@glass magnet your question sound like an ai perception node and gameplay tag thing
well im trying to make player detect player
or player detect ai at somepoint
and to move into range of ^
Yeah
If you assign a player tag to the player. Add an ai perception component to your ai controller and set it to use sight.
There is a walk through for doing this in the behavior tree quickstart guide on the documentation site
well
Your best bet would probably be to create an array of available options. Then all you need to do is use an array random node from the array to get the choice. You can then remove that choice from the array, thus the next time you choose, you will only be choosing from what is available.
well im trying to make it like if i click to move, if i click on an enemy to attack then it would move in range of
Oh, ok. Like top-down turn based thing
im not making it turn based but yeah top down click to move
Ok. Then you'll wanna do the tags and perception like I said for the ai.
The character you can just get the vector and distance to the enemy and subtract some amount so they stop a lil short
ok ok
yeah yeah yeah
1 question before i begin
wdym tags and perception, like i give the player blueprint a specific tag for it to detect?
Yeah. You can assign gameplay tags in the details panel of the player BP
this is news to me i appreciate it
If you Google ue4 ai documentation and follow the links to the behavior tree quick start. It has a step by step walk through
Hopefully this isn't a stupid question, still new to this, but I can't seem to find that purple variable type ๐
It's a class reference
It's the same as these, but you make it into an array instead.
You'd want to use a base class that all of these choices inherit from for the array type.
You only need to add like 3 nodes to your old set up though to use ints rather than referencing the class
lemme just ask 1 quick question, if i had team 1 and team 2 would they still have the same tag or what would be the correct way to go about it
@pure relic
material output
Are you inside a material asset?
I'm getting this error?
yeah
One of the requirements @pure relic has is that the list may eventually have up to 50 options, meaning any time an option is added, you'd have to expand the select node, and change the modulo. This is much simpler (and this time I included the random stream array choice node as I didn't realize he was trying to pull one from a random stream) and all that is required is to generate an array of classes to choose from which can be defined directly in the blueprint or generate it from another source (like a data table or data asset, or whatever)
Looks like you selected the wrong variable type and are trying to feed it into the wrong "contains" type.
Material type post process ?
Thanks for your patience, really tryin here haha. Let me try that...
wdym
The node is just the default output node for a post process material
Can't seem to find 'random array item from stream' im on 4.25 - does it have to do with my version?
Yeah I think that was made available in 4.26. This will effectively do the same.
hah, makes sense. Thanks.
It also automatically makes an array node when i plug in get -> set
Appreciate it
I'm trying to make it so that when the player character is within this box, they can press a button to start an event but i can't seem to wrap my head around it u_u
i'm using the default template for the top-down point and click if that matters at all
One way to think of it, might be like this: is this box a collision box? If so, you should easily be able to set the OnOverlapped of this box to react to Pawns. If a pawn is in it, you can set a boolean value on the pawn. Something like IsInBox. On the switch, look for that value on the user of the switch. IF they have that value and it is true, let them use the switch.
alright, i figured it out. thanks!
Hey y'all sorry I haven't been able to figure out this system. I need the played character to move to range of a target but I don't the the correct way to go about it
do I use a sphere collider or tags or variables? What would be the best way to do it?
So im plugging it all in, and I know I missed one easy step probably. Here are both blueprints.
- I am getting repeating array values still...
- Array only comes up with values 0-2 now, not anything more

What does your "Possible Characters" array contain?
and is it a variable of the class or a local variable (if it's local, it won't work right)
Im guessing this is local
You can see if it's local or not on the left side:
The other thing is... How do you know you're getting repeating values? If this is being called on begin play, then it should only fire once.
I only want one color to show up out of the four. So my error was putting the same blueprint down four times, when instead I need to have 4 unique blueprints that are each one unique array value I believe?
If you put the same blueprint down 4 times, then each instance of that will have it's own copy of that array, so each would roll whatever it wants (so two of them could roll 1).
The way around this would be to have something else that manages the array and values that isn't directly tied to the actor itself - so using something like game mode or game state, or a different actor entirely.
Gotcha. So a manager blueprint, that then I can call upon with my current blueprint. All blueprint data would be put in the manager, and then I'd reference it in my individual character blueprints
what can i do to remove infinite loop lag issue? i've made self reproducing tiled map on box collision overlap event
and once pawn activates it for the 6-7 time it becomes infinite loop
i've even tried to destroy previous tiles, still loop issue wtf
distribute the work across several ticks
wdym?
what i said, don't do crazy iterations each tick
otherwise blueprint vm will bite you
or do it in cpp
thats not even an iteration ๐
i've got flying actor that overlaps the extender box and only after that new tile appears
you talked about tile generation
thats tile with extender
they dont touch each other, so collision shouldnt be an issue
but still unreal thinks i'm running infinte loop somehow
maybe you do?
well, i really do, but i've deleted the BP where i did
and there was no issues before i started working on this tile generator
i can fly around as long as i wish, but if I start using this overlap event - 6 tiles, lag, infinite loop issue
this doesn't affect anything either
Does remove item or remove index node properly clear a struct from an array? I've tried both nodes and somehow the index/item is still in the array.
you don't need to, what do u u use?
in a shader it can be rendereded
and after you do a transition
had the same problem
Hey y'all sorry I haven't been able to figure out this system. I need the played character to move to range of a target but I don't the the correct way to go about it. Do I use a sphere collider or tags or variables? What would be the best way to do it?
probably shouldve changed it up rather than copy and pasting
but its ok
u sound like a usual shit
?
in some ways
like "do it and you will"
typical line for a disaster
we are sceptical here
huh
ikr this dude kinda mean

๐ฆธโโ๏ธ
but yeah no past 2 day I haven't figured it out. I just wanted to know the basis I should build from
Bruh, calm down
You can use either, but if you want it to be aware with the direction, comparative distance with vectors would be the way to go.
So using tags and comparative distance
Or can I just compare between target and player no need for tags
Also simply overlapping with sphere collision doesn't put into account how near/far it was
Yeah
It also
At least the way I had it set up
Was taking the sphere from the other target aswell
I'm sure there's a way to do it but do I need to utilize tags or can I just do this
You can skip tags if you really just want to get player character
I'll worry about it later when it's possibly a problem it would be better to just have a base down
I appreciate the help
This seems much more simple
I want my character to walk slower when they walk backwards, how could I do that?
sure mate
Do they turn or do they actually step backwards?
man I like your opinion (not gay)
Hello i have those settings on my SpringArm which children of it is my Camera . But as you can see from the following gif the camera is acting strange
Ack sorry, I was doing something haha xd
I have it where the character always faces forwards, so I guess they actually step backwards
Sure, something like this should work
Basically checks to see if you're facing backwards, and if you are it pushes you forwards some
can change the -5000.0 in the multiply to make it more substantially "slow"
that strangeness looks like the root of the springarm is not at the center of the ball
The root of it the is the ball mesh
i dont mean the root component, i mean the start of the spring arm
@brazen merlin you are correct let me check this
@brazen merlin You were correct bro ,ty so much !
awesome, np
heck yes finally figured it out no more manually placing it
well... how did you figure it out? an import checkbox?
I am getting this error on a bind I created, doesnt make sense....
its a simple pull from the variable
why would I get access none?
what does target none MEAN ๐
lol
but it does, so it means the call is wrong at the higher level, in the event graph?
Where do you set this EquippedWeapon
You are just showing us that you have a DisplayName inside the weapon blueprint
How is that fine
so that error stops it from working when one is?
I would suggest a different way of setting the weapon in your UI...
when nothing** is there
Instead when you equip a weapon, tell the widget the weapon that just got equipped
and in your widget just check if the equipped weapon is valid
k
so the is valid creates a caste for when its not, the other calls it on the equip function from the player
IsValid checks if the reference is valid, if it is: you execute something...
im an artist my man, learning this as we go
lets roll it down a tad ๐ @trim matrix
im asking because I have no clue
im fumblefucking my way into this
so this is what I do for when I overlap with the weapon, and it works
I have a very weird problem where my actor (In this case a door) only works the first time I press Play. Any other playthroughs after that it stops working.
To get it working again I have to update something in the blueprint (Anything, doesn't have to be related to the actual logic. Almost like it refreshes the blueprint) and then it works a single time again.
so, ill go back into the widget, remove the code and put in an is valid for the Event graph, then go into my BP player on the PICKUP event, and make the binding call there
No
then pull from there to access the bind ?
thats where I am confused, i have no issues calling this in the other bind
The issue was with equippedWeapon
No that won't fix it ๐
In your player blueprint, create the widget > if you already have a valid equipped weapon set the widget equipped weapon
hm.. let me think of how I might do that
Whenever you change equipped weapon > update the reference in the widget
in your widget, whenever you try to access equipped weapon > check IsValid first
well you can still have a reference somehow in the player blueprint
yeah
also make sure to have an IsValid for the widget inside player blueprint ๐
in fact pretty much any reference should be checked with IsValid
so you should always have an isValid?
in what case would you, not have a valid lol... seems odd
but okay
Mostly in edge cases, but building in safety is better than having runtime errors
very true
just different from the art world i guess
appreciate the "hand walking"
You can then instead, print a string saying: Oh hey you forgot a reference here
recently got some time on my hands so I am trying to learn the coding side of things
was toying with AI yesterday, pretty fun for the most part
How can I make an actor smoothly move to a location and not just do a sudden snap to it?
Lerp
I was trying to find in unreal engine the X/Y axis values . So in X axis if you are moving to the right direction is negative -1 and on the left its +1 ?
VInterpTo with a timeline
Actually with a timeline you could blend vectors I don't remember if there's a node for that
This isn't so much to do with unreal engine as just how vectors work
But yes that's correct
^well it is partially because different engines use different axes for directions
@echo salmon Positive X is forward Positive Y is right
so, say i have an array
how do i make it so that on a button press, it selects 1 array up
so it goes 1, 2, 3 then back to 1
Guys i need some help when i made a multiplayer thing i can only control 1 player i tried it with another computer and tested it also 1 player only can control the charecter can anyone help plz?
Index >=4, index = 1
that handles the "setting back to 1" part, but i need to know how to select next array with a button press
which array would be best for selecting something where it activates, i scroll through 10 options
Add 1 each time you call the event
awesome, thank you :)
That does the same thing less efficiently
2 billion? yeesh that's a bit low
jk, thanks so much for the help :))))
what's the ++ node?
it adds 1 and sets it
.
thats how you get a value from your Array
Use length of array as modulo for the new incremented value. Win win win
Int = (int + 1) % Array.length
Wrap is inclusive is it not ? So min of -1 would be invalid?
why can't I get this curve's float value?
Its a timeline, not a curve
thanks
So... I have some troubles with event dispatcher.
I made the bind from BP level to BP actor trough event dispatcher and i have a Bug.
If put the actor รฎn level and try to call the event dispatcher and change a value from level to an actor IT works very well ,but If i Spawn the actor that call it doesn't happpen anymore.
What can i do?
show code
This is where i bind the event dispatcher with the actor Superpower รฎn level Bp
Here i call it
Here i Spawn the actor that will call the event once i touch it
Fireball actor that i Spawn it's the child bp to Superpower.
Event dispatcher are created in Superpower
So I have character needing to walk on moving boat. When boat moves, the character does not stay with boat. What is best way to fix this?
can step on on the boat collision
Here is the code
he can step on boat but when boat moves he does not stay with it
boat is on regular collision channels like floor
that's a lot of spaghetti. most likely the reason it doesn't work is because you take values from one execution thread and use them in another
clear up your code so it's readable, save the values you need to local variables and test again
How can I duplicate and rename a template level in-game (for a level editor) ?
does this work ? https://www.screencast.com/t/LIiPqXFufl
or not what you are looking for
so same level, but the actors are spawned in procedurally ?
Yeah, you can change classes of child actors through a UI widget.
When you quit the level it's all back to 0, so it's good. But I need to save the level configuration by copying the level I guess (and store the selected classes somewhere I guess too).
well... how I am doing it is with SaveGame, save all the actors location and other details in arrays
Is it possible to get the faces of a static mesh in blueprint?
break ia hit result might work, never messed with it
Thanks!
Does anyone know how I can make the Tick() function execute 100 times per second ?
Run the game at 100FPS
No because I don't want that to be framerate dependant
So I wouldn't duplicate the level in fact ?
And I create a SaveGame instance for each level ?
I've just used SaveGame for options so far.
i think so, not sure if thats"Best" way, but it works
how many actors are you setting ?
that means if someone has a weaker pc he won't be able to run 100 fps ?
Why do you need to be that specific anyway?
Because I'm doing a timer and and my timer runs at a certain speed in the day and in another speed during the night (it's a 24h day/night cycle)
and using SetTimerInterval is it more precise ?
You don't need to be that precise for day night cycle.
For crying out loud, I use Event Tick to update the game world time, and still have it in consistent length
For me I don't have a consistent length It's 10 sec off for the day and more than 40 sec Off for the night
it's seconds
Then do a check to reduce the speed at night
How do I create a new SaveGame with given arrays when I press a button in the UI then then ?
but someone suggested an approach using Tick() and run it 100 per second and I don't understand how to do that and why is it better than my approach
That's a shit suggestion.
You can use Tick, but why not use delta seconds?
i can walk you thru min in a video call if you want
Could you check my problem above, to understand my problem please ?
I can't, Like my timer changes during the night, all of this is dependant on some values I enetered in some variables, and for instance if the variable night is smaller than the variable day, the timer will go faster during the night making it be sometimes less than 1 sec per iteration
Eh, it works on me through extensive battle testing, I got consistent 48 minutes / in game day, tested for 12 real time hours or so.
why not
Because I want my whole 24h In Game to be 15 IRL minutes (10 min for the day and 5 min for the night)
Fuck it, I'm going to open my project for crosschecking with my system
Here's my message from above and my code :
Does anyone know why my timer isn't perfect please ? Like My Starting_Night_Timer variable is at 23 (11PM) and Starting_Day_Timer is at 6 (6AM) and Day Duration variable is at 10 (IRL minutes) and Night Duration variable is at 5 (IRL min) and I used a timer in Windows to check if my timer is correct and it's not, like 10 min on the windows timer my game timer reached 22:50 (10:50 PM) instead of 23:00 (11 PM) so it's off by 10 sec in game somehow.
maybe the tickrate of the timer event isn't perfect ?
Any way to solve this and make it perfectly be at 11PM after 10 min ?
Here's my Code : https://blueprintue.com/blueprint/s0-g7rd9/
I'm not using floats in my code besides for calculating the ratio
it's not about the artistic part as I'm not doing that yet, I just need the night to go faster than the day (as the values are 10 and 5) but those values would be customizable
now I just need to display a 24h timer
I already succeed making it work besides the problem with 10 sec off for the day and 40 sec of at the end of night
like instead of being at 6:00 by 5 IRL minutes, when it's 5 min IRL it reached 6:40 somehow
I need to understand how to do your solutions
Pardon my astronomy, but isn't night shorter at times because of Earth rotation being skewed?
Maybe but it's not why I have my night shorter, it's just for gameplay as night has less things to do in it and also to prevent a single game being 2h40
this part I don't understand how would you convert that to the 24 hours format with different values
Nope I can't
but that would be too easy
FFS, let astronomy do its thing than artificially shortening the time.
I managed to prolong the daytime by rotating my sky actor, which has rotating sunlight from east to west.
I'm doing a game not an IRL reproduction of how time scales in real life, so I need to bend the rules for my game for gameplay purposed and to prevent having a single game being 2h40
Let me try the curve part
im pretty sure you can define how many real seconds is a single day in your game
and scale the whole in-game 24h from there
how ? ๐ฎ
๐ค
๐ฟ
calculate
? ๐ค
im just gonna put some suggestion and scoop ๐คฃ
are we just trying to do something like UTCNow() but for "ingame time" instead?
i dint really read the whole thing
I'm not trying anything. I don't have the mental stamina for this anymore
This is an oddly complicated conversation for something that involves taking a 1,440 integer and getting a float from it based on a scale of how close it is to 1,440 / 2
I think that's what I'v done but I get some imprecisions
Hey you.
Hey ?
Yeah, you.
You wanna know how I do day night cycle?
Yeah ? ๐
Is there a 'get random reachable point ON radius' node (rather than IN radius)?
unfortunately no ๐ฅ
you can try looking into EQS for that
Get random point in radius. Transform to point's local space, normalize, multiply by radius, transform back to world space.
or get random unit vector * radius + location
Yeah, CE's requires much less processing. ๐
It's pretty consistent, I got 48 minutes for each in game time, and you can scale how fast the day should pass.
I'll show you in a moment
ah yes. Get random unit vector should do the trick
Basically I want something to move randomly from point to point but always the same distance.
if you need to guarentee the point is reachable
you might need to do abit more stuff
You might have a point
It delays until the next frame.
I was wrong again...I came back to it and figured out exactly what's going on thanks to a few other suggestions from different place....Just for the record the reason he is Unrotating the Velocity Vector by the Actor's Rotation is so that the Velocity values alway's stay oriented to that rotation. He does this so that if he's facing a different direction in the world the velocity will alway's come out the same...By default if your facing the X axis and stafe left to right then the values will show up in Y but if you Rotate 90 degrees and do it again the values will show up in X....by Unrotating it to the player's rotation the values will alway's print out as though you were facing forward along the X axis in the world.
It's basically orienting the velocity vector so that it faces the player's forward direction...but without changing the values
alright
@main lake Here's my in-game time update setup. Pretty simple.
And updating the sun light rotation. Note that I specifically use Set Relative Rotation as opposed to Set World Rotation.
Can you pause the timer ?
It happens on Event Tick, so you can add a branch before Update Time function to pause it temporarily.
And where should I put the detection when it's night timer to go faster ?
multiply time scale based on a curve evaluating from the current progress of the world seconds
I'm still confused on how to do the curve
oh not a timeline
say you want second half of your day proceeds faster
you can create a curve like this
miscellaneous>curve>floatcurve
wich one ?
what values should I put in the Curve float ?
based on the example above
something like this
so you can technically "accelerate" part of your day
But here where do I put the values
x axis will be 0~1
y axis will be the multiplier you want to apply to your time scale
to make the day faster
Is "Get World In Delta Seconds" same as Delta Seconds in the event tick?
yes
which are both framerate dependant
unless you modified your tick interval on the actor
then your tick event will return a different delta
Got it thanks
but I want the multiplayer to be through a variable ?
Yes, except World Delta Seconds puts into account time dilation (e.g. affected by slow motion)
Multiplayer? Really?
*multiplyer
the goal is to adjust the TimeScale variable in the example above
you can use any method that suits your needs
the curve way has a fixed intervals where parts of the day will be accelerated
you can always just make multiple curve if you want a different "profile" and change the curve variable
I have no clue what values to put in the Curve
At least with the example I showed above, it's the matter of controlling the Time Scale, which controls how fast in-game seconds are.
so the x axis 0 to 1 is the % of the day ? And the y axis is the multiplier ?
yeah something like that
does it suit your needs?
lol i actually not sure what you exactly need
Maybe this float track could solve my issue, but is it possible to fill the values of the track through blueprint ?
You can do modulo (%) to a day (which is 86400 seconds) and use the result to speed up time in certain point.
Of course the scale has to be larger than 0.
im following this example so yeah, eitherway works
Like I said before I need it to be customizable later (through some UMG buttons, and stuff like that)
sadly curve cant edit runtime atleast in bp
if you need like sliders to adjust
๐ค well that gets quite complicated
but before that, you can always predefine a few different curve asset
then your "ui buttons" can just swap the curve variable being used for the time evaluation
interesting. Good u found out.
Is there a node being a mix of Math.Floor and Math.Ceil depending on the value if it's above 0.5 it ceils and below or equal 0.5 it floors ?
Round
Thank you
If you want to, you can have evil branches hack to adjust the range of the artificial time hastener.
You're speaking chinese to me with those terms ๐ค
yeah that's what I want ๐
adjustception
๐
ไธญๅฝ่ชใฏ่ฉฑใใพใใใ
Ah more understandable ๐
่ฏดๅ่ฏญๅ๏ผ
Yeah I'm still not sure exactly what's going on but Janmebows told me on his channel that it's rotating it by the inverse of a quaternion. I may have to look that up, but at least I have a general idea as to what is happening
is there a random exec in the unreal engine?
๐ ็ช็ถ้ดๅ จ้จ้ฝไผ่ฏดๅ่ฏญไบ
Multigate with the "Random" option checked works.
ok thanks
not sure but is multigate randomize without replacement?
You do need to reset it each call otherwise it'll only call each output once.
So random int + switch may be a bit prettier to use.
@dawn gazellethe multigate worked perfectly, thank you very much
So im attempting to take the stuct in slot 1 of my inventory, and using the object reference create the weapon and put it in the hand of my character
for construct object?
Is your "weapon" directly inherits from UObject, as opposed to Actor?
yes
anything that exists in the world is an actor
maybe you should use an actor or weapon class type in the structure instead of plain object
^
technically its workable by casting to it but
eh ๐คทโโ๏ธ save yourself the trouble since weapons probably will have the same base class
it's not because it doesn't spawn it in world
i mean you can cast the object class type to weapon
then you can use it on the spawn actor node
This is like the opposite of what i was told the other night
๐ค
here is this for context
and this
i believe this type can be just your weapon base class
well if you can find what you were told we can get to the bottom of this
its up in the chat and im probably remembering it incorrectly
personally i will separate up pickup items and the actual weapon since they dont have overlapping functionality dont mind me
ur talking to someone who has no clue how to do that
data assets
Actors have locations...uobjects dont...if your weapon is nothing more than a data storage class that tell the character what mesh, damage, ect...you would set the mesh directly on the character otherwise it needs to inherit from an actor class
Here's what I came up with because I sometimes have fun trying to solve people's problems with constraints. This is a "time of day" that starts with the day starting at 0 (which is 6AM) and night starting at 600 seconds (11PM). There are 600 seconds of day time and 300 seconds of night time for a total 15 minute day/night cycle. The seconds elapsed are calculated back into a 24 hour format that is printed. It's probably a bit convoluted, and probably not the best way of doing it, but was fun to figure out ๐
transforms*
Yeah more precisely transforms...
There's nothing wrong with making a weapon data class... But all you'd be doing is pulling defaults off of it and setting them directly on the character
They won't exist in the world technically
Ik you all know what ur talking about but im so new to this engine ur speaking french
its ok ๐ we learn day by day
anyway for starters
you can try using weapon class type for the Weapon Class Ref variable
instead of object class type
then use the spawn actor node
then attach it to the character
I feel like I tried to use the parent weapon class but I could only end up spawning the parent weapon
I had this issue when spawning loot from dying ai
you can spawn its child too
if you have your other weapons class hierarchy setup correctly
like a base weapon class
then every other weapon childs from it
then using a base weapon class type should allow you to select all the childs too
instead of an object class reference
this would be a actor class ref
to that specific class
I think
choose this
and now
I can only select the sword or its childern
this makes much more senes
to do
class polymorphism๐
I need to create a system where a lot of options are stored: bools, ints, floats etc. But I want to use a shared struct to handle all the data and to save and load it. Would it be a terrible idea to have a Key(fname) and Value(string) and use string conversions to translate my strings into the ints, floats, bools that they will need to be set as?
its not too bad
but managing the keys might get abit messy when you have too many
the find nodes ๐
Idea is that it will all be automated so I shouldn't have to do any managing, or whatcha mean?
Main concern is the idea of using strings for floats, at least for the storage and save / load
just fyi structs are generally meant to be read only in BP
Oh rly? I use "Set members in struct" node all the time
is it a performance concern?
nothing to do with performance, structs are just not well equipped to handle dynamic data
... in BP
Oh, I had no idea and have had no issues with using them in such a way, you got any information on problems that could manifest?
for where I need to use structs to persist data I have wrapper functions that do this for me in CPP
your data could end up not written
especially if it's a pointer
more like you just need to know what you are doing ๐คทโโ๏ธ
whether the struct you are using is a copy or ref of it
structs are always copies in BP
you can pass struct as ref
yeah it's still a copy
but you cant return struct as ref it is
So before I was comparing the class object reference Now I need that but for the actor, Will this node still work
im guessing no
I mean it will work in principle, but being that we cannot see the full extent of the code you may have some wonky logic that we can't account for
Hmm, So it looks like that path is still the same in the data table
so it just storing an actor now and not an object
an actor is also an object
but with transform
thats about it mainly
you can only spawn something with a transform
spawn being the keyword
you can construct objects
but they technically doesnt exist in the world
So getting the transformation need to be the Trans of the stored actor
you can just break the spawn tranform node since you will be attaching it later
the spawn transforms needs to be where you want to put the actor
This is the current concept, I'm on the edge of scrapping it so if anyone is like "that sucks" I'll be happy to listen. The Widget Entry Type defines whether a checkbox, slider, etc is created and that is the thing that will determine what data type the string val will be converted to. The Key might be "visibility" and the Value might be "true" and the Widget Entry Type would be a Checkbox so it knows to treat it as a bool
Uh key should be fname there m'bad
not text
but dunno if that makes it better ๐ฅฒ
I have no idea what's going on here
I'm gonna have a ton of variables which are different data but i wanna store them all as an array of structs
Yeah for sure i will be careful.
There are some nodes I don't understand like "Map Range Unclamped/ Clamped", "F Wrap", and some of the logic ๐ค
Rather than a set members in struct node?
the best way of doing what you want to do is to have something like a data object
a data asset perhaps
something like this
While i deffo believe you and defer to anyone's knowledge in here, I've not had any issue using them in a practical sense and have created games with systems using them, in character creation systems for example
there is is just no reason to risk stuff not working
Deffo happy to hear alt methods
.
the only problem that bp struct gives me is
Ahh right, yeah everything remains in BP, i wonder
when i edit the struct
the other bp that ref that bp will get fucked
when using a source control
thatsthepoint.gif
right but the fact that you have to find a solution to a problem that shouldn't exist should tell you it isn't an ideal situation
i agree
also cpp struct is dope af
they can have functions
data table can export and reimport if you have the same name and value types
the only pure BP structs I have are in a data table made to be read only
you gotta relink a bunch of the break/make struct thats gonna take some time
all dynamic struct creation is handled in cpp
hey guys, I need a simple help with a thing
To make my weapon inventory, I have made a simple map of Integers to Child Actor components, and I have made this piece of logic to check whether the actor assigned to that slot is or not an actor Slot_Empty, and I have used the != node to make sure the wielded actor is not a Slot_Empty, but it does not work for some reason, it always returns true even if the equipped actor is Slot_Empty, what could I do to fix this?
was gonna say, try not to use child actor component
heyyyy cuties
then probably try to figure out whether if every child actor is actually Slot_Empty in the data?
Oh Ok, I'll try, thanks
So I have a question about finding the vector between a target and a player. Im trying to set that up and would i want to turn it into a condition? or is there a different way to go about it
rn i get unit direction then turn it into a condition to see if the distance is greater than the attack range float
this is how i had put it
distance to 2D
or you can use vector length off the unit direction
then directly compare it to the attack range
ah ok
well just 1 question before i do that is the branch the correct way to do it or
do i do distance to 2 straight from actor location?
Map Range translates values from one set to another... In this example, it is defined that the input range between 0-600 which will translate to 6 to 23. So when the "Value" is at 0, 6 will be output. When it's at 600, 23 would be output. The node will automatically calculate all other values inbetween.
Clamped/Unclamped just determines if the values will proceed outside the bounds of the ranges. So if I tried to input 700 into this Map Range Clamped, it'll only ever output 23. If it was unclamped, it would try to figure out what the 700 would translate to based on the scale of the range (it would be a value higher than 23).
The Wrap node takes a value range and anything above or below the range will translate to be within the range. So if the range is between 1-10 and I input an 11, the expected output would be 1. I needed to use the wrap as we want to know what hour it is when we go passed hour 23, which can then be 0 (midnight), 1, 2, 3, 4 or 5.
is the way i have the boolean set up correct or
yeah
How can i replicate a whole animation blueprint and how can i replicate the weapon here?
Image
if the distance is greater than move if it is not then attack
that could work but to make it nicer like actual moba, you might need more checkings
But your code looks so complex x)
and that
try to use squared if possible
you can always just square the attack range variable
reason being
square root is costly
square root in the distance formula is very costy
you can try looking up how square root is calculated in cpu ๐ its quite funny
What's this I hear about BP structs being bad, the only issue i've ever had is adding new data types to them, and then the editor crashes if I don't remove the old default values. They seem to work fine for everything else. Is it going to be a lot of work to convert to c++ structs, and if so, what are the benefits if I am currently only having a minor inconvenience at best
yeah thats the part that will struggle alot if you dont know how to handle it
sucks it has to be that first time learning that it behaves that way
if you can treat BP structs as read only you minimize the amount of problems you'll have
I mean the issue isn't c++, I can do c++, might take a short while to get used to Unreal's API, but i know the language
but, why should i treat them as read only, I have yet to see an issue with not treating them as read only
the main issue with structs in BP is that they are all copies
so writing to a struct means you're writing to a copy
ah so it takes up a lot more memory
no
tldr you just need to know what you are doing
๐คทโโ๏ธ
i would for my future projects
i mean I do know the difference between writing to copies and references, and my methods seem to be working, so is there still any reason for switching
I mean I'm prepared to if it saves some miracle amount of memory usage, or will stop actual problems down the line, but every resource i have seen about using structs, doesn't point out any issues with BP structs
hell the documentation doesn't even mention that
just because you haven't seen the issues doesn't mean they don't exist
theres not alot of problems, the copy issue will still happens even if you use a cpp struct, its how just how structs are handled inside bp, just keep in mind when you edit a bp struct, the other bp that ref it will get fucked in someway
my solution to that is
the documentation doesn't mention that we shouldn't use child actor components either but common logic dictates otherwise
no but im saying nearly everywhere fails to mention them, and of the issues ive heard, its just that there are some, but doesnt say what they are
to have a source control to keep no uncommitted change before you edit the stuct
edits it
discard everything else that got changed because of the struct edit, except the struct
then viola problem solved
the main thing is: structs in BP are copies. literally all the issues with them stem from this one weird fact
yes that's the root problem, but i still want to know what issues they can cause, cause right now i dont know if the issues are minor inconveniences or biiig problems, because i need to gauge if it is worth rewriting all of them
cause that is going to be a pin
thats why i ask what issue they cause
your data might not be written
that is not a valid reason to me because its user error ๐
2 things from me
it could happen regardless of user error
is there anyway to find the gameinstance being applied? When I go to the project settings and click the find arrow, it doesnt take me anywhere. I assume its a UE internal one hidden some place, but figured I would ask
is this the correct way to do it
editing the struct
and having too many nested bp struct and editing it
i mean a lot of issues can stem from poor handling of them, but some issues can just stem from them being bad,
editing a struct == writing to a struct
I think you need to make a new one and set it Project settings>Map and modes
I was about to do that, but wasnt sure. Thanks
yeah that's writing to a struct
that's what we're talking about
when we say writing data
and if the majority of the issues stem from the latter, then it would be worth switching, but if its from poor handling then id say the headache would be my own fault
this
would making a c++ struct solve my issue of editor crashes when i add or remove members to an already populated struct
didnt think so
@versed sun yep, thanks, got it!!
well you know best where your pain thresholds are. if you are willing to put up with risky behaviors, do nothing
Can you maybe guide me in a quick question then. Being a noob coder (primarily an artist) what is the reason a person would make the STATS of a player in the game instance rather than a component that is then attached to the player?
id like to say my thrershold is quite high cause i have to work with SQL atm lmao
seems like it woudl be smarter to create the code with components so that each stat could easily be applied to different things/objects
there isn't a reason to make them in game instance
@odd ember interesting.... the tutorial i saw has me doing that
seemed odd to me
other than to be saved
people who make tutorials, especially on youtube, often don't know what the f they are talking about
yeah, well those are the people I have to learn from ๐
blind leading the blind
hence why I am here asking! ๐
i am unfamiliar with hot reloading, what is that?
trying to be a realCoder, like the rest of you ๐
no idea why it crashes, i never noted the crash stack
it's when you want to corrupt your project for free
hot reloading is inline loads of your code, never works
i thought that was only during C++
so if i wanna work with unreal, compile my scripts with the editor closed?
you cant hotreload with BP, can you?
that takes years of work. I would recommend studying general programming principles within the OOP paradigm
rather than listening to youtube tutorials
dont think so, thats probably why ive never heard of it
@odd ember been doing that ๐ i actually know PHP, (can read C++), C#, python
most of them are for making my art do things ๐
honestly unreal bp used to be so much more confusing until i went away and learned c++ for a while
Hi. I am trying to get a slider value in my level blueprint but print string keeps reporting 0 even though I am changing the value. If I plug print string to the UMG BP then I can see the values correctly.
well why are you asking us for help then?
...
why are you watching youtube tutorials?
if you have a fast computer, probably should just close the editor before compiling c++ code
just because I understand object oriented programming doesnt mean I know how UE4 works ๐
where the nodes go
how they interconnect
what they called a node
I can't count how many people come in here saying "I know xyz languages" in the same sentence as they are asking for what "inheritance" is
structure of the data placement
i notice when its about function symbols
Sure, but that wasnt what I did
the chance of getting fucked by hot reload is pretty high
else its just fine
๐
if you know of OOP then you should be able to answer your original question. what does OOP say about object responsibility?
.
sighs the question was posed due to me trying to understand if there was something I was missing
why would there be a tutorial by a guy who is fairly popular
doing it the wrong way
because people don't know their stuff
game instance persist even when level gets changed
I can guarantee you most of the youtubers who do blueprint have never understood the core principles of OOP
the people watching the tutorial do not know if someone is doing it wrong, because theyre trying to learn
i would imagine he want to persist the stat between lobby and levels
else
there is literally no reason to place it there
maybe for local save game
it didnt make sense to what I already have learned before. which is why I cam here asking
the point of a chat system, forum, etc... is to collaborate and express ideas ๐
why are coders so hostile ๐
thank you โค๏ธ
somebody asks me about rigs, weighting, animations, etc... im not saying "go spend 50 hrs learning animation basics and fundamentals".
well you said you knew programming etc.
knowing programming
and understanding the framework of unreal
is like
2 different world
lol
i also predicated that statement with a very clear "I am learning"
obviously
but unreal does a pretty good job at showing how its data persists in docs
that's about the only thing it does OK
doing a great job at fostering good communication here ๐
If I' making a C++ struct, i imagine it is this line that exposes each member to blueprints
UPROPERTY(EditAnywhere, BlueprintReadWrite)
interesting point
yes but ideally you should be looking to make wrapper functions in cpp (static functions, for instance) that handle struct data changes
yea the specifiers
i thought coding was about efficiency. The most efficient use of time would be to speak with a person who has already parsed the data and knows the direct route to the answer.
so you mean like make my own blueprint node similar to the set member in struct node
some answers require prerequisite information
so in order to not turn things into a 2 hour presentation
you may be given homework
very true, but there is no contractual obligation to actually spend time answering. I half expected it to be ignored.
asking people here probably will point you to the right direction, rather than giving the answer straight unless i feel the context is way too hard for the asker
for instance. I don't know your use case in particular
(that was a yes)
Meh, I feel there is a fundamental difference in the expectation of usecase here. ๐
the idea is to use as less bp nodes call as possible
Is there any reason why using the default functions isnt great for that?
I wasn't joking when I said go read up on fundamental programming principles. you'll be better off in the long run if you do
ill be back if i need help
