Skip to main content

Hammer Girl Week 2

Hammer Girl Week 2


Creating NPCs and adding a Quest Giver.

As usual, we need to create another actor blueprint for our NPC and add a skeletal mesh (because this is a character with animation we don't use the static mesh option) with a custom collision box that overlaps all except the player pawn.


Moving onto the variables section we need to create a variable for each piece of information we want the NPC to take notice of. For a helpful tip, we can change 1 variable to an array of information without having to create an enumeration blueprint, to make a single variable an array right click on the little pill-shaped icon and left-click on the 3x3 grid of squares. This allows us to create multiple lines of dialogue for our NPCs without having to create 1 text variable for every line of dialogue or an enumeration blueprint for all the lines of dialogue, this way everything is stored inside the single NPC blueprint file.




Now is the time to make the NPC talk and program their animations. To start off in the event graph create the event begin play node and connect it to a play animation node then make sure to select the correct idle animation file in the animation nodes drop-down menu.



Setting the Text to say and duration. Here I use the blueprint event graph and variable I made earlier to decide what text the NPC will say to the player and how long they will say it for. Start by adding an overlap event from the collision box and then casting to the player blueprint (Hammer Girl) and setting the player in range variable to true and ending with a branch node.


With the Branch node ready we can start programming the speech selection functions for our NPC. For the false Execute pin, you can simply call upon the custom event "stop talking" and that's that, however, the true execute pin is where this section of code gets a little long. First, call the custom event "Talk" then set the text of the "Text Render" component using the value contained in the "Speech" variable array. Adding the "Line Duration" variable to a get reference node (drag from speech pin "Get (ref)") will inform the engine how long each corresponding line of the speech array needs to be active. Next use the set hidden in-game node to change the hidden status of the text render component (this should be set to hidden by default then revealed when the player gets in range of the NPC) and add a delay node but use both line duration and line select variables as the value of the duration pin for the delay node. 


After the delay node, we want to add two integer variables together and set that value as the condition for our next branch node. You can retrieve both the ++ and <= nodes by dragging of the get line duration pin and typing in those respective symbols. 


At this stage set the 1st branch true pin to the custom event "Continue Talk" and create a 2nd branch node off the false pin of the 1st branch node, the condition of the 2nd branch should be the loop speech variable. moving forward with the 2nd branch node true pin we want to set the value of the line select variable and add the custom event "Continue Talk" again. Finally, we want to add the custom event "Stop Talk" to the False pin of the 2nd branch node then set the text render component to hidden in-game once more, this way the text will disappear from the screen when the player leaves the collision box. 


Quest Giver Code.

A Quest Giver is a type of NPC that will give the player missions to compete and because there is so little difference we can duplicate the NPC work we did earlier and add a small new section of code. This new section of code will require different variables then the standard NPC blueprint so be sure to add those now.





Comments

Popular posts from this blog

Guest Lecture #1 - 21/09/2022 - Secret Mode

Guest - Joshua Garrity, Head Game Scout at Secret Mode Guest Bio Joshua started as a product Manager in the marketing department. Joshua was in charge of digital publishing for Fireshine. Attending public events like Gamescom not only allowed him to network his way into the position as Head Scout at Secret Mode but is also a method he uses to accomplish his job by seeing new indie projects in beta stages at these events. Takeaway #1 – How to Pitch my projects Scouts and Studio CEOs will be travelling often and walking around both Hotels and event centers, so  you  need to be able to pitch your project anywhere at any time. This means your presentation needs to be smooth, quick, and confident, when talking with scouts, CEO, or other representatives you need to answer their questions (without checking notes) and speak honestly about what your team has done and what it will cost for your studio team to do more. Takeaway #2 – What Do Game Scouts Get Up to Game Scouts in their day-...

Guest Lecture #4 - 19/10/2022 - 10:10 Games

  1st Guest Bio - Bart Kosciolek, Junior Animator @ 10:10 Games Jfjdiejdjd 2nd Guest Bio - Reece Hewitson, Junior Games Developer @ 10:10 Games skdjalskjdlkasjd Takeaway #1 - Determination As an applicant trying to get into the industry I will be rejected many times due not being the correct fit for studios I am applying for, be it not enough experience or not the correct style of work for how the studio does things. I need to not let this deter me.  Takeaway #2 - Networking The video games industry is still very young (in business terms/years) and still very small (in one sense), while a single title is a product of many peoples work all put together those people often split after projects have been finished and they will end up working on other projects at other studios and this results in "everyone knows everybody" where you can say a name in conversation with a new co-worker and they'll reply with "oh yeah I know (name) I've worked with them on this project. ...

Guest Lecture #2 - 05/10/2022 - Rebellion Games

  Guest - Peter Dimitrov, Environment Artist @ Rebellion Games Guest Bio Peter enlightened us and told us his day-to-day while he worked on the 1st DLC project for Sniper Elite 5, as a environment artist Peter worked with another level designer to develop and refine the flooded map level that the 2 of them had been assigned to.  Takeaway #1 - Working with limitations      Both Peter and his co-worker had to stick to a schedule where sections of the map needed to be                   done to a specific deadline, the white box version needed to be done within a certain time limit,                   changes could not be made once the art pass had started, the map needed to include certain features like      ditches and a spot for a supply train to run through. The map itself went under many changes before         ...