#blueprint
402296 messages · Page 595 of 403
Not really. Just depends on how you're using the macro, but then you don't exactly alter an array while iterating over it forward either.
I actually did try it, like this, but it doesn't seem to yield a different result
Returns as an actor (but should be a struct)
That's odd, the input doesn't seem to know what it is either.
Input is still wildcarded on the left side of your macro.
Did you disconnect and reconnect the map to the macro?
Yes sir
Hmm. Gimme a sec and I'll see if I can replicate that. What engine version are you on?
4.26.0
I tend to avoid maps, personally. I use blueprints too much, and they're not very network friendly. Struct arrays can do pretty much the same thing.
They just feel intuitive often, when you know you want a unique key
Even if you need to do manual RPCs if you want to replicate things >.<
You can do the same thing in a struct array. You just need some extra helper functions. Make one of the struct properties the key, and make a function that adds to the array, but only if there's no struct in the array with that key already.
True, yes
@narrow bear There's no way to do what you're trying to do from a blueprint macro. I've tried as well. However from C++ you can write custom k2nodes in a process very similar to macros that will work. I've built one for my project because I agree that maps are incredibly useful and feel more intuitive.
@narrow bear Can concur with Ramius on that. There seems to be an issue with multiple wildcards. It doesn't want to input or output more than a single wildcard type.
Also tested on 4.25.4, same effect.
Thanks, will make a note of that
That clarifies things 😄
Thanks for testing as well 😄
So, it's still doable, you just can't single node macro it.
This can do the same thing, pretty much.
The point was kinda to encapsulate it all in one clean node
Maybe I'll try the C++ route sometime
Maps are not very blueprint friendly. Not nearly enough helper functions and by the time you do anything with them, structs are usually easier and end up more robust and are easier to extend on.
@narrow bear If you're comfortable with C++ it's definitely a way to go. I'm actually in the middle of writing up a tutorial because there aren't any nice resources for it. I'll make a note to send you a link it when it gets posted!
Yes please!
Especially the replication thing, pff...
Yeah, definitely. To be fair they're not replicable even in C++.
Yeah
True
Is there a fundamental reason for it? Or just a limitation that never got fixed?
Somethings just don't happen if no one at Epic decided they ever needed it.
I would assume that it's just not a consideration. Maps are kind of a niche thing from what I've seen. There's very very few places where you might actually use a map over a struct array.
But most of the arguments so far have been on the grounds of maps being underdeveloped
Not inherent problems with maps
Sure, but the reason for that is immediately obvious. Maps are two properties. Only two. By the time you flesh that out, it's a struct with two properties.
I mean structs can also have structs. So like in your case. You can make a struct with an Actor pointer, and then a struct as the second property. You can make some simple functions that add uniquely based on the actor pointer. Can write a few simple search functions. In the end it's twenty minutes total work to have a robust struct set up. And who knows if you're going to decide to add properties to it at some point, can't add to a map.
Yeah, but then I end up having to do that each time I want to use a map-like struct array
It's a bit cumbersome
And who knows if you're going to decide to add properties to it at some point, can't add to a map.
The index will never change, I can always change the properties within the struct value that I assign to the keys
Maybe. Depends on the project. I tend to define my structs in the .h file, above the class I intent to use it in and I usually have a pretty good reason for using it. Inventories are a good example.
I mean, if you think defining a normal struct is cumbersome, wait til you start working with FastArrays. XD
One two property struct array.
USTRUCT()
struct FFoliageRemovalPoint : public FFastArraySerializerItem
{
GENERATED_BODY()
UPROPERTY()
UStaticMesh* FoliageMesh;
UPROPERTY()
FVector InstanceLocation;
void PreReplicatedRemove(const struct FFoliageTrackerArray& InArraySerializer);
void PostReplicatedAdd(const struct FFoliageTrackerArray& InArraySerializer);
//void PostReplicatedChange(const struct FFoliageTrackerArray& InArraySerializer);
};
USTRUCT()
struct FFoliageTrackerArray : public FFastArraySerializer
{
GENERATED_BODY()
public:
UPROPERTY()
TArray<FFoliageRemovalPoint> Items;
TWeakObjectPtr<ACInteractableFoliageManager> ContainingActor = nullptr;
bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
{
return FastArrayDeltaSerialize<FFoliageRemovalPoint>(Items, DeltaParms, *this);
}
};
template<>
struct TStructOpsTypeTraits<FFoliageTrackerArray> : public TStructOpsTypeTraitsBase2<FFoliageTrackerArray>
{
enum
{
WithNetDeltaSerializer = true,
};
};
Could you cpp syntax it?
Better 👍
Without getting too off topic, that's the FastArray version of...
USTRUCT()
struct FFoliageRemovalPoint
{
GENERATED_BODY()
UPROPERTY() UStaticMesh* FoliageMesh;
UPROPERTY() FVector InstanceLocation;
};```
🤯
Is there a reason why we can't straighten node to the left from a single node connector to the right ?
Isnt there a library that could achieve that ?
you want a library to fix something cosmetic that's not even visible in game?
just use Q instead of the contextmenu...
I have player state references i am wondering from this how I can get the assocated player controller
hey i could use some help with some movement in my game any chance someone could help me?
ug.. i hate this question even as I'm asking it. So My log class, has a base class which is implementing an interface in c++.. I created a blueprint from my interface and tried doing the blue print node 'Does Implement Interface' the object is my log.. and the interface is like interface_bp_c but the return value is always false.. thoughts?
im sure its something silly like.. the c++ class only implements the c++ interface and never the blueprint interface that the blueprint node needs.
because the logic and check is in the blueprint 😢
i'm like 50/50 on where this should be asked
since you've made this in cpp I suggest you ask people who are aware of how cpp interfaces work. I can't imagine that people here would know that on a whim
okay doki.. worth a shot
im trying to make a mobile game where the player moves to the touch and movement of the finger. heres my bp, but it move the character left and right when going up and down, and vise versa. why?
If it's a single player game you could store a reference to the player controller in the player state. Just do something like this in on begin play on the controller
ok i fixed it by messing with the settings like this, but now i want it to rotate the player left and right when touch going left and right is input, how would i do this?
UE4 has some built in touch control functionality. Why re-invent the wheel?
what you mean?
oh you mean the two thumbsticks? i dont really wanna use those, i want to just use touch for it
Yes, that's what I mean. You don't need to make them visible, plus you can change their interaction size. There's gesture controls built in. Etc.
@dawn gazelle id wanna be able to control the entire character with one finger, so moving is you press and hold, then swipe up to add forward movement, back for back, left and right to rotate
i never tried to make a mobile game before so im confused, this is my first one
also i wouldnt even know how to get to them to edit anything, is it a widget or?
so how would i edit or work with that stuff?
Go to the project settings, and go to the input sub menu. You can double-click on the "Default Touch Interface" icon and there's some settings in there, including the textures to use for the touch controls.
There's also a "InputTouch" node available in the player controller. The Location pin is updated every tick that the player's touching the screen, and you can use it to detect more than one finger.
oh
location updated every tick
but what if i swipe from where i start to the right without lifting my finger, i want the player to rotate right, how would i do that?
i just tried it and it doesnt work like the bp i showed, i click and move and it doesnt go forward or anywhere i swipe, it just goes a direction and stays going that way
ok i figured everything out but the rotation
@dawn gazelle maybe u could help me with this one, i want the actor to face the direction its moving, if it changes direction i want it to turn around and face that way, kinda like if you had a magnet under a desk moving a metal object on the top of the desk
Let's say I get 24hours format time or hours. How can I create a logic to create a day counter?
Rudimentary, but this allows you to move forward while holding down, and rotates the pawn 90 degrees when you swipe left or right. Deadzone is included so you can define how big you want the swipe to be.
no way for it to track rotating while finger is held without having to take finger off and swipe huh?
For that I'd go back to trying to use the virtual joystick. It's built to basically do that already.
sadly, ok well let me ask you this
my touching is set up to move it up down left and right even when touch is held the whole time
but i want the actor to rotate towards whatever direction its going, so if i go from going up to then down, i want the actor to face the velocity in direction its going, does that make sense?
Logic change - now you can continue to hold down, and move left and right and the character will rotate while still moving, but your swipe needs to move back to the deadzone.
ok ill save that for if i wanna change it, for now i kinda like it staying facing upwards for now
This gives you the logic to make it so the character changes direction based on forward and backward too. You just need to change rotation based on location Y similar to how I've done it for X.
ok kool, thanks ill be sure to check into that later if i decide to change it
Have someone know about an Alternative for Begin Overlap Events, because on some Actors Bp cause an Infinit Loop and shut down my Game , Already Trace i cant use in this Case
@wooden rapids what are you trying to do
That shouldn’t be happening, what r u calling on overlap ?
does BP_Minimap inherit from gamemode?
no just an actor
there's your answer
If it’s causing a stack overflow, it’s probably a recursive function @wooden rapids
oh?
the HUD widget is a default value of the GameMode class. So your class would need to inherit from Gamemode
@hollow cape That is incorrect
@trim matrix it should inherit from the hud class if it’s a hud
It looks like ur inheriting from a user widget
Also why r u trying to cast the game mode to a minimap?
if he's trying to pull the ref of the HUD from the gamemode, then it would need to be a GameMode to get that ref...going based on the first screenshot
I dunno what he’s trying to ask
but if i make a gamemode, also it doesn't show up..
Based on what I'm gathering, he is watching a vid, and in the vid they are getting a ref to the HUD widget from the default ThirdPersonGameMode. He is showing a screenshot trying to get the HUD from an Actor class, so I assume he is trying to replicate whats in the vid
Thus, the BP_Minimap would have to inherit from GameMode to get that ref
ok
I think he made a bad turn
What should go in instead?
Oh wait I c
When casting, you're getting access to the contents of the class you're casting to, but the input object must be a parent of the class you're looking to get into.
you should be able to pull directly off the Get Game Mode return and get the HUD ref if that's what you're trying to get. You are casting the gamemode to something that doesn't inherit from Gamemode.
I made a model of a cockpit in blender. I imported the FBX to UE4. Everything looks nice. It has two joysticks that I want VR players to be able to grab. I made it work in Unity and now I am trying to do the same in Unreal. The model of the joysticks is part of the overall cockpit (as one model, with many objects, in a hierarchy, imported from a single .FBX) In Unity each of those meshes were their own GameObject so I could attach scripts that received trigger events and modified their transforms when grabbed in VR. In UE4 though, there is one Blueprint class and everything is in a hierarchy but as Components instead of Actors, so when I add the Pickup Actor Interface, it's for the whole cockpit RootComponent (scene object), NOT specific to the joystick mesh like I want.
I feel like I will need to manually reconstruct the hierarchy after FBX import, so that the joystick meshes appear in the same transform position and rotation in world space, but are actually AActor objects themselves.
- best way to reconstruct without pain? I am wishing I could click on a Component on an existing Actor and choose "Convert to Actor/Blueprint" so its parent, transform, material, scale, etc. all remain the same but it is changed from a StaticMeshComponent to a StaticMeshActor
or maybe I could rename the models inside blender to have a specific prefix indicating they should become StaticMeshActors instead of StaticMeshComponents
when you are importing, do you have the combine meshes checkbox unchecked?
L want when my player attack and he press jump that time disable attack and jump.
that l have create disable attackanimation atleast but it doest jump excect u press again jump.
oh nvm i found an option during import that lets me create one blueprint for every mesh
Any possible way to enable editing for trigger volumes? Looking to be able to edit the bounds similar to a geometry brush actor, or like an audio volume's built in editing bounds tool
Hello I am making blueprint function that uses Editor Apply splines and I want this to be applied to desired layer of Landscape (for example by passing layer name as function input). Is there any way to do it?
Guys how do I create a simple Hold Button action?
why are you chopping and appending
@tiny meteor yes, but I was looking for more using the workflow say similar to geometry brush in level
Just as audio volumes can be edited
but for a trigger volume
I’m trying to create a very simple drivable boat , just like the unreal default vehicle project , but with a boat instead , i fail to replace its mesh and it would have other errors when i migrate
Any suggestion for a simple boat?
there was a live stream like a month ago where they went over doing a boat
Let me look up
Cant find
But i dont want it too advanced , just simple movement since its a lowpoly game
This week we'll create a sailing game prototype! Andreas Suika will demonstrate several areas of the engine to make a small sailing game. We'll use Marketplace content and create custom assets in Blender to be sent over to the engine. Instead of going deep on one topic we'll leverage tools like Niagara for wind effects, materials for sails, and ...
so that i could take away the string from the name and take the number and add it with 1 then append it with level. so that i could get the nextlevel
have you printstring'ed the resulting string that's going into open level to see if it's correct
that's the first thing you should check when you are having an issue like this
its acting like a replay button
unhook the open level, and put a print string so you can see if you are getting what you're expecting
it'll do that if it doesn't receive the name of an actual map
ok. i will try this now
misspelling will cause that
Oo 2:30 hours , thanks 😇
the current level number is not adding with the integer
i think its not able to fetch the current level name but it does show me the level according to the number in the integer node
is it possible to have an actor that contains two characters as components?
whats the use for? sounds interesting
a gaggle of people walking? Maybe a mech, haha
I want a 3d navigation system but there is no 3d navmesh. Since all my obstacles are rooted to the floor, I want the second (invisible) character to follow the first's x and y coordinates as it navigates (pathfinding on the floor is working fine).
Guys so i have a robot ( actually different kind of robots ), What i want is when i dmg them, they dont just decrease in health, but there should be hit effects, like for example when my electric weapon hit them, an electric particle system will play in the robot mesh. i have done this already and it look awesome. the other thing is im asking about is, i have different kind of weapons ( flamethrower, minigun, tesla, laser, bomb, rifle etc etc ) each one of those different weapons should have different hit effect ( i mean particle system ), so what im going to do is
add all the particle systems to the robot and make them disabled by defualt, and when that weapon hit them, it will enable the specific particle system.
So all of my robots is going to have all the weapons hit effect, but disabled by default. and when the robot get hitted by laser, laser effect will play, and so on for other weapons.
is this good parctice? does it effect perfomance? is there a cheaper way to do this?
Couldn't you attach the particle system to the projectile? That way it would work on everything it hits or you can filter it so it only activates when it hits certain actors etc.
If the effects aren't unique to the robot then they should reside in the weapon or the projectile (if the projectile is a separate actor)
hmmm
no, the laser effect will play on anything it hit
same to other weapons
so my idea is not the best
Yeah, if you have another enemy that isn't a robot it would also need to handle all those effects, so letting the weapon or projectile handle it is simpler
I suppose if you have some enemy parent class (or otherwise shoot-able thing parent class) putting the effect handling in there isn't the worst idea
I'm not an expert at these things so I also wonder what's "best practice"
But generally speaking you want to avoid having to copy-paste blueprint and systems across BP classes
for when you decide to add a new thing to the game
What's the best way to implement a click and drag to pan the player camera (similar to the video below, I tried reverse engineering it but failed though it works really well in Unity)?
I'm attempting to create an RTS Camera Controller. I have just about everything working (keyboard movements, rotation, zoom etc). I just can't figure this one out.
In this video we take a look at how to build a camera system for a traditional simulation/strategy/management game. We look at how to rig a camera in Unity so that it moves and rotates around a center point in the world, rather than from a "first-person" perspective.
We also look at how to focus on and follow an object with the rig.
Be sure to...
I can get a fairly crude click and drag system running but it feels very unnatural.
hey guys, just want to ask if anyone here has managed to implement a leaning mechanic (like in rainbow 6 siege) for a true fps character ? Right now my approach is to rotate the spine bones but when i look up and down, the arms goes 45 degree up and down instead of in a straight line.
Sitting at a facial animation system. 2D anims, everything setup and working... except transitioning between expressions.
All data is setup in objects that don't need to ever be instantiated. They are pure data containers and no modification to that data will ever happen.
Here I try to read the materials through the class defaults. Everything seems normal to me but somehow the input is invalid!?
Is there some restrictions or limitations to getting class defaults?
watching tutorials, listening to people tell others what to do to make something work that uses any form of float just astounds me that they tell or show people to use == instead of <. <=. >= or >. Anything that uses any form of float has the potential not to have precise value, yet i see people constantly telling and showing people to use ==.... any form of vector, rotation, scale, location, etc can't be depended on to have a precise value a value of 1 can end up being 0.99999989 rather then 1, and then the next time it gets added to it will be over that value of 1. please stop telling people to use == for these...
problem is finding those decent tutorials among the 100's of others.
Talking to anyone in particular or just ranting about the online world?
If its the second, telling the specific individuals that bothered you might be more effective!?
it may be related to the same issue as data tables, data tables don't like having a pen dragged in on a function / micro to break them even if the table type is set on the input pin. ran across this several times.
i have a intresting issue in 4.25... another one... i have a sphere thats should be blocking the sun light of all the objects inside of it:
but all the objects inside are still effected by the sunlight.
the sun light is dynamic but that shouldn't make a difference.
this same object works fine for blocking sunlight in 4.24, but in 4.25 it doesn't.
omg discord is being a pain in the arse now and won't let me upload the second image to show how its effecting it for the lighting....
just keeps saying "upload failed" ....
anyhow.... the shadows on the character are still being cast depending on the suns position in the sky... it shouldn't be getting any shadows from the sun at all, even encased it in a cube (last picture uploaded) and still getting shadows on the character.
is there a math equation for like
i want the HP bar to fill up to 100 hp
but take 15 seconds
so how much should i + to the bar
per delta second
@shadow saddle
Figure out how many hp per second need to be added.
Multiply that by delta second.
((100 - currentHP) / 15) * ds
Oh, good point. If it's supposed to be 15 for the entire thing but 7.5 for 50% hp then just remove the subtraction of currentHP
ok managed to work it out
tq
1.0 /5sec
= 0.02 per second
multiply by delta time
tq
I'm struggling to use UMG HUD button clicks to change camera actors... I want to use one single button to cycle between 12 cameras in order. I can use set view target with blend to change cameras, but they are all using their own buttons (12 buttons). I feel like this is super basic but I can't get anything to work. Anyone have any thoughts?
Hi guys, how can one get a variable from "game state base" ? i dont see way to cast or refer to it...
in google no results also 😄
@sick creek GetGameState will return you your current gamestate as a GameStateBase.
well i mean, i am inside Player Controller and i want to read a value of variable existing inside the GameStateBase BP..
oh ok, i get you... going to try
thanks
thats it thanks again
hey guys, if i want to share viariables across different BPs can i save them in the game mode BP and cast to it everytime i need them? Is there a more optimized way to do it?
please note @heady spear that u probably DO NOT want to store it inside Game Mode, but in Game State as me, or in game instance, ...
because of this:
game mode, u can only read on server not elsewhere
depends what these variables are
Oh i see, but if im in a single player will it makes any difference?
So structs... anyone have an example of how they’ve used them to set up a player in an organized fashion or data tables? For things like weapons of whatever? Trying to wrap my head around them today.
not sure about single, probably u act as server, so it could work in that case @heady spear
u have to try
@heady spear my answer applies
but for what i understand the "correct" way is to store them in the game state
its correct for variables, you do not want to access from client, but only from server
are they unique to each player? are they global to all players
I mean im making a single player game so the answer is depends... like if i want to store the vector of the position of a object on my level and i need to access it in a lot of BPs
theres only one player, im trying to learn which are the best ways to do it in case ill need to implement it in another project...
best ways is using the classes properly
PlayerState contains data to that specific player
GameState are global game information that all players need to know or can know
GameMode is server only, defines rules for the game, etc
https://ibb.co/gjJ0s23
I have a problem by changing the color of my hairs. They only change the number of the materials from the first hairstyle i choose (on style has 4 materials the others 2 ) .
you are not using set material correctly
top right
index should not go there
try to remove that
also on the second line, where u use it again
index is material index ID, u have to enter id of the hair material
or do you have multiple materials in hair and looping that ?
yes
Hi! I'm having an issue where casting to my player blueprint returns null in the animation blueprint. Is it not possible to cast to the player inside the animation blueprint? Or am I doing something else wrong. Help would be much appreciated!
(Try Get Pawn also returns null)
@ocean gate maybe try to find out, what are u getting when it fails
or you know its null already? inside of which file you run that code?
I'm getting "None" as print string output from get player character
i think he just cast to wrong BP, not to BP he wanted to cast really
thats why it fails
I would not Cast every frame tho
why not?
performance
LOL
but pawn returns null too 😦
Can't you just use a AnimBP Begin Play and have the reference just set once?
Henriko, you are casting to wrong BP, change that for start 🙂
ANimBP does not have Begin PLay
It does
no it does not
I tried doing that with Blueprint Initialize Animation but it still returns null from pawn
Pretty sure i used something like that
@ocean gate grab the TryGetPawn node, and print it out
are you actually playing?
cause if you have the AnimBP open
it will always print that
Yes that's in-game
no difference
oh wow then it stopped printing it!
ofc
its running the AnimBP for your preview
which has no character
hence the reason its printing None
@dark crow ``` /** Executed when begin play is called on the owning component */
UFUNCTION(BlueprintImplementableEvent)
void BlueprintBeginPlay();
and tbh i really don't like that
it comes from the SkelMesh begin play
Didn't have any problem with it personally, worked flawlessly, so may just use it like this instead of Casting every frame :'D
casting isn't that bad (well not in C++, maybe in BP)_
sometimes its quicker to cast than hold on to a pointer in the stack
due to time accessing the memory, etc
For some reason it still seems like it's not working all the way. It stops after the cast (even though it no longer prints any failure results from cast failed?).
@ocean gate have you printed after the cast?
in the valid section
not just the failure
have you actually assigned the animbp to the skeletal mesh?
It's it's in a Character you play
Click Mesh -> Animation -> Animation Mode -> Use Animation Blueprint
And select the Anim Class aka the name of the Animation Blueprint
AH
that worked excellent!
Now everything is working correctly
Thank you so much for your help @worthy frost @dark crow
One more question, I'm a bit confused about animation blending using blend spaces. I have the speed output going into the character blendspace node and then to the output pose in the Animation Graph, but the animations don't blend at all and just snap to whatever animation is applicable (snaps from idle to running and running to idle with no interpolation of the animations whatsoever). Any idea why that could be?
(Speed goes from 0 to ~450 or so)
Hey theeeere... ! I'm looking for a workaround to replicate Map Variables :o
does anyone know anything ?
OH wait I think I figured it out, the player speed is way too high for the blending. Nevermind!
@ocean gate you also might wanna rename your axises just so you know which one is which
btw you are passing speed into both axis
Speed should be on your vertical axis, direction should be on your horizontal axis, if you are just having forward, then use a Blendspace2D
speed*
sounds more like an #animation question for future reference
Do actors store their data independently? I'm studying a FPS asset before I work on my own project but I'm seeing some issues, but it might be bad code.
What I'm trying to achieve is to store all the logic in a gun and have the player interact with it, so if I shoot once with one gun, then pick up a gun that is a duplicate of the other, will the duplicate also be missing one bullet?
so each actor in the world should be unique
yes
alright thank you
why can i not make a render camera ignore dynamic lighting???????
can someone tell me how i can find the "PRINT STRING" node that i put up in my bp that prints "fail" ? i used it to bugfix something but i cant remember where it is 😄
look in the output log, it shows what calls it
you can also use the "find results" search at the bottom of the blueprint window, look for "fail" and then click the binoculars on the right side - this will search all BPs for you.
but i have to be in that blueprint?
How do I change a players max movement speed in multiplayer?
clients end up becoming super jittery
fire event on server, set the movement speed in the actor component fire multicast to clients to update actors speed.
oh so it needs to be a multicast..
for client -> client play or Dedicated to both work it seems.
you could do something simple like this (where set speed is the thing that handles how fast they move) and it works fine:
sprinting in BP is kinda terrible
best way is to send it as a saved move, but that is C++ only :/
The game I am doing is a sprite based rpg so its not a huge priority
polish phase maybe
are there any good tutorials on learning just the AI aspect of things?
#gameplay-ai and there are some older books, etc, possibly a few youtube tutorials
oh thanks didnt see that that channel
so i found a issue for my issue with the dynamic sun light, in the actor blueprint for the inventory render, I switched the meshes and its point lights lighting channel to 2, and now its ignoring all other lighting when rendering:
so... some might think this is a simple question.... but.... how do i get a reference in a widget to a world actor?
without using line traces (item could be anywhere in the world)
Does the actor exist when creating the widget?
yeah its a permanent actor in the world
You could feed it in by exposing a variable on the widget when creating it.
i.e. player is in world and hud needs to display the direction of city X. so needs to get a reference to the actor that points to city X to calculate the direction
say... this was city x marker:
(set the variable type to the object's actual class reference so you don't have to cast)
yeah i know how to do all that but how do i get 'my direction actor'
Get all actors of class, or by tag.
so no really simple way unless you have something like the references stored in the level bp?
How many of the direction actors can exist at the same time?
well thats where the problem happens, wouldn't want to grab the actor for Y or Z, just X
Use tags then
im guessing this one Datura? can tags be changed on placed actors? (sry don't know that one)
Yep
Hello ! When my character is sliding, I have a head tilting in degrees. For now I can only choose a fixed degree whatever side he slides. I'd like to know how I can get him head tilting on a specific degree when he slides on the right side from the camera rotation ?
ty @dawn gazelle i'll give that a go 🙂
Is it common to use data-tables and structs together because data-tables are made from structs
? and data-tables can't be modified at run time.
Data tables use structs, their output is a struct of the row you're pulling from. And no, they cannot be modified at runtime - they're not meant to be a database.
i'd love to find a simpler way to do head rotation lol:
Here my character is sliding on the right side of the screen. I'd like to make it understand that it needs to headtilt negative xx when it slides on the right side. And positive xx on the left side
That's what I've typically used data tables for. Apparently you could also use data assets which are apparently a bit more powerful and you can do more things with them. For example, you could easily create a beastiary by using data assets without having to manually update anything other than creating more data assets children for your monsters, though I'm not well versed in those myself.
thats what im doing for my npc's, datatable, and then assimbled from that in the master npc blueprint when constructed.
I'll look into it
the only thing i can say about that is to make sure your master bp doesn't have a animation bp assigned to it, else you get all sorts of errors in the log about 'incompatable animation graph' even if they have the right animation bp assigned.
(that was for Zykoz on the database driven characters)
I'll formulate my horrible question in a better way : I'm gonna make a condition. I need two paramaters that will need to be superior or inferior to each other in degree. How can I find these :
1/ Finding the direction of the movement of the character
2/ Finding the direction of the FP camera
@orchid garden I'll have to use data assets for the monsters/weapons etc. Right now i'm trying to make a skill tree. I think i can get away with just a data table for this 1.
only thing i've used a data table for for the critters so far is what mesh(es) make them up, what animation graph they use, and what items are attached to them (i.e. accessory items) haven't gotten into the combat side of things yet.
Haven't done a skill tree yet, but im thinking a datatable will work fine for that as well, just gotta figure out how to link them together if your doing a tree based skill tree or a level based tree (or combo). im guessing different methods for different tree types.
I have a skill tree component
there was a free skill tree bp system in the market that might help give you ideas how to go about it, lemme see if i can find a link...
ah i can't its no longer available... been removed from the market place :S
well im using GAS too
i guess for the widget to make it modular i can use row/column for each skill
because i'll have pages like diablo 2
looks nice
@solemn parcel You can get the direction of the camera with GetForwardVector on the camera component
Direction of the player's movement = the unit vector of the player's velocity. How to get the velocity depends on how your player actor is set up. If you use a movement component, you can just get that comp's velocity. A more brute-force approach would be calculating the player's velocity each frame (i.e. the change from last frame's position divided by delta time).
would you need to know c++ to change some post process value settings like an increasing intensity of whatever or can it be done in bps
for lights or in the post process?
@keen goblet Thanks i'm trying this
i mean for lights themselves (if dynamic lights) you can do something like:
@keen goblet You meant something like this ?
Good afternoon guys, can anyone point me to a learning resource or advice on how to make a in game timeline which players could interact with to move the scene time forward or back?
@solemn parcel Not quite. VectorLength is like the numeric value of the vector, so VectorLength(GetLastUpdateVelocity) gives you the speed. You want to do Normalize(GetLastUpdateVelocity), which gives you a unit vector conveying the direction.
GetForwardVector returns a unit vector already.
@bold oracle how big of a scene? That's gonna be hard if it's of any decent size
@faint pasture it would vary. Hard as in computing wise or linking all the object in time wise?
@bold oracle What kind of timeline? Are you talking about reversing time, or simply setting thing's values to where they would be for a time of day?
@keen goblet Thanks a lot 😉
@maiden wadi yes it would be reversing time similar to scrubbing through a timeline in a video editing application
Do your things run on a sequencer? Because if not, you need to constantly save everything's transform at standard intervals and reverse back over them or forward through them.
hey guys I'm trying to make a pawn main character and my capsule collider isn't working, I'm not really sure what is wrong
@maiden wadi currently no however I would need the ability for the player to change the object's transform and have that change be saved through the whole timeline
really just looking for a robust core to build out from for what I need
Best I've done with that is create an actor component that can be placed on actors of any kind, and when triggered, would reverse their time by the input amount. All it did was record transforms over time up to the max reverse limit. You only really need like five to ten transforms a second and some math to lerp back through them.
@maiden wadi ill try it out thanks for your help
can anyone help me with my character movement?
do I need to have a movement controller for my collider to stop movement when I hit something?
How is your pawn set up currently?
And this is a Pawn inherited class, not a Character?
Odd. Either way, The issue is that it's falling through things?
yeah it doesn't collide with anything
it also flies but I could just lock an axis, I'm more worried about the collision not working
What is the capsule itself's collision set at?
What movement component are you using?
I'm not using one, I'm new to UE4 so please excuse if that's dumb
I didn't know they existed until like 10 mins ago
should I be using one?
Haha. It's all good. I assume that you're just making it move by adding to an axis on tick or an Axis input?
I'm making a vector for movement based off where the character is looking + input, and adding that to the position
then I set the actor location to the new pos
so I should be using a movement component?
You could probably get away with checking the Sweep option in the SetActorLocation. But using something like FloatingPawnMovement might go easier.
In short, collisions only work one of two ways.
First is Simulating Physics. Which you definitely don't want on a character. It basically detaches the object from it's actor and just makes it act like a semi realistic object with gravity and falls, if it has collision it'll bounce off of things, etc.
Second is sweeping movement. Most movement components use sweeping movement, because what it does is takes the actor's root component and 'sweeps' it along the vector that it's supposed to move to and stops it the moment that it collides with something. Normal SetActorLocation is more of a teleport, poof gone from here, poof, arrives here, no checking in between.
Both FloatingPawnMovement and CharacterMovementComponent use Sweeping movement to move their actors. CMC is much more robust, but it's strictly for actors.
It's also worth noting that there's actually a VR version of the character class, somewhere. Can't remember the exact class name.
ok thank you, it sounds like I need to attach a movement component
Anyone know how i would make this shadow softer?
i'd like to make the shadows lighter / darker depending on the time of day
If it's the light cast from your sun, there's a "Shadow Amount" variable that changes how strong the shadow is.
yep it is, ty once again @dawn gazelle 🙂
Hi everyone, is it possible to get the brightness level of a level or nearby lights? I want have lighting as a factor to the AI perception
@bold oracle Idk how you would implement it but look into csgo, overwatch etc demo systems
I feel really silly asking this, but Unreal beginner and all that.
I want to save details (location, material, etc) about an object between levels, but it only needs to be persistent between game sessions, so I know I need to use Game Instance.
However, I'm misunderstanding if I need to create a whole save game object alongside the game instance. I feel like there's a way to go about it without creating a save game object, but honestly, I'm probably just missing something conceptually.
@rough wing srry what do you mean "demo systems"?
When you say persist between game sessions, do you mean between just while the game is open or do you want to save the game so when you launch it again in the future you can load your game?
Then you do not need a save game object specifically. You can create variables in your game instance that can be read.
I have a variable set up under "BP_GameInstance" (nothing there but it's type), and all the code previous to this "Set Intractable" works.
It just doesn't save between levels.
I think I'm just missing a handshake or something before the "Set" node
Hey yall im having a problem with duplicating the same actor
I set up a system to destroy the capsule component when the chosen actor dies
And i set it to the event tick to check if the actor is dead or not
Does anyone have any idea what inside the thirdpersonblueprint makes the character rotate towards the travel direction?
I dont want it to constantly destroy the capsule if the enemy is dead so i put a do once node
@bold oracle Some games keep track of events going on in the game. Csgo calls them "demo's".
Only problem is that for some reason, the Do once sticks to its name and does once for all actors on the map
I was wondering if theres a way to make a do once, do an action once, but per actor
Cuz the actors i have are just duplicated
If you're transferring between levels, references to things in those levels disappear. So if say, you wanted to 'save' the interactable state of an actor, on the next level that actor will not exist. If you're spawning a new one, then you'd have to set the interactable state of it based on what you've saved.
Just destroy the actor itself, not the capsule component.
I want the actor to stay because I set it to ragdoll
nevermind I found it!
Do you think an 'is valid' node would work?
Ah, I see
So if it's deleting all previous references, how would I save the references of that previous level?
@rough wing oh ok I see so maybe like fortnite replay mode? Cause that uses ue4
@fading raptor It's more likely that you should simply consider making a single event on this dying actor that gets called when it dies, rather than checking it every frame. This event can delete your extra components and set the mesh to simulate.
Just a question, but why duplicate instead of spawning a new one?
@maiden wadi I tried doing that, but my whole code is set up in a way that makes it come out as an error
and @dawn gazelle whats the difference?
What comes out as an error?
Spawning would give you a fresh new actor. Duplicating would be copying the state of the actor as it was and spawning a copy with those parameters.
Basically my code is set up so there is 4 times the actor dies, 3 of the times when it takes enough damage from a certain ammo type, and the last time is when the head hits the floor, so when I try to destroy the capsule on all 4, it gives me an error because it tries destroying it 4 times at once
and I tried spawning the actor but I got a problem with the actors damage to the player
For some reason it wouldnt apply any damage
Im trying to make a boolean to check if the capsule is destroyed, and if it is then dont destroy it
Maybe that will work
Ok so it kind of fixed the problem, now i only get an error based on how many enemies i kill and it says that the capsule is pending kill
You would want to save the specific details that you want to save as their values (perhaps in a structure of some kind) so if you have say "interactable" is a true/false value, you would need to store it in a boolean variable, and then when spawning that same actor in the new level, you make it read the game instance for what values it should have set.
@dire lava In short, nothing in an actor can survive a level change. You can save properties either in a SaveGame or in the GameInstance, and then recreate your object in the new level based on these properties. But objects themselves cannot be saved. That blue variable that you're setting is called a memory pointer. It's a simple 4byte variable that points to a location in memory where the actual object is. So when you save that, you're saving that memory location. When you open a new level and look at that memory location, either nothing or the wrong object type will be there, so the pointer would be invalid to use.
Alright, let me try to rig something up in the game instance BP before I try to make a save game
Thank you for the help so far, will update when I get somewhere
The only real difference between GameInstance and a SaveGame will be that GameInstance will get deleted when you close the application. If you don't care about that, you don't have to go through the trouble of setting up savegame objects.
Yeah, I only care about the current session, I don't need data to be saved every time I boot up the game
GameInstance should work for what you're after. But yeah, there are very few objects that ever survive a level change. GameInstance being the main one. I think UPlayer(Not APlayerController) does as well. Everything else is literally destroyed and recreated in the new level.
I think this guy has an interesting idea of how to do it, although he doesn't give exact directions, he tells you how he goes about detecting light levels of a player.https://www.reddit.com/r/unrealengine/comments/8hcfwy/light_detector_method_inspired_by_the_dark_mod/
I think his approach is probably a better one to go with rather than trying to capture nearby lights - otherwise, you could set up lights with collisions so when your player is overlapping them, the player could store themselves as being in a "light" state and perhaps with an intensity value based on the intensity of the light it is attached to, which the AI sense could then read off the player actor.
I always wondered how I would do that one personally. Always did love playing Thief.
I set up an event to shoot. I want to lock this event for certain times so that the player cannot shoot continuously. For example if it fires, it fails if it repeatedly works within a second. How can I do it
Boolchecks, mostly. If you don't want to clog your variables list, just make a simple macro with a branch and a float, and a float input. You can lock your execution line for the duration of the input float.
Ok, I'm seeing part of the problem
I'm setting the "Target" to my instance of the "BP_Interactable" in the level itself.
So if I make a structure, I should just be able to grab all the info needed and then I can set my game instance's "Interactable State" to the struct, yeah?
@trim matrix Not sure if I fully understood, but something like this might be useful.
@dire lava I believe so. Even some of most robust savegames are simple just an array of structs that populate the struct with the class's necessary values to save. On load, you create a manager that will open the savegame and will spawn a new actor per struct and apply the values in the struct to the newly spawned actor. You're pretty much doing the exact same thing, except from GameInstance.
Hey there, does somebody here understand Unity Shader Code? There is a free tutorial online and I would like to similar stuff to unreal. Would be great if someone is open for having a short call. Can share quite a lot back as thanks.
*implement
lol
@young mountain You would be better off asking that in #graphics for shader oriented questions.
I think you're in the wrong discord
Ok thanks, I will post there
Okay, another silly question, should these variables I placed be on my game instance on not my interactable object?
Cause it seems it's gonna give me the same output of nil.
On the begin play of the object, have it read the game instance for its values. Before moving to a new level, set the values that you want to save from the object in the game instance.
On the first level, it'll get the default values you have set in your game instance.
On the next level, it should read whatever you saved to it.
I should be doing just that, but still nothing
If I posted the Blueprints, would you mind having a look
It looks like something isn't saving to the struct
sure
- This is the struct itself. The values only fill in when set in the BP.
- Just to see if the local variables on "BP_InteractablePedestal" were the issue, I made variables under "BP_GameInstance" that grab the material, location, and if the particle system is activated.
Hello everyone,
I came here to say that i f'ed up. Im trying to make RTS game with RPG elements. I'm about 6-8h into making it. But i did something with my camera bp at the beginning and i saw the outcome of my doing only just now. My camera sphere goes through sloped landscape like it does not have any collision.
I spent like 1-2h checking everything but didnt find even a single clue what's wrong.
I would be grateful if someone helped me with it. Mayby someone with "fresh" look can find my mistake :)
Cheers
- Once everything's been set on "BP_GameInstance"'s copies of the location, material, and activated variables, they're set in the structure variable on Game Instance.
Then after that, I set the state of the interactable in Game Instance.
I should be able to clean up this BP a little bit so not everything has to rely on Game Instance, but I want to make sure that it works before I default the values of location, material, and activation to just copy whatever's on BP_InteractablePedestal
Your cast isn't plugged into that execution path
The first place that your cast is touching, which appears to be before this.
You can't have pins from one execution path plugging into other execution paths. It's a disaster waiting to happen and it's messy and usually will not work. If you want, you could set a variable after your cast and store the reference to your game instance and then call it where needed.
Bad:
Good:
Alright, just cleaned up some of my code
And I remembered BlueprintUE exists, so I copy pasted my stuff there
https://blueprintue.com/blueprint/c59-ea8y/
I put the "Set Game Instance" in there, but if it's not showing up there, give me one moment
2 things you should avoid:
- BP Stacking
- refusing to use variables and drag the value across half the planet when its used 100+ times
also make this a pure function instead, then you don't need the begin play
is this basicly the same as a delay with 2 seconds? or does this use "less" performance when its on a event tick?
That was just a macro that would stop the execution line. It's not a delay. I just used tick as an example. You could do the same thing on an input key and spam the key, but the event on the right side of the macro would only ever run every two seconds. Or whatever input you give for the input float.
I cleaned it up and I'm trying to do a couple of print statements to see if there's anything that isn't setting
As soon as I get out of this infinite loop, it does seem like the correct info is being set
another knot in my head. i want to access a variable from my animation blueprint via a behavior tree task. basicly i want my npc to look at the "target"
how do i reference the anim_bp from the btt
store a variable in your AI character or AI controller blueprint. that's your link between the animBP and your BT
I'm trying to write a dynamic (video from Spout node) material to a Render Target at runtime using Draw Material to Render Target. New to UE4, so I'm prob just missing something in my logic, or a missing a checkbox. Here's the BP:
Could someone take a quick look and advise?
Could've sworn someone here just asked whether editor-only functions can add entries to the undo buffer. It never occurred to me but now that I look into it, UE4 seems to have a standard macro to facilitate that ("CreateTransaction")...
I did but I solved it after posting ahahah
it was not that complicated, there's just no documentation on this stuff :(
yeah, I have an editor utility widget and I'm gonna try implementing undo functionality with that
documentation is pretty vague
do you want a screen on my implementation?
sure
I'm just not sure how the Context (string), Description (text) and Primary Object inputs come into play
thanks for the screenshot
Context and Description seem to be more on the advanced side, you can leave them empty I think
You're welcome
Is there a good UMG/Blueprint pattern for this? I want to have a function that takes in a delegate. It fires whenever the list view selection is changed. However this function would cause a bind every single time it executes. I want this delegate to be one-off.
I've never seen a delegate set up like that o_o
Yeah you can pass in delegates if you pull the pin from a bind to a function input
What's really cool is that this totally works
But I know it's a footgun. Eventually I'll have double bindings
Hmm, can't get the undo thing to work at all. It's a dead simple Editor Utility Widget that takes a selected actor and moves it by some increment. I tried putting Snapshot after BeginTransaction, and plugging the widget (Self) into Primary Object... no joy on any of that. Ctrl-Z acts as if it never happened.
(sorry, had to eat)
I'm sorry if I keep asking simple questions, but you know when you've hit a wall and you're just stuck? I'm at that point.
But the good news is once this is over with, I can move onto other small issues with this game.
The info is indeed saving, but nothing's happening to the interactable. I'm in the middle of changing it to an array again to see if maybe that works.
Is there an elegant way to get the world velocity of a scene component?
put end transaction after completed
I'm not sure I see the benefit of having that delegate within that particular function. If it's on the completed path, that's just as valid as placing the delegate after the function is run, especially if the "Item List View" object is not a local variable.
nope, still doesn't work. Ctrl-Z acts as if it never happened and just undoes my BP node graph edit.
@faint pasture Doesn't USceneComponent have a GetComponentVelocity?
Whats your begin play looking like on your interactable?
@dawn gazelle the benefit is not having to bind before use, you can call a function and pass in a delegate, much like many functional programming languages
@maiden wadi that's only relative to parent.
maybe delete the context
yeah, I tried removing/disconnecting all those fields... no effect.
idk then
@faint pasture Huh. Fair enough, only ever used that for simulating physics. I guess the only way is to update it on tick.
@dull sequoia I got it to work. I followed an example online (https://chriszuko.com/implementing-undo-in-ue4-editor-utility-widgets-and-blueprints/) and it's just BeginTransaction --> TransactObject --> (do stuff) --> EndTransaction.
yay
Nice, thanks for the screen too, I'll try and see if it works on my end
it works but I can't get the description to show up, how did you know what context to use?
I didn't. It's just the name of my editor utility widget.
Compile your BP?
I always forget to do that when making editor functions
Huh.
@dawn gazelle
On BeginPlay, for all instances of the BP_InteractablePedestal, I get 0,0,0 for location, true on the activation, and none for the material (all of which is expected).
When I place some BP_Interactable, the "Interactable State" updates the info as expected, and the info carries across the maps. However, the position of the BP_Interactable doesn't change upon map change.
Are you setting the interactable's location on its begin play based on the value loaded from the game instance?
If anyone has any input on how I can get a player controlled AIController to be able to move diagonally with WASD please lmk :] https://answers.unrealengine.com/questions/1003455/8-way-character-movement-with-aicontroller-and-was.html
@sweet swan Your best bet is probably just to make a directional vector, and keep updating it via WASD axis events.
how can i attach myself to an actor without me going inside the actor like i kinda want to keep the distance i started with
Is me the player character?
ye
You should be able to do that with the attachment settings. KeepWorld, KeepRelative, and SnapToTarget.
@maiden wadi I'm having trouble determining how that might work, do you have any examples?
nvm I got it to work 😅
set a variable they share and a boolean if the axis is not zero (being pressed). If the other axis is being pressed, take the value from the variable they share.
I actually had to draw a graph lol
I cannot seem to find out how to apply both the "listen" option and the "game" option when using the "Open Level" BP node to host a game.
What's the syntax? Should it be like '?'-separated or something like
listen?game=GM_MyGameMode
do I need to have a hyphen/dash character anywhere?
this was made for 1 spell to damage the npc, but i made a second spell, how would i add damage from the second spell too?
make a parent spell class and override damage system in child classes
Separated with: ? Yes
Basically ?Listen?game=<shortcode>
As a blueprint, I prepared some weapons. These weapons include events such as Fire and I want to access them from my character. I created a component for a player named WeaponComponent. I want to put all the gun blueprints into this. How can I do that?
Spawn them from within the Component
@trim matrix are you just using the component as an attachment point for the gun actor?
You can either spawn and attach or use a child actor component (basically a scene component that auto spawns an actor). You can also attach a weapon to a socket on the mesh.
how can l set my anime notify works in all animatiomn?
So I have a volume slider that works perfectly in editot but not at all in build. I have no idea where to even start with debugging that. Basically the colume slider just sets a float from 0.0 to 1.0 and the volume is set to that float. Super simple and like I said works in editor. Any idea what would cause that?
hey guys how can i make a character move only on axis using AI? i want to make him move only horizontal or vertical on my map but ofc the moveTo find the shortest path...
Line Trace is perfectly fine. But my NPC looks in a totally different direction
I added "world rotation" and "combine rotator" but it makes it only a little less strange :/
What am i missing? the rotator that gets set is a modifier for the head bone in the anim_bp
lol with the socket roation he become a helicopter 😄
yes you need to go to your project setting and enable AI Debug Plugin and Gameplay debugger (and assign a key)
then look ingame at your NPC then press debug key
what do you want to do if not debug your AI path?
just see it as a gameplay mechanic?
show navgiation console command for example does that
The video you show is not playing the game but simulating
Hey Guys, I know this has been asked a few times but i cant figure out how to set it up.
I have a Tank, which consists of a Base and a turret. The turret is parented to the base with a Socket. You can move the tank with WASD and rotate the turret with the mouse. Now i want to make the turret point at the mouse cursor.
- Do i have to build this in the "pawnBP" or do i have to set up a "controller"?
- What are the Nodes make the turret look at the mousecursor?
Hope anyone could help me with this.
Thanks a lot 🙂
This was just a test (still a newbie).
I´ve got the mouse to be visible but now i have to press LMB to rotate the turret and it´s still not looking at it
@obsidian notch You need to convert the Mouse Location to an actual Location in your Level.
There are nodes like "ProjectMouseToWorldLocation" or so
(they require the PlayerController)
You can then use that Vector and the Location of your turret/tank to get the look at direction/rotation.
So I need a PlayerController for the Turret and a PawnBP for my Movement?
You have a PlayerController anyway
With "require" I mean that the functions are members of that class
Such as the ShowMouseCursor variable being a member of that class
I have a UMG Button that when pressed SHOULD move the camera according to a level sequence , but when i'm running the game the sequence doesn't work.
the problem is from the level sequence, because i tried setting the level sequence to play at an input in the level blueprint it also didn't work.
This code is from the UMG button "on clicked" event
@surreal peak Thanks, I´ll try to make it work this way 🙂
Hey there... I wann check if the whole array of booleans I have is true :o how would I do ?
That "note" on your cast is probably telling you something. Why are you casting here anyway if you're not doing anything with the object?
i dont know how to do it another way..
the camera is attached to the main character pawn
Get all actors of class -> for each loop -> your branch
Ok, but you're casting to something but then not using its value, and again, there's a note on the cast node - when you press the compile button there's probably a message in the compiler results about it.
The note on the cast node is just because he's trying to cast a pointer that's already that type. So that cast node is nothing but a validity check.
wouldn't it be smth like this ?
(I was hoping he would figure that out 😉 )
so get owning player is same as get all actors of class ?
No, getting all actors of class is getting a collection of all actors in the world with the defined class. Get owning player in a widget is finding who the widget specifically belongs to.
ohh i see
So whoever presses the button gets checked on wther that bool is true or not and gets send to the level (or not)
Casting is only required if you're trying to get to a child object of a class. In Ayuma's example, "Get Controlled Pawn" only returns a "Pawn" class object. Then they're casting to "ThirdPersonCharacter" which would be a child of the Pawn class. This then allows you to access any values or functions stored specifically within the ThirdPersonCharacter class.
Finally, you probably need a "play" run after the level sequence player.
oh.
u do ?
thats..
ok
thanks
i was stuck on this for a week , thanks guys : )
Glad I could help ^-^
So ehh any guesses ? :D
An array of booleans you say.... hmm
yea I can't just make "this" many variables since they change dynamically
cannot use a for each since it can't compare multiple values inside of it
or can it ?
Well... what did I expect... -_- xD
You could, or use this:
but what if the first (0) is not true but the others are
The find command you have there returns the first index of false. Index 0 is always the first index in an array, so if the find returns anything >= 0 that means it found a false value somewhere.
Here's a foreach loop with break alternative, but I think the find way is much more elegant and doesn't require any additional variables.
Well you could just get 0 and check if its true or false, no need to find.
whats the shortcut for the reroute node ?
double click on the wire
oh ok
@rotund basalt well that doesn't help :o I need all of the booleans be the same way... the find is good here
Found a Tutorial from 2014 on crating that rotation to mouse cursor. He creates a Macro to get the cursor location and there are two nodes i have no clue what they are.
https://gyazo.com/64493b874181c93d714565e084c428f2
https://gyazo.com/9b6186c924735ecc7f285f3da594395c
Top one is Float != Float
Thanks a lot you two 🙂
I would concur
@dawn gazelle would this... "work" ? o.o it looks kinda odd to me (like would it replace the maps value with the new one ?)
No won't work
@fair magnet Your the first person i've seen who actually needs a bool array lol
Neither did I
but I have Regeneration arrays going on and I wanna disable the timer whilest all values are at max
You can use bools to represent bits, therefore a boolean array.
that is kinda neat ngl
Hey, a little confused over finterp. What are the Delta Time and Interp Speed inputs exactly?
I thought perhaps you could use the Delta Time as a reference begin time, and then Interp Speed as the end time, thus making a time interval to interpolate over, but I guess I am wrong since a constant factor in each of the inputs returns no change in value?
nah
delta time is basically the frame rate :o
therefore interp speed is how long it takes to reach the target
you either use "get world delta seconds" or the event tick delta time float
Oh so its kinda like, it needs to know how frequent the hud updates, and the Interp Speed is some kinda relative difference to that time?
hud updating as in frame rate, i mean
the is
finterp
and finterp to
both interpolate between current and target value
the normal finterp adjusts the interpolation rate based on the Interp speed... which basically means:"Oh shit I'm late hurry up"
finterp to constant does the same at a constant rate which basically means:"Oh I'm already late ? ah well okay"
Please note that it doesn't make sense using these on a non ticking event
Hm maybe thats the issue. I have an event based system, I guess. If I do the following in the figure it works fine with a specific amount of change, but a higher change messes up steadiness of it all
Oh, the world delta seconds should be connected btw
needs to tick
maybe timeline is what you need
but since I don't know what you're trying to accomplish it's hard to say
UpdateVigour gets called everytime vigour changes. This makes it look messy especially since regeneration and depletion are different effects
Excuse me for that but as of now I don't know what Vigour is :o never heard that word before
But never messed with timelines, they can be used instead of tick perhaps?
Haha, np. Think of it as stamina, I guess
They can be used with event yea
but they also have an issue
you cannot use them in functions
Oh timelines?
ye
the update event right here would be a "tick"
which only runs aslong as the timeline does
Yea they don't seem to be accessible anywhere in the widget blueprints at least
Not sure what the "ratio" you have in your example is, but this would work.
(and whatever else you want to add into your add vigor function)
Yea, I guess I could update it on tick, doubt it would be an issue, but I kind of hoped that perhaps you could do it somehow outside tick
You could create a timer if you only want it to update every so often.
Less resource intensive than tick, but not smooth motion.
Never tried them, but I'll look into them. People do seem to endorse them whenever I see them mentioned
I love them :D
I guess that could actually work, as long as you set the update freq properly
Well but I don't love that I'm not able to use them in Actor Components...
oops misread XD
only my "regeneration" system is larger than my whole attribute system itself lmao
How can I cast to an actor with a reference to the child component version of it as the Object?
just cast to the parent actor
So wait... you have a Parent Actor ? and a child based of it
and you have the child reference ? and you wanna cast to the parent ?
Works now, someone in #ue4-general told me to ask here then found the answer
Sorry for wasting your time
I see :o
Anyone know why open level automatically teleports clients to that level aswell?
Hi all, hope you've having a good break
can anyone help me understand how to add the player aim vector to this? Currently my horizontal rotation is taken into account, but not my vertical rotation. Thanks!
break?
assuming people taking a break from jobs etc. for xmas 😄
Are you expecting different behaviour? Normally in a multiplayer setting you'd want to change levels while keeping all clients still connected. Perhaps you're trying to use level streaming?
Also, if you're working in Multiplayer, I believe that ServerTravel is supposed to be used in place of OpenLevel.
@trim matrix Instead of making a vector out of your randoms, it might be easier to create a random rotation out of randomizing the angles on the pitch and Yaw of a rotator, and converting that into a facing vector and then multiplying it by speed.
@trim matrix
yes?
hi
sup
yeah but
so on overlap, if left click is pressed
@trim matrix What blueprint has the overlap events?
oh.. do you have the button?
yyes
Your player or the door itself?
Oh, I see, so it is a prop that triggers it
so i want to left click on a button prop to open the door
Gotcha
it's a very hard part for me in ue4
Ok, do you have interaction system already setup, or you looking to implement that now?
What kind of game we dealing with? First person, third person, top-down, etc?
first
first person
@dawn gazelle The issue is both clients seem to be synced together from the very beginning. I don't want that to happen until after a session was created and joined
Ok, so you want something similar to what @coarse forge showed in the general channel. That is in C++, but same logic applies in blueprint as well.
You will want a line trace that runs from your camera a set distance forward.
ok
That is triggered when you press your "interact" key
yeah
@trim matrix Oh, that's my bad, I see what you mean with this. Normally you would simply spawn the bullet projectile at a socket's location with it's rotation.
So this can be inside player controller or the player itself.
ook
depends on your door type to how you'd interact with it.
my doors are setup to use my pickup interaction system, so the players pickup check checks the item type its hitting, if its a door it fires off a interface call to the door and the door runs its open close.
other people use hit boxes and when the player is in the box they can press x key to open the door.
yeah, my objects have pickup tags and interact tags and interfaces that the line trace checks for
@maiden wadi problem with my character right now, is they don't rotate at the hip. So I can't rotate the character vertically (otherwise their whole body rotates). So for now wanting to get the camera vertical rotation (currently separate from character rotation) and add that.
because it's easier
with hit box
@proud hull
are you here?
@trim matrix Third person I take it?
no first
perhaps this can help you @trim matrix its me bro has setup a small tutorial series on basic doors and interaction: https://www.youtube.com/watch?v=XgpgizFcR9Q&list=PLGm9gBuuMTevYvJubYrybU47h0ZvYRUjK
This is a preview video for the Door System series.
Link to the full playlist.
https://www.youtube.com/watch?v=XgpgizFcR9Q&list=PLGm9gBuuMTevYvJubYrybU47h0ZvYRUjK
Join our discord: https://discord.gg/Gr9sPP2
Free assets: https://itsmebro.net
Donate: https://itsmebro.net/donate
Patreon: https://www.patreon.com/ItsMeBro
okay
@trim matrix Are you doing a full body first person sort of thing? Normally in first person, an arms mesh is attached to the camera component, and then weapons are attached to the arms, which allows you to move the weapon simply by rotating the camera.
something like this?
@maiden wadi good point. I have 1P and 3P both, but I think i'm attaching my weapon and doing the calcs on the 3P mesh... 😄
I guess I'll go back and change all that
@trim matrix hit box will work too. This requires saving/clearing the reference though, which is actually more work than running line trace only when the interact key is pressed.
i want the easier way
Both are easy to setup hehe.
k
@trim matrix This is for multiplayer?
yes
So not sure which would be considered easier. I'd go for the more performant route, which is line trace on keypress.
ok ok
its also more exact
You mean like while in play-in-editor?
@proud hull easier to setup - hitbox, better performance - linetrace
so if later on you needed like a keypad
@trim matrix Ah, do be careful with that. Spawning full projectiles for something like a minigun is going to hurt. A lot of times stuff like this is faked with client side muzzle flash effects and maybe a streamer in the vague direction the gun is facing, but clients often trace and input to the server that they hit something, the server does some cheat prevention calculations of it's own, and accepts the hit. It turns your hundreds of replicated bullet actors into only a few server checks per second.
I honestly think line trace is easier to setup. Easier to understand is what I think you mean, hehe.
Sorry. I meant the line trace is better because say later you need a 10 digit key pad they would press a combination to open
Line trace confuses people for some reason, but its a very simple concept.
@proud hull the hit box method can all be done in a single actor, while linetrace your working with two actors, and firing a interface call
ok
i want hitbox
@maiden wadi no worries about that, I will be changing the minigun to hitscan soon enough 🙂
i saw on youtube too
something with hitbox
it doesn't matter
let's just do it
No - Play-In-Editor the clients automatically join the server from the beginning. If you're wanting to test how clients would connect, etc, you can run independent clients and a server through your windows command line. https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/Server/index.html
An overview of the role of the server in multiplayer.
@trim matrix Jambax did this test, it's semi relavent to this. Shows how brutal spawning projectiles can be. Not to mention there's the issue that sometimes they'll spawn on the server and do something before it's ever even replicated and then die, which means no effects ever end up on the client. https://www.youtube.com/watch?v=ggnSFNJaH4Y
This is the worst profiling test of all time. Just a video to demonstrate some findings.
This is the editor environment, so take what you see with a pinch of salt. Real-world connections are of course not this reliable and I'm not sure this behaviour is intentional (such as rep graph yeeting past the 10Kbps bandwidth limit).
Either way, the l...
@maiden wadi - im stuck at a spot with my day/night cycle, syncing the clock with the clients, any suggestions?
@dawn gazelle Thank you!
They are both done the same way. Yeah, line trace uses an interface call, but even hit box needs an interact event. The main difference is: hit box needs the reference stored and is tested every frame, while line trace does not need the reference stored and is only triggered on keypress.
@trim matrix hey, I'm not just gonna set it up for you, lol. We are going through the options and giving you more search criteria so you can help yourself.
Personally, I use a TimeOfDay actor with a repnotify variable that is set every second from the server on a timer.
You look up youtube videos and get an interaction system going.
k
Hell, even search this chat and you can find examples.
@proud hull actually you can so a begin overlap / exit overlap, set a var on the hitbox, and when the player presses the key for the door, the door checks the hitbox to see if the boolean is set or not to be allowed to open the door.
The interaction question has been answered countless times in this channel. I have even, once or twice, provided full examples of it.
@proud hull just saying, hit box activated objects can be done alot simpler for interaction. doesn't mean its the better performance method but they can be done with alot less coding then linetrace. I myself am using the linetrace.
@orchid garden It really depends. You should mostly be able to just replicate a couple of values for the weather system and have clients simulate it locally. How you do it really depends on your setup. If it's a single actor placed in level, you can probably just have clients simulate it locally with their own time, and maybe max a few times a second have the server replicate it. Might only need to replicate it once or twice a minute.
@dawn gazelle my day time uses a timeline for the tiime of day thats speed is set off of variables set in the actor (current time of day and speed of day):
@maiden wadi yeah i was thinking minimal updates for it to clients, just to make sure that the time of day is sync'ed with them. really only need to pass 2 vars for it to work for syncing.
@maiden wadi thanks for the help. I got it working with the BP i posted. Certainly need to optimise a lot of things, iterating every day. Thanks!
@maiden wadi and yeah its a single actor in the scene that controls day/time (probably weather too if i do that)
my problem is the syncing part... how to I get only the clients to sync the variables and not the server?
don't want the server resetting its vars every time the event fires, causing little tick rollbacks
if i do a rep_notify / multicast, it seems to effect the server as well
on the rep_notify you could do a server check branch.
um... how? lol
does that work for both dedicated and peer to peer?
ah cool ty 🙂
Be careful with that check. If you're running a Listenserver setup, you also want it to happen on the server.
why would i want the server to update its own time?
that causes the little tick rollback on the time
You wouldn't, but you don't use OnRep for that. The variable is already replicated, you can already use it. OnRep is for doing something after the variable is replicated, like rotating the light, or updating the skysphere material. Which you would also want to happen on the server on a listenserver setup.
okay then something else is happening because the variable isn't replicating to clients on its own on peer to peer
oh wait you mean using rep_notify my bad
You're for sure setting it on the client, and this is inside of a replicated actor?
i was thinking something like this with the has authority:
That client event assumes that you're going to spawn a time manager, one for every player?
was thinking a simple timer ran on the server for the day night update every x minutes.
RunOnOwningClient will only run on the server, unless you specifically set that manager to be owned by a client. But only one client can own an actor, so you'd need multiple time managers to do that that way.
It would also run on the client if you spawn it on the client, but then it would have no replicated counterpart on the server.
the timer would call that function to update the clients, the day night manager is a actor on the map:
That'll make it a server owned actor.
so that means my idea, running the timer on the server only would work yah?
Do you basically just want the server to tell the client, "Set your time of day to this time", every so often?
set the two vars yes, then after that the timeline in the actor should be synced with the timeline on the server.
for the clients
currently whats happening is when a client joins, or a peer to peer is launched, when the client is finally able to play the hour of the day is off by aprox 1 hr.
Thank you
You'll want to rely on replicated variables for state. Server only should set these. Client can set them locally for client prediction, but the logic should run in a way that if the server replicates a new value, it works with the new value and starts updating from there. RPCs are bad for state, since late joiners don't get updated with old RPCs, etc.
Hello I am using BP function 1Editor Apply Spline` that applies selected spline to Landscape (smooths landscape to spline). Is there any way to make it work for only desired (for example passed by name) Landscape layers?
both @maiden wadi and @dawn gazelle deserve a place in the credits if i ever make this into something i distrubute, you two have helped me alot.
so... rep_notify for the two vars?
I'll take the "Unqualified Backseat Programmer" job title.
And it depends. You said you're using these in a timeline? Does this update the timeline itself, or just what the timeline is using? If this updates the timeline, possibly repnotify. If you're already using these in a way that simply overwriting them would cause the desired change, you don't need a notify.
That looks like you'll want a notify to call that play rate function again.
honestly, im not even sure i need to do that anymore.... i should really check lol....
ah yeah i do, so the speed of the day kicks in.
i could do it like ....
but then if i wanted to speed the time up say like 'everyones sleeping' i wouldn't be able to
Same XD
If I redid this, I'd probably just create an actor manager that gets spawned by game mode. The manager would more or less just replicate the date and time or day. Time of day would be converted into a float between 0-360 to update the directional light's direction. Set the actor to tick maybe once or twice a second, and let it run.
I don't personally care for timelines outside of specific things that are very static, like opening doors, or making something repeat it's movements. They run on tick anyway, so there's no performance difference.
on mine the time of day is a float beteen 0-1440 (minutes in a day) then it sets a curve for the various things im modifying ( sun yaw, fog, tempature, lighting, shadows depth )
I did something similar with manager that handles my foliage replication. I can paint foliage with a subclassed foliage actor/component. And this manager allows the players to alter a HISM component and for the server to update clients with only one struct replication via fast arrays. Allows for easy map creating since all the manager does is deletes HISM instances at certain locations and respawns them after a time.
Would love to continue that project, but I'm waiting until 4.26 gets fixed at least on the Interfaces.
its not really overly complex:
(all the lines going to the right are just to print debug info to the screen if i tick a debug var on the daytime actor)
On a random side note. I'm happy in this single player project. I'm up to 200 Character AI on screen at 60FPS In the editor. about 85FPS packaged. All have a simple animation, die and respawn. I'd have been happy at 100 AI with 60FPS in editor, but this is fantastic.
i tried porting my project to 4.26, because 4.24 and 4.25 (currently on 4.25) has a issue with 'hair' materials, and 4.26 crashed every time i tried to run, no error pins in anything, so i'd probably have to redo it bit by bit to find why its crashing.
4.26 seems to use 2x the memory to load my project as well, that didn't make any sense to me.
I find it hard to imagine developing in older UE4 versions. Everything is so fantastically streamlined. I think I started right after 4.24 released. Seeing some of the older posts from like 4.13 or 4.7 are horrifying.
Whats the specs of the system you are developing on?
my pc? its a older system
I'm on a laptop I7-6600HQ, GTX1070, 32GB myself
yeah mines older then yours im betting heh
Ryzen 5 2600x, 32Gig memory, RTX 2060.
My next computer is going to be a ryzen for sure XD
amd fx-8350 4ghz, 32gb memory, 6 2tb drives, 1 128gb ssd, zotek gtx 1060 6gb
I keep looking at threadrippers and thinking about how fast shaders would compile
I don't know what to think of CPU benchmarks right now. I'm so used to Intel's server stuff being on top... And now everything is just AMD, AMD, AMD.
i've used amd's for years, i do have a intel here too but its abit dated as well.
processor bench marks are skewed though, i don't rely too much on them.
if i do look at benchmarks its usually to see how the processor im looking at performs on different boards
far as processors go, its really mostly just preference. AMD or Intel, granted somethings run better on each processor, but it really boils down to 'will it get the job done'.
can anyone help me
depends on what you need help with 😉
or setup a input for the left mouse button in project settings
you should really watch those tutorials by ItsMeBro, they'd answer alot of your questions on doors, making lockable doors, mutliple doors in a single actor, etc.
Ryan Laley has some simpler ones:
https://youtu.be/DHWFx0YifE0
In this beginner tutorial series I go through how to create a variety of doors used in games.
This episode teaches you how to create a door that will open when the player presses a button. It is highly recommended that you watch the first part as this will build upon code that is taught there.
[Resources]
Door Model: https://www.dropbox.com/s/...
that covers the interactive part of the door
ok
both itsMeBro and Ryan have pretty good tutorials.