- back to tutorials

Creating Help Triggers and using the Scale (by Matan)

Making the trigger:

1) Press ~ and then type in $testcheats=1; and then enter this code. Now press ~
2) Enter a level, press F11
3) Press F4 and then press Mission Objects from the menu on the right
4) Now press Mission
5) Press Triggers
6) From the new window that popped up, you can name this Object. For example, name it: helptrig1
7) Press the default button (in the data block row) and then a list of 5 triggers appear. Press Helptrigger.
8) Press OK
9) Press F3. You now see the some numbers and rows on the right. That's the code for the Helptrigger.
10) Drag the new yellow box that is in front of you (the marble) and put it whether you want to. Type in the position and scale (position is where you want it to be activated) and Scale for the size of it. I'll talk about scaling bit later on.
11) Now that you positioned it whether you wanted (dragging the box and pressing the yellow box twice will tell the game that this is the new position and so it will update the position on the right side) and scaled it, you're almost done. Press Apply to save the changes done!
12) Save the level (press Save Game or Save Game As...)
13) Exit the level and exit Marble Blast.
14) Search for the level name (eg, you saved it in Beginner Levels as MyCoolLevel.mis) and open the .mis file with Notepad/TextEdit.
15) Search for the help trigger (since we named it Helptrig1, there's only one thing in the document called like that. Had we not named it, we could've probably needed to find that help trigger from a mass of these things.) and if you didn't name it, search for HelpTrigger.
16) The code for that help trigger is now shown in front of you. For example, here's a trigger I've done in one of my levels:

   };
   new Trigger(helptrig9) {
      position = "11.2511 1309.67 488.801";
      rotation = "1 0 0 0";
      scale = "8.80313 10.9996 1";
      dataBlock = "HelpTrigger";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
   };

Helptrig9 is the only help trigger called like that, so I can always find it easily from the 9 help triggers I had in my level. I have a position set for it and I scaled it in some sort of manner (again, scaling is talked about later!).

17) After the Polyhedron part, press enter and then add this:

     text = "";

18) Now, add something between the inverted commas and in the game it will be the text that the help trigger will display when it is activated (meaning, the marble goes into the box [the help trigger]).
Now you have the full code for the help trigger.
For example, we'll take again the same help trigger from one of my levels, but this time with text written in it.

   };
   new Trigger(helptrig9) {
      position = "11.2511 1309.67 488.801";
      rotation = "1 0 0 0";
      scale = "8.80313 10.9996 1";
      dataBlock = "HelpTrigger";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
         text = "Congratulations for finishing the Advanced level! Think that was hard? You\'ve seen nothing...";
   };

This time, when I go into the box area of this trigger, it will display the text entered. Before the ' the game added \. Don't worry about that and you don't need to type it (\) either. Game does this automatically.

19) Save the .mis file and then enter MBG and enter your level. Now go to the help trigger and you'll see the text displayed at the middle of the screen.

Congratulations! You now made a fully working Help Trigger!

Scaling

OK, so you added your trigger/object. What's that 1 1 1 thing next to scale?
This is to make the trigger bigger than the original 'box' that you have. For example, putting 5 1 1 will increase the size of the box in the X Axis 5 times as much as it was than in the original box's shape (vertically and parallel to the marble). Putting 1 6 1 would increase the size the size of the box in the Y Axis 6 times as much as it was than in the original box's shape (horizontally and in front of the marble). Putting 1 1 10 would increase the size of the box in the Z Axis 10 times as much as it was than in the original box's shape (above the parallel to the marble).
Putting a negative ( - ) in front of a number means that the number (X/Y/Z only) will be backwards. That means, that in -7 5 2, the box will go 7 units negative to its original position on the X-Axis, 5 units positively in the Y-Axis and 2 units upwards (trigger becomes bigger).

For example:

   new Trigger(helptrig9) {
      position = "11.2511 1309.67 488.801";
      rotation = "1 0 0 0";
      scale = "8.80313 10.9996 1";
      dataBlock = "HelpTrigger";

This help trigger has a CENTRAL POINT at 11.2511 units to the right (X-Axis), 1309.67 units at Y-Axis and 488.801 units at Z-Axis. Therefore, since the point is central, everything in the scale is divided by 2 and you got the position from the central point that this trigger is activated (Z Axis remains the same). In this case:

X Axis 6.75 to 15.75
Y Axis 1305 to 1315
Z Axis 488.801

This is the estimate of the activation point, but you get the points of where it gets activated:

from 6.75 1305 488.801 to 15.75 1315 488.801

Confusing? It's easier when you do this IN THE LEVEL ITSELF when the box is IN FRONT OF YOU!

Or we could have this:

   new Trigger(outofbound4) {
      position = "11.934 1168.44 488.301";
      rotation = "1 0 0 0";
      scale = "2 130 3";
      dataBlock = "OutOfBoundsTrigger";

This OutOfBounds trigger has a central point at 11.934 1168.44 488.301 BUT it has these transformations:

X Axis 2 Units
Y Axis 130 Units
Z Axis 3 Units

Therefore, it's the central point, so my trigger is in this box only (if the marble is at a position before or after and the trigger doesn't get activated at all) at:

X Axis 10.934 until 12.934
Y Axis 1103.44 until 1233.44
Z Axis 486.801 until 489.801

So, if my marble is anywhere within these points and I'm going out of bounds (in the InBound Triggers, if you go OUTSIDE the box, you're 'Out of Bounds', while that in the OutOfBounds Triggers, if you go INSIDE the box, you're 'Out of Bounds'. Confusing, but you get the main point.)
So if my marble is at ' 10.6 1100 488.801 ' it is not out of bounds since my Y and X axis are the ones that determine when my marble is going into the box or not in this case. Z axis doesn't do anything in this case. So if my marble is at ' 11.7 1170 490 ' I would still not hit the trigger, but it's directly BELOW ME (notice that I'm at 490, and the trigger is activated at 489.801) so if I fall down, I hit the trigger and I need to start the level again.

Same for the Help trigger, except that if I go into its boundaries, it's activated and so the text appears.

To make InBound / OutOfBounds trigger, do the same as you did in Help Triggers. Just save the level and exit the level and then re-enter it in order to have the changes applied to the triggers to be 'made'; so now that it will have the triggers where they are supposed to be.

Hosted by www.Geocities.ws

1