#blueprint
402296 messages Β· Page 792 of 403
Although, I am probably going to have to use a map because the index could change on the array and not put the weapon in the correct slot it's supposed to be in
No one PLANS for the fifth DLC that adds twenty weapons to their game.. But if you don't you'll get community pitchforked.
Always plan to do the least amount of work that involves you not getting pitchforked.
With your solution every cube in the level need a reference by a set. Then I need a slow "get all actors of class" and a for loop. I want to call a function from an instance to all members of a class (cubes). How can I make this?
I would just use GetAllActorsOfClass like you mentioned.
Random fun facts. That particular call isn't nearly as bad as people make it out to be. I recently had a dive into the C++ for that with some test cases. Actually for what it does, it's extremely performance friendly.
Put it on a 0,0001 timer
lmao no
And every year the CPUs are faster and faster. So visual programming is not so bad too.
I have talked on my university in 1996 about visual programming, and I hope visual languages will be a good choice in the near future.
Actually, that timer is worse than tick. It'll run multiple calls of the function each tick.
I wish the BP connections were encoded in some source control friendly text with the visual positions as less important data in another file
A BP diffing tool would more or less solve it I think
I think there is some kind of thing for it in the editor, but the only way to get access to it is to use the builtin source control features of the editor which seem fiddly at best
It might not help that BPs are binary files, so one does not simply cherry pick a commit
for Pie you mean Play in Editor? i usually select filter before playing
There are no objects created to select. I unsure how you can select them before they're instantiated.
ok, i'm having an issue, checking equal variables in that logic, i used breakpoint on branch and it is fired correctly
if that two variables are 0
but it doesnt siplay the string for some reason
This is a beautiful thing about the BP debugger. It sucks. It doesn't actually evaluate those nodes until AFTER the function is ran. So in a Branch case, you actually need to put a print on both the True and False, and breakpoint both of those to see what the Branch evaluate. Before that you're going to see default values, which for an integer is 0.
So if you breakpoint the branch itself which breaks before that branch is ran and it's comparing one integer to another, and you see both as 0 in an ==, it can be confusing.
i think i got it the issue, i'm spawning 10 enemies but actually i noticed it only spawn 8, when a car hit i reduce the amount of ai alive but it never reach 0 when it compare it
thanks for helping btw
Hello, i'm trying to show a widget blueprint when the player opens the game im trying to do that in the GameInstance 'CreateLoginWidget' is being called in the level blueprint, but i'm getting these 2 errors whenever i play as a client not sure why, though everything is working as expected the UI gets created and i can control the mouse its just the errors that appear, only n client mode though.Here are the errors:
Blueprint Runtime Error: "Accessed None trying to read property LoginUI". Blueprint: CombatGameInstance Function: Execute Ubergraph Combat Game Instance Graph: EventGraph Node: Add to Viewport
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetPlayerController_ReturnValue". Blueprint: CombatGameInstance Function: Execute Ubergraph Combat Game Instance Graph: EventGraph Node: Set bShowMouseCursor
is this the correct way to do it?also this happens only when i play as client.
is this struct too big? this is my item struct and im just making sure that having arrays of these isnt gonna bog down my game
I have a turret gun that tracks the player when they get within a certain range, but the gun whips round in a microsecond when it starts tracking. Is there a way to limit the rotation speed please?
Clamp the speed
Clamp?
Clamp (float)
Thanks! I'm a dev not a coder so didn't know what you meant π
Yeah no worries we are all learning
What you also can it take its current rotation and the desired rotation and use lerp on a timeline
Lerp
Lots of different ways to do it
Depends on how it's setup right now
Thanks
And what you find more intuitive/seems more logical for your project
It is quite tricky yeah
Second question... I copied a level so I had it safe before I made any changes. When I opened the copy, the light was different. Is this a common thing in UE4?
Different as in you can't see the building properly!
I don't think I baked the lighting, but I did rebuild it in the copy anyway
and it's still dark
I have screenshots
@random plaza I don't think the size will really be an issue so much. Though having worked with both UI and inventory stuff a lot, I strongly recommend considering to split the gameplay data from the details data. Gameplay doesn't care about the name, or icons, or other stuff that is only useful to the UI or sounds. And even Gameplaydata can be split in itself, because stuff like an item's max stack size, or type, or whether it's two handed is all static data that doesn't change at runtime. So you could put like the stack size and stuff in a much smaller struct that you save in your arrays. Everything else is useless static data that can be pulled from datatables at any point.
thank you, i appreciate the help.
@random plaza Also one more thing to consider is like the IsStackable. It's nice for ease, but it leaves your data prone to more errors when that also has to interact with the max stack size. It is discernable data that can also be pulled out of an item's MaxStatckSize with simple functions. Such as If MaxStackSize > 1 return true else return false
thank you, i was using it so i could display the stack number easily, but i'll replace that. sounds like it would be easier.
If you have something like an inventory component, or manager somewhere, you can write the functions there, which take your Item's ID. Can write a plethora of functions that all just take that item's ID and return data for your static data out of datatables, or return the discernable data like the IsStackable
And on the note of Item IDs, if you're not already overwhelmed, I recommend taking a long look into GameplayTags. They make managing inventories incredibly easier.
i havent been using datatables, i didnt know how to use them so ive just been using lists and arrays to store literally everything because i understand it.
im gonna look into that
Datatables are just comma separated value entries that can be populated into a struct. In fact you can literally think of them as a Map of FNames as Keys and Structs as Values.
When you call GetDataTableRow, you're looking up in that map via the FName key, and it returns that struct populated with the data.
Hello, can someone please explain to me how to have a static mesh loop an animation without having to turn it into a blueprint? I've downloaded some foliage assets that have looping animations of swaying and just wondering how to replicate that with the meshes I'm making in Blender
Normally you do things like that in materials with vertex offsets.
Oh I see that makes sense
Thank you! I was searching for a while but couldn't find any sort of option or slot for selecting animation
this is my code to set my direction, and for some reason it's flickering between 180 and -180 when I'm ONLY holding S (should be entirely -180)
any ideas?
-180 and 180 are identical in rotations.
I see, I think I know the issue then, thanks
anyone
@unique falcon Are you playing simulating a Dedicated Server?
Dedicated Server also runs beginplay in the level, it also has a gameinstance. But the call to create widgets will return a nullptr on the dedicated server because it's never supposed to create UI.
That should also run before a client exists, so there will be no player controller on the server to get the one at index 0
I'm relatively sure you can just gate that behind IsDedicatedServer->Not->Branch and it'll be fine.
The better approach would be to do this in the controller or the HUD class.
I dunno if this is possible but any suggestions are welcomed. I have a progress bar and i'd like to have a text follow the fill% with a number. So technically, a text that changes position based on the progress bar. Any ideas?
I wonder if a justify right text with it's UWidget set to fill, and the fill amount set to the same as the percent would work?
Alternatively, you could just put the text and the progressbar in a panel, and discern the text's location from the fill percent and the tickspace geometry of the progressbar.
Was going to suggest Slider trick, but I don't think there's a way to get slider thumb position
I do that with sliders using the canvas. I have a little slider bar that plays a niagara particle system effect at the slider location and follows it. π
hm lemme try
originally, i had a selector where i changed the slider to a square
and i was thinking of the same but the text threw me off
oh you are right i totally forgot about that thank you
@zealous moth Kinda works well I think. I made a Userwidget with a Canvas, and then a Text and ProgressBar as children. Only edge case is when the bar gets too low, text goes out of it, could be handled with clipping or just hiding based on sizes or switching sides if you wanted.
Can someone tell me if I'm supposed to move my follow camera or my camera boom in the third person template? I remember having some issues with collision when I adjusted the wrong one a while back and trying to avoid that
Move as in move away from the character?
You're likely controlling the Spring Arm.
Yeah I want to move it further back for a wider view
So Spring Arm is the I want to adjust?
the one I want to adjust*
Yes.
make the camera the child of spring arm if it is not already then move the spring arm
is there any reason why i wouldnt want to change my blueprint only project to c++? id like to be able to compile certain plugs ins directly from my project.
No reason.
thank you, itll pretty much be the same thing as if i were blueprint only, except i have the ability to write c++ classes now and compile plugins
Hey! I need help, i have a node random int in range min value:0 and max value:100 but i only want to return value if its multiplication of 10(e.g 10,20,30..so on) if its not ill call function to look value again.pls can some one help
Makes me wonder if any completed games are actually done in blueprints. Everyone seems to despise using them for production
A shit ton of them uses BPs.
probably a bunch half and half
Pure C++ UE4 project is nigh impossible
I know Ark did when it first came out, which was super buggy, but not sure of any others off the top of my head.
bright memory is another one done entirely in BP
It depends on context on how the BP/C++ is applied.
C++ excels in blazing performance (if done right) and lower level logics, somr that BPs can only dream of , but it lacks fast iteration, among other things, that BP has.
Also worth mentioning how asset loading sucks in C++.
BPs aren't really compiled, in a sense that it still runs through its interpreter/VM.
It seemed like from most of the complaints I saw BP just has a ton of performance overhead and has limitations you just can't overcome without c++
I haven't ever seen any, but all of my projects are miniscule compared to AAA games or indie releases
In most part it's greatly exaggerated. I can see the concerns, but function calls or simple Event Tick practically made barely any dent.
Dealing with BP's tick is like giving a job. Treat it with care, and you get okay performances in return. Abuse it, however, and your BPs scream in agony as they slowly chugging in heavy tick ops.
Use BP ticks, but don't abuse them.
yeah man, that 0.15 ms saved in c++ is well worth a complaint π
@trim matrix The actual truth is that using only C++ or only BPs is shooting yourself in the foot.
Even without being a 20year programmer, there is a lot of stuff in the engine that you can very easily use basic C++ for and get major performance benefits out of. And some functions are just simply easier to write as text instead of using BPs. Using C++ allows you to override functions simply and minorly change already existing architecture rather than rewriting all of it in BP and having to build from the ground up.
On the other hand the one thing that C++ is terrible at is referencing assets or static data. Getting a reference to a specific static mesh, or datatable for instance is a pain in C++. This is one reason I routinely caution people away from creating Widgets in C++. Pretty much all of my widget creation is done via writing functions in my HUD that I call from C++ code, that creates widgets in the BP subclass of my HUD.
Hi, I was wondering how I could make time dilations smooth, like in superhot. I basically have no clue how to interp stuff. Thanks :)
ok
thanks
To give you a head start, it looks like you're likely looking at a Timeline for convenience.
hi. what is ubergraph
It's just a main graph.
eventgraph?
This might explain a little better. There's a paragraph about it about 2/3rds down. https://heapcleaner.wordpress.com/2016/06/12/inside-of-unreal-engine-blueprint/
Hey, simple question, I have to set the visibility of a Material Billboard to true or false depending whether a small sphere collision component is in the line of sight of the player or not, I have done this but it doesn't work, I think I should cast to FirstPersonCharacter but I have no idea what to do next, can you help me?
@safe ironRecentlyRendered, not Visible.
The other way would be to GetPlayerCameraManager and do some vector math based on the camera's FOV to get the camera's FOV cone and check if the object's bounds are within the cone. Though RecentlyRendered usually works well for stuff like that.
Yeah, better to avoid doing excessive calculations, specially cause they can slow the program down, UE5 is already slow as is on my system
Not sure if anyone answered but modulus 10 and then a not node into branch and if true it's(10, 20, 30 etc..)
Yeah, if the result of modulus 10 is false and you put a not node the result is true if it's 10, 20, 30
True, though integers are inexplicitly castable to bool
Haven't used mod much in BP
True that
if you're using an int, i don't think you'll be needing mod
mod returns the remainder
5 mod 10 would return 0 for example
Is it possible to attach the same actor to 3pmesh (body) and to 1pmesh (arms) ?
Wouldnt 5 mod 10 return 5?
5 contains no 10's so nothing to do jut return 5
5 goes into 10 evenly, there is no remainder
Hi! is there any way to go from string to Enum Type? (supposing the string is a value Enum To String)
Dont think so. Enum is byte tho. So you could do a function for converting it at your manual discresion i believe
Just a pure function with string in, the enum out, and switch on string inside.
in either case mod can be turned into a bool by using it with < 1
I'll ask again since q got a bit burried
Is it possible to attach the same actor to 3pmesh (body) and to 1pmesh (arms) ?
So you're wanting to attach one actor to two parents?
parents are singular, so unless they are nested, you'll have to change ownership
sort of.
It sorta works when doing so in begin play, but can't figure out how to do so at runtime
let's backtrack. What are you designing?
It sounds like holding an item in the first person but having it visible in the third person for third party viewers
fps style multiplayer game
Player picks item up, and I'd like the item to be attached to FP arms mesh for the player
I'd also like for the item to be attached to TP body mesh so that other players may see the item 'properly' socketed
you're probably not going to get around having two separate meshes
for a variety of reasons

