-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about room logic #50
Comments
Hi @GamesAndBacon What I would first try do in your case, would be to create an actor component with the standard logic inside. So in short, I would go that way:
If you have a C++ project, you can create a subclass of the |
just as a follow up to this i wanted to let you know which direction i went with. i created a RoomLogicComponent class in C++, and when the RoomLevel is just about to finish initilizing at the bottom of begin play, i add the component and pass in the room and room data. i added a helper function for adding a component, and exposed to to BP. so you could add more at runtime if you wanted. maaaybe your map has modifiers and you want them to add features to certain rooms. something along the lines of Path of Exile random enocunters. i also added a helper function to GetAllActorsInLevel, inside the level instance. just something i found handy so i could check for spawn points, or if all my team members were inside the room at the same time ect. i also exposed the roomlevel returning the dungeongenerator. i use my dungeon generator as a singlular source for where i keep my pooled actors and things. so begin able to easily reach that was handy. in the end i went with using logic driver pro lol. but now in my roomlogiccomponent thats where i spawn my state machine and plugin all the required data. |
hello there,
im wondering about how i could encapsulate room logic.
for example, i have a room and i want it to be a wave attack type room.
i have spawner actors placed around and i want the room to know about them and be able to use them.
i looked at custom data but i dont think this is what i want.
i currently have another actor my "room manager" that i place in the level blueprint for the room and that does the job.
But im wondering would i be better off expanding the room class? perhaps even removing the custom data aproach and just letting the room class have more of a role in managing all logic in that room.
not sure what you would recommend.
The text was updated successfully, but these errors were encountered: