blueprint

Paperboy BP_BlackHouses 210260

  • Exposure: public
  • UE Version: 5.0

TobiyC

January 18, 2023, 2:35 pm

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v

1 comment

  • TobiyC

    January 18, 2023, 2:35 pm

    One of the more complex blueprints. It is used to replicate the feature of the original Paperboy, in which damaging multiple objects on a single Black House would yield a gradually higher score. Hitting one object on a Black House gives 100, hitting two objects gives 100 & 125, hitting three objects gives 100 & 125 & 150, and so on up to 225.

    To recreate this, each breakable object on each black house is a separate blueprint, but all feature near-identical blueprints, so I'm only showing one example. Each blueprint also has the score bubbles from 100 to 225 placed directly above the blueprint's location.

    The first thing that happens in the blueprint is all those score bubbles from the start of play, as they only need to be visible when the object is hit. The comment stating "Make any Score Symbols Invisible from BeginPlay" is where this happens. There is an instance editable actor variable corresponding to each score bubble. "Score100" is tied to the bubble with 100 written on, "Score125" is tied to the bubble with 125 written on, and so on. Additionally, the broken object sprite that appears when hit is also set to be invisible from the start of play, this is what "Object to Appear" is.

    The collision of the blueprint is set to only overlap with the Newspaper blueprint. When a Newspaper does overlap, the broken object sprite immediately becomes visible, such as a window becoming broken.

    Next, a branch node located in the comment "Make different Score Symbols Visible, and increase BreakageBonus Score, depending on BrokenObjects Variable" detects what the "Broken Objects" variable is set to. The variable is a simple float variable that is set to 0 by default. The first branch detects if the variable is currently set to 0. If this is true, an Event Dispatch ending in "SetObjects1" will be called, followed by the '100' score bubble being made visible, then invisible again after 1.5 seconds, and finally, the blueprint will destroy itself so it can't be activated over and over.

    The Event Dispatch ending in "SetObjects1" is received in the BP_BlackHouseHub blueprint. What happens in is the Hub blueprint will detect the Event Dispatch has been activated, then send out two more Event Dispatches. The first Event Dispatch simply goes to the BP_BreakageBonus100 blueprint, which adds 100 points to the Breakage Bonus score.

    The second Event Dispatch is sent out to ALL instances of a BP_BlackHouse blueprint tied to a specific house. For example, on house number 110, there are 8 unique breakable objects. The Dispatch will be received by ALL 8 of these blueprints. In the above example, this Dispatch can be seen as "H6 Set Objects 1" in the comment at the start labeled "Receive Event Dispatchers from Black House Hub to set BrokenObjects Variable." All this Dispatch does is set the "Broken Objects" variable to 1, for all BP_BlackHouse blueprints on house number 110.

    The reason it's important to set the "Broken Objects" variable to 1 for all BP_BlackHouse blueprints on house 110 is the branch from earlier. What the first branch does is check if the "Broken Objects" variable is set to 0. If it is, instead, set to 1, the branch will register as false. When this happens, the blueprint will go to a second branch, this time checking if the "Broken Objects" variable is set to 1. If it is, then the same process from earlier will play out. An Event Dispatch will be called, which gets received by the BP_BlackHouseHub blueprint, and a score bubble is set to become visible, become invisible after 1.5 seconds, then the blueprint destroys itself. The key difference, however, is the Event Dispatch this time ends with "SetObjects2", and the score bubble that becomes visible is the '125' score bubble.

    In the BP_BlackHouseHub blueprint, the exact process as before plays out, but is instead triggered by the "SetObjects2" Dispatch. Two more Event Dispatches are sent out, the first being received by BP_BreakageBonus125, adding 125 points to the player's Breakage Bonus score, and the second Dispatch is again sent out to all instances of the BP_BlackHouse blueprint tied to house 110. In the example above, the Dispatch is called "H6 Set Objects 2", again in the "Receive Event Dispatchers from Black House Hub to set BrokenObjects Variable" comment, and what this does is set the "Broken Objects" variable to 2.

    By now you can see how the process repeats. If the "Breakage Bonus" variable is set to 2, the first two branches will register as false, but the third will register as true, sending an Event Dispatch to the BP_BlackHouseHub blueprint and making a '150' score bubble appear then disappear, with the BP_BlackHouseHub blueprint sending two more Event Dispatches out, one to BP_BreakageBonus150, and one back to all BP_BlackHouse blueprints tied to house 110, raising the "Breakage Bonus" variable by one.

    This system is complex, but works fantastically well, as it means if you hit one window on house 110, you'll receive 100 Breakage Bonus points and see a '100' score bubble appear, and if you then go on to hit a second window on house 110, you'll receive 125 Breakage Bonus points and see a '125' score bubble appear. This is what happens in the original Paperboy, and I have managed to recreate it in my project.