file Tutorial: Gravity Point Triggers

  • HiGuy
  • HiGuy's Avatar Topic Author
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1333
  • Thank you received: 604
11 Nov 2015 20:09 - 11 Nov 2015 20:17 #1
MBP 1.60 added some new triggers from PQ, but I don't believe they're documented anywhere. I'll be making a few guides in the near future on how to use them; let's start with the easiest trigger: the Gravity Point Trigger.

GravityPointTriggers create spherical gravity. If you play "Sphere Plates" (in MultiPlayer / Hunt / Custom) you can get a basic idea of this effect. For this tutorial I will be using this simple Sphere and Ring map:


GravityPointTriggers can be found in the level editor, under Mission Objects -> Mission -> Trigger. Make sure you have the right datablock.


[hr]
Inside/Inverted Gravity Triggers

After sizing your trigger to fit, play with the values. Here are the values I used:
  • Since this first trigger will provide inverted spherical gravity (i.e. you roll on the inside of the sphere, rather than the outside), I set invert to 1.
  • Additionally, I know that the center of my sphere is (0, 0, 5), so I set customPoint to 0 0 5 to ensure that we orbit the correct point.
  • I know the radius of my sphere is 5 units, so I set RadiusSize to 5 and useRadius to 1. If you only have one global trigger, you can skip this.
[img]http://i.imgur.com/K4kz1cD.jpg/img] Now that I've finished customizing your trigger, all that's left is to save and reload the mission. And look, I'm on the inside of a sphere! [img]http://i.imgur.com/wHyBfxu.jpg[/img]

[hr]
Normal/Outside Gravity Triggers

I created another GravityPointTrigger for this map in exactly the same way as I made the previous one. There are a few differences in the options I use, though:
  • Since this trigger will be for the outside, I leave invert at 0.
  • Additionally, I know that the center of my sphere is (0, 0, 5), so I set customPoint to 0 0 5 to ensure that we orbit the correct point.
  • I want players to be able to jump out of the gravity region and onto the platform. To enable them to leave its field, I set UpDownLeave to 1 and useRadius to 1. If a player leaves the radius of the trigger with this enabled, their gravity will automatically snap to either straight up or down depending on which side they're closer to. You can skip this step if you don't want them to be able to leave your sphere's gravity.
  • I know the radius of my sphere is 5 units and I want to have 3 units of extra space around the sphere so players won't fly off if they jump, so I set RadiusSize to 8.


Now I just need to save and reload the mission. And here we have a fully working sphere:


And if I jump off and land on the platform, my gravity resets automatically. Neat!

[hr]That's just one of the triggers that we added in MBP 1.60. I'll make more guides soon for using the rest. Let me know if you have any questions about what the triggers can or cannot do.

If you want to download the level shown in this post, you can find it here .

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
Last edit: 11 Nov 2015 20:17 by HiGuy.
The following user(s) said Thank You: Jeff, Kalle29, Technostar, Weather, Evokrypt

Please Log in or Create an account to join the conversation.

  • Technostar
  • Technostar's Avatar
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • I Factorial
  • Posts: 116
  • Thank you received: 40
11 Nov 2015 23:18 #2
Great tutorial! This will be really useful for new levels, but I would recommend to level builders that you don't have too many orbital challenges using this, as levels like that can be long and challenging (Orbital, for instance).

System.out.println("Hello");

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 0.788 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.