#blueprint

402296 messages Β· Page 737 of 403

tight schooner
#

Dunno about alt tab

#

Usually esoteric things like this need C++

open crypt
tight schooner
#

And if you (like me) don't know C++, hopefully there's a code snippet on the web you can steal lol

bold phoenix
#

Is it possible to somehow get the static mesh of an actor by raycasting it's class ?

open crypt
bold phoenix
tight schooner
#

Do you mean you have a ton of child classes? You can still cast to any of its parent classes; it'll work. That's a totally normal thing to do.

#

If you need some way to interface with actors in a way that cuts across class hierarchies, look into Blueprint Interfaces or using components as interfaces

bold phoenix
#

I just saw the node "cast to actor"

#

But then it seams like "as actor" I can't get the mesh of the actor

#

I will look for the interfaces as you said

onyx pagoda
# bold phoenix But then it seams like "as actor" I can't get the mesh of the actor

Cast to the master parent actor all of your different child classes are parented to. Your hierarchy should be set up such that the shared components of your classes are in your parent, such as something like "MasterChair" which has a static mesh component, and all the subclasses of "MasterChair" override the mesh to the specific type of chair. Anything that is in the parent class can be retrieved from the 'As ...' output of the cast

bold phoenix
onyx pagoda
#

and it would work for all future items you create, unless there are ones that have weird edge cases like using a skeletal mesh for some reason. The MasterItem having a StaticMeshComponent will trickle down to all the children, but can be overriden in each child as needed without needing to make a new StaticMeshComponent. One component to rule them all.

faint pasture
#

If it's something super simple then dialogue should be data on the character

#

or data with character name as key or something

high ocean
#

Bit of a design question. I've been looking around for formulas but can't seem to find quite what I'd like (or I don't fully understand).
I have units which have base variable damage (13-37) for instance. They also have attack and defense ratings. I've found many ways of dealing with scaling out there. But there's something I can't figure out (if I go with attack=attacker's attack-defender's defense): How much bonus to damage should attack provide?

odd ember
#

this sounds like of those "two trains are going at two different speeds" kind of questions from physics exams in high school

#

I don't think your question is answerable

#

or maybe it needs rephrasing

high ocean
#

well, if I use one of the "standard formulas" where A=A-D=> for instance: A=15, D=8 => Final A=7. Base Damage is 13-17. WTF do I do with the 7 attack? xD

odd ember
#

yes the math is correct

#

you would do 7 damage

#

what's the issue

high ocean
#

nobody out there speaks a word of the attack's contribution to actual damage, they all speak as if the damage itself would b irrelevant πŸ€·β€β™‚οΈ

high ocean
#

that's exactly what I mean... Should I just add or subtract the fker? xD

odd ember
#

up to you how you want to design it

high ocean
#

idk what to do with the +/- attack from a design perspective xD

odd ember
#

there is no right answer

high ocean
#

ofc, it's a design question πŸ˜„

odd ember
#

I don't know what your intention is

high ocean
#

to have something familiar, the player could relate to, something widely used - don't wanna re-design the wheel... But can't find the common practice unlike the att-def formulas

odd ember
#

I mean some studios spend years perfecting the balance

#

and hide their formulas under lock and key

high ocean
#

wtf...srsly?!

onyx pagoda
#

The first question is, what does your ceiling look like

#

is this a game that scales infinitely, or a fixed known quantity

#

A-B is a fine answer for infinite scaling, but there are better solutions for fixed known quantity.

high ocean
#

~200 for stats at highest levels, dmg would probably end up in the same range

odd ember
#

in most cases you'd probably want diminishing returns

high ocean
#

uhm...diminishing returns?

odd ember
#

basically a soft ceiling

onyx pagoda
#

One of the most common practices is to have a Defense stat calculate and spit out a % mitigation rather than deal with the damage directly

odd ember
#

e.g. in dark souls, 50 strength is a soft cap where after you get much less damage from continuing the spec

onyx pagoda
high ocean
odd ember
#

so 80 strength vs 50 strength may only be a 10-20% increase, whereas 30 to 50 may be a 100% increase

#

I mean you do it so it's easier for you

#

and so people can't just stack one stat infinitely

#

imagine your defense is so high that you take 0 damage from everything

#

that may be a very real case with your system

high ocean
#

I thought of that, and also thought of clamping the min dmg. It's turn-based sp, so encounters are 100% under my control, the player will never meet opponents ridiculously over-under his own level range/stats etc

#

read the LOL system, it's pretty straight-forward but also limiting - feels "hard-coded"

#

so, basically if I just go with att-def=> final A which I just ADD to the main damage, would that be a bad idea? Seems to linearly scale to infinity pretty nice

odd ember
#

it's up to you

#

I do think diminishing returns in general makes for more robust balancing but you do you

onyx pagoda
#

It's effectively turning a Defense stat into effective health, which is fairly easy to comprehend and tends to play nicely with other systems. you can penetrate armor, double armor, do other things to it without the system collapsing into a balance nightmare

#

those decisions are the things that will determine what type of calculation you should use. Every good system has ways to break it. If you have Defense, surely there will be some things that want to ignore it, or double it, or do "X thing based on Defense".

high ocean
onyx pagoda
#

exploring those out and knowing what they will do will be fairly important. Does something with Ignore Defense completely break the calculation, does Doubling Defense make something unkillable

high ocean
#

@onyx pagodaGood points. I think i'll sleep on it, get working on it fresh in the morning πŸ˜„
Thanks for your input guys, much appreciated. πŸ™‚ @odd ember

tranquil snow
#

I love playing games that don't have diminishing returns, especially when the 4byte value is displayed and changes often. ^.^

bold phoenix
burnt trench
#

Posting this again because it got buried. Hello Everyone!
My question is: I have a level with a nav bounds generating the navigation data for the AI
Now I have an actor with a navmodifier component it. On runtime I change the area class of the modifier but it does change anything on the navmesh. It only changes before playing and not runtime. Is there a way to generate the navmesh on runtime?
please tag me if you know a resource or know you to fix the issue

odd ember
#

set the navmesh to be dynamic

tranquil snow
#

@burnt trench an answer?

fiery swallow
#

If they're going to be reused why do you have to destroy them?

#

If you want to swap actors on the fly you can just create an area on the map somewhere hidden, and put all the characters there in an idle state. Whenever you switch actors you can just have them swap locations

#

This was a similar method used in a few games I was hired to work on. It was very smooth, efficient, and had no problems

#

Yup

#

Just store a reference to all your characters in the playerstate

#

Well, I guess I don't need to tell you where to store your stuff

#

But I believe playerstate persists through map changing

#

Yeah sounds good too

#

I use components to separate things that aren't technically part of the character. For example, I would make an XP component for handling leveling and Experience. I'd make a component for inventory and/or weapon switching logic

#

I'd use a blueprint interface for sending or grabbing information inside of that XP component or something

#

I dont know if that answers your question or gives you any ideas

#

Nah you could use a blueprint interface to check if the reference has a status variable

#

And set it that way too

#

You could do all of that in a blueprint interface, I believe it acts as a function and returns the result immediately

covert arrow
#

hey guys I wanted to ask what would be the best way to implement to mantle in first person?

fiery swallow
#

The only thing about blueprint interfaces and functions that could be considered a con is that it is respected to return information instantly

#

That can obviously be undesired in a lot of cases as

#

No you call the blueprint interface and wait for the result, then apply the status after

#

In your case you might want it to return a result as fast as possible to keep up with what's happening

#

Yeah if it's information you'll need repetitively then a function/BPI is likely what you want

open crypt
#

What would be a reason that a video player would stop looping, or pause for a long period of time in between playing?

fiery swallow
#

It'll be much more efficient then calling a component, calculating, and then calling another even to send back the data

#

Yeah

#

Well as far as storing a variable you can put it wherever you think it belongs, doesn't matter if it's on the character or on the component in terms of speed

#

You should update the variable using a blueprint interface though

#

That's adding extra steps

#