If you need things to be synced up that well, I'd prefer not having seperate arms for 1pp and authoring your assets such that just hiding a bit of the 3pp mesh is enough for the 1pp perspective
I'd like to not use two meshes if possible, since the items 'abilities' (gas) would then need to differentiate between which one is real, and which one isn't
3p mesh doesn't need as much detail as 1p mesh. you don't want to handle complex rotations if you're handling throwables. Data assets are setup for this type of behavior
now here's the odd thing. I can get what I want working on Begin play
Note FP_Gun
Doing so properly attaches gun to third person mesh for all other players
I mean you're just setting yourself up for failure later if you don't want to solve it properly IMO, but it's your project
the way this is solved everywhere is by having two distinct meshes. they can then both share other attributes
see above for reasons

There's a lot of problems as well with two meshes.
that's the only reason I'm trying to see if there's another way.
π€·ββοΈ well, I'll give it a shot then. just going to be extremely more complex doing two meshes
I'm not currently using DAs but I've used them in the past. I'm assuming, you mean creating a DA that has information for both FP item model, and TP item model (and all other item data)
correct
but I'm struggling to see how I'm going to handle certain items. for instance a flashlight
I'm able to get the flashlight spawned correctly using two models
however when using the flashlight, the GAS ability is affecting the flashlight that is in my FP hands
since that one isn't replicated, t~~he other players don't get to see where I'm pointing it to, ~~and the sub component (light) spawns from my FP one as well
since that one isn't replicated, the other players don't get to see where I'm pointing it to
this isn't actually an issue so I'll cross that off.
but the other point is. that sub components, and abilities will all need to take into account where the 'true' target/frame of reference is supposed to be
there is probably a way to have 3p replicate the data of 1p somehow
3p mesh I would generally consider cosmetic
If you're aiming through 3p I'd say use on screen crosshairs to determine targeting
yeah I'm sure, but as of now, for each item, it adds another layer of complexity since I have to now take into account whether the item should actually perform certain actions, or not.

