Blockland Files > Game Modes

Pizza Delivery Gamemode

(1/7) > >>

Farad:

DOWNLOAD GAMEMODELast Update: November 27, 2016
Unzip the downloaded file. It contains two folders: Add-Ons and Music.
Move everything inside the Add-Ons folder to your blockland Add-Ons folder.
Move everything inside the Music folder to your blockland Music folder.

This gamemode is designed to satisfy your desire to deliver pizzas while competing with co-workers for money and survival. I could describe the amazing code that makes it work, but I don't want to bore you (yet). Just enjoy delivering pizzas and avoiding explosive death. There are four modes within this gamemode: Golden Pizza, Explosive Pizza, One for One, and One for All.

Make sure to say /help when you get started; this will provide info on how to use the compass to find your customer, the goal of each mode, the different vehicles you can unlock in the store, how to view player stats, round info, music selection, and map commands.

Player stats are saved, so you can restart your server and everyone should still have their money, car selection, etc. The gamemode is meant to be played with several players, but it's possible to play solo. If you read all of this short text, you deserve a secret command; say /color to set the color of your vehicle.

You will need to know how to use the compass, described below:

More info can be found HERE
About the codePizza delivery gamemode is based off of the default speedkart gamemode script; when I first got started, I copied/pasted all of the speedkart gamemode because it had things I needed like a round system and map rotation. Next, I began thinking about how pizzas could be delivered. The best method I found was to make a stationary bot inside of a 16x cube zone brick; I modified the zone script so that when a vehicle enters, several things happen: it checks if the player is the deliverer to the bot within the zone, makes the bot play one of several randomized animations and sounds, gives the player money, and sets the player's next delivery location.

To implement this pizza-delivering system of zones and bots, I needed to link bot spawn bricks with their 16x zones; to do this, I named each zone and bot spawn with corresponding numbers - for example, "bot1" goes with "zone1," "bot2" goes with "zone2," and so on up to however many delivery locations you decide to have. When the gamemode launches and when the map switches, it waits for all bricks to load and then checks through every brick, searching for names that begin with "bot" and "zone." If it finds a match, it will take note of the brick's ID and add it to a list. There are several other important bricks that the gamemode defines using this method: pizza pickup zones, starting gates, starting clocks, and vehicle spawns.

Another part of the script that I think is interesting is how it decides the amount of money players earn for each delivery. To make it as fair as possible, I made each delivery worth an amount proportional to the distance from the previous delivery location to the next delivery location; for your first delivery, the amount you earn is proportional to the distance from your spawn to your first delivery location. I might add a feature in the future that awards more money for faster deliveries.

The last thing I want to mention is how the explosive pizza is transferred from one player to another. First, the script defines a global variable for the bomb carrier. Every 33 milliseconds, it checks if there is a player near the bomb carrier and it checks if there are any bricks between the two players by firing a raycast from the bomb carrier toward the closest player and seeing what it hits first. If there are no bricks in the way, the bomb transfer process begins. At this point, the bomb is deactivated for 4 seconds to prevent it from instantly being transferred back to the original bomb carrier, an animation plays on both the bomb transferrer and acquirer (mounting the pizza image to their hands, lifting the hand, lowering the hand), a sound plays to the server, and 4 seconds later the bomb is re-activated so it can be transferred again.

Pretty sweet code right?

Making this gamemode has provided useful insight on how to make a game interesting or engaging. The most important factor seemed to be keeping the gameplay as stimulating as possible; it helps a lot to have custom sounds, player/group interaction, and explosions or other visual spectacles. It also seems important to have a 'slow' period in the gamemode when players take a break from the action - round transitions usually accomplish this. Pizza delivery gamemode is still far from perfect.

Credits
Whirlwind (idea guy)
Wehrmacht (build)
Filipe1020 (vehicles)
Armageddon (compass script)
Cowboy Dude (idk, moral support)
Faraday (programming)

gr8dayseth:
hohohoooo sweet

gr8dayseth:
holy stuff this is very well done and fun even just in singleplayer
like this is something i'd expect from a really popular server but never really given out like this
good job to those involved and thanks for releasing it dude

Farad:

--- Quote from: gr8dayseth on November 19, 2016, 11:37:30 PM ---holy stuff this is very well done and fun even just in singleplayer
like this is something i'd expect from a really popular server but never really given out like this
good job to those involved and thanks for releasing it dude

--- End quote ---

Thanks! Let me know if you find any bugs. I know there are a few, but they shouldn't be game-breaking.

rggbnnnnn:
You are the kind of person that keep me playing this game. Thanks for actually releasing what you've made!

Navigation

[0] Message Index

[#] Next page

Go to full version