Preface
- Prep Time: ~ 12 minutes
- Cook Time: ~ 0 minutes
- Total Time: ~ 12 minutes
- Can Serve: A LOT of people
Hi guys :3 and welcome to cooking with Wired. Today we’ll make a pseudo waypoint mechanism, which is just fancy lingo for “I made a waypoint using other devices”. I came up with this recipe when thinking about how to let a player “drop” a waypoint at their location. Using standard methods with the waypoint or brute-forcing the problem wasn’t going to work, so I decided to re-invent the wheel waypoint :D!
Ingredients
- 1 coordinates device
- 6 properties
- 2 game overlays
- 1 notification
- 2 triggers!
- 0 waypoints!
Instructions
-
To let a player “drop” a waypoint, we must first find their location. Place down a coordinates device.
-
Check inside the coordinates device and set “Update Properties” to yes. To know where a player was, we must store their location in not only 1, but 2 properties!
-
Now I hope you went grocery shopping because now you have to add two of your properties to the mix. Again, these will store your x and y coordinates, which will be tracked by the coordinate device.
-
Make XPos a number property, have the default value be zero, have player scope, and change nothing else. DO the same for YPos. It’s a coordinate, it’s not going to be text!
-
Go back to the coordinate system, because we’re not quite done yet. We have to know when our coordinates change, so let the device transmit on the channel “ChangeCoordinates” when a player’s coordinates change.
-
Change the “X-Position” and “Y-Position” properties to the properties you placed down earlier, X-Pos and Y-Pos. Your coordinate system should be DONE and its settings should match this image:
What’s next? We’re now constantly storing a player’s coordinates, but the goal is to let a player drop their coordinates and have everyone follow them. So obviously… we need a button on their screen to do that!
-
Add a game overlay into the bowl, and change it into a button via settings.
-
Set the overlay text to “Drop Location” since the player needs to know what the button even does.
-
“When button clicked, transmit on…” Store. Here’s an image of the game overlay’s settings:
-
We now need to add another three properties, which are going to be the stored x-coordinates and the stored y-coordinates, and the name of the player who dropped their location.
-
Name the properties “StoredName”, “StoredXPos”, and “StoredYPos”. For the two coordinate properties, you can just copy and paste the “XPos” and “YPos” properties. HOWEVER, make sure to change the scope of the two properties to “GLOBAL”. We want everyone to know your location, not just one player!
-
For “StoredName”, your name won’t be a number, so it’ll be text! Nothing else should be filled out.
-
Go into blocks and create a new block. Set the channel name to “Store”.
-
Place down these blocks:
This makes it so that your current location is set to a property and fixed. Then it also finds your name. Just be glad this isn’t real life
Okay. So we’ve been able to constantly track the coordinates of every player in the game, and store the coordinates and name of players who choose to drop their coordinates, but we’re missing the key point - the waypoint mechanism!
So what does a waypoint do? A waypoint shows up on your screen:
and shows you the distance in meters to a point and the direction you need to go. So it has direction and magnitude.
Well, that’s figured, we’ll next notify the player that a location has been dropped, tell them how far they are to that location, and if they need to go up, down, left, or right to get there.
-
Open a box of notifications, take one out, and don’t edit any of its settings.
-
Create a block (select the first option) that runs when receiving on channel “Store”.
-
We need to send a notification (the block imma show is in “For this Device” btw) so place down these blocks:
This is what the notification looks like in-game:
-
Now, we will activate a game overlay that says how far you are from the waypoint and what direction you need to go. But first, we need to put one down!
-
Put the overlay in the top right and set the content scope to “Player”. Set “Visible on Game Start” to no. Set it so that it shows when receiving on channel “Store”. Why would a player need to see the overlay if there’s no dropped location?
Quick intermission: You might be wondering when the overlay is closed? And to be honest? I don’t know when. You can make that part yourself and decide when you want the overlay to stop showing.
- Place these blocks down when receiving on channel “ChangeCoordinates” (there’ll be an explanation):
What is this? This is the distance formula, a way to find the distance between two points on a plane. The formula looks like this:
You don’t need this many variables, but I had a hard time troubleshooting and making sure everything was right.
Now to find the direction that you need to go?
-
Place down a property named “RequiredDirection”. It’ll be a text property.
-
Place down a trigger that is triggered when receiving on channel “RequiredDirection”.
-
Add a block to the trigger and place down these blocks:
So this looks like a lot, but it’s really just doing a few checks. For example,
If my x-coordinate is 304, but the dropped coordinate is 310, 304 < 310 meaning I have to go right.
UH OH, we hit the block limit! Well, that’s okay because we can just broadcast a message on a channel and continue our block code over there! Let’s place down another trigger, and make it trigger when receiving on “Left”.
- Place down these blocks in the next trigger:
- GO all the way back to the game overlay and add this to the blocks:
…And you’re done! This system has kind of a rough texture, which has not really what I was hoping for, but I guess I just suck at cooking.
Author’s Note
And there you have it! The first Cooking with Wired.
How should I say this? I am so incredibly sorry for how this turned out. By the end of the guide, finishing it was just… a chore. Not fun at all.
Hopefully in my future recipes I can uh… do better. But I first need feedback from you! Feel free to be as mean as possible as long as you provide constructive criticism. Just kidding. Kind of.
Oh yeah here’s it all:
Merry Christmas Eve y’all, and don’t stop cooking :D
Signing off now. Seeya next time!