Browse tags

10/11/16

SnapMap Tutorial #1 - Interactibles as 'Shops'

Waddaya buyin?


We're now starting a slew of tutorials for SnapMap! Hope you keep watch over this blog, as I will be posting updates. I can also make SnapMap tutorials over on YouTube, but I'm still working on the general look and feel of the videos.

When I started playing SnapMap, I noticed a lot of Surival-themed maps that centered around gathering points for players and shops. Which raised the question: how do I make shops a la Call of Duty: Zombies?

For this tutorial the scenario would be: 
Making a shop that dispenses ARMOR if the player has enough credits, otherwise it tells the player to get more credits.

The Ingredients


  • The shopping counter. A trigger - Volumes, Interactibles, or even Player Input (if you wish to have a shop you can 'carry around'). I find Interactibles to be the best, but you can use Volume Triggers as well. Personally, if I'm purchasing weapons, I go with the Volume Triggers; Interactibles are reserved for Health/Armor/Ammo/Powerups.
  • The cashier. A resource - Player Resource or Team Resource. This is our backbone for purchasing stuff. I use Player Resource if individual players are claiming resources (cash) on their own pace, like most multiplayer games with an economy system.
  • The item to sell. Whether it's Inventory, Vitals, Pickups... it's all up to you. Pickups can be spawned or given directly, same with ammo/health/armor (and any modifiers). You can even have obstacles clear out, doors open, friendly Demons spawning...
  • The bells and whistles. Finally, some audiovisual cues - you can use Messages, World Texts and/or FX, in combination with 2D/3D Speakers or announcer Speakers. Or use CalloutsTechnically speaking you can use any object you can find, as long as you get the effect that you want, so get creative! I would suggest avoiding World Texts though, as they add about 0.40% towards your Objects cap.

Minding the store

1. The storefront. You want a shop that attracts customers, right? Let's do one that easily catches the eye:


I'm pretty sure that terminal sells armor.

We used a Tripod Panel on this one so that we can add texts inside the panel, instead of just having a button. Saves us time and precious resource counts!

If you're curious, here's the properties:


Make sure that Allow Reuse is set to True, otherwise, 
whether the transaction succeeds or not, 
we will not be able to use this again.

Now, time to put our shop to work.

2. Working with Player Resource. Let's now put the Player Resource in, and node it to our Panel with input On Used and output Spend:


Align it well, or you'll be in debugging hell.

So every time we use the Panel, we will be spending Player Resource. The amount spent will be based on the Spend output properties. Any amount will do, but for this example, let's set it to 500:


You can assign a Variable to the value, if you want it to scale 
(or offer discount) after certain conditions are met.

3. Successful purchase. Now, we press "G" on our Player Resource variable, and select the input On Spend Resources Succeeded:, and node to the Vitals with output Give Armor:

Remember: Vitals for HP/Armor, Inventory for shooty stuff.

We want our armor to be completely restored, so we adjust the properties of our Give Armor output:


Amounts are almost always adjusted in blue Output nodes. 

4. Insufficient funds. What if the player doesn't have enough resources? That's where the other output, On Spend Resources Failed, will come into play. Simply link it from our Player Resource to a very obvious object: the almighty Message.


I'll be subtle here, and not rub this in people's faces when they can't 
afford what I offer. Of course, there's fun in the opposite approach too!

Then we just set our Message, and that's it!

And our finished product:





Final Notes

  • You can add and change variables to whatever suits your liking, but be sure to take in mind your Objects and Network limits!
  • You can scale the amount of resources to spend for every successful purchase by linking On Spend Resources Succeeded with a Variable (Integer or Number) via Add, setting the amount to increase on the output, and using the Variable as the resource amount to spend on our earlier output Spend.
  • Volumes have a better degree of freedom, since the Interactibles are so limited in terms of visuals and function.
Thank you for reading and as always, I hope you have fun mapping!




No comments:

Post a Comment