If the target is the status effect component then yes, that would be the more responsible thing to do

#

Glad I could help

tranquil snow
#

is there a built-in blueprint that puts out a sine wave?

tawdry surge
#

Hey dumb question, but how do I get the object reference for the widget my player clicks on?

odd ember
#

usually you parse it through with the events or functions that you call

#

but I don't know how you've done your setup

odd ember
tawdry surge
#

I have a menu widget with 3 buttons for a lil rock paper scissors game.
I need to determine which button the player pressed and record it in the GameMode BP

tranquil snow
#

are you describing blueprint pieces or theory, cuz if i have to make that blueprint myself im sure i cn find something

tawdry surge
#

I just can't seem to get the reference to the widget object.
Should I go through the player controller?

odd ember
tawdry surge
#

Its a BP. I call it from the start menu widget

odd ember
#

so who controls it... who is it for?

tawdry surge
#

When the game starts the start menu widget is called.
When you click start game, it changes to the game menu widget. (This works fine because it's all inside the widget)

Inside the game menu widget I have events for when a button is pushed.

My issue is I need to get that reference from the game mode so I can compare it to the computer's choice and track the score

odd ember
#

why isn't the game mode spawning the widgets then so it can pass itself as a reference to the widget when it spawns them?

tawdry surge
#

I could re-do it that way I suppose.
Seems odd that I can't get the reference another way

odd ember
#

you can use GetGameMode anywhere

#

but if you want to do it properly

tawdry surge
#

Yeah but the widget isn't inheriting from the game mode so it give me an error

odd ember
#

you setup your UI hierarchy to ride off the objects that are necessary. usually that's either the player controller or game mode

#

the widget doesn't need to inherit from game mode

#

but if it's because it's not got a world context object then that's another reason for passing in the controlling actors as references when you spawn the widget

tawdry surge
#

Ok. Ill try it through the player controller.
If that doesn't work I'll re-do the logic in the game mode

odd ember
#

in an ideal scenario the game mode has knowledge of the player controller and is also responsible for starting the game. so it passes the player controller reference (as well as itself potentially) to the widget

gray chasm
#

You can also just use OnInitialized in your widget event graph, to get whatever you want.

modern musk
#

Just curious if anyone could give me some direction on the best way to deal with the following situation:

I've got a blueprint that has 9 skeletal meshes on it (plants). I want the plants to "grow" at different rates, which is relatively easy for my needs (i.e., I just do "for each plant, get current scale add random float in range to XYZ value of current scale, then set new scale"). However, currently, the plants kind of "pop" whenever they grow in scale. I want to lerp the current scale to the new scale but I'm unsure of how to call a separate instance of the "lerp event/function" for each plant (outside of creating a second BP actor specifically for the plant, adding the lerp functioning there, and then adding that as a child actor to my current BP). Anyone have any thoughts?

odd ember
gray chasm
#

Hm... really? I swear I've used it to get a reference to the game mode before.

odd ember
#

you can use the node GetGameMode anywhere

#

assuming you have a world context object

#

or don't require one

#

but if you're having variables exposed on spawn for widgets that you are spawning, OnInitalized takes place before any of those get loaded in

gray chasm
#

yeah, sure. I'm just saying, it's kind of a 'standard pattern' to spawn the root HUD and then immediately assign it a reference to game state / game mode from the spawner. ...but, it's not necessary and it just means its easy to screw up and forget later.

#

If an object needs a reference to, specifically, the game mode, it should take one itself.

odd ember
#

sure but that reference has to come from somewhere. and that somewhere is usually passed through as you spawn the widget itself, from the actor spawning the widget

gray chasm
#

For the player reference, sure.

odd ember
#

it's not necessarily the player spawning the widget. rather in most cases it should be the gamemode

#

hence why you get a MVC type architecture

tight schooner
#

@modern musk from a general perspective, the normal way to approach a piece of code you need multiple instances of is to put the code in a spawn-able object. If it's truly a fixed amount of plants and you just need to wing it no matter how hacky it is, you could make like 9 timelines lol. Another approach would be each plant is its own actor, managed by a separate manager BP.

Yet another approach that wouldn't take too much rejiggering of your current approach is to make a BP child class of Mesh Component that is set up as your plant, and in its BP event graph, have some self-resizing logic on it. Timelines aren't available on components, so you'd have to do something similar on tick with a fInterp node (which wouldn't be that bad if you control the tick with Set Component Tick Enable so that it's only ticking during animation.)

And straight up Child Actor Components would work, though I generally find that workflow finicky. But you would get the timelines.

Actually my last suggestion, if the plant growth is largely cosmetic, is to do it as a Niagara mesh particle system. This would be the most performant and least complex approach provided you are familiar enough with Niagara (or are willing to dive into it). You can spawn plants that grow, and each plant can roll its own lifespan/size/color/etc parameters automatically.

modern musk
astral venture
#

whats a good beginner vid for people who learning blueprints

drowsy flame
# astral venture whats a good beginner vid for people who learning blueprints

https://www.youtube.com/watch?v=bY6Nl-OEhSo
This one really helped me out

Hello guys and welcome to the Unreal Engine 5, Blueprint for Beginners complete tutorial. In this video, I will explain what is blueprint - the visual scripting system of Unreal Engine. I will show you how to create blueprints, and walk you through, step-by-step, how to create a few blueprint classes. We will create a simple door you can open an...

β–Ά Play video
astral venture
#

Has anyone ever taken an internship?

drowsy flame
#

you can use this tut for ue4 or ue5 it doesnt really matter

#

yeah i have

#

but not for unreal

astral venture
drowsy flame
#

In my country

#

////////////////////
Hey so I have these many meshes in my actor, and I wanna set material to a specific one at diff time.
Is there any way to get the reference of a mesh by having a string that is equal to the mesh name?

The other way I see of doing it is making like a switch which takes in a string and making 10 cases which all run the same set material just with a diff mesh reference, but I will have approx. 60 of these meshes so it's not really maintainable. and it's prob slow too?

astral venture
#

try adding blueprints to each of them correspondingly?

dawn gazelle
drowsy flame
regal venture
#

How can I control the firing of this OnComponentHit event? I want to use it to trigger a sound once only once, and I don't want to do something hacky like bPlayedSound

high ocean
#

@regal ventureOnComponentHit -> DoOnce

regal venture
#

Well another problem with that is that I need the ability to turn it on, as well

zinc portal
#

Thanks. this rotate/unrotate is the most understandable explanation yet. I was trying to Google it before posting here but not very successfully. My math is already in relative but the conversion from world to relative is where I have failed I believe. thanks for nudging me to the right direction.

civic briar
spark steppe
#

is there some node which can be used to check if actorA moves towards actorB?

#

or what would be a good way to figure it out? currently my "best" approach would be distance(actorA location, actorB location) < distance((actorA location + actorA forward vector), actorB location)

dawn gazelle
spark steppe
#

ok, but i could predict the movement as i know the forward vector / or velocity of both

#

so my approach isn't that bad? πŸ˜„

#

it's for a damn crow ai, which should flee when i move closer, it doesn't have to be perfect πŸ˜„

dawn gazelle
#

Just do an overlap in that case.

spark steppe
#

well, i use sight sensing, so it detects if something is in view range

#

however it doesn't know then if it moves parallel or towards the crow

#

guess i'll start with the simple check that i posted above and maybe enhance it with velocity if it works as expected

grave relic
#

Is there anyone that can help me with this? I have a tower defence game, where i want my turrets to attack faster the higher the attackspeed value is. Right now i just have a timer so the higher the attackspeed is the slower they are going to attack.

spark steppe
#

but?

cloud grove
#

Hello, I've a blueprint which inherited parent got removed or renamed. So I can't open it anymore on the Editor. I wonder if exists a way to fix it using the editor, or what's the best solution to fix it at all. (Note, I don't know the name for the original inherited class).

earnest tangle
earnest tangle
# cloud grove Hello, I've a blueprint which inherited parent got removed or renamed. So I can'...

