Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

Little Town - Session 03 - 16 Using Function

4.0K views
•
April 27, 2021
by
GameMaker
YouTube video player
Little Town - Session 03 - 16 Using Function

TL;DR

Learn how to add a NPC prompt function in Game Maker Studio 2 to display prompts when the player interacts with non-playable characters (NPCs).

Transcript

let's implement this new function so we can understand how it all works open your player object and go to its crate event in the variables code block let's add one more line let's type npc prompt equals no one again npc prompt is just a variable that we're making up and we're setting it to no one by default next let's go to the step event and go to... Read More

Key Insights

  • 👻 Adding a new function to the player object allows for the implementation of NPC prompts in Game Maker Studio 2.
  • 👣 The "npc prompt" variable is used to track the state of the NPC prompt and determine when to display it.
  • 🤙 The "pop up prompt" code block checks for specific conditions before calling the "scr_show_prompt" function.
  • 🧘 The "scr_show_prompt" function takes arguments to specify the position and details of the NPC prompt.
  • 🥘 Modifying the y coordinate in the function call allows for customized positioning of the NPC prompt.
  • 🍵 The NPC prompt remains on the screen until further programming is implemented to handle its removal.
  • ❓ The tutorial advises adjusting the positioning of the prompt if desired.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the purpose of the "npc prompt" variable in Game Maker Studio 2?

The "npc prompt" variable is a user-defined variable that is used to track the status of the NPC prompt. It helps determine whether the prompt should be displayed or not.

Q: How is the NPC prompt displayed in Game Maker Studio 2?

The NPC prompt is displayed using a function called "scr_show_prompt" that is called when certain conditions are met. The function takes arguments to specify the location and details of the prompt.

Q: What does the code block "pop up prompt" do in Game Maker Studio 2?

The code block "pop up prompt" checks if the "npc prompt" variable is set to "no one" or "undefined" before displaying the NPC prompt. If the condition is met, it calls the "scr_show_prompt" function with the appropriate arguments.

Q: How is the position of the NPC prompt determined in Game Maker Studio 2?

The position of the NPC prompt is determined by the x and y coordinates of the nearby NPC. In the provided code, the y coordinate is modified to be 450 pixels above the NPC's original position.

Summary & Key Takeaways

  • The content explains how to add a new function to the player object in Game Maker Studio 2 to implement NPC prompts.

  • The tutorial demonstrates adding a variable "npc prompt" and setting a default value for it.

  • The step event is modified to include a new code block called "pop up prompt" that checks for a specific condition before displaying the prompt.

  • The code block uses a function called "scr_show_prompt" with arguments to determine the position and details of the NPC prompt.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from GameMaker 📚

Little Town - Session 03 - 10 Adding Effects thumbnail
Little Town - Session 03 - 10 Adding Effects
GameMaker
Little Town - Session 01 - 22 Object Parenting thumbnail
Little Town - Session 01 - 22 Object Parenting
GameMaker
Little Town - Session 02 - 23 Adding an Audio Emitter thumbnail
Little Town - Session 02 - 23 Adding an Audio Emitter
GameMaker
Little Town - Session 03 - 09 Closing Our Textbox thumbnail
Little Town - Session 03 - 09 Closing Our Textbox
GameMaker
Little Town - Session 02 - 20 Using Variables thumbnail
Little Town - Session 02 - 20 Using Variables
GameMaker

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.