#blueprint
402296 messages · Page 768 of 403
"pick item"
but when i do this
i get this
because my inventory is trying to access an actor that is destroyed
So then copy the data you want from the apple before deleting it
^^
do i really have to make an entirely new actor / struct / whatever in my inventory and copy all the data over there, is there no way to keep my object reference?
Because that way i could save additional information in my apple that is unique to that one apple

Give the apple a struct called itemdata or an uobject with the data but no you cannot expect the apple to be both be deleted and exist
is it a stupid idea to turn the visibility of my apple off, and set it as a child of my player character when i pick it up?

I mean. Yes that can work. It's not elegant but for a simple system you might get away with it
is that gonna eat alot of performance?
Do you expect to have hundreds of these items. Then maybe? Only one way to find out.
A couple dozen? Nah you fine
hm.
I'll try the struct way, you're right, that's probably more elegant before i start fucking around with hundreds of child objects 
Yes keep data in a struct or a data asset or a data table. Each has its pros and cons
But generally an actor is not the best place for canonical item data
Actors are for visualization of the item when dropped, sure. But for saving and loading the game or multi-player, a unified inventory data system is a lot cleaner than a hundred actors each controlling a fragment of your data
I personally like using data assets. They can be subclassed for specialized types of items, unlike structs and don't come with the management horror of huge data tables.
can't use c++ tho 
You can make BP data assets...
Nope. Create a new blueprint and search for data asset
Actors can reference a data asset yes. They do not create them
Data assets are unique entities like meshes or textures that other things can reference.
You normally don't create them at runtime
ooh i can use it as a data asset variable...
Yes
I don't like structs very much because they're often buggy in blueprint 
to the point where they bricked an entire project once
Yeah lol I feel you there
I only use c++ structs now for that very reason
*but also source control. Use it
i know, am lazy, i should set it up 
damn so that means i wouldn't have to make a child of my item for every item i use-
But i could just have 1 Item actor, and a bunch of data assets 
Is there anyway to force a teleport, my character won't teleport since target is slightly in ground but I want player to teleport flat and not fall down to ground
I think I did this before but it was so long ago
How to make that happen? I have set of current planes that I have purchased. The I have current plane int.
how can I has something have Collision but not affect the NacMesh ??
I need to allow AI to roam where needed but not collide or have patch obstructed by object
if anyone has an idea
please
My question is how to set "set" value for example key 2
hello i need help with a bluperint
basically i have this blueprint that toggles between Run and Dodge/roll
the idea is that if you hold shift you run, but if yyou tap it once it makes a roll
i can print a message and the functionality works perfectly
but im having trouble with adding what to do when each input is done
i followed a tutorial on how to implement the dodging animation but when i put it in the bluieprint it wont work
okay, I manage to work it out. But it may me think that, instead of using a pawn class for a ship, that I should really look at something like a default pawn or even character as the ship. Does anyone have a recommendation on how to approach this?
Key 2 as your Key within your map?
If so, just add it to your map again. The keys of a map are unique and if you add the same key again, it'll overwrite the existing value.
is using enums efficient for tracking character level, weapon and weapon variation?
Weapon being pistol, machin gun etc...weapon varation being a sub menu within pistol
enums aren't generally super useful when dealing with infinite sets
at least not without some degree of reflection... which again leads us to FName
there would be about 5 levels to the characterm 25 weapons and upto 25varations of each weapon would it be effective to use 3 enums? Alternatively what is the best way to do this
Level should probably just be an integer. Who knows how many addons you'll end up with. Level 10 in four years can end up being level 600. For weapons, I personally say GameplayTags
ty i will research gameplay tags
gameplay tags being glorified FNames anyway
GameplayTags are the most amazing data management tool.
well they're FNames at 50% of their potential
So I have this question... I want to get an array from my Plate blueprint, the array is called "Boxes in plates" and it's just made from the boxes are overlapping the plates. I would wish to use it my doors as I want to check if the boxes that are on plates have a certain color (and then the door will open), but I don't know how to share this information (having in mind that I will need to reuse this and it is not a one time and that the number of boxes and plates may change).
I can share images if needed
this sounds extremely confusing
can you, in a non technical way, describe what you want to do
Yeah
I want a door to open only when the player puts a box of a certain color in a plate
ok cool
The door may require multiple boxes
can any of the colored boxes go on any of the plates?
Go as in they overlap or what do you mean?
so if you have two plates requiring two boxes, red and yellow, does it work for red and yellow to be on any of those plates?
4
do you have an enumerator for your colors?
ok so one way of doing it would be to expose a map of ColorEnum, PlateActor
but that locks color to your PlateActor
To expose it?
expose as in make Instance Editable
Alright
is there a way I can rotate the parent so the child moves, but stop the child from rotating?
But I don't want to lock color to my Plates
I have a parent object with a sphere on it, I am rotating the parent so the sphere moves in a circle, But that makes the child sphere rotate aswell, anyway to fix this?
in that case, have an array of ColorEnum, and an array of PlateActor
inversely set/add the rotation of the parent's delta
I thought about that, but then what do I do?
But I want to keep adding rotation to the child, just not from the parent
then it would be add and not set
Appreciate the tip on gameplay tags I will use it for my weapon system and character level. Would I use Gameplay tags or an Enum for a item powerups, I have about 25 powerups and the enum is setup but is it better to stick with gameplay tags for everything?
alright
so every time you place a box on a plate, loop over the array of plate actors. for each unique color, add that color to the ColorEnum array (check if it is in the array first). then at the end, test to see if the ColorEnum array has the required colors
do whatever you want to do to open the gate. if it's a door, open the door
ty, it works now
wait nvm
I found a new wierd problem
well you could have it as a component on the door, you could have it in a class that the door actor inherits from. you could have it in the level blueprint. depends on how unique or systemic whatever you're making is
would gameplay tags be the better system because of the data tables?
it's mostly the better system because there aren't really any alternatives
Hey everyone :o
I wanna make a world-level-selection...
so you're in a 3D world and the levels kind of lie on the floor.
I also want to connect them with lines that sort of charge up like they do in super mario :o
not too hard but my problem is I also wanna merge and split these lines so there are several paths the player can take...
this is what I have for now...
so like... assemble your own level?
nah it's like super mario you enter this world and you can click on any level :o
and I want to connect them with lines but I don't know how I make them "find" a path
like visual lines
that have no effect?
that's a #graphics question then. but for the level question, you can just have a collision box with the Open Level node
uh yea that's not the problem :o I just need some math or anything to connect something like a mesh in a procedual manner so it's always connected no matter where I put these widgets
a spline mesh I guess?
but like if you want to insert boxes like that you'll have to customize it a bit
I tried that and it works well as long as the line is straight :o but if the level widget becomes offset it should have corners
if you create points before and after corner curves you should be fine
this sounds like a waypoint system
@fair magnet as long as you're not doing anything too exotic like seamless transitions or whatever, just your classic overworld system like super mario, you're basically going to be making a separate level with its own mechanics and entering a level is basically a hard load. In terms of layout, you can either do it by hand or have some sort of data representing your game levels in the connections between them and parsing that. I would start with just laying out your overworld by hand and figure out how you want it to look and behave. Splines and spline meshes are going to be your key.
You could start with just pathfinding to portals to levels, we don't know anything about your game mechanics so we don't know exactly what type of movement you would want.
it's literally just a level selection :o player can float around and click on the "level 1" or "level 2" to enter them if unlocked
since spline meshes are using relative locations I can't really figure out how to do it
So what's your question? How to load the level when they click on the widget or what exactly?
how to do the math so these widgets are connected with lines
tbh the easiest thing you could do, which kind of saves you a headache, is to create the spline lines as you want them, and then for each point, spawn a widget at the location of the point
Yeah for that you're going to want splines.
like that but with corners if level 2 is more to the right for example
replace widget with mesh as necessary
dont use widgets?
why not ?
whats wrong with my widgets q-q
try this though
so should I just make like an "line actor" with a spline ?
yeah
on begin play you can have the logic spawn widgets
or actors or components or whatever you need
whats best way of checking if there is an actor at a specific location obvs for loop but without having multiple collision boxes everywhere for each individual area how could i do it more effectively
for example if I already know location where each actor is at game start is there something in the engine that can use location to see if actor is at that locaion ?
@trim matrix am I just stupid rn or... is the equal node what you're looking for ?
what's your use case?
equal ??
yea
I'm not even sure what you're asking lol
so i'm bassicaly trying to make Pak man like
in the game you collect the fruit and all the powerpellets respawn for next round
however this just takes an exact value if it's even one 0.1 off it will give false
what I need is a way to check does a powerpellets already exit at location X if no then spawn one
becuase there is alot of power pellets to run collision checks would be heavyto do
how do you determine the spawn for normal pellets?
as in ??
I assume you spawn them in... or are they manually placed?
manually placed on map
I see
then when they need to respawn at the min I have the engine remove all of them
like get all actors etc and destroy
save the default starting locations, then add the ones that are used/collected/missing, and respawn as needed.
so far i have been using an array which there all saved in at start of the game
well basically you're making a powerup spawner. so I'd make an actor with a trigger box and in each location, that spawns a power pellet. you can query the trigger box actor to see if there still is a power pellet or if it's been taken
it can also handle a cooldown so that it automatically respawns
i'd just save the pellet info when the pellets are used/taken by the player
or just make one actor add an vector array with 3d widget and iterate over it
then make another array that just saves the pellet state
there is such thing as over engineering
a trigger box for each pellet sounds like overkill though, especially if this is mobile game
future proof is what I suggested
so I would have a spawning actor
since it's in an actor that's contained
Best practice for storing code that externally effects a players health/speed/ect... would be as an event on the player or in a seperate object that manipulates the character itself?
component, hands down
can be put on other actors too
basically you'd place down an actor, and use that actor as your spawner.
spawned during use then destroyed when out of use.
can you give an example of what you're doing?
how would i link each pellet to it's location as at the moment I kinda know the spawning process
it's making sure if there pellet is valid but location it is on it dosen't just skip over the location when there is actually no pellet there
so inside your actor you would have something like a spawn location and a type of actor to spawn. then have an internal variable for the actor, check if that's null, and if so, spawn an actor on the spawn location and set the internal variable to be that actor
arr so didn't mention this the Game Mode atm is handling this haha
so lets change that
well to be honest, the spawner actor is something you might need any how
you can always let some system spawn a pellet spawner
which gets a bit meta
as would we be actor component or just actor ?
i've done that
right but you need to add logic to it
so guessing on begin play we need to get the ones in the level so far which is fine
I can use get all actors
I don't know which method you're using
I think... that's what you want isn't it ?
that you can put into an actor place it at like... 0,0,0 and then create the vector locations using the 3D widget
that setup can lead to double spawn bugs tho
like how
well thats what i'm thinking
because you don't have a good way of checking what already exists at that location
so far I have already had that kinda of workflow break the game as it rtys spawning based on location and if it dosen't know an actor is there it will spawn mulple time
it bricks the game like haha
that's why I am suggesting the spawner actor
since it spawns the actual powerpellet, it has knowledge of whether the powerpellet is in world or not. you can query it for whether the power pellet is currently spawned or not
if you kinda work me through this spawner thing I kinda get it it's linking between the various pellets and there locations
ohhhhh
it's very similar to something like a weapon spawner in unreal tournament or what have you
in this case just being a power pellet instead
cause I can spawn actor at each Pellet location and as it does this remove the location from the array so it dosen't double spawn
well you dont even have to check location
you can just ask the spawner to respawn a pellet and let the spawner itself work out if a pellet already exists or not
thats the bit I kinda get stuck on
who would the spawner check is there a pellet at the location ?
I'm not sure what you mean by this
so the spawner will just have an array of pellet locations and array of SpawnedActors from start of the game. When it respawns I don't know what code is needed to have it check at Loc 0,0,0 is there a pellet
no the spawner spawns just one pellet
so you'd put down a spawner where you want it in the level
ohhh right
and then you can do, as you suggested, get all actors of class for the spawner
and then iterate through the spawners in the level to say
go over them and call Respawn
if there is not a Pellet then spawn one
and the spawner then decides if it needs to respawn, or if the pellet already existed
so I would need a collision box for the main spawner
well you might not need one
if the pellet has a collision then you can just create a binding
it's basically an event dispatcher
the player uses it to collide with pellet to destroy it
that you bind after you spawn the pellet. then when the pellet gets eaten, the dispatcher gets called, and the spawner then knows that the pellet has been eaten
would it now it's specific pellet was eaten. and not one across other side of the map ??
so the spawner would have a child actor technically the pellet
if you then want to create a spawner manager that manages these actors across the level, feel free
but game mode can do this for you tooo
not a child actor, just a spawned actor
what about that? :o any better?
gotta admit using 2 arrays theres can lead to problems if one index doesn't fit the other
still seems very error prone
wait if all he's trying to do is respawn destroyred pellets
like how? xd
....
same way as before
So i would have my spawners like so each on is it's own actor
then at start of level it spawns the pellet at it's location
because you're not controlling how an actor is spawned, it doesn't matter how many arrays of locations you are keeping
but that's exactly what I'm doing lol
this controls how they are spawned ? o.o
obviously he can't use like another spawner or smth then? but if he just uses that it's fine
On Pellet destroyed, save location/pellet index to an array, then respawn from that.
simple and done.
oh btw @odd ember I tried what you told me with the spline and spline mesh :o it... sort off works but sort of doesn't
it kinda drifts off for some reason
Looks like not enough polys to be more bendy
how do I increase them? :o
That's entirely depends on how you make the mesh for the spline to begin with.
I think the point is they're coming from a point of having tried setups like these where double spawns are an issue. I'm just trying to solve that problem and keeping everything manageable. having a manager looping over locations or whatever isn't great in situations like these. it's better to have the actor itself be aware of its location and passing this on.
create a more polygon dense mesh
use blender or what have you
hmm
In Blender, make a plane, go to edit mode, make 32 or more edge loops, export as FBX, then profit
@trim matrix If you have a grid like setup, use a map
🦇 🐴 ☠️
A map of int vector 2d to enum or actor reference would make anything you're doing on a grid way easier.
super newb question - how can i get my player character's movement speed so that i can check if they are moving?
character movement component holds that information. you can use GetVelocity
otherwise if you're looking for if the player has movement input, check the axis values
i thought this but how do i compare a 3 vector with a single number?
VectorLength
and you'll have a float
oh. i'll try that, thank you
have a question, is there anyway to delay player spawning, cuz now i have rng map and i get the location but can't figure out way to delay the spawn time
use delay
are you using the default spawn points?
nope, i set my own spawn location, but due it takes 1-2sec to generate map, he puts player to soon and in goes under map 😄
so you're manually spawning the player?
ummm... yes/no 😄 i just set it's location. and then it spawns 😄 being honest idk how to control spawning
it's kind of important if you want an answer. if you are spawning it manually then add a delay
if you're not spawning it manually
you'll have to do a little extra
i'll have to do little extra
in the game mode there's an override function called SpawnDefaultPawnFor that allows you create your own pawn spawning functionality
i have a sprint toggle system. when the player stops moving, i want the player to walk the next time they move. BUT using the 'movement released' means that if they are strafing with WA/WD keys, and choose to drop the direction/sprint forward only, they return to walking again, since a movement key has been released.
i thought that replacing the input with a check to see if the character is moving would fix the problem but it does not. what other ways could i try? sorry for the long message
@haughty axle look into the spectator pawn class and the game/match state functions in GameMode. I don't remember the specifics but you can wait until your map is ready then call Start Game or Begin Game or whatever it's called, them it'll give the players the default pawns.
Hey hey! I’m trying to make something like this…
I need a drop down that allows me to change its value on each instance of an object. Anyone have a video or screen shot of how to do that?
In this example it’s of an npc where you can change the weapon it’s using. I didn’t create the BP so I haven’t a clue how to do it.
I don't know what you're doing inside of your functions
sorry not sure if this is the right channel, but is there a way to model a loft nurb with splines in blueprints?
here is the sprint function. the macros are simply setting the max walk speed
but tbh just use if (MoveForward == 0 && MoveRight == 0) { IsSprinting = false; }
Detect the stopping of the movement instead of the release of an input.
Keep track of speed (velocity length) and do logic on that.
i don't know how to use this, sorry! 😅
I have tried this but couldn't get it to work
MoveForward and MoveRight are input values for your respective movement axes. if both of those are 0, then you can assert the player is standing still
i've not really ever touched blueprints before so i'm unsure what this would look like. i understand the logic tho, at least. i really appreciate all of this help, thank you
well if you look for those keywords that would be a start
they're also on the Input events
? 😅
yeah use boolean and
where your input events are
or in a function so you can call it in multiple places
idk
@odd ember so i did this, removed default pawn class, and did in game mode BP to get location and spawn actor from class, it works. and it doesn't matter how long it takes to generate map it spawns after. BUT.. if I put delay it messes up (overall I don't care about it tho 😄 ). so idk what the hell is happening but now works 😄
also i can't go huge numbers in for loop's and i get inf loop 😄
I don't know what you're doing in that function but it sounds like you could make it easier on yourself
@odd ember it's fine cranked up loop iterations in project so he generates larger map just for testing
Anybody got an idea why my material is showing up translucent?
Alright will go there, I'm always very confused as to where to ask questions. Thanks!
So in my abilities I have an actor component that holds the data on which abilities to cast, and I was going to store the ability logic itself within objects, but I can't spawn actors from an object, which poses a problem. Any suggestions?
This is the easier solution.
is there any major performance difference between an actor or object?
making it an actor doesn't add much overhead
alr thanks!
How would you create a road system that generates itself, including intersections. During editor, or runtime. This is the closest I've found to what I want, but I've never been able to figure it out, or find a released product: https://www.youtube.com/watch?v=9uQwSx7m3CE
Procedural generation of editable intersection.
More at Unreal forums: https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1433781-tool-procedural-street-and-intersection-building-tool
Demo of the alpha version for the street and intersection building tool (plugin) for Unreal Engine 4
BP or CPP
hi, I have videos that plays as an outro and intro for my game and several videos that are in game aswell.
my problem is, when they play, it shows the previos video for a split second before playing the actual video
any idea how to prevent this?
You have nothing plugged into target for the anim montage, so it's playing on nothing
Those are called enums. They hold separate states that you can switch between
does anyone know why DemoNetDriver Console Comand demoplay test give me a Black screen no lights .... i set everything to replicated
Hi, weird issue.
So when I press left mouse button and this condition is true then this should call the print node. But it doesn't, it only calls when I double click.
Why??
The logic seems pretty straightforward
Well, this intersection thing.... They had a link in the comments to their plugin which is free... https://github.com/ydrive/StreetArch/releases
yes, but that's a very old version, and it's just the plugin. no source or BP.
Guys, is there a way to disable collision on a specific area of a mesh at runtime? I want to be able to put doors at runtime, so hiding the part of the mesh and disable the collision there seems like a good idea
what's the difference of Spawn Sound 2D and Play Sound 2D?
Spawn Sound 2D will create a new sound and play it, there is a Return Value to store that as a variable. Play Sound 2D will play the sound input, there is no return value output
ohhhh alrighty, thanks!
Yes but not in Blueprints. You need to write a contact modify callback. In your case it may be easier to look into procedural meshes. Or solve it with a modular environment where each piece has its own collisions and you can re-arrange them to create doors and passages.
Thanks! Do BP procedural meshes allow for runtime editing of the mesh? If so, that might be the way to deal with doors, windows etc, indeed.
@trim matrixProcedural meshes can be used, among other applications, to create sliceable elements or mesh modifiable at runtime. Sounds close to your use case. I would also have a look at modular elements though. You can take a wall (or portion of it) and, at runtime, swap into place a different element with a door and appropriate collisions.
I don't think modular parts will work, as the gameplay element consists of dragging walls out and placing a door at non specific position, kind of like how it happens in the Sims games. Currently, I made it so dragging the walls out is done by scaling a cube in x,y,z + using world aligned textures so UV's won't mess them up. Now I have to figure out a way to make holes in them at non specific position.
Procedural mesh
hit location, door size, wall bottom and calculate the verts
So you can use the current wall, and when door is placed you replace it by procedural mesh
Or you can fake it with smaller wall segments and some material wizzardy
when a door is placed, you segment the wall into 3 (or more) pieces
the door can even contain the top part(2) in case you have some curved door top
I think this approach is easier, and prooobably more performant
That's cool! So, do I just use the bp slicing on the procedural mesh to segment it?
Think so,
havn't really used it... I ment segmenting it by replacing singular wall segment with several smaller ones, but slicing proc mesh surely would work aswell
If that doesn't work you can also try a more hackier approach via collision channels and overlap boxes
My current approach is something similar, doors come with hitboxes that disable the wall's collision on overlap, but it's indeed a bit hacky + opacity masking the particular area of the wall is annoying
Yeah, I would've done it via a 'Wall' Collision channel that gets disabled/enable on the player charactee
And I would use render targets for the masking
wouldnt that be relatively expensive?
Render targets.. maybe they are cheap and im just doing it wrong lol
I don't think render targets are expensive
The thing that renders the scene into one are
Ah alright
But using a 256x256 render targets for masking should be no problem
You just need to get the stretching right
align it with simple snapping, and nobody will ever know 😛
I'd still imagine some ISM method would be the cheapest method to go about this
but could get complicated with materials
question, if im casting to an actor is it a little cheaper to cast to the highest parent possible? lets say i want to retrieve the player, would it be cheaper to cast to pawn(assuming pawn is sufficient for my purposes) or would it be a little cheaper to cast to the lower member, the last child, like myplayercharacter instead of pawn or character
depends on how much you've extended on the subclass i think ?
Im a bit curious about this aswell
In a scenario where you'd use a parent class that holds all the possible events and callbacks that a child has, but 0 implementation. Would this be relatively cheap to keep a reference to, or will it be equal to the child with the implementations somehow?
Hello people!
How do I find out the maximum number of visible characters in a text widget?
Link to the question in answehab
https://answers.unrealengine.com/questions/1058371/how-do-i-find-out-the-maximum-number-of-visible-ch.html
Need help:)
its tricky if the font is non-uniform
In such case i think you're best off just assuming worst case (max width char)
If its unisized, then .. well unisize 😛
for size;
think this is more #umg tho
@gentle urchin Thanks! I use mono-sized font
that's the name of it.. mono-sized! 😄
🙂
Has anyone done unit tests for BP, especially function libraries? Surely it should be a thing 🤷
Hello. Is it possible to use a line trace on a dynamically deforming object (like with world position offset in shader) I want to implement something like digging into sand. Thanks
Hi I've got a spline mesh which i am adding a new spline point to which works, but the mesh doesn't update... only if I do it from the editor. (turning the finalize railway boolean on or off) Does anyone know how i can get this to work in blueprint?
spline mesh variable is this
This is a variable of a structure. Can i get widgets from engine and give to this variable or must i create slate?
TSharedPtr<class SWidget> WidgetLoadingScreen;
you need a new component per spline point
Like a new mesh component?
yeah
Alright I'll try that out, thanks
Sweet did the trick. cheers
Does monatge on interupted works. Currently it seems to not working for me. If my player interrupts enemy attack by hitting him 1st my enemy doesnt sets its state to idle??
Probably if you call Montage Stop ?
Very important question about LevelScriptActor and Level blueprints in general.
I have sometimes heard that the level blueprints should not really be used. Is that correct and what are the reasons for it?
I noticed that the level blueprint is also just an Actor (LevelScriptActor), which would be one more reason to use them for scripting (because they are easy to use etc).
@celest steppethere aren't many reasons for using Level Blueprints except maybe some quick hacks/test code and to handle/tweak level streaming
ok, thank you for clarification
Hey, how to set material for each face of a cube through code? (Blueprint)
DopDie: you don't set the material for a face, but for the material slot
if your faces all belong to the same material slot you can set the material for the slot and it's applied to all faces
(exception: the procedural meshes you can generate through blueprints)
(I guess there you can set the material ID per face or something like that)
It's a long shot, but I don't suppose any has done a LineTraceByChannel that has an Actors to Trace instead of Actors to Ignore before? Got a workaround doing a 'valid' loop on the hit objects, but feel this isn't efficient
I need to add snap rotation to The “Add Controller Yaw Input”
Like 45 degree angle snap, please just tell me what to add to get it working with the “Yaw Input” because as for now, the rotation it has is smooth rotation with no jumps, i need the jumps like 30,45 degrees thing add to it specifically.
thanks for the help everyone
can you redirect me to any sort of guide/tutorial/resource to be able to create a sort of "battle pass" system for my project?
what is a battle pass system?
AxisValue.Sign() * degrees
something like you get rewarded with assets in game for completing quests (for example getting a new skin for the character) and a shop to download dlcs
I don't think there's tutorials for that because it's very high level
@odd ember pardon my ignorance
you have the axis value already lol
look at the name of the float you get
what should I search for?
and from which node it's coming out exactly
unfortunately i was expecting that. but thanks anyway, i'll try to research some infos
from the node you're picking. I gave you all the info you need
the best way to have NPC positions saved is having a master array of saved npcs and loading them based on what map you're in and if their variable says they're dead or not, right? its been working for me and its a lot easier then having different arrays for different levels.
Hey, I'm trying to set up a 3d widget for the player to click on. Everything works fine in stand alone, but I can't get the click events to fire in listen server or client modes
Loading them based on... sounds interesting. I prefer to let the npc's register by themself
Searching a massive array of all the enemies in the game sounds inefficient
hey so i have a player who plays an attack animation and has a combo system, it all works fine, but i want it to be able to affect physics objects in the level, so i turned on collision during the animation, but when you hit the phyisics objects, it hits them WAY too hard, is there any way to fix that?
like the objects go flying across the map
How massive can it really be. 100's ? 1000s? Large enough you probably wanna consider a map or something
Is this the best way for sending an interface message to all available actors? Or is there a more efficient way?
If its something you wanna do alot, subscribing to dispatchers should be considered imo
This is probably only easier because you don't have a function set up for it. Instead of one array, you could have an array of structs. Each struct could have data about the level it belongs to, and another array that is your npc data. Then your function just needs to look up in the first array for the correct struct, open that struct, and use that much smaller NPC list.
Alternatively, at least parse the larger array into a much smaller one for runtime use.
Does anyone have a clue about my 3d widget issue?
I've been searching and can't find anything about it specifically.
And since it's not owned by any particular player the usual method of deceminating 2d widget interaction to the players doesn't apply
there is always a better way, and GetAllActorsOfClass should never be used
GetAllActorsOfClass is not that inefficient like everyone says
GetAllActorsWith [...] however is
Oops, i thought you meant With... was faster, ignore me
in both cases there are better ways than requesting references across architecture. it's not a robust way of doing things
true
and I doubt the speed is much faster if I am being honest. maybe there's an interface lookup table somewhere that is smaller than the list of actors in level, though I'd still not think it necessarily faster
No, GetAllActorsWithIInterface is slower because it actually iterates through every actor and checks if it implements this specific interface.
GetAllActorsOfClass uses a hashmap
a lookup table isn't necessarily fast either
hi
does the animbp have the default montage slot in it?
hi, im intressted in the limitations to make bluprints in to full C++ code. Anyone that culd elaborate on this wuld be mutch appriciated
If you mean nativization, it's pretty limited.
If you mean what can you manually transfer from blueprint into C++ code, pretty much anything
You need to plug a skeletal mesh into target, or else you're not telling the anim montage what to play on. You also need to set up your slots in your abim bp
@tawdry surge okey thx for reply, pls explain abit about nativisation 🙂
Isnt nativization deprecated?
Yeah, cuz it's terrible
Yeah don't do it.
Idk what specifically it breaks but I know its too many things for anyone to use it really.
Best way to find out would be make a copy of your project and try it
If your code is too heavy for blueprint, manually bring it to c++. If it's not a problem, who cares, ship it. It's not like anyone's going to give you extra points for moving a mechanic to c++, just do what needs doing to make your game hit performance targets
Or try to refactor so your code is lighter.
Either way it's easier to optimize the flow in BP
it's good to establish code practices for this early on
e.g. make your own components in bp, inheriting from its cpp counterpart
then one can gradually move code over
function by function even
👍🏻
Ideally your BP will just call cpp functions and pass variables around
bp functions are just wrapped cpp code anyway
I meant functions declared and defined in the cpp parents as opposed to one created in BP
does it make a difference if those functions are from the parent or from any other part of the engine? ... not really
Correct, as long as it isn't another BP graph wrapped in a function node, and it's actually calling the function from a cpp file, it doesn't matter where its stored really
I mean you're still only paying a fractional cost. BP cost is high when considering all BP calls are about 10x more expensive. but in reality, there real takeaway is that you don't really see those 10x except under extraneous circumstances. BP wrapped graph may double the cost, but in the graph scope of things that's still fairly minimal
I read from DataTables pretty often and wanted to consolidate the 'read all rows and return them as an array' to a single function so I created a macro for it but it seems that I can't make an array within the macro, add to the array, then return it all within the macro. Any ideas how I can achieve this?
just make a class that is commonly available read from the data table and store it there
first time i see a "make array" attached to the "add"
this is a point in your life where you should consider using c++ 😄
yeahh I figured this is the limitation of BP only 
time to fire up the monster that is VS 
Rider
datatable already has GetAllRows function, its templated, so blueprints can't stomach it
Rider is for C#/.NET though 
VS without intellisense upgrade is something you will regret
I love it. But then again I don't really have any muscle memory with either one, the ide I used the most before any of this Game Dev stuff was eclipse LMAO
Oh wow that's convenient, I used Rider for years with Unity
it's not going to be free forever just fyi
I can't speak for the greybeards, but in my experience, it's f****** awesome.
vs22 is pretty good
if u attach a struct array instead of that "make array" you can collapse to macro
Can anyone tell me what the Node type is for the circled node?
@frosty berry that's the one minus. It says right there.
#graphics tho
i just honestly don't know the difference between a "make array" or creating a variable of whatever type i need, set it to array, and populate it. i find it easier, faster, and also "easier to read" but disclaimer: i'm a noob, i just do what i can the way i can 😄
Why? it was a general blueprint node question.
that's material graph
Thanks. New to this and dont know all the node types
ok... i just call all the "node" based stuff a blueprint.
What do you mean by 'attach'? I ended up going with this, which looks like what you showed but specifically I had to use the local array of * node to 'attach' the array.
it's not. there's different graphs managed by different things. it's not at all comparable
i meant attach (the connection) to the "add" node.. the way you did it works fine as well if you need the array of wildcards
can i make a rotator from a forward vector?
hey guys
does anyone know how to replace the default character BP jump animation with one from mixamo
trying to replace this
change the animbp
the animation is set in the anim bp - go to the skeletal mesh and select it
to use your new jump animations when entering the jump state
that will stay the same
you have to retarget skeletons, ask in #animation
i did all that already
then change the state machine
the jump mechanic doesn't change in BP
it's all animation based
Out of curiosity, what is the point of this? Generally dumping datatables into an array is not a good idea.
sometimes make array has to be used. One example is if you have a bunch of widgets that you've placed for ui, but want to reference them via array, these are existing objects. I'm sure there would be the argument that they should be generated procedurally, but some cases dont merit this. By using Make Array, these specific objects can then be set to an array for future referencing.
Another example is on a line trace where a the collision filter type is an array. Using make array lets you plug in the one or two collision channels without needing to make a variable (unless it is suppose to by dynamic).
Another example is referencing pre-placed objects, such as waypoints in a level that an AI will access to follow. These are not made at runtime, yet a reference to them is needed, therefore Make Array can work to plug in each of those waypoints.
As you point out, it's not always needed and in some cases not using it is better than using it.
It's <20 rows in each of these files, 5 total files only read once at the relevant init time, and it's just used for placeholder content.
In Unity I would've used the ScriptableObject for this.
didn't know any of this! thanks for the examples
why aren't you loading it into the game mode and just querying that from there?
No experience with unity. But Datatable lookup is extremely fast.
Some of the data tables have data relevant to specific actor variants. It would feel odd to me to place that in game mode.
I am completely new to UE though, it's a pretty different game from the many years I have in Unity
if it's data you get all the time game mode is one ofthe few common places it matters
Why not just have the actors themselves look up the data they need? Datatables are static data, so anything in blueprint can get access to it.
If it's for spawning, definitely game mode. Safety concerns, etc. If it's for runtime stuff, the actor itself can look it up.
I do have it attached to the actors themselves at runtime for some, but I have some datatable data used in a widget also which is what my question was originally intended for
sounds like it is within gamemode scope regardless
and it saves you having to query it all the time
which is just weird
I don't query it all the time though
do you query it more than once?
Not really necessary to keep it in GameMode. A pointer to it in the widget or actor is perfectly fine.
I don't query it more than once. However, I do load data for each 'player type'. I suppose in a multiplayer context, the client may end up trying to query for more than just the client's player, so I will look into that.
if it's something you access more than once, having it in a common class that is easily accessible makes more than sense
Game mode is actually a really terrible place to be keeping static data unless it is only ever required for guarded things like spawning gameplay actors with specific stats. Widget implies UI. That's definitely not guarded data. It's perfectly fine to just have a static pointer to the datatable in the widget to use for setup by pulling the struct it needs from the table on construct or an init function.
For a camera not attached to the possessed pawn, would you guys recommend a separate actor or can we just use the player controller for this purpose. We don't want camera implicitly tied to the pawn because reasons.
I said an accessible class. if not game mode then PC or game instance. arguing semantics isn't my point
I don't personally see the point of tying static data to a game class.
i don't know your specific case, but in my last project i had a pawn without camera, different cameras across the level, and i was just using the player controller to achieve the camera change.. so it might work
for ease of lookup? I certainly do
How is that easier to GetGameState, CastToMyGameState, GetDataTable easier than just making a pointer of datatable type and setting it?
you're assuming that getting datatable data is free
I'm assuming that it's going to be loaded whether it's on the GameState, or a Widget. And the GetDataTableRow/FindRow<>() is the same regardless of whether it's a static pointer in the Widget or on GameState. So going through GameState is just unnecessary indirection.
you're also assuming it's only going to be used in one place, which is what I said it was predicated on
Pointers are extremely cheap. Having thousands of widgets with a pointer to the same datatable really isn't going to be an issue.
you're making a case for copying code if nothing else. all this because you dont wanna do "needless indirection". ok. you do you
I would always centralize data for use between different actors multiple times
more performant, less repeat code
Personally. I have a single DataAsset pointer on GameInstance and a lot of getters that access that asset, sub assets and any tables on them. Which I do prefer because most of thema re designed not to even copy the full struct when returning data. But in regards to being newer to Unreal, having pointers to static data is a very easy way to work.
it's still not advise I would give out as it adds more tech debt than it is worth
I integrated another project into my own and theres a drag inventory widget however when i drag the widget the title bar text offsets to the right a bit, any idea on how to fix that problem
there's a faster way and there is a better way. and as you know most often those two are mutually exclusive
Hey guys, I have a working clock/Calendar in my build, and I have a day/night cycle, does anyone know how I would go about syncing them together?... I know it's a bit of an ask without seeing the BPs, but there are probably too many BPs to show..
DayNight should have access to the clock. DayNight should eitherr poll clock when it's set to update, and check for time of day to update itself. Clock should work as intended and not care about DayNight
When at all possible, dependencies should flow in one direction
Character knows about gun, gun doesn't need to know about character. Sun knows about time, time doesn't need to know about sun, etc.
My Day/Night is currently using Event Tick and Delta Seconds, so what should I be using?
and what is the clock output? a string?
Didn't you just say you already have a working clock? Just get the time from that
i don't have time to watch this, but... https://www.youtube.com/watch?v=x3xBtPIVWEs
This video explains how to create a day/night cycle in Unreal Engine 4, including a moon and working clock, as requested by isaiah games on discord. Topics covered: Material functions, post-processing, blueprint scripting, level blueprints, HUD elements, animation timelines.
LINKS:
Moon Tutorial - https://youtu.be/thF80XvnqMo
Colored Fog Tutori...
I'm looking for a resource for how to approach item stat rolls, does anyone have any suggestion I can look at?
instead of having predetermined stats from a csv file for example
random?
semi
for example
say some armoured boots would have a "primary stat" which it would always roll such as armour + X
but sometimes it could roll + X Dexterity
or if they were very heavy even - X dexterity
sounds like random
so ive worked out all my stat modifiers
and am happy to work it out on my own but maybe instead of reinventing the wheel there would be a common way to approach this?
yes even if there is a random example
I can fix it to suit my needs
I'm having an issue with my projectiles, I have a crossbow that shoots projectiles that initially don't have simulated physics but when they hit something I want them to simulate physics, however this seems to be making characters able to step on them (which leads to them being able to move characters when they shouldn't)
does anyone have an idea on how I could fix that?
CanCharacterStepUpOn is set to No on all every component
You want to look into procedurally generated / pseudorandom generation.
I have successfully imported Data Tables into ue4, my question is how do I create branch logic based on integer data on specific rows (one column has the level of the character the other has the level of the weapon experience) I would like to use if else logic to determine a specific result based 2 columns of a row
tahnk you @dawn gazelle I'll do some digging into that
the closest thing I could find was weighted loot tables
which definitely can be used for some of what I'm trying to do
a weighted loot table is not what I am looking for, I want to modify my bomb explosions based on the level of the character and the level of the experience with the weapon. I do not need the loot to drop. (I will use a weighted loot table somewhere else thanks for making me aware of this but not the solution I am looking for)
@sonic crow we were having separate conversations I wasn't replying to your question
Save the numbers you're interested in to local variables and then after getting them, do your magic math and combine them
lol oh sorry
no worries 🙂
@halcyon grove here's how we roll our items.
We start with the level. It is plus minus one level of the current map level.
Given the item level, we have a weighted roll table to choose the item base.
We roll for rarity. In our case, rarity is just the number of mods.
We roll for mods. In our case mods are multiplicative only so the item level doesn't come into play. If it did, you would have some sort of function per mod to determine the mod stat values given item level.
At the end we have our super flaming minigun of piercing or whatever
Is this the correct channel to ask about materials?
Cool thanks
does anyone know why my ocean is completely frozen'
so very helpful, thank you!
this is exactly what I was looking for
last thing is for "item abilities" presumably these are stored as functions?
turns out i had just changed the Material Paramer collection to clouds
or macros if they happen over time
We just have a BP class per item base that is composed of a bunch of functionality. Your approach will probably differ but that's what we went with.
GAS is probably the "best" way to go but it can be a handful
I am trying to use a data table row number which is set to an integer already to determine which switch int to use, the problem is I am not sure how to get my datatable to feed that information from my Row column
Ya. It's great but a pretty big undertaking. If you're nooby idk if I'd bother with it.
yea im not getting into that
no offense but... why aren't you using a select node here?
ty will look into that, literally my second week in ue4, appreciate the point of direction, honestly i am learning so fast 🙂
We branchless now
I prefer to avoid them if i can really, but not for any cost obv
Ending in some obscure formula is just weird
I'm not sure of intention I just don't like seeing random switches
Is this possible in blueprint function library? I'd like to make a function that defaults to self (of specified class)
Dont think so. Whats the intent?
Target here is the owner of the function.. in a library, the library is the owner of it...
@high oceanYou can hide the world context pin, if that's what you're after?
One required step is to ensure the exec pins (white triangles) on your node are properly used
oh frik
I didn't scroll hehe
Would you use a select node with a data table? It does not seem to be designed for many inputs lead to many outputs. Each input leads to one output with a select node. Specifically I am trying to use my data table over an enum for code efficiency. ETC... Depending on the row determines the size of the explosion
You should try playing Starbase. It's all concurrent and branchless programming due to their in-game programming language restrictions.
no use it instead of the switch node
;_; why is the GetDataTableRow node not connected
also no node corresponds from many inputs to many outputs, it's not desirable
I had a lot of fun playing Stationeers. Writing the low level machine code. 😄
seems like there's an increase in titles ending in -eers
yet here we playing #blueprint volunteers
@gentle urchinUnified hover mechanics for UI buttons/text/whatnot with some exposed parameters. But since ALL buttons will use it, I wanted to skip connecting the "self" for various button presets I have.
@maiden wadiI don't think so, I'm not even sure what "worldcontext" does really 😅
it's the context of the world, duh
Yes... Still nothing 😅
For stuff like this you usually make a Button Widget
no it means that you're ensuring that you're calling this inside a world
And then reuse it
Apologies I did connect it, just disconnected it while playing with blueprints to figure out how to pull row data into the switch so that the correct information is pulled from the data Table, however it seems datatables are a bad way to go and it is easier to define the varaibles or use enums, however I was told the right way would be with data tables, it is just trickier to setup.
So you wrap the native one into your own
Made several @surreal peak And I'm reusing them.
You will only not need to connect "self" if you are calling it inside the instance
If you call teh function on a different instance, you need to connect that one to the target pin
I always left it unplugged, never seemed to have any need for it 🤷♂️
Not much to get around that
how does one use data table row to get a specific outcome if the select node only give you one outcome
WorldContext is a UObject* you can provide that the function uses to get the UWorld, so the current World from.
that's the secret, even if you leave it unplugged it still gets world context through the actor it is on
Static functions have no access to World function otherwise
there are cases sadly where you can't get world context
yep, never used one, can't see a scenario where I would (ofc I'm no programmer/any good with anything tho)
for instance in utility blueprints or widgets
you dont use it explicitly, but the engine uses it internally lol
It's more of a C++ thing tbf
In BPs you usally don't get in contact with it
Your Blueprint Function Libraries utilize it
figures, read up on them and they seem useless in bps since you basically use functions to reuse functionality which beats the purpose of them being constant - unless they're just refs, which I usually handle through interfaces+flibrary anyway
Not sure what your goal is, but it might be easier to first define what you want to do and then to learn what a DataTable is for.
Just forget about the WorldContext stuff. It's more confusing to you than it should
The SetRenderOpacity node is defined in the UWidget class
Ok, so all in all, I can't simulate the "self" by default behavior I see in native functions
Which ultimately all your Widgets inherit from Iirc
You need to connect the Target pin by hand
@surreal peakGreat, thanks for the help 🙂
The only automated way is "self" itself. Which is a blueprint thing to make it easier.
All that does is pass the current isntance this function is called on into the Target.
It's the same as you manually connecting the "self" node to it
@surreal peakThat's what I'll do really, just wanted to get it EVEN faster 😅
Only "faster" thing is to put your Widgets into an array
and connect the array to the target pin
UE actually allows you to do that without a for loop
IsValid checks are missing then though :P
I created a datatable with 116 rows and 5 columns, The infomration on the Row states the character level, weapon level, row number and some description string. The purpose is to use it to determine which weapon you can use based on the character level and what impact the weaon has based on the weapon experience. The example is a blast radius. I want to use my datatable to identify the character level and weapon level so that it impacts the blast radius. I only need to use the row number for this but it needs to pick up the column row and the ro it is in to get the row number to know how large the explosion needs to be
I know that (found out by mistake) - however, @odd ember was skeptinc of it, and he was - guess what, right... Sometimes doing that can break things in a grand way in silence, w/o anything seeming wrong, I'll never do it again 😄
Does of course require you to have all the widget instances in the same BP :P
Yeah, could break stuff
I guess
@surreal peakNah, it's fine, just wanted that bit of info, thanks for the help 😄
goes back to the idea that programming is solving wicked problems https://en.wikipedia.org/wiki/Wicked_problem
In planning and policy, a wicked problem is a problem that is difficult or impossible to solve because of incomplete, contradictory, and changing requirements that are often difficult to recognize. It refers to an idea or problem that cannot be fixed, where there is no single solution to the problem; and "wicked" denotes resistance to resolution...
What is the actually Row of your DT?
The CharacterLevel?
Cause a DT is meant to be a key value pair
You have to give it a Key to get the correct Value
Value here being the Struct
@odd emberRead that and watched a game design wicked problem session (he called it cursed) - pretty funny and scary+accurate 😄
Key being the Name
Your Screenshot shows it's a simple number, but what does the number mean?
Attached a screenshot
Ahh................
I think one single DT won't work here
At least not pretty
You could try to cut this up a bit
if i can just use the row number i can make it work i think
Yeah I mean
I'm not sure what the RowNumber is for tbh
You have WeaponLevel and CharacterLevel of that row
Why is that not enough info?
purely to reference the row if i could not use to columns i could use the row
.
when generating data bases the same notion goes
Wtf is your function here, you want to get some weapon stuff given a character and weapon level?
what resource should I look into, from the sounds of things Datatables is pointless if you cant reference a cell and make a specific output based on the cell
Well you can reference a cell
well you can
The Key/RowName is your Row
And the Varaible of your struct is your cell of that row
as long as it is within a table, you have a one to many relationship
one key, many values
yes that would be the row column cell number bot it does not work when trying to use it even when connected
@sonic crow In plain English, describe what the inputs and outputs of this mechanic should be. For example "Given weapon and character levels, return a weapon effect mod"
Okay so to put a bit simpler first: DataTable are meant to hold static information one can look up but not alter during runtime.
You usually have a DataTable that holds specific information about one thing.
E.g. You can have a DT_BasicBomb that holds all Levels of that specific Weapon
So each row could be a level of BasicBomb
And the row then holds all the data about that
You can reference that row in other DTs
Anything that is a result of like two variables, like char level and bomb level, would probably better fit a math equation if possible
Not sure that big DT there is doing you any favors
Also still not sure what you are doing with that row int
The whole thing is meant for you to give it a RowName (e.g. 1) and that gives you all the data of that row
And that's all
I think your problem is that you are trying to do this the wrong way round with DTs
You want to somehow figure out the row via Char level and Weapon level or?
at least from the looks of your spreadsheet
We on the same page I should make multiple data-tables, similar to what would have to be done with Enum. That being said just so that I know how to reference a cell (being the row number) how do I connect it
right click on out row, split pin?
Yup but then a switch would make more sense than a select node as a select node is opposite?
ty 🙂
a select node is a switch node without the execution pin
Your setup
makes the whole DT kinda redundant I think >.>
You get Row Number 1
Then get the Data in that Row
Grab the Row int, which is 1
and then you swtich on that int to get data
Like, you already know you are providing row number 1
all to make some extra spaghetti
@sonic crow please explain what you're trying to get and what you already have coming into this. Do you know the character and weapon levels and need to get the effect or what?
but that would be too easy
Can be done pretty with some curve
If you want it even prettier, you could have a look at I think CurveTables. That's what GAS uses for mapping like these
Can only be created via importing spreadsheets
Can use ScalableFloat variable type
Which allows a scale and a CurveTable to put into I think
And then you can ask it for the float value based on the input
E.g. CharLevel+WeaponLevel
I got the blast radius working, everything is done. I have manually tested with different integers that it works. I am just trying to input the integer from the datatable.
In short I have a bomb that explodes, the size of the explosion is determined by the first row which is an integer, i just need to pull this infomration from the data table, once this works I will create the relevant blueprints so that it can do a check, i realize now datatables are glorified enums and I should probably stick to enums because there seems to be no cost to using enums
wait till you realize enums are just numbers behind the scenes
i just need to know how to reference this row correctly
I know enums have a bad rap in this community but it is honestly super simple and it works first time compared to datatables
If you're going to do that use a select float on enum
need help guys. So i've sorted the spawning thing of pellets I know how I will do it now
However I need to give GameMode the ability to fire the function for respawn that lives on the PelletSpawnManager
If i cast to I am unsure what I would use as my wildcard for the cast as I'm using game mode I am not able to select the PelletSpawnManager actor that lives within the level
That what i get when i try casting to the PelletSpawnManager
just the the cast won't work when it runs
where are you setting the variable itself
let said i have box 1 2 and 3, that cant connect to the same target tho?
that to me ??
if so on game mode
referencing the Pellet Spawner Manager for the variable
i can see where i have gone wrong and i can never get the casting right if i'm honest
i cant find any documentation within blueprints to convert an enum into a float, i know the set values is from 0, 1,2,3,4,5. But there is no infomration online that i can find to "select float on enum" There are some resources in c++ and within unity but nothing that I can find for blueprints. I assume you suggesting turning it into a float so that I can do math and have less mess and cleaner code, I really like the idea but I am not sure how to do it.
unless i'm casting to player then it's fine haha
it's an actor in the world but obvs thats gonna be epensive keep calling get all actors. I could do it once on game start
Just drag off that enum, type in switch, and figure it out.
then save the variable
but was wondering what would be correct way of casting to something that need wildcard etc like
the variable is empty until it's set
so you can either call Gamemode and set the variable from Pellet manager
tbf I got that but I can't set that in game mode and thats where the respawn on pellet spawner manager is called from
thanks 🙂
or in gamemode get actor of class pellet manager and then set the variable
i was thinking that, what would be less expensive to do
you do it once, after the level is loaded
yes but you might have to put a delay because game mode is spawned before other stuff sometimes
just a delay before get actors of class
okay
let's see what happens
so that works pretty well
a question if i didn't use get all actors
how would i set a variable for something that when I cast to it i can pull the variable
as to have loads of things all cast to something else to set a variable so the that thing then has a wildcard to use sounds like it would be lengthy process and pull alot of uneeded resources like
sooo... i just drink a good beer enought to solve a "character" switch issue which i had for months and didn't even do that in unreal (instead looked for other stuffs like particles 😄 )
lol yes see the "study" rumor from microsft - Ballmer Peak https://xkcd.com/323/
huh xD nice,
you can set the variables directly from the actors themselves, by calling Get game mode inside Pellet manager for example
So in Pellet Manager - On Begin Play - Get game mode - get variable - set variable to self(pellet manager)
there's not really any other way around setting the variables
lets say the gamemode was a workshop table
the workshop table would need a wildcard as i would be able to go from pallet manager to the workshop table to the set it's variable
or would this be were people would use line traces etc to pull the actor ref from the world
to them use as wildcard
I managed to get the same affect a slightly different way most likely due to lack of know how but i got it working, thanks for the idea 🙂
yes you need to already have a list of variables in gamemode in order to set them.
dont know what you really want to accomplish, this is just how programming is
i mean im not saying its impossible to do it another way, but the above method is just the most common and straight forward to do.
i've done method you've suggested, I'm dyslexic so I explain things so wierd to me it makes sense but won't to some hahah
if I come across it i'll let you know haha
haha nice
you can still use a select node lol
I don't know why you insist on the switch
just FYI, you can also have the Game Mode spawn the Pellet Spawner Manager instead of placing it in world
although I don't know your current implementation so I'm not sure if you have configured the instance
PelletSpawnerManager is in game from start
so it PelletSpawners
the pellets are however on game start spawned in by the spawners
i'm using a box trace when respawn is called to check if there is a pellet as spawner location if not it spawns one
if there is it will do nothing
the PelletSpawnerManager will go through array of spawners calling the function
so at the moment i ask manager it goes through loops calling functions of the other actors
but each spawner is aware of its own state?
technically yeah
cool, that's the most important part
yeah I see PelletEaten, nice work
and the other runs only when respawn is called
you can bind an event dispatcher instead of going per tick
spawn pellet if find no actor in trace box
which might save you a bit of performance
inside your pellet, create an event dispatcher
what i want to do now is check when all pellets in level are eaten
called something like OnEaten
okay one momen
when the pellet gets eaten, call the dispatcher
Yep got that
so I guess you're using interface for this yeah?
i'm not this is child of the main collectable item
ah I see
This is collectable base
I would override the implementation for OnCollect locally then, so that you can add the dispatch call before you call super
would i remove the event on here then ?
no no
or leave it and just overide like you said
everything stays the same
we're doing the same as before, we're just ensuring that we can call our dispatcher first
hmm I'm not sure how it works with interfaces tbh
it is interface as well
i'll try implement see what happens
if you right click on the function node after implement, see if you can Add Call to Parent function
yep
now how would i link this to the specific pellet spawned that spawned the pellet
so when you spawn the pellet from the spawner
you also get a reference to it
so go back inside your spawner actor
to the spawn node itself
so that essentailly
yep. so after you set the variable, pull out a wire and type bind PelletEaten
from that socket you can pull out a CreateEvent node
yes, but we can make it a little nicer with the CreateEvent node
so it's not pulling wires across entire thing
soo now what would be best way to track when all pellets are eaten
would on tick on manager work
you don't need to
would i noy ?
well now that you have seen how delegates work, you can add the same delegates for your spawner
cause after alll pellets eaten PacMan speeds up you see
and then in your SpawnerManager, you can run a loop through every single spawner any time the eaten delegate has been called
so instead of doing this every frame, you're just doing it every time a pellet gets eaten
So i have that
where does it connect from?
oh so use dispacther to call on manager the something has been ate and use that to trigger to loop event so it's not running on tick
to tick at the moment
bingo
okay barewith lets see if I get it first go
I'm confident you will 😎
hmmm
i have a catch
the manager dosen't spawn the spawners only has an array of them all in level
would i be able to grab a copy of one to get ref to one
yeah so on beginplay or where ever, loop through them all and create bindings
barewith please
So were getting there
what's best way to do the if all pellets eaten check could I increment until amount shown as eaten matches amount of spawners in level ??
you could, though it's somewhat unsafe. you can run into situations where it is not stateful enough
like for instance you might pick up a pellet from a respawn that alters the counter
thats what i'm thinking at moment
yeah I mean go for it
I would actually use Modulo here if you're not resetting the count
modulo whats that ??
so basically if you're replaying the level, and respawning it, but want to keep the counter going (for whatever reason, for instance if it's tied to scoring). the modulo node would allow you keep incrementing.
so let's say you have 50 pellets
at 50 pellets you could check that the modulo between the count and the amount of spawners
and if it is 1, that means you've gotten all the pellets. for the next try, the score would be 100, so the modulo value would be 2
etc.
hmm, I think for this reseting to 0 on restart would be prob normal to occur
sure
as unless the game you respawn with possible less then start of game I would think once PacMan dead he would need reviving haha
I mean as long as you do either, you're good
the integer way is good as a base, but there are other ways to make it more stateful in case you get bugs
i'm gonna try it now
so once all have been ate hopefully it should make PacMan go super fast
is there a way to SetActorLocation to 200 units before the BoxTrace hit location?
(GetActorForwardVector * -1 * 200) + GetActorLocation
I have issue
when i'm collecting pellets the number increase seems to be off
by how much?
ah that's right, you're looping over this right
i collect another it adds 2 so i end up with 3
then again i end up with 6 on 3rd pellet collec
so we can do a little improvement here
i need pre value
inside your spawner
yes
on the dispatcher, you can add a parameter
i have
it's a bit obnoxious. it's on the top instead of the bottom
yep upper right corner, the +
yeah
you should get an error
right click on the spawner child ate