If the project opens you could try hovering over the asset and hoping it displays the parent name. If not, you might be out of luck. If you know the parent name and what it was renamed to, you could possibly fix this using a core redirect which tells the engine what the new name is, so it can map the old one into the new one.

You need to start using version control software if you aren't yet, since that would help with problems like this as you can always look in the history to see when stuff is renamed/removed

grave relic
#

Youre thinking like this?

earnest tangle
#

Correct

fiery swallow
# spark steppe but?

Why not just get the distance of the actor every 0.1 seconds while It see's the player, if that distance becomes less than the crow's comfort distance have the crow fly away?

cloud grove
earnest tangle
cloud grove
earnest tangle
#

Well, if you know what was the last good commit where it worked, you should be able to find what the class was called back then :)

cloud grove
#

I can't do that, but thanks for the help anyway πŸ™‚

earnest tangle
#

Alright, I've never used a version control solution which made that impossible to do, but hope you aren't losing too much work from this

cloud grove
#

Don't tell it to me πŸ₯²

earnest tangle
#

What are you using so I know to avoid it lol

cloud grove
#

It's the combination of some factors that make this case difficult. Usually it's simple to fix, just like you described.

spark steppe
#

works pretty well

#

did you guys know that crows strafe a lot? (i've watched way to many bird videos today...)

drowsy flame
#

do crows bhop too?

spark steppe
#

yea, but not much

#

i gave them 10% chance to hop on my movement mode right now πŸ˜„

drowsy flame
#

nice

spark steppe
#

i thought they would hop more, but apparently they dont

#

maybe small birbs hop more

drowsy flame
#

If i put crows into my game i would make an easter egg where a crows bhops past you

spark steppe
onyx token
#

how do i get a neat default value?

spark steppe
#

set the variable to "editable when inherited" in the parent class

onyx token
#

um... it's a struct tho...

#

and it's just a variable i have lying around

crude spire
#

Hey guys, does anyone have a blueprint / guide or tutorial I could follow for a forward moving camera (slider) that starts slow and gets faster and faster until the level is completed? Any info / resources would Help

spark steppe
#

oh i see, then idk if you can change that behavior

onyx token
#

so uh... is that dumb then? kek

onyx token
spark steppe
#

why do you set that to an object?

onyx token
spark steppe
#

yes i do remember

onyx token
#

and you told me "just make 1 farmer walk" - which i managed to do

#

I can spawn a building now - farmer walks to field - returns to building, infinitely.

#

But now i'm starting to understand why you guys were recommending a central AI manager...
Because i'm already running into problems when i spawn multiple buildings, some of them work, some of them don't...

And the error is somewhere buried either in my AI, or the field, or the building, or the child of the building, all of which have small pieces of code that are important

crude spire
onyx token
#

now every tick it gets a little bit faster. If you wanna slow the increase or speed the increase up - just multiply your clock by something (like 0.5 => half the increase. 2 => double the increase)

onyx token
# spark steppe yes i do remember

anyways- now i'm trying to build a central AI manager - and for that i'm thinking:

I need a Struct that contains the type of building i build (farmhouse)
And some additional information about the farmhouse (like which AI actor should be spawned / how many there should be, etc. etc.)

spark steppe
#

calling that struct farmhouse attributes sounds very specific

onyx token
#

I'll put that struct into an array of structs in my player pawn - and use my player pawn as an AI manager.

When i press a "spawn building" on my UI - and i place a building - a struct gets added, and from that point on that struct represents that one farmhouse.
With which i can do whatever i want.

crude spire
spark steppe
#

actor can't be a type

#

actor can be of a type, but not be a type

onyx token
#

ok sure, but i just wanted to name it type to get "what type of building is it"

spark steppe
#

what you may be looking for is an actor class reference

onyx token
#

like "what version. What... thing.... of building..." rooBlank1

#

that wasn't intended to be programmer speak, it's just english for me to understand "wtf kinda type of building is this" kek

spark steppe
#

no

#

the approach is still wrong

onyx token
#

oh

spark steppe
#

make it a actor class reference instead of an actor object reference

onyx token
#

wait- but i googled object vs class references - and it said that object references point to a specific object - and class references are just a blueprint for all of those objects rescBlank

spark steppe
#

yes

onyx token
#

ok, but if i add a struct when i spawn a house-

#

that struct is supposed to point to that one specific house

spark steppe
#

but the struct is saved on the house?

onyx token
#

no, it's saved on my player pawn

#

my player pawn has an array full of structs

#

because i'll make it the "everything manager"

spark steppe
#

ah ok, i see

onyx token
#

or is that stupid? rooThink1

spark steppe
#

i would just name that building instead of type then

onyx token
#

but the name would just be "Farmhouse" tho...
If i do a "get all classes based on name" - then i'll just have a bunch of farmhouses...

I wanna use that one specific struct to tell each and every AI actor in my world, to return to their specific houses

spark steppe
#

yea i got what you had in mind, the name just confused me, and i wasn't aware that you save the struct on your "manager"

onyx token
#

so... does that approach make sense at all? rooThink1

spark steppe
#

yea sounds like it's moving towards what we discussed yesterday

onyx token
#

ok neat rooVV1

#

alright, so if i put this in my HUD-

#

(ignore the class reference, that's just old)

#

is that fine to just set stuff on construct?

spark steppe
#

hard to tell without knowing your whole setup

#

yes it's fine, the real question is, does it make sense where you do that

#

you say this is your HUD class?!

onyx token
#

well yeah, this is my main hud widget that contains the "spawn farmhouse" button that i click...
is there a way to do it somewhere else?

#

i mean i guess i could just funnel the button into an interface and set the struct in my pawn rooThink1

spark steppe
#

guess you have an event on your building blueprint which fires when it gets placed in the world?

onyx token
#

oh wait lol, i get what you mean

#

i'm dumb.

spark steppe
#

thats where i would tell the player about it

onyx token
#

oh so you would put that onto the building BeginPlay

#

ok that's smart

spark steppe
#

not in the begin play

#

in some custom event, onPlacedInWorld or something

#

which you fire when the building gets placed

onyx token
#

rooWtf so how would i fire that custom event?

#

using an interface?

spark steppe
#

you call it when you place the building

#

so from your UI probably

onyx token
#

ok, but my UI uses an interface then you mean

#

blueprint communication be complicated cuu_cry

spark steppe
#

didn't you make a generic class which all your buildings are childs of?

onyx token
#

yeah

spark steppe
#

then you can just put the event in the generic class, and call it without messing with interfaces

#

(you can even override it if you want to do specific things on some buildings, however keep in mind that you add a call to the parent node if you have logic in the generic building class)

#

like with the onBeginPlay thing you ran into few days ago

onyx token
#

ok hang on - but in that generic building class - i gotta put it on begin play right? rooThink1

spark steppe
#

no

#

beginplay fires already when you are still in placement mode

onyx token
#

oooh sure ok i get it. Ok, but that "place building" event is an interface... Is there a smarter way to do this without interfaces?

spark steppe
#

if you tell the player about the building there, and the user cancels the placement, you would have to take care of that as well

#

implement the event in your generic building blueprint, then you should be able to call it on every building

#

idk how you handle different buildings in your UI logic, so i can't give you a bulletproof answer

#

a interface works as well, but it's not always necessary

onyx token
#

i just hardcode them rooBlank1
There's a "farmhouse button" - and there's gonna be a "hunter's hut" button

#

and those are fixed. fuck it.

spark steppe
#

go with the interface if it's easier for you to handle now

#

you'll refactor that shit in 2 weeks anyways because you learnt more πŸ˜„

onyx token
#

well i wouldn't even know how to do it any other way SWEATSTINY

#

without interfaces

spark steppe
#

i told you, only bear emotes

onyx token
hybrid ether
#

I'm creating mining and I want to set player rotation towards rock while mining. How should I do that?

earnest tangle
#

Maybe using find look at rotation?

tropic girder
#

get player location > get rock location > 'find look at rotation' > break rotator > make rotator (tweak a bit) > set world rotation (player)

lone garnet
#

Any Ideas on ways to move a camera slightly randomly like that of a scope sway?

#

not a shake or anim

#

needs to be in world so the trace moves along with the camera

earnest tangle
#

you can probably lerp or vinterp the position or something along those lines

lone garnet
#

yeh but im not sure how to repeat without any kind of loop giveaway

#

ive used a lot of variations of lerping the vector and floats and such

earnest tangle
#

ah so you just want it to rotate into random directions?

lone garnet
#

it can rotate if that works instead

earnest tangle
#

Yeah I suppose at least scope sway type things usually would rotate the camera

lone garnet
#

yeh I think they might just

earnest tangle
#

so you could probably pick a random direction at somewhat random intervals, and slowly adjust the rotation into that direction

lone garnet
#

my attempts so far have made it so it doesnt smoothly move to new selected locations. like the intervals ignore the lerping

#

it just shifts to the new location

earnest tangle
#

Right, so instead of choosing the new location, choose a direction

#

then on tick you'd just move the rotation into that direction at a small increment * deltatime

#

this way it would just slowly move towards that direction

lone garnet
#

ooh. Gonna give that a shot

gentle urchin
#

Any obvious reasons why an "Apply damage" event wouldnt go through ?

earnest tangle
#

iirc if damage is 0 it gets ignored

gentle urchin
#

Damn.

#

I was just about to consider it

#

thanks πŸ˜„

#

thats prob it

#

yepp. Works.

#

It would appear that the guns forward isnt the actual forward?

earnest tangle
#

Yeah that seems it would return the gun's forward vector, so your mesh probably is just facing sideways

#

You could probably try using get socket rotation instead, since you could then adjust it by rotating the socket

gentle urchin
#

Otherwise you can reimport the mesh with a rotation to it

earnest tangle
#

Well if you try get socket rotation, and it still points wrong, then you should be able to just rotate the socket to adjust which direction it's pointing :)

onyx token
#

this doesn't add the object reference to the struct does it? rooThink1

#

how do i add an item to an array inside a struct?

gentle urchin
#

Curious, why is people inside the struct in the first place?

#

Isnt it easier to keep track of them outside having to update an entire struct?

onyx token
#

no because each building is represented with a struct

#

and each building has multiple people assigned to it

#

so i got an array of structs (buildings)
and each struct has an array of people

#

in my central AI manager

gentle urchin
#

So you went for a central AI manager beyond the building then

#

Alright cool

onyx token
#

yea, i managed to get my lil farmer duder to walk and farm his field-

#

and i noticed how terrible everything is if i wanna get multiple farms to work rooBlank1

#

so i went "alright, i gotta control dis shit from my player pawn blueprint"

#

so to get a building with multiple stats in it, without having code in the building - i need to make it a struct and manage all of the variables there.

#

Problem is, one of those variables is an array.

#

And when i spawn more than just 1 person-
I gotta somehow add it to that array inside the struct

gentle urchin
#

player pawn controls all the NPC's ?

onyx token
#

yea, controls all the buildings & npcs

#

megamind

gentle urchin
#

Still not sure why you need it in a struct tho

#

just makes it worse to work with imo

onyx token
#

how else? rooThink1

gentle urchin
#

Just get the array? πŸ˜›

onyx token
#

right now this is how i spawn an actor

#

well but how will the array be part of that building tho?

gentle urchin
#

So building spawns the "worker"

#

Building can also have an array of workers

onyx token
#

but i want my player pawn to spawn the worker tho

gentle urchin
#

Hmm

onyx token
#

i mean- i guess i can gotta do your way if there really is no way to add an object to an array that's inside a struct

gentle urchin
#

there is

#

its just extra work for no reason πŸ˜›

#

But i guess this struct is your "connection" to the building

#

so guess it makes sense

onyx token
#

also i find it pretty comf to have all of my stuff on my pawn...
Like, if i wanna have an event that affects all AI characters - i don't have to take it from every building individually, but i got the arrays of structs right there...

gentle urchin
#

Imagine if you could have all the AI bind to a dispatcher for such events

onyx token
#

so there's no way to add it into my struct? cuu_cry

gentle urchin
#

It is

#

set Member in struct, with the new array

onyx token
#

i for the life of me can't find anything on google

gentle urchin
#

Its called Set Member in struct

onyx token
#

ooh OhIPanda

gentle urchin
#

whatever your struct is named

#

then you can select which pins you care about updating

onyx token
#

and then just- ?

gentle urchin
#

You need to add it to the current array

#

So get array, add to array, set array in member

onyx token
#

like that? rooWtf

#

(i wanna press F and spawn an actor on all of my buildings)

gentle urchin
#

If u connect the execution then yes

#

But no

#

Because structs are silly, and loops use copies

#

You need to get from your array of buildings

#

Get (a reference)

#

With the index from the loop

#

And plug that into struct ref

onyx token
#

this?

#

there's no way

gentle urchin
#

Correct

tight pumice
#

hi i got wierd problem, when i play animation on press and it ends on realase when i use pause game and unpause .... animation got stuck seems like realese never fired of, anyone know the problem ?

onyx token
#

but this is so ugly tho

tight pumice
#

sorry for english

onyx token
#

do i?

#

this should work just the same

gentle urchin
#

You missed one part

#

the outgoing part of "Add" should be connected to "people" pin

onyx token
#

but the outgoing part of add is an integer tho...

gentle urchin
#

im blind

#

Actually,

#

if you break the ref

#

you can add to the array directly i think

#

break this Get instead of the one in the loop

onyx token
#

sure but how do i get it back into the set members?

gentle urchin
#

You dont need to

#

it should work without the set member in struct node

onyx token
#

sadly doesn't Cry

gentle urchin
#

Remove the set member node

onyx token
#

so just this?

gentle urchin
#

y

onyx token
#

huh. It actually does work

onyx token
# gentle urchin y

fair enough, thanks alot, i would've literally never figured this out without you

onyx token
tight pumice
#

i mean its rather other problem

#

i have found some stuff

#

lets say i hit left mouse button and it start animation when i pause and release button and unpause it couldnt end beacouse release never fired

#

with execute when paused it acctualy works

unique harness
cobalt gyro
#

hello community!
Is there a semi-easy way to make a character and throwable objects inherent the speed from a plattform they stand on?

i.e.
If a player stand on a train and throw a grenade. Then I want the grenade to inherent the train movement and add that to the velocity of the throw.

zinc portal
#

Thanks again. Got it working with your tips.

#

the sequence where I turn world rotation to relative then to vector, un-rotate the vector and turn back to vector seems bit unnecessarily long but works so not complaining.

wise mantle
#

how would i go about making all components in my scene with a specific tag, hide after hitting an input? ive tried 'for each' with an 'all components with tag' node, but it needs a class, and i cant connect the for each element with the 'set hidden in game' node.

odd ember
#
foreach (Actor atr in GetAllActorsOfClass)
{
  if (atr.HasTag(myTag))
  {
    atr.bIsHiddenInGame = true;
  }
}
#

or something like that

#

how you get that working upon hitting an input however, I'd love to know too

wise mantle
#

i use blueprints, but i sorta get what you mean. i think so?

#

this is how i would think it should work in theory

odd ember
#

get component by tag doesn't work

#

you get components on an actor

#

you need actors in world

wise mantle
#

yeah i saw some people saying that on reddit, i just thought if there were a workaround to creating actors, since i just want some scene decals, and some actors to hide.

odd ember
#

there's plenty of workarounds for creating actors, depending on what you need. but this has nothing to do with get component by tag

wise mantle
#

ok. i think i misunderstood the meaning on the function

#

but i think ill just make some actors then

odd ember
#

I still don't know what you want to make actors for. you sounded like you wanted to hide actors based on a tag

#

which is possible

wise mantle
#

but its different actors. different actors/scene objects with a tag

odd ember
#

get all actors of class

#

use that node

#

set it to the Actor class

faint pasture
worthy bison
#

I was wondering if someone could tell me why my blueprint isn't working. I watched a video and it seems to work for that person, but not for me.

wise mantle
odd ember
#

you need to go through the loop

#

that's probably why it's giving you errors

wise mantle
#

jeez im stupid

#

im sorry, 2 sec

#

i tried this now

#

no errors, but it doesnt unhide the actor

#

this does count as a normal actor?

odd ember
#

you've just told it to hide

#

you didn't mention you wanted to unhide it

#

add a new boolean variable

wise mantle
#

oh no. i see my mistake. so sorry.

#

i meant unhide

odd ember
#

call your boolean something like ToggleHiddenInGame

#

if you just want everything unhidden

#

just tick the box

wise mantle
#

im not quite sure what you mean πŸ€”

odd ember
#

otherwise, before the loop, set ToggleHiddenInGame to ToggleHiddenInGame > NOT

#

then set new hidden to ToggleHiddenInGame

wise mantle
#

ok ill try that

#

thanks for the help so far btw

#

like this? im 100% certain im doing something wrong here, because this doesnt make sense in my brain at all.

odd ember
#

you didn't set it to be NOT itself

wise mantle
#

hmm... im sorry but im so confused. after the 'get all actors' i get the bool and connect it to..?

odd ember
#

a get version of itself

#

with a NOT node

wise mantle
#

like this aight?

odd ember
#

yes

wise mantle
#

do i hook up the bool to the NOT?

odd ember
#

read what I am saying

#

please

wise mantle
#

im trying, i just find this overly hard even tho i think the solution you're giving me is really easy

drowsy flame
#

gotta be patient with us nabs. :^)

wise mantle
#

xD

#

ah jeez i finally figured it out

tight schooner
#

@worthy bison sorry that I can't give you specific advice; all I can suggest is debugging with breakpoints and/or Print String/Text nodes. Is the On Entered event firing? Is the Cast node succeeding or failing? Etc

Try to methodically determine if your BP is working the way you think it is, and narrow down the issue.

worthy bison
#

That's odd. I'm having game mode restart.

dawn gazelle
#

Or your game mode for your level is not set to the class you're trying to cast to.

#

eg. You could be using GameModeBase as your game mode, but you're casting to GameMode which is a child of GameModeBase

onyx token
#

quick question-
I have a character called "AICharacter", with an integer called "AIState"
And i have my player pawn, and i'm trying to change AIState inside my player pawn.

To do that, i get an object reference to "AICharacter" - and pull out "AIState"

Do i need to cast here? rooThink1

#

because i'm getting error messages...

dawn gazelle
onyx token
#

i have an array of these AICharacters

#

but i want some

#

no, it already is the type of AICharacter...

#

hm. so what might the reason be then rooThink1

#

like it is an AICharacter ObjectReference

#

uh... my BP graph is a little... spaghettio rooBlank1

#

well-

#

okay.

#

here's where my AICharacter originates

#

before you judge

#

I'm trying to make an RTS

#

i'm trying to get a screenshot, but zooming in unreal is annoying rooHold

#

hang on

#

is this readable? rooBlank1

#

yknow there can be too much bear... OhIPanda

#

wait this is better

#

okok i'll use enums once i can actually set states kek

#

sure

#

wait-

#

the first is 0 - sure, but the default value of AI state is 0

#

i'm just setting it to 1 once they walked to the field

#

then they're supposed to return to their home

#

which will set it to 0 again

#

sure like get all actors of class

#

what node are you talking about? I'm confused...

#

Like, the code works so far...

#

The only thing that doesn't work is the "set AIState"

#

vvCry ow

#

what does latent node mean?

#

you mean the foreach?

#

don't use those? rooThink1

#

ooh on the top right corner

#

i see...
But a building can have a bunch of actors... How am i supposed to move all 3 actors without going through the array of actors?

#

i see.... so just add an interface with a vector destination and put that into the AICharacter...

#

i see... so that was probably my issue that i triggered a bunch of methods who also have timers in them in 1 frame?
And that's why the SetAiState "on Success!" wasn't running correctly?

#

i guess i can just set the AI state inside the AI character now rooThink1

#

yea i was kinda scared of them because i thought they had the same issues Structs have...

odd ember
#

so uh, is there a way to hotkey scripted actions?

onyx token
#

well- i think i'll be fine, so you're right - because i figured out how to not break blueprint structs

#

if you wanna change something-
Enter struct - Save everything - change struct - save struct - exit unreal without saving - open unreal again

#

idk why, but that's how you do it

pulsar schooner
#

wait the struct thing hasnt been fixed yet?

odd ember
#

structs still being broken? can't be, structs aren't buggy

#

I heard so myself

pulsar schooner
#

i just spent alot of time making a thing with structs, thats really unfortunate.

onyx token
#

i managed to brick my shit once with them rooBlank1

#

since then - i ALWAYS do the struct-exit-reenter routine

#

that way they don't bug

odd ember
#

had a guy arguing in one of the other channels that structs weren't buggy

pulsar schooner
#

and thats everytime you edit a value?

onyx token
#

or just used... idk

#

thanks for helping me btw.... again rooVV1

#

people who can code using text

#

are nerds

#

big nerds

#

the nerdiests

pulsar schooner
#

someday ill learn, but c++ feels likes its trying to be as hard as possible

odd ember
#

ue4 cpp is like cpp with training wheels tbh

odd ember
#

it very much tries to help you not screw up

pulsar schooner
#

ight im inspired, time to learn

odd ember
#

some bugs still persist through cpp structs in BP

#

some type of refs cannot be carried through a struct

#

sure, cpp structs overall are better, I'll give you that

#

but to claim that structs are bugfree is nonsense

pulsar schooner
#

a fool

odd ember
#

did you not remember the discussion in cpp a couple of days ago?

#

I even provided examples

#

and he was like "structs aren't buggy"

#

anyway if you'll excuse me I'll bang my head against the wall called blutilities until either of us gives way

vocal elm
#

are there any docs or anything on creating a tutorial with the tutorial blueprints?

gentle urchin
#

lol

#

i litteraly just googled it 2 minutes agoπŸ˜„

vocal elm
#

haha that was crazy fast, what the hell I googled a few variations and didn't get that

#

oh haha wow I must have picked up on your psychic vibes

gentle urchin
#

Its not perfect, but atleast its a start

#

^^

#

Felt pretty straight forward after playing a tad with it tho

#

the selection stuff is a bit weird

vocal elm
#

ahh I'm not seeing any images though are you?

#

yeah thats what I was trying to figure out was the selection

gentle urchin
#

you click on wanted selction, then press escape to "select" it (no indication)

#

it says so during the selection tooltip aswell

vocal elm
#

awesome cheers 🍻

cobalt gyro
clear robin
#

I have enabled "Use Flat Base for Floor Check" on my Character, but it seems not to work when i crouch-jump onto an object. In this case the base seems to be round. Is that normal?

jaunty solstice
#

Can anyone tell me how you drive a Material parameter from a Blueprint? I need to use a Timeline node to drive a Material Expression Scalar parameter.

gentle urchin
#

create material instance

#

set scalar parameter value in that

autumn plover
#

How do you clear an array including index

trim matrix
#

worryPuzzled you use the node called clear

autumn plover
#

i think that still leaves index... but i think i fixed it with a forloop remove

worthy carbon
#

How can i create an system where players can equip/unequip the items they earned? ( an locker like in fortnite or other games )

maiden wadi
#

@autumn ploverClear will remove all indexes in an array.

worthy carbon
pale orbit
#

What is the best way of doing character outline colors based on team? for example Team 1 sees Team 1 as blue outline and Team 2 Red outline and such?

clever helm
#

guys i need help with something
so i am working on a true fps project and just trying to make everything animation wise procedural
i have procedural aimoffset, procedural ads
and i want to try to make procedural recoil, but i cant wrap my head around the logic it needs

#

I found an equation that could help me but i still dont know where i must apply it

pale orbit
#

for example how'd i go about making this ? for the other team is inverted

#

close right and left characters are in the same team and the other 3 are on the other team

#

i have no idea how to setup colors outline on characters like that

clever helm
#

there are plenty of tutorials for setting up outlines for meshes

pale orbit
#

But how'd i tell for example team 1 that the other team should be on a different color?

clever helm
#

i got a good idea for procedural hand placement on guns

#

works just like procedural ads

prisma stag
#

Hello, I am working on a menu where you will be able to purchase items. I would like to have each item have 4 elements attached to it: Name, Price, Total, and quantity. I created a structure with these four items and now I have 2 options.

Option One: Create a map variable with the 2nd element being the structure. This one causes more work when binding the values to the widget.

Option Two: Create a structure variable for each item. This is much easier when binding the values on the widget.

whole dune
#

Probably Option 2

prisma stag
burnt trench
whole dune
prisma stag
burnt trench
#

I would go with option 2 as well unless you want to you the key value of a map as a primary key or some other use. Just my 2 cents

prisma stag
clever helm
#

i like to understand how things work so i could be more knowledgable in the future

burnt trench
#

the more you go specific, the lesser the resources usually. So either find a person who has done it personally or trial and error until you're happy with it (with a push in the general direction ofc)

clever helm
#

you know what, i just had an idea that could maybe work i am going to write it down

burnt trench
gentle urchin
#

Any known issues with NavMesh in c++ /bp projects? for some reason it refuses to build any navigation data

burnt trench
#

are you trying to change it runtime?

gentle urchin
#

No, in editor

#

Created new level, added mesh "floor", and a navmeshbounds volume

burnt trench
#

Sometimes it does that and I just move the navmesh bounds and it usually force rebuilds

#

also there is a setting in project settings that does that

gentle urchin
#

Tried moving it around, both mesh and volume,

#

in another project the same steps produce the wanted result

#

maybe its part of the settings... but cant remember changing them, ever

burnt trench
#

just asking, do you have world composition on in the level?

gentle urchin
#

No

#

hmm, runtime gen is set to dynamic in the one that doesnt work

#

i wonder...

burnt trench
#

dynamic is more expensive. try static

gentle urchin
#

No difference so far

#

restarting

burnt trench
#

check to make sure these values are same

#

also try new level in the same project where its not working to see if its the level or the project

gentle urchin
#

more differences.. weird

#

what engine version are you on

burnt trench
#

4.27

gentle urchin
#

No luck so far

#

settings are identical

#

im in 4.26, but that surely cant matter that much in this case

#

Guess i'll leave it for tomorrow ! Ty anyways :)

pulsar schooner
#

my PIE window increases its size in the y axis everytime i hit play, is this a common thing or am i unlucky?

#

it also increases a tiny bit in the x axis but its alot smaller

desert storm
#

Is there a way to get a value from an actor BP (not the player) and bind it to a UI widget? I cast to the object in the UI widget, but I get an error because of the object pin (where 'get player character/controller' would be) having nothing to plug-into.

clever helm
#

how is this any different t

#

from this

pale orbit
#

how is this giving false return?

maiden wadi
#

@pale orbitGenerally speaking, I find that the Blueprint Debugger doesn't really work that well on exact nodes. I find values don't update correctly until the node after. I tend to drop a Print node in if I don't have nodes after the check.

#

TLDR, most likely that evaluation hasn't happened in the debugger and bools are false by default. Put a break on the next node and then check.

dawn gazelle
# desert storm Is there a way to get a value from an actor BP (not the player) and bind it to a...

Casting only gets you a more specific reference from less specific reference so you can access variables and functions of the object of the class, so you need reference to the object you want to access to plug into a cast.

You can get references to objects in the game by doing overlap/hit events (The Other Actor pin is usually what is used on those types of events), traces (Hit Actor on the hit result is usually what you'd use), or even something as simple as a "get actor of class".

pale orbit
tight schooner
desert storm
odd ember
fleet cedar
#

Hi guys. Does anyone have any links to recommend about how to sequence gameplay for a story game? I am trying to do things like... locking a door, but first you need the key, but first you need to talk to the character, but need to do x before that

#

How can I manage all of these conditions?

odd ember
#

different actors of different types

#

it's a design problem more than a BP one

#

if it's just a linear sequence it should be easy enough

#

talk to X, they give you item Y, use item Y to gain access to room Z, rinse repeat

#

but if you're looking for the technical specs, all you need is some sort of interaction system. either by using components or by using an interface

fleet cedar
#

I mean the design problem really, as you say... Just not sure how you manage the flow of the different BP's

odd ember
#

simplest way would be when collisions overlap each other

#

play overlaps NPC's sphere of influence, NPC notifies player that interaction is available

#

same for any type of interaction really

fleet cedar
#

And if you need a "key", would that just be a boolean that says "has key" or whatever

odd ember
#

it could be a boolean

#

it could be a physical key

fleet cedar
#

Interesting

#

I like that idea

odd ember
#

there aren't any rules about how you have to do it

fleet cedar
#

Makes it more understandable to me, because you physically would have to get it just like the gameplay story

odd ember
#

but consider that if it's physical, you may need an inventory as well

fleet cedar
#

I'm just imagining these 50 booleans all needing to be toggled in a certain way

#

And it's stressing me out lol

odd ember
#

narrow it down to per level, or even per area

#

unless it's something that's reusable

#

like one key can access more than one door

#

then it's probably better to use a physical key

#

but it's really up to interpretation how to do it

fickle nebula
#

Hello, How can I access mouse events like in widgets, On mouse move, On mouse wheel that stuff... how can I get those in a bp actor?

odd ember
#

you want them just in widgets yeah?

fickle nebula
#

I want to access the get wheel delta to make zoom based on that

odd ember
#

create a project binding for it

#

I think that way you get the appropriate value for it too

fickle nebula
#

wdym

odd ember
#

project settings > input

#

then you can use that event in any player controlled class

fickle nebula
#

they are different types, maybe I need to get something first

odd ember
#

probably want it to be an axis so you get a scale value

fickle nebula
#

but the axis input wouldnt be 1 and -1?

odd ember
#

you can set the axis values yourself

#

1..-1 are just default

fickle nebula
#

yeah but once I scroll it would hit the maximum or min

odd ember
#

sure, it's a scale value.. you multiply it onto something else... like FoV

fickle nebula
#

yeah, but I want to get the delta

odd ember
#

the delta will be the difference in the scale value per frame

fickle nebula
#

cause that gives me the number I want to multiply

odd ember
#

the event should already update per frame so you should be able to use the value as is

fickle nebula
#

@odd ember ok I got it

#

using this I get the delta out of the scale

odd ember
#

nice

fickle nebula
#

thank you

rancid cloud
#

Hi guys.. i've implemented Skeletal Mesh Merge in UE4 to reduce draw calls for each mesh. Do you know a way to control the meshes' UV and form them in a grid, like an atlas?

heavy burrow
#

Hey guys, im looking for a blueprint of a character in my game to just attack me (with a sword or punch not shooting!) and my health reduces with attacks. just a simple AI. does anyone knows a premade blueprint I can use from Unreal Marketplace or any good tutorial covers health and an AI attacking. let me know. thanks

copper vessel
#

Hey guys, would anyone know how to change the software mouse sensitivity in ue4?

#

Not the input axis to a player controller, the actual mouse used for UI interaction, etc

plush ridge
#

is it possible to instance an AnimBP and have the child use a separate skeleton ? (please @ me if you respond, I have to leave for a bit)

onyx violet
#

I'm trying to use the insert node for an array, but what I don't like is that it's adding it to my array rather than replacing the index I'm setting with the insert node. Is there a way to make it so it replaces an index in the array rather than adding it?

#

nvm i'm using set array element instead

hazy vortex
#

How can I (un)set this actor variable? Or set the actor to none

#

Basically so that my character won't see the previously overlapped actor as stealth killable.

odd ember
#

you are already unsetting it

#

and you're already setting it

#

but there's no filter so technically every actor becomes an actor you can "take down"

#

I'm assuming this is something you're doing inside of the player character or some such

hazy vortex
#

Oh I didn't know that set actor with nothing going in would automatically set it to none. Thanks πŸ˜„
Its still WIP, just thought I have to set something up.

odd ember
#

just keep in mind this will make everything that has overlaps exposed something you can "take down"

hazy vortex
#

yeah I'll make it have to be an enemy actor and only if unaware of player

grave apex
#

for some reason, I cannot cast to my player character within my animation blueprint

#

my player is a NewFpsChar

#

and im casting to it from the player pawn

spark steppe
#

is that the animation bp for the character?

#

then use get owning actor instead of get player pawn

grave apex
#

I would

spark steppe
#

or is it the AnimBP of your weapon?

grave apex
#

but this is a skeletal mesh inside of a child blueprint component

#

weapon, yea

spark steppe
#

ok i see

grave apex
#

usually this works!

#

I have an old rig that worked like exactly the same

#

but Im trying to replicate it with this new one

spark steppe
#

and you character is player 0?

grave apex
#

yea

#

unless you can change that somehow??

#

the top part should be printing all the player actors

#

but nothing prints at all

#

except for the ===s

spark steppe
#

then double check the player class

grave apex
#

aight

#

what about it?

spark steppe
#

if your player really is a child of it

grave apex
#

child of?

spark steppe
#

NewFpsChar

grave apex
#

the weapon is the child of my character

spark steppe
#

and the player is child or instance of NewFpsChar?

#

because actually it looks like it isn't

grave apex
spark steppe
#

or it spawns something else

grave apex
#

hmm

#

it is weird

#

the scale doesnt match up in the world

#

and if you double click the bp for it, it really is the same bp

#

wtf

#

I just closed and opened the bp tab for it

#

and it went back to how it is in the scene

#

why wasnt it synced??

spark steppe
#

idk

#

you got weird things going on πŸ˜„

whole dune
#

Or SetWorldLocationAndRotation

trim matrix
#

hello guys can we do full multiplayer game using BP with AWS GameLift ?

wet patrol
#

Is there any good tutorials for inventories/chest done in Actor Components?

open crypt
#

what's the trick that connects up a bunch of wires (like from a switch statement) - I've seen it done before, just can't remember

leaden goblet
#

Hey, i have a problem with Destroy Session. Destroy session doesn't work for me. Server is still on (listen server) and when server quits a game (changes map), all players are moved with him to menu level instead of just staying there (they should stay offline on map, without server)
Any ideas what i need to config?

vestal plank
#

hello! im trying to make the player character take damage from ai whenever the ai is touching the player for certain second. (player are stationed while enemy spawn and run at the player) but it only do once when it collide instead of keep "hurting" the player.. when i tried to put while loop it crash the game instantly the moment the touch. is there a way to do this without event ticks ?

gentle urchin
#

On Overlap -> Start timer
Timer Loop -> Damage Player

#

@vestal plank

vestal plank
#

was it start profiling timer ?

gentle urchin
#

Nono, start even by timer or something along those lines

#

Set Timer by Event

#

Something along these lines

vestal plank
#

ah

#

tyty ima try that πŸ™‚

gentle urchin
#

Check if incoming Actor is Player -> If so, then set it as some sort of target for the damage event, then start the event timer. Save the handle so we can invalidate it later

DamageLoop coming from timer checks if we have a valid target (on is not valid, you should prob connect up the "clear and invalidate timer part aswell)
If it is valid, we simply wanna apply the desired amount of damage to it ( != 0, because 0 is ignored)

End Overlap simply check if the actor that ended overlap is the same as our damage target. If it is, remove our damage target and invalidate the timer

vestal plank
#

tyty πŸ™‚

#

sorry one more question, so i set up this hp for enemy, but when i shoot one, the rest of the enemy hp went down (along with all the child actor of the "master" enemy. I want the hp bar to act seperate from each other. not sure if i set this up wrong or something

gentle urchin
#

Are you sure their individual hp bar reduced, and not that they're sharing hp bar somehow?

vestal plank
#

they are sharing hp bar atm

#

idk how to seperate that tho

spark steppe
#

how do you update the health bar?

#

show the code/bp where the healthbar gets its value from

gentle urchin
#

The bar itself cant be shared, but their values can if they all come from the same actor

vestal plank
#

maybe from this? X:

spark steppe
#

iirc you can assign the same widget to multiple components, so it could be shared, too

#

where/how do you set the master reference?

gentle urchin
#

^Hm, i tried this for something a while ago, and wasnt able to add the same widget in multiple.. it wasnt a component tho, it was a umg box in my case

#

components may work differently, somehow copying the referenced widget and not being the actual one itself, therefor allowing multiple.... idk

vestal plank
#

ah

#

i think i found the code that do that

gentle urchin
#

I sort of expected something like that πŸ˜›

vestal plank
#

x: how do i not do that... xD

spark steppe
#

delete it

gentle urchin
#

^

spark steppe
#

thats how you not do that

#

πŸ˜„

gentle urchin
#

Let the npc create their own widget

#

and set it to the component

spark steppe
#

and set the variable to expose on spawn

#

then you can pass the enemy reference on constructing the widget

gentle urchin
#

I'd rather go for a delegate but i suppose that'd work πŸ˜›

spark steppe
#

or on the widget blueprint in the onConstruct event, get the widget owner and cast it to your enemy class and set the reference

#

so there's multiple ways to solve your issue

vestal plank
#

like that?

spark steppe
#

no

gentle urchin
#

But in that case Ben you still have to somehow update it with some extra effort (or do a separate call to the widget)

spark steppe
#

in which case?

gentle urchin
#

By saving the Reference in the widget

#

usually one wants to tell, not ask

#

keeps the widget re-usable aswell

spark steppe
#

which way asks?

gentle urchin
#

The reference in the widget

#

atleast as i see it

#

Say you make a function there "Update"
Which gets the reference, gets the min/max health and sets the percent

#

getting the reference, asking for its current values, and then setting the percent

spark steppe
#

so you would rather clutter your character blueprint with stuff that updates the UI?

#

well, you could have an event dispatcher on the character which is called when the HP changes

#

where the widget could subscribe too

#

but thats too much for hanniee now πŸ˜„

gentle urchin
#

Fair enuogh ^^

vestal plank
#

lol

#

anywayy help BlobSweats pwease

spark steppe
#

don't feel offended

#

it's okay to be dumb πŸ˜›

#

*jk

vestal plank
#

lol.

gentle urchin
#

I guess someone would call this cluttering ;P

#

But yeah, Hanniee,
At beginplay in the enemy thingy you want to create the health widget

#

In the widget component, set its widget class to none, and space to whatever suits your needs ;

vestal plank
#

okie lemme try that

gentle urchin
#

After creating the health widget, one usually wants to save a reference to it for easy access and all that. Then you want to take the widget component and set the widget that should exist within it. This would be your widget reference.

vestal plank
#

so in the widget, do you not bind the percent on the progress bar to anything?

gentle urchin
#

I prefer to avoid bindings but i suppose you could

#

Usually you want it to be as event driven as possible

#

Why waste resources on updating something that doesnt need updating, right?

vestal plank
#

true

gentle urchin
#

So usually you want to make some function instead,

#

that you either call directly from the npc blueprint whenever the health changes

#

or you bind said function up to an event delegate, but thats like.. two steps ahead

gray chasm
#

hm... can you have a blueprint variable of class type, and assign a reference to a class that subclasses it somehow?

#

eg. subclass Animal to create Dog

#

Have an actor with a ref to Animal class, and put any kind of subclass on it

gentle urchin
#

yes

#

Thats the beauty of it

gray chasm
#

awesome, how do you do that?

#

I mean, I know it must be possible I guess, since you can create VehicleWheel instances and assign them to the SimpleVehicleMovement component

#

but if I just have a variable of type Animal

#

that's an object reference

gentle urchin
#

I felt like you just said how

gray chasm
#

so I cant select the Dog class type to it

gentle urchin
#

Well, Dog is part of aniumal, so it will fit in the variable

#

but for you to be able to treat it as a dog

#

you must cast to dog

gray chasm
#

Hm... it's not selectable in the editor though.

gentle urchin
#

object references are not

#

if you set it to class, you'll see that you can select all the subclasses aswell

gray chasm
#

ah... the compile failed when I tried it before, so the it didn't update the select widget in the editor. You're totally right~

#

thanks~

spark steppe
#

no squize, it's not cluttering

#

it's cluttering if you get the widget component and update stuff on the widget itself. dispatchers are fine

gentle urchin
#

Yupp i think we agree there

undone otter
#

I am really confused, I am trying to build an AI behavior tree, that does specific behaviors based things like Hunger, engery levels, but I can't see to figure out how do it. I made up the Ints in blackboard and know how the BT works in terms of selectors and such. My issue is where and how do I do the calculations and have them update in real time.

I don't understand the point of blackboard having values, if i can actually add them to things like services and such.

Do i create a function, but then how do i get the blackboard values into the fuction?

fallen glade
#

having a problem when resizing dynamic navmesh obstacles. Before I move a set the radius to 1 and when I stop I increase it again but the navmesh doesn't get updated?

spark steppe
undone otter
#

ah have i got the how blackboard wrong

spark steppe
#

you can add variables (must be exposed) of type blackboard key selector to your tasks and assign the blackboard values in the behaviortree

#

the keyselector variable can then be used as reference to retrieve the blackboard value

undone otter
#

I don't think i understand

#

maybe this to complicated for me to get my head round right now

spark steppe
#

well, i'm not a good tutor anyways πŸ˜„

#

maybe just watch some more tutorials relating to that topic

undone otter
#

been doing for last three days

spark steppe
#

maybe the wrong ones

undone otter
#

thank you for your help

trim matrix
#

hello all can i make a multiplayer using BP only with AWS?

undone otter
#

but i suspect this beyond my understanding atm

trim matrix
#

is that possible?

gentle urchin
#

BT's are ... tricky imo

#

adds yet another layer of confusion when you're starting of with them

#

I struggle with their flowcontrol

spark steppe
#

yea they are their own complex construct

undone otter
#

I hate programming, as i can never visualise the code working

gentle urchin
#

Gonna dive into them again today, but most likely i'll end up doing my own bp logic instead

undone otter
#

I hoped Blackboards would be easier lol

spark steppe
#

then get a coder and do art or whatever you're good with

undone otter
#

Yeah might have too, wanted to do this myself, but It seems this no eaiser than writing in in C++

#

might as well learn C++ and do that way

winter plank
#

Hey! Is it possible to debug in blueprint on a package build? It works in editor but crash in package build

spark steppe
#

well, even c++ folks uses behavior tree's

undone otter
#

The BT bit i get

spark steppe
#

for AI and such they are just a good tool

#

maybe do something else, and get back to them on another day.

undone otter
#

its the feeding variables and functions into it, I just don't understand how they all fit together and all the tutorials seem to be obessed with chasing the player.... but never go anymore depth

spark steppe
#

well, following something is a easy and good example

#

what's your goal?

gentle urchin
#

^ this plus extending/changing the code to enhance your understanding of it works wonders

undone otter
#

To build a scientific model to mimic animal behavior for part of my thesis πŸ˜„

gentle urchin
#

Dang.

#

When you're done, please share it as a tutorial πŸ˜„

spark steppe
#

yea have fun

undone otter
#

hahahaha I know

spark steppe
#

i've started with crow ai yesterday...

undone otter
#

I have a year to do it

spark steppe
#

and fuck crows, even they are complex πŸ˜„

undone otter
#

hahahaha πŸ˜„

gentle urchin
#

im doing predator animal...

#

should be very simple

spark steppe
#

what animal is the thesis about?

undone otter
#

Sharks

spark steppe
#

does it involve tornados?

gentle urchin
#

πŸ˜‚

undone otter
#

But i am trying to build a model based of my own models i have done IRL

#

Yes it does, I also believe that Eric Roberts will be involved πŸ˜„

spark steppe
#

i think sharks have pretty simple ai, don't they?

#

if(hungry) eatNextBestAnimal()

undone otter
#

hahahaha

#

Oh god if you only knew

gentle urchin
#

Theres alot more to sharks than that ^^'

undone otter
#

I am trying inclue things like Metablic rate, hydrostic pressure (speed)

gentle urchin
#

Curious if you'll care about their "smell" etc

undone otter
#

the issue is i have 30 different variables that will feed into one, that will become say the "Speed"

#

Then say another 30 different variables that will be for "Hunger"

#

and so on and so forth

spark steppe
#

that sounds like something you would do on the normal character blueprint

#

not in the behavior tree

undone otter
#

ah

spark steppe
#

behavior tree rather takes data and decides what to do with it

undone otter
#

Oh

#

So i should maybe make a blueprint and do all the maths and calculations, then send them to blackboard?

spark steppe
#

no, the decorators and tasks would get the data and work with it

#

but yea, you would really have to understand the system, specially if you want to simulate a complex system

#

behavior of animals in games is usually rather simplified

gentle urchin
#

Yupp

#

Bt would just evaluate the results

undone otter
#

Correct me if i am wrong here, So if make blackboard say with a simple speed calculation based on size and energy levels, and had a final variable?, I could then call the Variable in a Decorator?

spark steppe
#

BT kinda is the brain part which makes decisions on facts (or emotions :D)

undone otter
#

sorry

#

not blackboard, I meant Blueprint

#

Correct me if i am wrong here, So if make BLUEPRINT say with a simple speed calculation based on size and energy levels, and had a final variable?, I could then call the Variable in a Decorator?

spark steppe
#

yea the decorator could get the final result from the character blueprint, and decide what happens next

undone otter
#

Well i think you just solved my problem πŸ˜„

#

I was trying to do all of that inside of function inside the the AI controller

spark steppe
#

the decorator condition check event gives you the controlled pawn, which you have to cast to your character blueprint, then you can access all the data that you have from there

undone otter
#

Right i see now πŸ™‚

#

I think that were i was getting confused,

gentle urchin
#

Speed would probably just be an input to the "move to task" or simply setting the speed of the movement component directly ^^

#

But ye

undone otter
#

I was trying to do everything inside the behavior tree and with custom functions

#

But i am going to have like 30 sharks in a lake for example, all with different size, energy levels, and thus speed

#

So i guess it better to that calculation in a BP

#

then send that to a input to moved too speed?

spark steppe
#

last shark standing πŸ˜„

undone otter
#

hahahaha πŸ™‚

#

bingo πŸ˜„

spark steppe
#

like squize said you would use speed to adjust the movement component

#

as this has direct impact on the movement

undone otter
#

Thank you guys, You really help me understand this πŸ™‚

gentle urchin
#

Its all Ben really

#

He'd be a great tutor

spark steppe
#

no it's squize

#

name the biggest shark after him

undone otter
#

Hahaha done πŸ™‚

#

One last question before i go back to it

spark steppe
#

the shark should be white^

#

cya

undone otter
#

The EQS, Environmental query system, can that do all three X,Y and Z or it only X, Y?

#

i got working with X,Y but not sure if possible to do all three Axis

spark steppe
#

i haven't used it yet, so no idea

undone otter
#

ah kk πŸ™‚

#

thank you for help : )

#

Well i have gone from the emotional state of wanting to go find a "Sharknado" and kick in the nuts, to calm and being one with the Blueprint πŸ˜„

random ibex
#

Hello, everyone,
I'm trying to achieve control of the pawn with this blueprint.
Unfortunately it doesn't work properly, when I press play the pawn moves up and down but not sideways. Any idea how to solve this. Thank you

spark steppe
#

but looks like they can access blackboard variables, so almost everything should be possible

spark steppe