I need an ez button
okay let me see if I can workout how to do this with two meshes
thanks for the feedback!
that's what I'm saying though. 3p is largely cosmetic
yeah, I'm going to try and program them with this in mind. I can't see too many other items being all that complex.
why are your nodes so cool?
Hey. I have this function where an Actor stated in the Data Table contains a event. However, there is no instance of the item ingame, which seems to be why the event is not running. does anyone know a workaround for this?
Data table cannot contain references like that
Youd need the class, spawn itz and then execute the function
Alright. Thanks
can I edit a objects rotation constraints through blueprints?
this is what I want to edit
Not through generic BPs.
(I don't think it's possible in animBP either, which is kind of a different beast)
pretty sure you can lock movement to an axis, but don't know about specific physics constraints
HI guys, quick question, I want to make a charge kill for my character, it will move forward towards the camera seeing direction in a very fast speed. Is there any suggestion how to approach it? Using the move to location function or anything else? Do I need to lock the input?
Problem I've run into a couple times now is when copying and renaming blueprints that have event graphs - sometimes will get errors such as reference to self is not correct object type, and some functions or casts will fail.
Is there a proper way to avoid this? I know it would be better to not copy them at all but usually I'd be doing that as an intermediary step
first question would be: why are you copying code?
but to give you a short answer: variable nodes are inherent to the object they are on
Aka local
yes but the word local is misleading
since local variables exist in other scopes
and local variables cannot be accessed outside of their scope, which isn't true for object variables
Does anyone know of any good videos on using data tables(besides the HTF or WTF ones)? I'm cross-referencing data tables to dynamically load Dialogue files for the NotYet Dialogue plug-in, and I have it working for the most part. But some of it could probably be implemented better. As well once I start duplicating the process to use on other characters things start going wrong. So, I know I need to know more. lol Sorry for the novel. Any help is appreciated.
I think an example of what you want to improve would be helpful
for some reason my camera is on the player controller class, and I want to access its world position from my character class, how can I do that?
what kind of template are you using?
the basic fps one
you can get the camera through the player camera manager or just on the pawn itself, if you are using just one camera
how do I do it through the camera manager?
get player controller > get player camera manager > transform > location
I tried that
would it help explaining why I need this?
or what I am doing with it?
what didn't work?
ok well, I am trying to send out a raycast to where the player is looking, so the cameras rotation and transform, but it doesnt seem to be doing anything on the z axis, the raycasts are a flat line.
You can use get control rotation for the camera rotation
but how do I put it into the raycast?
where is this code located?
when I use debug, it looks like this
a function inside my player character
why is it inside your player character?
cause all the tutorials I have watched put their code in there
oof it's tutorial based
ok well the player camera manager's transform should give you camera location
and that is where the character movement thing is
the raycast takes a location, not a transform
break the transform
wdym
oh
wait
that didnt do what I want it to
it didnt fix the issue
now the line is angled downwards, still not following the mouse
You are using the forward vector
Which will always be a straight line from the actor
then how do I make it not a straight line?
all I want is it to do follow the mouse
I am very new to unreal, I am pretty sure you can tell that, sorry if this is basic stuff
I believe I set the end point the actor location
what exactly do you want to do, where do you want your line trace to start, and where do you want it to end?
I want it to start at the camera, and end like 15 meters in front of the camera
Alright, then instead of using your characters rotation you use the rotation of your camera
Something like that
No worries
Yeah I can imagine
But its fun to do blueprints
I just love watching the logic run
yeah
I have another thing, that isnt much of a issue
but pretty annoying
I am using a physics handle to pick up items
I am using a offset to move the item in front of me
and that means that everything gets multiplied by like 500, and that moves stuff on the x, the y, and the z. And this makes it so it isnt perfectly in the center of my screen, but a bit to the left / right depending on how you look at it
I'm going to crosspost in here since #umg seems to always be dead.
Basically, does anyone know why widgets within a widgetswitcher won't update when you change the child widget?
I can update my inventory widget, but because it's inside a widgetswitcher in my main menu, it doesn't update until I go into main menu and replace the widget in the switcher with the same widget.
this is all happening in the editor by the way. just editing and saving one widget and it doesn't update in the switcher. and when i do play it shows the old version of the widget that's in the switcher
sorry if any of this is poorly worded or straight up stupid, i'm not formally educated on any of this
i mod the UE4 game jedi - fallen order pretty frequently and i'm currently working on a blueprint that's meant to, among other things, play an anim montage for a set actor, but the problem is that the existing animation blueprint for said actor immediately interrupts this
i've tried temporarily disabling the animation bp and re-enabling it but that breaks other behaviours
is there a way to prioritise a specific animation being played so it won't be interrupted?
layered blend per bone and montage anim slots
awesome, thank you :))
oh uh, i should've probably clarified
i can't access the actor's existing anim bp
and unsure on how to accuratley recreate it
is there a way to achieve this using only a standard blueprint?
unlikely
I want to be able to easily toggle rotation constraints on some physics bodys, how can i do this through blueprints?
Is it possible to get the value of a variable within a struct by using indexes?
How do I add echos mesh to the standard 3rd person character BP?
Remove it from the widget switcher and re add it. Happens all the time not just with widget switcher
If you add any widget to a widget and the update it, you need to remove it and then re add it to see the update... it's definitely a low priority bug
can someone show me how to put echos mesh onto the third person character?
in broad strokes, how would you make a movement and terrain evaluation system like death stranding? not the balancing but just checking the terrain and falling or sliding if there's a pointy rock or weird slope
Probably the same way foot IK is calculated
hey, so i have a blueprint called frame with variables called framestyle and image, how can i give the player the ability to change the image parameter of the object?
Hi. I want to check when there is an input. Any input which has an action mapping.
you can try this
I have this Editor Utility Blueprint that allows me to rename multiple files at the same time. I was wondering if anyone knows a way that I can "queue up" multiple operations and then have them all go in one big operation?
I can do this in Blender, as shown here
https://cdn.discordapp.com/attachments/221799439008923648/925256359933517854/unknown.png
So, surely there's a way to replicate this behaviour in Unreal?
I suppose you'd need the editor to maintain a queue. Not sure the best way to handle that. Savegame file? A spawned actor in the level? AFAIK the built-in manager classes aren't available outside of play
And then you have an editor function that processes and clears the queue array
i want the player/user to be able to select their art and set the variable as that jpeg
hello,
Does anyone know if there is event that fires whenever you make an app active again
How would I go about moving my character from one place of the level to another?
I have a marker where I want to move, just an actor. But from what I understand I can only access things placed in the level from within the level blueprint.
Is there a way to get a reference to the level from my character--so i can get the actor and use it's coordinates to move my character?
Or do i need to somehow invoke a function in the level blueprint? But that would also require a reference to the level somehow.
Like here's an example i found online of exactly what i would expect to do. but this is specifically in the level blueprint. how do i invoke a custom event that looks like this at runtime
I see a lot of examples of using trigger boxes, which are elements of the level to trigger the teleport. but im looking for something more extensively usable. like teleporting based on a option selected from a menu
your teleport bp would need to know about the actor or actors so it can reference them and get their location. Im confused as to whether or not you're trying to do this in the level bp, but i prefer to never use level bp - especially for what sounds like needing two bps to talk to each other or know of each other
I made a custom event in my Player Character that I was just gonna call from whatever thing i wanted since i can always just get the player character.
and i just want to move my character from where it is to another place on the level that i've marked with an actor
but i can't access the teleport destination actor without consulting the level, and i dont know how to interact with the level
Hello. I've got a problem. Users are complaining that if they play a long session of 5+ hours they sometimes get a memory leak. What are common causes of memory leaks in blueprints? I don't even know where to start debugging this so maybe somebody has some tips?
you can try a GetActorOfClass, if it is a class to find, but only if you have one and only one to get
Seems like a meme, but if it works it works. i'll try it out
check out the profiling tools
Thanks I'll look into that!
there might be a bind event you can use
Looks like that's gonna work. Thanks man.
what do you mean? binding to an event? but which event
Thanks!
when an AI character Is derived from blueprints, does the ai usually use data that is derived from a custom struct of character variables?
or does the AI usually derive from a custom class?
I think this highly depends on the implementation and how linear the AI is. If all of your AI are nearly identical but just play separate animations or fire separate effects, data is enough. This split also isn't required to be one or the other. An example might be an RTS game like Command&Conquer. Soldiers are all pretty much the same. Some throw grenades, some shoot, but the soldiers themselves all act identical save some move speed and what they fire, voice lines, animations, all of that can be data. Meanwhile you'll probably want to create a separate AI class for vehicular units like tanks. But here these all mostly act the same save some data driven differences.
So I think this really falls under the typical DNRY(Do Not Repeat Yourself). If you have similar units, make them the same base class right up until you absolutely require a separate class for one special unit. If you have two majorly different types of AI, make two different classes. Although you will probably still have a single base class for both.
There is also a sort of disconnect here as well. Data doesn't always mean a datatable or whatever. You can have data only classes. A data only class is basically a class with defaults only set, no coding. Maybe some values set in inherited properties, or an inherited actor component moved to a different place. Potentially extra static meshes added in the viewport or something. This is actually a fantastic way to manage memory too because you'll have base classes where all of your game logic coding is done, and you only ever reference the heavier data classes when they're spawned. You can do this either in a Datatable or a bunch of subclasses. I don't think there's really a right way to do that, just based on how you prefer. Neither is really better as long as your structure keeps core classes from loading useless design relevant data.
Is it possible to add a search filter to find variable references from a specific blueprint class? For example when I copy a variable getter node and paste it on notepad I can see that there is a VariableReference field that has MemberParent, MemberName and MemberGuid values. Can I make a search inside blueprint to find VariableReferences from a specific MemberParent?
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/Search/
Okay this page gives me hope but I can't quite get how can I use it in the way I want. I would be happy to have some help on how can I construct my own search queries
I had to write this custom. but generally you may be better off branching it off functionality rather than input
can i create a random terrain with blueprints?
I achieved this with Nodes(VariableReference(MemberParent="BP_PlayerController")) to find all get and set nodes for BP_PlayerController blueprint
I tried a physics constraint component, didnt seem to work
Hey, trying to script an editor utility bp here. I access BP of street lights and their light components to turn on/off for bakes. Can't set intensity of the lights to 0 for some reason. but I do access the light successfully
hi guys, i'm trying to setup an horde zombie waves spawning system, i would like to increase the zombie amount only when all zombies of the first wave are dead, i have done the logic very simple that check if zombies are equal to 0 the wave is done, but i would like to spawn & increase enemies amount the next wave only after the hud show me that i'm currently in a new wave
for example here i binded event to show "wave" when game start
here to check if zombies are 0, now after the branch is true i would like to set the hud to show wave2
i can create more dispatcher from HUD without problems, but it would be the correct way?
Ignore the UI at first. The only thing you need to start with is the spawning system. Until you need to optimize and you have your logic set, you can just poll the spawning system on tick to update the UI.
After your spawning logic is in place, you can optimize with some delegates in your logic flow. Like one after spawning is finished, and having zombie deaths call another. You can bind those in your UI to have UI update instead of updating on tick, though to be honest I don't know if I'd bother going that far. It's like two objects, just leave it on tick if it's not a performance issue.
it's a very simple game so i don't care much about performances actually, but since i'm learning i would like to create the most clean i can, so far this is what i created for the spawning syustem
i add +1 enemies until condition currentenemies (0) is less than increasedwave (20)
for each loop i spawn an enemy in a random location within the box volume i placed in level
it work good, maybe not the best solution but it work, now i can create as many variable i want to increase and check, for example first wave 20 , 2nd wave need to reach 60 and i can build another logic, at the same time i would like to change wave text
in hud
but before i change hud i need to pass a valid check once all zombies are dead in first wave
new variable set at 40 for second wave
of course i can create an array so i can store more of them i guess
First note is that I strongly, very very strongly, encourage avoiding while loops as much as you can. They're not terrible, but they are incredibly easy to cause infinite loops on compared to an integer range or foreach loop.
Second is that you should rely on an array of pointers to the AI instead. Spawn your wave in a range based loop 0 to (desiredwavesize-1) In each loop, spawn a new AI, and add the return value to an array of pointers.
On AI death, get this actor that spawned them, and tell it that the AI is dead, the spawning manager can remove that AI from the array. After removing the specific AI, check if array length <= 0. If true, your wave is done, spawn a new one, which should be the same exact call as the first with nothing but a changed DesiredWaveSize parameter.
Now your only management is a single WaveCount value that can drive the DesiredWaveSize parameter, and the array of AI pointers.
By pointers I mean memory pointers. Light blue variables, they point to an object.
What class are you handling this stuff in at the moment?
i'm doing from actor BP wich i called spawner
ok array of object
in here i can "attach" my Ai class?
Wave count will be an integer. One second.
Sure, thank you
how can I check if a actor is in the air from a blueprint component?
@trim matrix Bit of an info drop, but here. I made four classes. Spawner, An AI base class, a child of the AI base class named Zombie, and a Widget.
In the spawner, It calls beginplay, spawns a wave and creates the widget.
Start New Wave increments the current wave count from 0 to 1, then spawns the wave.
GetWaveMaxSize is just this.
Doing this will spawn you your first wave. In the AI Base class I've done one thing, which was to override Event Destroyed, and call a function in the spawner that I passed in at the AI's creation. That called function removes the AI from the pointer array, and then checks if the array is empty. If array is empty, spawn new wave.
IsWaveEnded is just this.
@trim matrix This is all for just the basic spawning logic. Doing this will give you your gameplay. Then in your UI tick, you can start by just doing this to display the current wave count, and Current/Max wave size.
Wave current size is in the spawner, Simply this.
I'm getting frequent crashes which seem to happen more often if I'm starting and stopping play in editor sort of quickly - i'm trying to test menu flow. Using a dedicated server running in separate process and 1 client. Is there a proper way to remove a presistent levels and sublevels when play is stopped? Right now I just destroy all widgets in the EndPlay event in both persistent and sublevel but still get these errors. From the logs - it looks like they are cleaned up correctly but obviously not:
[2021.12.28-15.05.55:254][614]LogWorld: UWorld::CleanupWorld for BaseOnlineMenu, bSessionEnded=true, bCleanupResources=true
[2021.12.28-15.05.55:254][614]LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated
[2021.12.28-15.05.55:254][614]LogWorld: UWorld::CleanupWorld for OnlineMenu, bSessionEnded=true, bCleanupResources=true
[2021.12.28-15.05.55:254][614]LogSlate: InvalidateAllWidgets triggered. All widgets were invalidated
[2021.12.28-15.05.55:310][614]LogAudio: Display: Audio Device unregistered from world 'None'.
[2021.12.28-15.05.55:314][614]LogUObjectHash: Compacting FUObjectHashTables data took 3.68ms
[2021.12.28-15.05.55:317][614]LogLoad: Error: Previously active world /Game/_Maps/OnlineMenu.OnlineMenu not cleaned up by garbage collection!
[2021.12.28-15.05.55:317][614]LogLoad: Error: Once a world has become active, it cannot be reused and must be destroyed and reloaded. World referenced by:
[2021.12.28-15.05.55:630][614]LogReferenceChain: (standalone) World /Game/_Maps/OnlineMenu.OnlineMenu is not currently reachable.
Owning spawner point is just a pointer to spawn location?
No, that's a pointer to the spawner itself. I never specified a spawn location.
why this function is impure?
look like i cannot get pure function
Hi! I have a EUW where im trying to access variables of different classes using tag. question is how can I access those variables? casting fails
Click the function. You can mark it pure in the details.
Hi all!
I have a question. I use four different characters in the game.
They replace one with the other. The characters are replaced through Actor to Posses. During a character change, the player can not let go of the forward movement key and because of this the character can go through a wall. How can this problem be solved?
I tried putting Disable all imput before it, but it didn't help. The weird thing is that it always happens on one side of the wall. On the other side, the character gets blocked when changing and can't go through the wall.
Hi. I need to get somehow my ai characters rotation direction? How can I do that, for example the enemy is just starting to turn left so i can play animation when he is turning left?
ok thx, i have setup all, wve is spawning correctly, one things in my case the ai die when it's been overlapped with a veichle
can i do like this?
the owning spawnerpoint is a pointer to my spawn BP?
Is there a special trick to debugging engine BPs? I'm trying to hunt a bug down in LandmassBrushManager but no matter where I'm putting my breakpoints they're not triggering
You can. Don't forget to pass Self to the ReportAIDead.
Like here. You're calling that function on the AISpawner, and passing self through.
Hello guys. I made a interact with the left mouse button and a Button_BP. But if i press the left mouse button on the actor its don't says hello.
ok, have problem with reference self , is deadAi a reference to the enemy class?
enemy class is not spawned in level when i start the game so i think i cannot call it
just to recap i have spawner BP wich is this:
spawnfunction:
getwavemaxsize :
iswaveneded:
start new wave / reportdeadai :
all this functions into spawner BP while enemy have only reportdead:
The error here is because you need to use the OwningSpawnerPointer as the target for that.
the owningspawnerpoint is reference of spawnerBP?
here i set to that but cannot reference aidead to self
Odd. You should be able to. What does the error say when you try?
oh ok now it's working normally π
it wasn't make me reference to self because i was pointing to actor generic base class
not my spawner class
now i need to implement the hud you made, i will cover that and let you know, thank you a lot for your time very helpful i will try to play with your logic so i can learn more
hmm, is there a way in code, when a projectilemovement component is spawned to tell it which direction to go?
A couple. The usual is to specify a velocity on the PMC's X direction and then spawn it with the rotation you want it to shoot in.
Yeah, I have it going in the x direction, but it always fires in the same direction, so if I am backwards it shoots behind me
I'm trying to copy and paste my autosave blueprint back into my content folder because I seem to have made a mistake and ruined my blueprint and can't find where I made the mistake...the problem is that my autosaves even from 2 days ago have the same changes I made today. It doesn't show the new functions I made today
I'm really worried and don't understand why these autosaves have the new stuff I created today
hmm this helped, but now it seems to be veering off from going straight and drops down to the ground almost immediately.
Cant you get the sockets rotation aswell ?
Not sure if control rotation would be correct i guess
There doesn't appear to be a socket rotation node
wait yes there is
the socket seems to be oriented wrong though, ha. It's shooting sideways.
Bring it around! Ninety degrees starboard!
how did you make visible the aispawning var into create widget node?
i can see only owning player
InstanceEditable, ExposeOnSpawn
Mark those two on the variable itself, and then right click the CreateWidget node and refresh it.
perfect thank you π
all working now
Expose on spawn is needed because it's referred to the SpawnerBP or the widget itself that need to be enabled when created?
It's a pretty lightweight spawner. Should be pretty easy to change logic on. For instance if you end up wanting multiple spawners, you can move your widget to the GameState's beginplay, and have your spawners all register themselves in an array in GameState, and your UI could add up the totals from all spawners. GameState could have the WaveCount variable instead of each spawner, and would tell them to spawn instead of the spawners doing it on their own.
ExposeOnSpawn is just a way to say that you want that variable set and ready before the widget calls EventConstruct. It's just an easier way to pass it in. You can do the same thing by getting the widget pointer and setting the variable before adding the widget to viewport.
perfect
is there a reason that the debugger doesn't break on my breakpoint? the lines are red indicating that the nodes are being executed but the BP debugger seems to be ignoring them
Blueprint debugger is a special snowflake
I usually debug values with a print string cause of it
LogBlueprintDebug: Warning: Hit breakpoint on node 'CallFunc_SetTextureParameterValue', from offset 73
LogBlueprintDebug: Script call stack:
Function /Landmass/Landscape/BlueprintBrushes/CustomBrush_Landmass.CustomBrush_Landmass_C:Render
``` it even says that it had hit the breakpoint π
Most of the times it doesn't even read the proper values from the debugger, it's a mess
good to know
Print string and logging the actual value you need to see is more reliable imo
Basically UE_LOG
BP Debugger usually won't break unless you're playing in PIE.
no way to debug editor bps?
how would I get this location?
Subtract from Hit Location?
((Start - HitLocation).Normalize) * DistanceFromHitLocation
oh yeah that was it. thanks a lot. kinda blacked out right there. thanks a lot
Not seeing anything in settings anywhere. Google failed me. Alternatively, you could sort of hack it I guess with some static functions in a library? Break in C++ code.
not afaik
even breakpoint aren't respected π
Well, the IDE would still break when a BP Editor runs a node I'm sure.
Well my birthday is going swimmingly. I am making awesome progress on my project π
Nice, happy bday
Make yourself a BP cake
In UMG, where you can radialmenu select which slice you want. π
I'm setting up a random dungeon generator through level streaming. I got it working but every now and then there is a problem with the generator and it doesn't load properly, is there a way to reset or clear the loaded levels so I can loop back to the begining and try it again?
Oof. I personally avoided that potential mess. I really love the Prefabricator Plugin. We use it at work, but I had time to mess around with it a little in a personal project, and for level generation, it's stupid fantastic.
never heard of that plugin, I'll take a look. I'm pulling my hair out over here trying to get my level generator working with premade rooms
It's amazing. You basically just create an asset that can house other actors and such and spawn that prefab. You can edit your prefabs where ever you want, in an empty level or in place where it's been used.
Im not sure where to ask this, but im trying to make a game in the style of Lemonade Stand, so say if i have ingredients lemon, ice, sugar. How would i go about programming "taste" into the AI? its kinda hard to explain, but i would like the ai to decide if they would "purchase" the "Lemonade" based on ingredients.
or at least make a yes or no on weather to buy it
My first thought is to have a struct with each ingredient and a threshold for each ingredient. Add that to the AI if you want to randomize it for every different AI, or store it in GameState or something if it's for all AI. Check each ingredient in the lemonade based on the threshold value.
would the threshold be random?
If you want it to be. Up to you.
the way i have it now, is random ints min and max per customer, but its too random for my taste.
but thanks ill try a struct
so would the ai have the threshold?
Well, the randomization is up to you. How you structure it is largely personal preference as well. Several loose integers works too.
If you want each AI to have different tastes, yes. Otherwise it's probably better to put it someplace like GameState.
evntually my game will progreess past "lemonade" you start selling lemonade, but end up selling drugs later, but for story i need the lemonade system in place.
Is there anyway to do an isvalid test before I do get level streaming? Seems like isvalid is only for object references.
if level name is empty, does that mean I could check if name is equal to 'None'
you could use world soft object references instead of names
@fossil dagger
Have a target sweetness and tartness that each AI likes, and a valuation function based on how close it is to their preferences.
Maybe something like
AIValue = 5 - (Sweetness - TargetSweetness)Β² - (Tartness - TargetTartness)Β²
If AIvalue > Cost, buy the lemonade
So the AI would value the perfect lemonade at $5 and go down from there as it's recipe suffers.
Tune numbers to taste.
Or maybe to add some diversity, have the initial value be random as well (pocket money)
Is it possible to know when the Character movement Steps up?
Can anyone help my approach to handling UI slider interaction with a 3D stylus? I want the stylus touching the widget to start an interaction which ends when it stops touching.
I tried using WidgetInteractionComponent to send a Press when the stylus touches a widget and a Release when it stops touching it, but this component doesn't provide the necessary information
I put an event dispatcher in my levelgenerator BP that my Persistent lvl BP casts to and runs. I'm trying to put an event dispatcher at the end of the levelgenerator BP and bind to event on Persistent lvl BP but for some reason it doesn't work.
@cerulean fogDoesn't seem to be a delegate for it.
darn, Thanks though
If you happen to override the CMC, there are a few places you can override where that is called and place a delegate there. That's some serious C++ work though.
Hi. I have a question, that is more a problem. Why in this video this node appears with all those outputs but when I add the same node in my unreal engine, it only has 2 outputs please?
and this the only output I get inside the unreal I'm using
Could anyone help me, I messed up my logic somewhere in my Health and Shield System, I keep getting 110 health and I don't want that. For information I'm using 1 variable called hitPoints being shield + health, and another variable called shield saving the shield value.
Right click OutHit blue pin and Split the Struct.
Oh I didn't know that was possible. Thank you so much!
Thats some logic you got there
Oh I forgot that
@main lake Out of curiosity, why the combination? You could simplify this with just having separate shield and health.
I call it o ndamage
Health is health, and shield is shield
I can't do that, I'm just using ue4 blueprint to code the health system because it's easier for my brain to read blueprint than lines of code and I'm doing this because I need to code this in another software using lua, so I'm doing the logic here first because it's easier for me
it's the same system as Fortnite
when damaged, the shield need to be consumed first then the health
Nobody said anything about changing coding language
oh yeah I forgot the explaination x) I can't do it with health and shield being separated because on that engine, damage is only for health and I need to detect the damage and apply those to hitPoints so it consumes shield first then health.
.
If shield > 0 then
If shield >= inDamage then
Shield = shield - damage
Else
Damage / inDamage-shield
Shield = 0
End_if
Health = health - damage
Else
Health = health - inDamage
End_if
{
CurrentHP = Clamp(CurrentTotalHP - DamageAmount), HasShields() ? MaxNonShieldHP : 0, MaxNonShieldHP+MaxShieldHP);
}
HasShields()
{
return CurrentTotalHP > MaxNonShieldHP;
}
guys, Does anyone know of a discord server where I can get help making a inventory system in BP's.
I don't understand both logics
Slackers is probably the most active community discord for Unreal.
ok, I'll try them again
? I not seeing what I'm doing. This server is Unreal Slackers
@main lake
That will follow usual shield logic and damage shields til they're gone with no spill over to green health.
I can't seem to find anything on google. anyone have any ideas. the issue is inventory systems. I been trying to setup 1 up. and the devs are gone and the work is no longer supported.
Does this work for overflow after shield is nulled?
I dont think it does
Clamp_min being maxnonshieldhealth
It will. That's what the HasShields is for. If it has shields, clamp it at nonshieldmax. Else at zero.
Did you watch the gif I sent above, because there you can see it goes to 110 but comes back to normal after taking the damage again which means I only messed up somewhere with my branches
If it has shield (37(and 100hp so 137 tot)) and take damage (57) im not seeing how clamping currentotalhealth to 100 will return 80 health
But maybe my brain's not with me
how would I get all Actor Components in an Actor?
depends
wouldn't that only be like static meshes and stuff like that? would that also include custom components?
Custom aswell
alright, thanks
Since they derive from the base component class
generically, actor components
With what I posted, doing 80 damage with 30 shields would only do 30 total damage. If 0 shields it would deal 80 damage or as much health is left. A lot of shield games tend to not let damage spill over, so I assumed.
I was considering if it was by intent, and as you say, many games do this ^^
Not sure what fortnite does tho
Full damage
As do most βcompetitiveβ games
Itβs the most fair approach in PvP
@maiden wadi So it's not possible to fix my logic without changing the whole code ?
Dunno. Possibly. Don't see why you need two different functions.
Just to make my brain more organized, one calculating health and the other the shield
and I start by doing the damage on the shield, then on the health
perhaps another way to go about it
He doesn't want two variables for health and shield though. Or at least that's what I thought.
Yeah. π€·ββοΈ
lol i dunno how to read code π
didnt scroll up far enough
I thought it was pretty reading friendly :(
Except the variable names being mildly overlapping
InDamage vs Damage
Here are all my variables :
hitPoints = health + shield
maxHitPoints = maxHealth + maxShield
shield
maxShield
Damage = incoming damage
healthDamage = Damage left to do for health after calculating damage for the shield
nah it is, i literally did not scroll up to that
You need a separate variable for the shield
Also, int ? Floats are.. less conversions
Damage is float
The progressbar is float
yeah I just don't want to have decimal values for those
Float to text has functionality for removing decimals
yeah could do that
but I still need what to fix in my code because I'm so close to the solution
Just start over and do as conrad suggested ^^
I suck at math. What's the math equation % to next level when you have currentXP and neededXP?
I thought it was neededxp - currentxp / 100
I can't do that, like I said about I need to have hitPoints being health + shield
You always start at 0 for each level and each levels needed xp is currentlevel * 100
So current xp/needed xp* 100?
visually? just place shield bar at the end of health bar
why would I do that ?
because i cant understand why you care so much to have these two variables together when it makes no sense π
I explained it above #blueprint message
which has literally been suggested to you in several different ways
what do you mean ?
maybe you should reread what you are asking - because that has been answered by all of us here, if you dont understand that, then i guess you want something else
What I need is just to understand where I made a mistake in my code to have this 110 hp and fix it
Where is the code for the widget that's displaying the health?
The only code left out π π€
It could very well just be the widget working incorrectly
Considering 110-50 is 60 but the text/bar jumps to 50 and you are doing 50 damage right? It looks to me like the health bar text update is incorrect.
Its actually
The output
From the calculate shield
Which returns -10 ,
And 100-(-10)=110
Atleast, thats what the math looks like
(Shield - damage) when (damage > shield) return (negative value)
Yeah but why does health from that point on do 50 damage and it goes down to 50/100 instead of 60/100?
It seems the dmg amount is random
First its 30 then its 20(10 overload) followed by 60 and lastly >= 50
I thought he said it does 50 to health and 30 to shields?
Could anyone help me, I messed up my logic somewhere in my Health and Shield System, I keep getting 110 health and I don't want that. For information I'm using 1 variable called hitPoints being shield + health, and another variable called shield saving the shield value.```
This was the original text
Cant see 50 and 30 mentioned beyond some explanations later on from others ^^ but maybe i missed a memo. On the phone so easy to miss out
I never saw the apply damage event he tested with so its purely guesswork that its random
Nah it was me looking at your explanation of 80 damage doing 30 shield. Was thinking he was saying shields did 30 damage, and the video looked like it was doing 50 damage to health.
So sort of made some assumptions. The overloaded shield is possible if that's not the case. Id be curious to see what it does at full shield since he showed the video with some shield gone already.
So much extra , just to avoid a variable π
Winning gone up in the spinning, as we norwegians say
Yeah I'm not sure why all this is necessary and why the introduction of other issues is worth throwing away one variable.
I explained it above : #blueprint message
why ?
How you chose to handle it is up to you
If you want to subtract it from 19 variables you can do that aswell
Only thing you gotta check for is if you have a shield,
And if the shield is more than the incoming dmg (can the entire incoming dmg be absorbed by the current shield)
If so, simply subtract from the shield
If not, subtract shieldvalue from dmg, null out the shield, and pass on the remaining dmg to the health function
As attempted explained above quite a few times
This other engine sounds like you can't by default use a shield to block incoming damage,so all damage goes directly to health. If that's the case why can't you increase health to health + shield?
If health > maxhealth (100), displaying overload as shield value
I'm doing that, above I said hitPoints = health + shield, but I need to display those as 2 different components and from that you can guess the health by doing health = hitpoints - shield.
Your shield checks are wrong
I know but why / where it's wrong is the question
first thing I go is substract the damage from hitPoints so that's good here
Thats not good
Because you want the remainder?
no not yet, I do that after
You want to know the difference between them.
No, you instantly should want to know this
First branch should be : do i have a shield?
no the first thing is to calculate hitPoints once and for all, the next part of the code is to see if the damage should remove shield or health or both
Ill forever disagree
but do you remember that hitPoints = shield + health
so the real value is hitPoints
Which means shield can be applied even with hitpoints below 100
^
Which means, you cant track it with a single variable, what is shield and what is not
shield can be applied when hitPoints are below 100...
In fortnite, yes it can
imagine if you have 50 health and 50 shield = 100 hitpoints
Yeah if your health is 25 and you apply shield, it would make your health 25 + shield
So it would be a heal not a shield
and that's good
If good != fortnite, sure
That's not how fortnite works at all
because there will be a shield item giving shield and health item giving health
But then you shouldnt say you want it like fortnite
then I don't understand
The way you have it now, shield will always only ever heal, unless you are at or near max health
Not sure i can make you understand if my attempted explanation dont make sense , sorry
If you have 25 health, that means you have 0 shield. If you apply a 50 shield, it will only give you 75 health and you'll still only have 0 shield
I don't understand
Any "shield" applied while < max health would be healing, either partially or fully
If you have 75 health and use a 50 shield, it will give you 25 health and 25 shield
In order to increase your shield separately from your health, you need to have the two tracked separately in different variables.
if I have 25 health that means hitpoints = 25 and shield = 0, if I apply 50 shield, I will have 75 hitPoints with 50 shield, and from that you can guess the health by doing some basic math like this
health = hitPoints - shield wich gives you this health = 75 - 50 = 25
so health = 25
π€
Seems you got it figured out. Best of luck
but I have 2 variables
- hitPoints
- shield
So you want your shield to fill you up to 100% AND give you the designated amount of shield?
but I figured that out from the beginning but you didn't understand it π€
I was being ironic /sarcastic depending on
Doesnt translate well over text, ill admit
in which case ?
Any time you apply shield
depends on the shield item, could be a 25 shield item or a 50 shield item or a 100 shield item
The way a shield is supposed to work, and the way it works in Fortnite, is shield always absorbs damage before health, and a shield potion doesn't fill your health, only your shield.
The way you are building it, shield is only filled after health is full.
Since your shield is determined by your max health + overloaded value (So 110 would be 100 health and 10 shield)
Therefore, applying 50 shield to anything below 100 health will heal you before it fills your shield.
If that's what you intend it to do, then you are all set. But you wanted it like Fortnite and fortnite tracks the two separately.
I want it to work like Fortnite
Then you need to change how you are doing your logic and you need to track shield and health separately.
show me where in my code it does that so I can fix it
but I can't
They already showed you, multiple ways to do it.
Then you can't do what fortnite does
so im trying to get Ai to form a line, or a queue system, where line up and take turns getting to a point. how would i go about something like this?
I know it's possible
so I have to have a health variable ?
π

