This is great approach. What I would do normally is to create an empty actor bp that acts as a manager for a gameplay system. one advantage of this compared to UGameState is that since it's an actor you can add box collision component to it and place it on area that you want this to affect which gives you more control ( or even you can add multiple box collisions to actor and place them differently to even have more types of behavior based on location) but most importantly you can get all specific types of actor that are overlapping with box that is much much cheaper than "get all actors from class" and you can even set a timer and update them based on duration you want. Also since actors are instansable in nature you can tweak lot of things on diffrent levels when you place the manager actor.
@kenalpha38 ай бұрын
4:06 @NumenBrothers so how do you "get the closest" foliage actors (to player) if GameState doesnt have a collision box (not possible?), as @sinavaghefi1603 is suggesting?
@NumenBrothers8 ай бұрын
@@kenalpha3 I have a function on each HISM foliage actor where, based on passing in a location, I can get nearest 'X'
@kenalpha38 ай бұрын
@@NumenBrothers Ty for the confirmation. Is the code for the HISM / get nearest - available somewhere? Im guessing it is a BP with collision. Event > OnBeginOverlap > you transfer to a Function? and where does the Get nearest code go?
@megtwin4 күн бұрын
Hi there, I have an issue I've been trying to fix for quite awhile now. In a cave I have wall torches. I need to save the wall torches that the player has already lit so when the game starts again the torches that were previously lit are still lit. I tried using Get all actors of class in the save game function, this function saves the values but on load they are all showing as false. Can you show the correct way to do this?
@neosozlp78634 ай бұрын
Thanks for this video. It's still pretty confusing what all these entities (gamemode, gamestate etc) are, what they can access and what they be used for.
@kenalpha38 ай бұрын
0:59 Can you do a video on Player State vs Game State? (A video on the best place to put player info that you wanted remembered when transferring maps, e.g. status effects, Experience, current weapons in hand?) It's the first time I heard of Player State, so I'm wondering where AAA games put their stats? (Use Player State to load temp memory (load stats while Game is running), but link to and offload it to a SaveGame asset for Game/PC reloads?)
@NumenBrothers8 ай бұрын
I have minimal experience with saves and loads thus so far. I'm sure I will tackle it, but it won't be for awhile, apologies.
@kenalpha38 ай бұрын
@@NumenBrothers Np. Ive made a SaveGame asset that stores what armor I wear. (But it's tedious to setup copies of variables to pass from Player BP to SaveGame.) And I bought some SaveGame assets (but havent used to see which method they use). And I saw another method that Stats use a Component added to Player BP. (But Im hesitant to use Components since they dont allow Timelines/transitions.) I was just curious if anyone knows or can show about Player State (when you can), since it seems to be what Epic wanted us to use for player stats?
@Some0705 ай бұрын
Funny, you need to make a custom game state bp to activate anim budget plugin
@AmeenGhazizadeh8 ай бұрын
Hi, I'm having a really difficult time trying to fix something from one of your earlier tutorials. Tried emailing you a while back but received no response. Is there any other way to get help? I've been stuck on this issue for weeks now.
@NumenBrothers8 ай бұрын
I recommend posting on the forums. This looks promising- forums.unrealengine.com/t/umg-drag-drop-not-working-4-20-packaged-standalone/431658/14
@cxvcnxbzfdhjlaks4 ай бұрын
There is no reason to cast to the game state in a player pawn. Use an interface to talk to external objects from the player - as someone working on a mid size team project, undisciplined player casting is a rabbithole nightmare that causes grief in everything from the editor to builds, to load times. The engine chooses which assets to load and the order to load them in an efficient manner - using casts and hard references really messes with that. If A has a reference to B, A cannot load before B finishes, and if B has a reference to C, and D, and E has a reference to C and so on, if forms a thing called a reference chain (which is an important part of OOP but nasty if unmanaged) - with side effects that aren't forseeable or controllable. So casts to important shared objects like the game instance, state, and player pawns should be avoided entirely on anything that isn't the size of a 15 minute demo. We have interfaces and soft object references and soft class references for this very reason. But if you don't mind build errors and editor crashes - by all means, cast your brains out. Also aspiring devs should look into the load order of things. UE has a specific way it loads objects into memory and there's videos on here that explain it. Fwiw, I think game state loads before foliage and thus may not find all the actors on begin play (esp. if using world partition) - But if this works, it works. I think a better approach would be to call a game state interface message on the level's or player's begin play event, to do the find all actors of class and store those references then send them to the player as needed. Of note, find actors of class is one of the slowest built-in and cpu resource heavy operations that UE can perform, and should be used sparingly, once on begin play is fine - just never use it on a tick or a timer, always control it with events when needed.
@LupusMechanicus8 ай бұрын
bro you think I know better than you. lol lmao just. Um Akshually shouldnt you be using an interface for this?
@NumenBrothers8 ай бұрын
You can't store variables/data on an interface. Event Dispatching might work (it's a 'Twitter-like' communication method) but the problem is Event Dispatching still needs hard references.