Announcement

Collapse
No announcement yet.

Communicating with the Level Blueprint?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Communicating with the Level Blueprint?

    Is there an effective way of doing this?

    I've created a generic framework for the completion of level objectives. However, what each of these objectives IS is specific to the level, so they need to be handled by the level BP (rather than some sort of class BP).

    So each level BP has an array of objective structs, and when one of these values changes, I need to be able to access the value from an HUD blueprint. But there's no way to get a reference to the Level BP from any other BP... So what's the best way of passing this data around in this case?

    #2
    You can try to do "Self - Get Display Name - Print" on Event Begin Play on the level Blueprint. See what comes up and if you are able to store it in a variable, you might be able to use it as a reference in other blueprints. However I reccomand you to build your logic into the GameState rather than the Level Blueprints.
    [Released] Multiplayer Combat Editor
    A-RPG Sacred Swords
    Auto-Chess Live Development
    Youtube Tutorials

    Comment


      #3
      Most of the logic IS in the GameState (or GameMode or whatever), but the problem is that the specific criterion of objective completion (e.g. Score 50,000 points, Score 60,000 points) is something which is level-specific. So I'd have to make a modified duplicate of the GameRules for every single level, even though 99% of what GameRules does isn't changing. That seems kinda silly.

      One would think that doing something like this would be exactly what the level BP is FOR; it's a BP which always exists but which changes from level to level. It seems like it would be THE way to plug core gameplay logic into parameters which changed on a level-by-level basis.

      Strictly speaking, the Level BP doesn't need to be callable from class BPs... It can work the other way. The Level BP can be configured to "shout" information to the HUD, I suppose, calling a custom event in the Widget's graph and passing along the relevant data, rather than the widget pulling it out. It just seems like this would not be the most elegant way of achieving this.

      Comment


        #4
        Hello,
        For "one shot" events you can create a custom evnt in your destination blueprint with inputs and call it from level blueprint when you need. For recurrent transfert info, you can create a dedicated blueprint set in level where you send infos and call them from this blueprint when you need (as a game instance could do...)

        Comment


          #5
          First, you inherit the general GameState into specific GameStates.

          Second: This sounds very much like something that the Level Blueprint should put in GameInstance, GameState or PlayerState, and then the HUD should read.

          Comment


            #6
            Yes, I'm aware of that option. The problem is, it means the GameMode is going to have to contain the objective-completion framework for EVERY level. If each level has, say, 10 unique objectives, and I want to handle each of these one-offs via a Custom Event, then with 6 levels I'd need 60 events in GameMode's BP, with most of them going unused.

            I'm not saying it's unachievable that way, I just hardly think it makes much SENSE. The process of completing objectives is generic to the game mode itself, and the specific rules which govern whether each objective is completed are specific to the level. To my mind, that means that Classes which can potentially influence objective completion should report what happens to them to the Level BP (e.g. "My death is listed as relevant to Objective1 and I have died"), the Level BP should translate these notifications into objective completions (e.g. "All 3 actors which must die for Objective1's conditions to be satisfied are dead, so Objective1 is completed) and then pass that information along to the HUD, SaveGame, and/or whatever else needs to know that an objective has been completed.

            Allowing the GameMode to handle it directly is an option, of course, it just means that something which is not generally unique from level to level must either be changed slightly to suit each level or must contain within itself the logic applicable to all levels, neither of which seems like the "Right" way to do it when there's already a perfectly good level-specific BP class right there (being the Level BP)

            EDIT: If you ever played Tony Hawk's Pro Skater you may understand what I'm talking about. Each level generally has the same "rules" for counting down time, calculating score, etc., but in one level maybe you're supposed to grind on 3 fountains and in another level you're supposed to frontflip over a schoolbus, right? Those objectives have rules which are unique to the map itself, though the fact that their conditions have been satisfied and they can be crossed off the list, as well as the visual indicators of their completion both in-game and out, is something which is not unique to the level. So the level needs to handle the "rules" of each unique objective in a way that can convert it into a more generic "completion!" notice for the overall game mode itself. What I'm doing is basically that.
            Last edited by RhythmScript; 04-07-2015, 01:51 PM.

            Comment

            Working...
            X