You need two variables you need to track. Your health, and your shield
When you take damage you first need to check if you have shield, and if so reduce that. If not, reduce health.
Health,maxHealth, shield, maxShield
what do I get if I succeed doing it without those health and maxHealth variable ?
you dont get anything, this is not a competition.
you get to be happy that your game works
that was my first approach and I succeed doing it, but with the limitation of the other engine I have no choice to do it like this
It's a challenge, and I want a cookie role if I succeed, bet ?
The limitation of the other engine is what is preventing you from making it like Fortnite then
cant you just have a health and max health variable. If health is greater then max health, it counts as shield
Im not sure exactly what your trying todo tho
What does "the other engine" refers here lol
that's what I'm doing here, with hitPoints = shield + health
so if I want my health to be 100
and shield to be 100
then hitPoints should be 200
...
And it seems logic to me because from this you can get health and MaxHealth from it and Shield and Max shield from it just by doing substraction
But people above tell me it's not possible ...
Well. I mean you can compress two values into one value.
That's what I'm doing
im not sure hiw you could get max health/max shield?
subtraction?
subtracting what from what?
If I were you, I'd just keep both separate value. Basically how boomer shooters and Fortnite does it.
But I can't, with other engine I can't do that. Because I already did the whole system in unreal with 2 variables and it works perfectly but I have to redo the system this way because of the other engine
wtf is your "other engine" anyway lmao
Here are all my variables
Max Health = maxHitPoints - maxShield
and maxShield there's already a variable for it
Core
Oooooh
you know it ?
Never touched it, but I heard of it, kind of like Roblox I say
what isnt this channel for helping with unreal
I doubt any of us know anything about core
yeah, its a "game" engine
I guess the problem here is being too strict with other's convention
And Core is a UE4 game.
i see then
yeah my problem is in Unreal as I'm doing the code on Unreal blueprint first because my mind is more organized using blueprint than code, after that I'm gonna code it in Core
sounds like Core cant do math then
lol
Why not make it in Unreal fully?
no it's not about math it's about how health is set for the player and there's an event linked to that when player takes damage and when it's below 0 the player dies (can't be changed) so that's why I have to set it like this
that makes sense
Because I'm using Core for different reasons as Core has a lot of assets (audio, graphics,...) to help us create games, and by the same time I train my self at coding and designing stuff
and it's for a school project
sounds very roundabout to ask for help in mocking up something so specific in another engine here, just get help from the forums/discord of Core then
Unless I'm mistaken, Core has it's own ways of doing things, including Lua scripting.
yeah
the limitation here is we can't redefine the function when a player takes damage, otherwise I won't need to come here and ask for help so I have to to find a way to do this system with hitpoints being shield + health, and do some magic voodoo to display it correctly on the UI
at this point im not even sure you know how it works in Core, this all seems moot to solve
I just looked at the documentation. It works almost exactly like Roblox.
You can set an individual 'shield' value on the player and calculate the actual damage BEFORE you apply it
already tried, if you apply damage in the function connected to player.damagedEvent, it creates an infinite loop
Then you did it incorrectly. I have done it numerous times in Roblox games, and the syntax looks identical in the documentation.
local maxShield = 100
local shield = 0
function <Your Damage Function>(player, args)
dmg = math.random(0,50)
if player.Shield >= dmg then
player.Shield = player.Shield - dmg
else
local finalDmg = dmg - player.Shield
player.Shield = 0
player:ApplyDamage(finalDmg)
end
end
Without actually testing it
But this isn't the correct discord or place to discuss that.
Is that Lua?
yeah
Looked familiar. π
I'm almost certain it's not in the correct place either, as you'd have to store the shield variables in the player class file and the damage function in wherever you are applying the damage from, and grab the player from the class file to get it's shield value. Not sure how Core does it.
Whew. Just got done hacking away the drag selection of units on screen again... Still don't fully understand why that is a HudDraw function. It really doesn't need the Canvas reference.
I got on the pc to work on my project, and don't really feel like doing anything right now.
π’
Maybe I will try to clean up my shooting animations.
the code here creates an infinite loop because you use ApplyDamage, wich triggers this function as it's waiting for the player is damaged. That's where I'm stuck right now
Because you are using the applydamage on the applydamage function
make your own and call that to apply damage
You should probably try a discord for core @main lake
And doing the thing in Unreal just to do it in Core is pointless.
it doesn't solve the issue it will still be an infinite loop
Just because how different both handle things around
Okay well I am done offering my help. Literally 10 people have offered to help you and you have rejected every solution. The code I gave you is almost an exact copy/paste of things I have done numerous times, and things many others do as well. I would suggest moving to the Core discord and asking in there.
The help people gave me like I explained above I already did that solution and it works perfectly but for Core it won't work because of the way it's handling stuff. And your code above you seem to not understand it will create an infinite loop because ApplyingDamage to the player will trigger the damagedEvent linked to the player which calls your function that applies damage which calls the damagedEvent on the player,... forever
What you want to do is possible, it just may not be possible at your skillset. Many people have done the same thing you are trying to do, the way we are explaining to you to do it. We can't help any further.
Not even related.
Core is basically Roblox but made with Unreal, down to the Lua scripting.
not related to blueprint at all, I'm just more confortable at coding using blueprint because my brain is more organized because I struggle alot when I have alot of lines of code I keep getting lost and I get demotivated or don't understand my logic anymore
If good looking assets are what you're going for, UE marketplace has some freebies.
Always helps to draw diagrams
Especially cause those can translate 1:1 with the framework you are using
the problem with UE marketplace is, it cost money and if you go with free stuff usually mixing stuff doesn't give a coehesive art direction which is something I don't like, while core gives for free alot of assets, it also handles server for you and relation between the platform and the players if there's any problem, and other stuff
yeah I know
If that's the case, then asking on Core discord server (if there's any) would do you better.
I just did and I got a crucial information, it looks like we can catch damage to the player before it's being applied which solves my issue
I don't use Core, and I'm sure majority of us here don't as well.
Got curious. Got halfway through the selling page and cringed. "Get your game in front of players instantly with one click publishing. Core provides high-end, scalable servers and doesn't require netcode for multiplayer games so you can instantly get your game in front of a huge audience."
All I read was "Use our basic implementation of networking. It's basic. So your games can be too!"
smh
At least Core don't have child exploitation drama going on, yet, but I digress
Core is the big boy Roblox
Game Maker or bust
I dunno. Maybe I'm wrong and it's fantastic. It just looks painfully limiting at first glance.
there are fors and cons, if you come from an engine with alot of features where you can import you own stuff you will find it limiting and get frustrated really fast (it's my case for some feautures being crucial not being there yet), otherwise if you're someone not knowing any programming or a bit of programming and you just want to make a game without breaking your head with server management, dealing with unhappy clients, make a bit of money,... Core could be a good place to start your video game journey π
For all intents and purposes, it was basically Roblox and not a game engine.
Heck, Core itself is basically sandbox UE4 game.
yeah
Nevermind, it looks like the person giving me that information was wrong, you can't cancel damage from player, so back to the paperboard π¦
To be fair though. Unreal's networking is incredibly simple. The only bonus that using that engine would really truly bring is that they host servers for you. But at 50% revenue, they better.
Unreal's networking. Setting replicated variables on a replicated actor or a replicated actor component on a replicated actor on the server replicates it to clients.
Clients can only do one RPC which is a Server RPC through owned actors, by default that's PlayerController, PossessedPawn, and their PlayerState.
Wait, Epic now provides dedicated servers?
Yeah, meant Core.
Literally in the documentation:
Oh, whoops.
But yeah, make LAN party and local MP cool again
People actually tend to prefer community hosted servers a lot of times. Different mods, different settings.
Elements as in materials?
And by elements, do you mean slots? Or parameters?
yeah all the elemnts of the meshes materials i want to change
If it's the latter, I think you have to go through making dynamic material instance of the material (instance) that the mesh uses, usually on BeginPlay (maybe Construction Script, but I doubt Setter works there)
Define "elements"
I think they mean the array elements
On a mesh, where you can define multiple materials
That's material slots then
excuse me they are elements in my unreal engine
how can i change all of those to one material in run time
eg have one same material for them all
I think there's a node to set material on certain slot index, but I forgot exactly the node name
Does this work?
Set Material on Slot Index?
Or this.
Couldnt you just set 1 material for the whole mesh? instead of changing each material into the same one
yeah first one was good
I have 7 elements there?
@zealous fog
and thanks @maiden wadi
That material slot names threw me off a bit
Ah I didnt know you need to specify an element
Hmm is there a node to get the camera look direction? I want to change my fire function to spawn a projectile movement actor towards where the center of the camera is looking (the on screen reticle) instead of just at the forward vector of the player.
Or at least get the gun socket to always point at the center of the screen
Get World Rotation of the camera -> Get Forward Vector
Maybe that?
I may actually want aim offset. Looking at it now.
If you're looking for an animgraph node for aiming, usually GetBaseAimRotation. If it's in something relating to the local player, usually getting it from the CameraManager is better as it doesn't rely on having a specific reference to the cameras.
What I am really trying to do is add a reticle to the center of the screen and when a player shoots, it shoots towards the reticle instead of just forward.
Which will usually be forward but could also be slightly up. Trying to replicate ratchet and clank style aiming
For First person or third person aiming?
Ah. Usually just a line trace from camera. Get the hit location, and use that hit location to find the look at rotation from the weapon to the line trace's end point.
Ratchet And Clank Rift Apart All Weapons (ratchet And clank PS5 all weapons)
Like the video? Subscribe now: http://bit.ly/1S7oa8K
Support Me & Get Special Perks! http://bit.ly/2NGslwd
Ratchet And Clank Rift Apart Weapons (Ratchet And Clank PS5 Weapons) used:
Blast Pistol
Enforcer
Pixelizer
Shatterblast
MS Fugal
Large Negatron Collider
Ricochet
...
Like this
Right now I am just spawning projectile component at weapon muzzle socket + forward vector but it's just going forward always. Trying to change it so I can aim anywhere and send the projectile in that direction
I would wager a simple line trace from camera would do that for you. To avoid hitting things between the pawn and camera, just project the start location to a plane that is in front of the character in the plane normal direction of the camera.
I was just going to ask if a line trace from the muzzle would work but that wouldn't go with the camera look
Unless I used aim offset
Do I set the trace end location to be how far away I want the projectile to hit?
Okay. Does this require a hit on the other end? I want the player to be able to shoot in the direction even if there's nothing there.
Would anyone know why it looks like the camera shakes for a brief second whenever I start a wallrun? It only happens if I rotate the character.
Wait the video didnt embed one sec
I just moved it from a timeline to event tick and now it doesn't do it so uhhh
@trim matrixMaybe. After the trace you can just do a vector select for whether there's a hit. If there's a hit, use the hit location, if not, use the trace end point.
I will take a look at it tomorrow and see what I can come up with. I don't quite fully understand yet how to use a line trace with projectile movement components to determine what direction they go in
Whats the performance hit on using ai bb and bt? As opposed to timers and if statements.
Sometimes i cannot justify ai for simple tasks.
Is this proper way?
I have list inventory where are my guns and I want to set current weapon ammos in mag
I want to set details structure by id not add new
Like how to replace that with new values or set
In that case I have Dictionary "Inventory Hot bar items" key is structure where is item id etc and value is how many I have of those items
Use 'Set members in struct' to change individual variables within a struct. Also make sure the GET is by ref
You choose which variables you're setting in the details panel of the Set members in struct node
To get the node you drag off the struct pin and type 'Set members in' and it should show the name of your structure in it
Ive created a rotating rock with blueprint, simple set up. It rotates in simulation, but Id like to actually have it play in the sequencer to export with the movie queue. How do I get it to play in the sequencer mode, here is my set up
Hey if I'm using a ForEach Loop with a delay (custom node but im not sure if it matters.) Is there a way for me to recall the ForEach Loop without cancelling the original one?
you have a forloop with a delay within it's macro? or is it a delay on the Loop exec pin?
okay, calling it will operate the entire loop (the array)
Should I just redirect it directly to the ForEach Loop then? Because atm I have a custom event that I've been recalling
Recalling Loop Event
ft Spaghetti code
it will call the loop starting with the first entry of the array
if you are trying to filter it for some reason, you should remove the entry after each Loop, but i dont exactly know what you're trying to do at large
When I call the loop again, it does start at the beginning again. However, the current loop is supposed to keep going, but instead it resets.
loops arent meant to be delayed, so this wont work well
ahh okay
you need to wait for it to complete then call it again
I'll probably just set it up manually instead of a foreachloop then
thank u for helping out
sure thing
Whats the usecase for trying to start a new loop from start while maintaining the last one?
Is it an overengineering to implement getter and setters for each variable on my blueprints? Instead of just using the variable itself? It's just easier to use them visually, without requiring an exec pin (for getters) and also doesn't take up much space (like pure fns). But it feels safer to implement functions for future purposes
Nope.
BTW this new tutorial for "C++ for Blueprinters" from the official Unreal Engine channel is the good stuff. Fairly approachable for BPers getting started with C++ programming in Unreal, and best of all it doesn't encourage Hot Reload and instead opting for restarting the editor in recompiling code (it also highlights Live Coding, which is a huge bonus)
Highly recommended to check out.
Have you mastered Blueprints and want to take the next step into C++ to leverage more from the engine? It's easier than you think! In this tutorial, you'll learn the basics of exposing C++ to Blueprints, migrating Blueprints, and more.
when i attach a char to my mesh socket my movement direction gets messedup . If i press forward it goes back and so on. Does any1 knows problem??
Yeah I've been watching that video, I think it makes most sense if you've done the absolute basics in unreal C++
Enough so you know the basic syntax of the code
But its super simple to follow then
Is there a way to flush inputs from blueprint?
I know you can access PlayerInput in C++ and from there access FlushPressedKeys, but I haven't found a way to access that from blueprints
does anyone know why my weapon trail is not replicating to client? This should work with any issues.....(deleted main post in UEgeneral)
@visual vigil can you show the bp related? Are you attaching something like a weapon to your skeleton socket?
well this is actually a question for #multiplayer π
Ughh... lol
i got to stop posting in there no one knows a thing xD (Ue General)
just to have it shot one bullet. Was going to add more to it in the future
client only: local trail, multicast for everything else
server/client: only multicast
Oops.
I think the do once is what's making it fail
lets hope you are right!!
I'll DM you a code snippet of what worked for me
it should basically be exactly the same in blueprints π
replacing the functions with nodes
this is not for a montage to play
this is for bullet trail xD
a projectile spawner
yes, but it should be exactly the same
ohh i see what you are saying
you just replace the montage with a trail
You know what, ill just worry about this another time and mark it on my todo list.
Something is causing the code not to replicate.
how to fix this?
Doubt it's a good idea to profile in the viewport like that
Try Standalone or atleast PIE
The issue was never that code, i forgot to add the third person support inside the function i created.It was only understanding that the first person view had bullets. Big OOPS thanks for trying to help π Works now!
I'm fairly new to Unreal Engine, after moving from Unity to UE
I've got a wee ol' question for potential guidance and or assistance;
What am I trying to achieve?
I have a Stryker vehicle, I can enter it and exit it, the character can posses the vehicle and move with the controller assigned to the vehicle object.
The Stryker has a turret on top of itself and I am wanting to be able to switch to the turret and possess it. However, currently it is all a single mesh, fully rigged.
Any advice on how to go about this? I've so far seen hints towards using multiple blueprints, which I vaguely understand as you'd have a blueprint for the controls of the vehicle and a blueprint that controls the turret. My confusion is primarily with how to obtain the turret from the same mesh, or is it outright better to end up with 2 objects and making the turret the child of the vehicle?
Any input/guidance is greatly appreciated, cheers ^_^
I have NO idea if these come with blueprints
but you could look in one of his products and see how he did it, IF he has the blueprints
All for free btw
only a few support 4.26
the rest are 4.27 btw
make sure to filter if you are using 4.26 π
Just went ahead and installed the same build they use, just to ensure no possible issue(s) arise π
Damn that is exactly what you are looking for too
LOL i just realized what a Stryker vehicle was.
Aye, it's mainly to replicate it now to UE5 xD
However, instead of just trying to work with what it has already, I wanted to learn a bit more on how everything works XD
In the interest of programmatical discussion, one of the cleanest ways to achieve this is to have one main vehicle actor. This actor is the main shell of the vehicle and spawns it's "seats". These seats are possessable pawns. Lets say a simple truck for example, two seats. Driver seat and Passenger. The two seats would be different classes because the driver will need their inputs forwarded to the vehicle, while the passenger on the other hand just needs the ability to look around, maybe lean out of a window to shoot. You possess this seat pawn, and give that pawn a reference to the player's actual character so that it can set up the character's actor into the seat. Allows the passenger to still take damage in their character if you want. Setting the capsule collision to none and attaching it to the seat allows easy minimap updating as well since it'll probably use the root of your main pawn for ease. If not or if you don't want to see the character you can always just hide it away. But now you should have a pawn on the vehicle possessed. Pressing exit would set your old character to the door of the vehicle, play montage of getting out of the vehicle, etc. and then repossess the human character. That would be the basics of using the vehicle. How each seat works, Driver, turrets, passengers, that's easily definable and up to you.
Aye, that's roughly what my understanding was of that, simply to have separate classes for each "possessable" seat within the vehicle, and each of those having "different" controls depending on the seat (Driver, passenger, turret controller etc..). Cheers for the input lads, I'll put that input to use now ^_^
Like Lannis said, don't profile with play-in-editor (PIE). The CPU/gamethread metrics in particular will be way off.
Has anyone seen anything about blueprint diffs outside of the editor? Preferably in a web friendly format.
how can i debug the F key ?
Can i use blueprint variable in timeline?
not internally since timeline is a component. but nodes exist to modify timelines in their owner classes
you can also reference static curve assets
hey guys, I have a question. How can I hide a widget using action mapping?
I tried this
but not working
yeah because you can't use a variable from a previous execution like that
oh
what did you try exactly
does the widget spawn?
yes
Enable Input.
oh my bad you're doing it inside of a widget?!
No, it's another actor. Not a pawn though.
spawn your widgets through your HUD or PC
Needs Input Enabled on overlap as well.
Don't forget to disable input when actor leaves the thing as well.
yeah right
@earnest flaxAlso Isvalid that widget before removing it from screen, and null it's pointer after removing it so garbage collection can collect it.
alright
Oh. You did that on hit, not overlap.
yes?
@earnest flax Should probably look like this in the end. That'll allow the widget to be collected and not stay in memory. And handle your object not keeping escape bound.
Hmm. May want Disable input before the widget pointer IsValid. Either way.
Does anyone have a good video about line traces in fps/tps? I want to do a more in depth set up like if the camera line trace is = to a weapon line trace, So I would have 2 line traces the camera line trace would be the main looking line trace and the weapon line trace would be a more practical way of doing bullets and weapon vfx. I am sick of bullets shooting from my characters face sometimes(removed from wrong area posted)
It does spawn from the weapons socket correct
So how does it get into the characters face
but when strafing, the bullet follows the cameras motions and sits on center of the screen
If something is to close to the char(fits the cam trace, but wouldnt really work), then you'd need to default to something else
@lucid ingot #blueprint message
Where did you get this information from
My head.
