Some friends and I want to create a game in UE4 for the Global Game Jam, but are having issues with the source control. Myself and another are working on game logic, while the others are working on level design and models, but we are still all editing the same level.
So that we don’t have merge conflicts every time we push something to the repo, is there a way for us to try and create the game logic somewhere else? We are working on a mechanic that allows you to control over pawns in the game, but I’ve tried to to create a new blueprint class, and use the GameMode BP, but I cannot reference the trigger box or characters from either BP. The only place I am able to do that is in the level BP.
yes, and this is a great way to program, because you wind up developing modular portable code that can be easily adapted to a variety of situations. In your game mode or game instance you can build lists that are references to the objects you are looking for, and use those lists to execute game logic.
For example, on game mode begin play, ‘get all actors of class’ or ‘get all actors with interface’ can be used to return a list of actors that you are looking for, then iterate through those lists to find the one you’re looking for. to find the one you are looking for, use unique identifiers like actor tags (scroll all the way to bottom of the actor details to find these usually), or maybe even a variable in that actor that gives it a unique id to check against. make sure to include an ‘isValid’ check so you can return debug messages telling you when the game can’t find what you’re looking for.
depending on your familiarity of blueprints, player states are a good example of this type of coding, and include all kinds of unique player identity stuff without any actual persistent data up front.
hopefully this helps, or if not, feel free to post specific cases where the logic might be breaking.
if you want a level placed actor to reference another level placed actor, you can make an exposed variable of the Other actor reference. then in the level editor, in the actors details panel, you can use the eyedropper to select the other object.