Author Topic: The BETC Project (BETC Only)  (Read 19141 times)

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
The BETC Project (BETC Only)
« on: September 04, 2009, 12:05:46 PM »

This is reserved for the BETC. It will remained locked. If you wish to sumbit any questions, comments, suggestions, ect., please go to the other BETC thread.
« Last Edit: July 24, 2013, 07:11:26 PM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #1 on: September 04, 2009, 12:07:08 PM »
This is the online version of the BETC hosted on the Scattered Space Forums.

This is the home of the original BETC. All other copies came from this one.

Boom's
Event
Training
Center

I hope you find the BETC as a good event resource. If you have any question you would like to ask, want to know how to do something, or just want me to do something for you that is Blockland related, either post it in the Comments and Feedback thread, or PM me.

To read the BETC that is hosted on its own webpage, go here.
« Last Edit: December 05, 2009, 05:51:15 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #2 on: September 04, 2009, 12:08:36 PM »
BETC

Written By: Boom

Version 0.54

===== Table of Contents =====

I. Prints (Not the Print Block)
   A. Print Types
   B. Hex Codes
   C. Changing Font (Text and Size)
   D. Basic "<>" commands
   E. Advanced "<>" commands
   F. Other


II. Buttons
   A. Non JVS Buttons
   B. JVS Buttons


III. Switches
   A. Non JVS Switches
   B. JVS Switches
   C. Advanced Switches (VCE)


IV. Doors
   A. Non JVS Doors
   B. JVS Doors


V. Useful
   A. Delays
   B. Relays
   C. Command Explanations
   D. Print Blocks


VI. Tutorials (Like making a pong game.)
   A. Basic Tutorials (No Delays, Relays, Named Bricks, or VCE)
   B. Delays, Relays, and Named Bricks
   C. Mixed Tutorials (Non-VCE)
   D. VCE Tutorials
   E. Advanced Tutorials (Uses all media)
   F. Other Tutorials


VII. VCE
   A. Introduction
   B. Values
   C. Variables
   D. Functions
   E. Saving/Loading Variables
   F. Using retroCheck
   G. Using onVariableUpdate and Varlinks


VIII. Credits
   A. Main Authors
   B. Helpers
   C. Special Thanks


IX. Change Log
   A. Versions 0.01 - 0.29
   B. Versions 0.30 - 0.39
   C. Versions 0.40 - 0.49
   D. Versions 0.50 - 0.59
« Last Edit: February 01, 2012, 07:05:13 PM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #3 on: September 04, 2009, 12:10:52 PM »
I. ===== Prints =====

--- A. Print Types ---

   Bottom Print - Displays a print near the bottom of the client's screen.

   Center Print - Displays a print in the center of the client's screen.

   Chat Message Print - Displays a print in the Chat Box in the top left part of the client’s screen

   Bottom Print All - Displays a print near the bottom of the clients's screen that are in the mini game
   of the player who activated the event.

   Center Print All - Displays a print in the center of the clients’ screen that are in the mini game of
   the player who activated the event.

   Chat Message Print All - Displays a print in the Chat Box in the top left part of the clients' screen
   that are in the mini game of the player who activated the event.

--- B. Hex Codes ---

   Hex Codes tell Blockland what color you want your text to be. It consist of 6 or 8 letters or numbers
   (Because Blockland normally uses the 6 character RRGGBB format, I will explain that one first.)
   that relate to three colors, red, green, and blue. To fully understand it, it's good to know that these
   colors are the primary colors of light, while red, yellow, and blue, are the primary colors of art.
   To make yellow with light, you mix red and green. Knowing this may
   help resort back to your comfortable set of the art primary's.

   A Hex Code looks like this, "FFA500" this happens to be the Hex Code for Orange. The first two letters,
   "FF" handles the color red. The third and fourth letters, "A5" handle green. The last couple of letters,
   "00" handle blue.

   A Hex Code uses numbers 0-9, and letters A-F*. To determine the color of a Hex Code, you must
   understand it somewhat.

   *-The letter "G" has been seen in very few Hex Codes. The letter "G" as being the value of 16
      is considered a myth. No valid Hex Codes have been seen using the letter "G".

   Here's the technical jargon, it's okay not to get it. First off, you must convert the decimal RGB value
   to a hexadecimal. Converting a decimal RGB value to a hexadecimal value is fairly straightforward. 
   RGB values are usually given in the 0-255 range; if they are in the 0-1 range,
   the values are multiplied by 255 before conversion.
   This number divided by 16 (integer division; ignoring any remainder)
   gives us the first hexadecimal digit (between 0 and F,
   where the letters A to F represent the numbers 10 to 15.).
   The remainder gives us the second hexadecimal digit.
   For instance the RGB value 201 divides into 12 groups of 16,
   thus the first digit is C. A remainder of 9 gives us the hexadecimal number C9.
   This process is repeated for each of the three color values.
   Most modern operating systems have a built-in calculator to perform
   conversions between number bases and this can also
   be done with some hand-held calculators.

   Here's the non technical jargon. (This is completely inaccurate, but helps you understand.)
   Think of the numbers 0-9. Now think of A-F being 10-15. Thus, you have 0-15.
   To make a Hex Code in RRGGBB format, think of 00 being none, and 1515 being full.
   To determine a value, use my method. A single digit number (0-9) controls 0-9. (Easy, right?)
   A single digit in the ones place determines part the ones.
   A single digit in the tens place determines part of the tens.
   A double digit (A-F a.k.a. 10-15) in the ones place determines part of the ones, and part of the tens.
   A double digit in the tens place determines part of the ones, and part of the tens.
   Think of 00 Being, 0000. The first 00 as the tens, and the second 00 as the ones.
   So, 91 = 91, 27=27, 32=32.
   And, A0=100, 0A=010 (10), A5=105, 5A= 500
   Therefore, AA= 1010, FF=1515, AB= 1011

   If all else fails use a Hex Code Chart until you understand it.

   Here is a list of some commonly used Hex Codes:

      Black:   000000
      Blue:   0000FF
      Red:   FF0000
      Green:   00FF00
      White:   FFFFFF
      Dull Green:   008000
      Yellow:   FFFF00
      Purple:   800080
      Orange:   FFA500
      Hot Pink:   EEA2EE
      Gold:   FFD700
      Silver:   C0C0C0
      Light Gray:   A0A0A0
      Gray:   808080
      Dark Gray:   606060
      Pink:   FFC0CB
      Magenta:   FF00FF
      Cyan:   00FFFF

   There are an infinite combination of Hex Codes.
   (Well, really there are 16,777,216, but seriously, who cares?)
   Feel free to experiment with Hex Codes, search online for a Hex Code Chart, or use one of the charts
   in the links provided.

   To implement a Hex Code into a text, type "<color:xxxxxx>" before the text that you wish to color.
   The "x"'s take the place of the letters and numbers of Hex Code.
   For example:

      <color:FFFFFF>Hi there.
   
   This would display "Hi there" in a white text.
   Here an example of a multi-colored text:

      <color:FFFFFF>This is a print example by: <color:FFFF00>Boom <color:FFFFFF>.

   This would display "This is a print example by: " in a white text, "Boom" in a yellow text,
   and the "." in white.
   Doing this would make "Boom" stand out. This can be used for color coding things.
   While multi-colored text can look nice, over using it may lead to confusing the reader,
   and a big mess. Be wise with your colors.

   You can experiment with mixing and matching colors on your own.
   Think of it as light, white light is all the colors combined right?
   Therefore, FFFFFF results in white, and 000000 results in pitch black.

   Hex Codes do not work if you type it in the Chat Box,
   but does work if you use a ChatMessage(All) event.

   Color Tester (Great Resource)
   Color Table (Easy to use, Easy to Print)
   Color Table 2
   Color Table 3

--- C. Changing Font ---

   To change the type of font, type <font:xxxx:xx> before the string of text that you wish to change.
   In the "<>" code, the first set of variables handles the font type.
   The second set of variables handles the font size.
   Unlike Hex Codes, the font size only supports numbers. These numbers can range between 1 and 99.
   Here is a list of the supported font types:

      Arial
      Apple Bold
      Arial Bold Italic
      Arial Bold
      Blackadder ITC
      Calibri
      Comic Sans
      Comic Sans MS
      Heveltica
      Impact
      Jokerman
      Kristen ITC
      LCD
      Lucida Console
      Lucida Sans Unicode
      Monotype Corsiva
      Outlineletters
      Outline
      Palatino Linotype Bold
      Palatino Linotype
      Papyrus
      Pussycat
      Size
      SoulMission
      Symbol
      Tahoma
      Times New Roman
      Trebuchet MS
      Unicode
      Veranda
      Verdana Bold
      Webdings
      Wingdings

--- D. Basic "<>" Commands ---

   <color:xxxxxx>   :   Changes the color of the text. (See Hex Codes)
   <br> :   "The Enter Key" Continues the following text below the previous text.
   <font:size:xx>   :   Changes the font size. (Replace "xx" with the number of the desired font size.)

--- E. Advanced "<>" Commands ---

   <bitmap:x/x/x/x/x/x/x/x/x>   :   Displays a bitmap image. Each "x" is the name of a file folder,
                                                 starting in the Blockland folder. The last "x" is the actual file.

   <a:hyperlink>   :   Creates a hyperlink. The URL replaces hyperlink (Do not use http://). The text after
                               the hyperlink becomes the link. "<a:www.scatteredspace.com/forum/index.php?
                               topic=346.0>The BETC" would create a link sending you to the BETC. Note: This
                               only works in chat messages. To end the hyperlink, use </a>.

--- F. Other ---

   Character Limit:
      There is a 255 Character Limit.
      "<>" Commands are included in this count.
« Last Edit: July 22, 2012, 09:48:14 PM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #4 on: September 04, 2009, 12:12:26 PM »
II. ===== Buttons ======

--- A. Non JVS Buttons ---

   Non JVS Buttons are one of the most simple things there is.
   A plain old Non JVS Button is just a simple "onActivate" command,
   but I'm going to cut to the chase for something better than ordinary.

   First off, a button does only one thing. If it does more,
   I consider it either a Switch, or a Dynamic Button.
   I'll do a simple size changing button just to show you
   how simple this really is.

   Okay, here's the logic:
      Button - onActivate
      Changes player size - SetPlayerScale

   Wow, not hard, right?

   Here's the easiest code ever:
Code: [Select]
[X] 0 [ ] onActivate -> Player -> setPlayerScale -> [I---------]
   This simply makes you small.
   Because I prefer taking simple things to the point of confusion,
   I'll add some more things.
Code: [Select]
[X] 0 [ ] onActivate -> Player -> setPlayerScale -> [I---------]
[X] 1 [ ] onActivate -> Client -> centerPrint -> [<color:FFFFFF>You clicked the button.]
[X] 2 [ ] onActivate -> Self -> setColorFX -> Glow
[X] 3 [100] onActivate -> Self -> setColorFX -> None
[X] 4 [33] onActivate -> Self -> playSound -> error.wav

   And there you have it! A simple button.

--- B. JVS Buttons ---

   Yet another simple concept. This one is only slightly harder,
   but allows much more things to come of it.

   First off, "onActivate" can be used for doing things, but shouldn't.
   This is because if you do an "onActivate -> Self -> contentStart -> TrustLevel2 -> [ ]" event,
   an "onContentStart" would event would only play if the person
   toggling the event had full trust with the creator of the button.
   An "onActivate" event would work no matter what.

   Secondly, pretty much all event that you would need are set up for you already.
   All you need to do is one, add what you want to happen with an "onContentStart"
   beginning, and change the default red prints. You don't have to change the prints,
   but just by putting "<color:FFFFFF>" at the beginning of all of your prints can actually
   make you seem more experienced than others.

   If you don't seem to grasp the concept by now,
   I'll simply convert the old Non-JVS Button example into JVS format.

   Okay, here's the logic:
      JVS Button - onContentStart
      Changes player size - SetPlayerScale

   Still not that hard, right?

   Here the first snippit of code.
Code: [Select]
[X] 0 [ ] onContentStart -> Player -> setPlayerScale -> [I---------]
   Now, a JVS button already comes with the events needed,
   so you would just add the event above and you would be done,
   but I will continue as if no default events were given.
Code: [Select]
[X] 0 [ ] onContentStart -> Player -> setPlayerScale -> [I---------]
[X] 1 [ ] onActivate -> Self -> contentStart -> TrustLevel3 -> [ ]
[X] 2 [ ] onContentStart -> Self -> contentStop -> Unrestricted -> [ ]

   Right now, the button works, but we still need sound.
   Remember that if someone is not you (TrustLevel3),
   they can not use this button. If they are not you,
   which they shouldn't be, you would use an "onContentRestricted"
   event so that they know that they can't press it.
Code: [Select]
[X] 0 [ ] onContentStart -> Player -> setPlayerScale -> [I---------]
[X] 1 [ ] onActivate -> Self -> contentStart -> TrustLevel3 -> [ ]
[X] 2 [ ] onContentStart -> Self -> contentStop -> Unrestricted -> [ ]
[X] 3 [ ] onContentStart -> Self -> playSound -> [Sound]
[X] 4 [ ] onContentStop -> Self -> playSound -> [Sound]
[X] 5 [ ] onContentRestricted -> Self -> playSound -> [Sound]

   Now the button "clicks" and buzzes if a person without Trust Level 3 presses it.
   Now to add some nice little "centerPrint" events.

Code: [Select]
[X] 0 [ ] onContentStart -> Player -> setPlayerScale -> [I---------]
[X] 1 [ ] onActivate -> Self -> contentStart -> TrustLevel3 -> [ ]
[X] 2 [ ] onContentStart -> Self -> contentStop -> Unrestricted -> [ ]
[X] 3 [ ] onContentStart -> Self -> playSound -> [Sound]
[X] 4 [ ] onContentStop -> Self -> playSound -> [Sound]
[X] 5 [ ] onContentRestricted -> Self -> playSound -> [Sound]
[X] 6 [ ] onContentStart -> Client -> centerPrint -> [<color:FFFFFF>You pressed the button.]
[X] 7 [ ] onContentRestricted -> Client -> centerPrint -> [<color:FFFFFF>You are not allowed to use this button.]

   There you have it! A JVS Button that shrinks you.
« Last Edit: October 06, 2010, 01:05:14 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #5 on: September 04, 2009, 12:13:14 PM »
III.===Switches===

--- A. Non JVS Switches ---

   By Non JVS Switches, I mean any switch that does not use any form of an "onContent" prefix.
   This means that you will create this switch with any random brick.
   Before we get into the code, let me explain it. In a Non JVS Switch,
   you will be using events such as "onActivate", "Named Brick", and "toggleEventEnabled".
   "onActivate" means that the Output of the event occurs when I player decides to click it
   with their mouse.
   A "Named Brick" event is a variable event. Think of the Named Brick as the Variable "X".
   When you name a brick, which is done by "Wrenching" it (Clicking on the brick with the Wrench
   Tool in hand), you may then apply the Output of an event to that brick.
   "toggleEventEnabled" means to toggle an event On and Off.

   Here are the basics. If a brick has a "Switch" on it. When you click the switch,
   something will happen. When you click the switch again, something else will happen.

   Here is what the code looks like in a light that can be switched On and Off.
Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled [1 2]
[X] 1 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 2 [0] onActivate -> Self -> setLight -> None

   Here are the events put in English:

   Event 0 toggles events 1 and 2 On and Off.
   If event 1 is On, the brick that the player clicked will light up.
   If event 2 is On, the brick that the player clicked will not light up.

   To make a Non JVS Switch toggle a different brick, replace -> Self -> with -> NamedBrick [Name of the Brick] ->
   on events 0, 1, and 2.

   Let's spice things up a bit. Instead of having a light just toggle On and Off,
   let’s throw in some sound effects:
Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled [1 2 3 4]
[X] 1 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 2 [0] onActivate -> Self -> setLight -> None
[X] 3 [33] onActivate -> Self -> playSound -> lightOn.wav
[ ] 4 [33] onActivate -> Self -> playSound -> lightOff.wav

   Now it does the same thing, but this time sound effects are in play.
   Still not satisfied? Okay, let's throw in some prints:
Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled [1 2 3 4 5 6]
[X] 1 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 2 [0] onActivate -> Self -> setLight -> None
[X] 3 [33] onActivate -> Self -> playSound -> lightOn.wav
[ ] 4 [33] onActivate -> Self -> playSound -> lightOff.wav
[X] 5 [0] onActivate -> Client -> centerPrint [You turn the light on.]
[ ] 6 [0] onActivate -> Client -> centerPrint [You turn the light off.]

   Now it toggles a light, plays a sound, and displays a message.
   Still not amused? Okay, let's add some color to the prints:
Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled [1 2 3 4 5 6]
[X] 1 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 2 [0] onActivate -> Self -> setLight -> None
[X] 3 [33] onActivate -> Self -> playSound -> lightOn.wav
[ ] 4 [33] onActivate -> Self -> playSound -> lightOff.wav
[X] 5 [0] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
[ ] 6 [X] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]

   There, now it toggles a light, plays a sound, and displays a message with colors.
   If this doesn't suit you, then tweak the events until you get what you want.

--- B. JVS Switches ---

   Now on to JVS Switches. JVS Switches are almost the same as Non JVS Switches.
   Instead of many "onActivate" events, you will have events like this:
Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> CW -> Unrestricted -> [ ]
[ ] 1 [0] onActivate -> Self -> contentStop -> CW -> Unrestricted -> [ ]
[X] 2 [0] onActivate -> Self -> toggleEventEnabled -> [0 1]

   With these events laid down, you can have a JVS Switch that switches,
   but does nothing. On the bright side, you can now just use events like,
   "onContentStart" and "onContentStop".

   Let's apply the Non JVS Switch code to the JVS Switch.

   Here are the old events:
Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled [1 2 3 4 5 6]
[X] 1 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 2 [0] onActivate -> Self -> setLight -> None
[X] 3 [33] onActivate -> Self -> playSound -> lightOn.wav
[ ] 4 [33] onActivate -> Self -> playSound -> lightOff.wav
[X] 5 [0] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
[ ] 6 [0] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]

   Now to tweak it:
Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> CW -> Unrestricted -> [ ]
[ ] 1 [0] onActivate -> Self -> contentStop -> CW -> Unrestricted -> [ ]
[X] 2 [0] onActivate -> Self -> toggleEventEnabled -> [0 1]
[X] 3 [0] onActivate -> Self -> setLight -> PlayerLight
[ ] 4 [0] onActivate -> Self -> setLight -> None
[X] 5 [33] onActivate -> Self -> playSound -> lightOn.wav
[ ] 6 [33] onActivate -> Self -> playSound -> lightOff.wav
[X] 7 [0] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
[ ] 8 [0] onActivate -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]

   If you didn't notice, we changed the Non JVS toggler,
   to the JVS toggler. It might seem a little longer,
   but it really helps in the long run. In this format,
   you no longer have to keep track of which events are enabled,
   and which need enabling. Instead of having many "onActivate"
   events, you can now just use "onContentStart", and
   "onContentStop" events.

   If you were to test this, you would notice that when you
   press it, the switch lights up, and doesn't turn off.
   This is because we are not done with the events.
   The next step is to change all of the enabled
   "onActivate" events between 3-8 to "onContentStart",
   and the disabled "onActivate" events between 3-8 to
   "onContentStop" and enable them.

   The result will look like this:
Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> CW -> Unrestricted -> [ ]
[X] 1 [0] onActivate -> Self -> contentStop -> CW -> Unrestricted -> [ ]
[X] 2 [0] onActivate -> Self -> toggleEventEnabled -> [0 1]
[X] 3 [0] onContentStart -> Self -> setLight -> PlayerLight
[X] 4 [0] onContentStop -> Self -> setLight -> None
[X] 5 [33] onContentStart -> Self -> playSound -> lightOn.wav
[X] 6 [33] onContentStop -> Self -> playSound -> lightOff.wav
[X] 7 [0] onContentStart -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
[X] 8 [0] onContentStop -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]

   Now to solve the last problem. If you were to activate the switch,
   you would notice that the switch lit up instead of a designated brick.

   This is where the "NamedBrick" event comes into play.
   Create a brick that you wish to be your light,
   or use one that you already have.
   Pull out the Wrench Tool, and click on the brick that you wish to be the light.
   Name this brick "Light".

   Now change the JVS Switch's events to this:
Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> CW -> Unrestricted -> [ ]
[X] 1 [0] onActivate -> Self -> contentStop -> CW -> Unrestricted -> [ ]
[X] 2 [0] onActivate -> Self -> toggleEventEnabled -> [0 1]
[X] 3 [0] onContentStart -> <NAMED BRICK> -> Light -> setLight -> PlayerLight
[X] 4 [0] onContentStop -> <NAMED BRICK> -> Light -> setLight -> None
[X] 5 [33] onContentStart -> <NAMED BRICK> -> Light -> playSound -> lightOn.wav
[X] 6 [33] onContentStop -> <NAMED BRICK> -> Light -> playSound -> lightOff.wav
[X] 7 [0] onContentStart -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
[X] 8 [0] onContentStop -> Client -> centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]

   Now the JVS Switch should work perfectly!
   If you have any questions just post it, and I'll reply back A.S.A.P.

--- C. Advanced Switches ---

   Advanced switches work differently from most switches.
   First off, JVS Switches should not be used for this,
   as they have an on position, and an off position.
   An advanced switch is a button that has 3 or more "phases".
   A phase is defined as so: You click the button,
   something happens, and then the phase changes to where the
   previous events are not used until that phase is called upon.

   A regular switch has two phases. Here's a example of a music brick
   that turns on and off by clicking it:

Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled -> [1 2]
[X] 1 [0] onActivate -> Self -> playSound -> After_School_Special.ogg
[ ] 2 [0] onActivate -> Self -> playSound -> NONE

   This brick will only turn on and off. Meaning it has two phases,
   phase one is on, and phase two is off. Let me show you how a
   three phase sound brick will work. This will play the "After_School_Special"
   soundtrack, then the "Jungle" soundtrack, then no sound at all.

Code: [Select]
[X] 0 [0] onActivate -> Self -> toggleEventEnabled -> [0 1 3 4]
[ ] 1 [0] onActivate -> Self -> toggleEventEnabled -> [1 2 4 5]
[ ] 2 [0] onActivate -> Self -> toggleEventEnabled -> [0 2 3 5]
[X] 3 [0] onActivate -> Self -> playSound -> After_School_Special.ogg
[ ] 4 [0] onActivate -> Self -> playSound -> Jungle.ogg
[ ] 5 [0] onActivate -> Self -> playSound -> NONE

   It may be a little hard to grasp at first, but let me break this down:

   *Click* (Phase 1)
   Event 3 plays the "After_School_Special" soundtrack
   Event 0 turns itself off, and Event 1 on, it also turns off Event 3, and turns Event 4 on.

   *Click* (Phase 2)
   Event 4 plays the "Jungle" soundtrack
   Event 1 turns itself off, and Event 2 on, it also turns off Event 4, and turns Event 5 on.

   *Click* (Phase 3)
   Event 5 turns off the music
   Event 2 turns itself off, and Event 0 on, it also turns off Event 5, and turns Event 3 on.

   Do you understand? Every time a new phase is executed,
   that phase will execute and turn itself off, and turn the next phase on,
   and the last phase will execute, turn off, and turn on the first phase.

   Eventually you will understand how this works.
   It will normally look a little funny to people at first.
« Last Edit: October 06, 2010, 01:04:41 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #6 on: September 04, 2009, 12:14:02 PM »
=== IV. Doors ===

--- A. Non JVS Doors ---

   Non JVS Doors are quite simple.
   Just plant a 1x4x5 and make it operate like a door.
   You can do this by giving the door these events:
Code: [Select]
[X] 0 [0] onActivate -> Self -> disappear -> [3]
   Now it opens like a simple door.
   Want to give it sound effects?
   Do this:
Code: [Select]
[X] 0 [0] onActivate -> Self -> disappear -> [3]
[X] 1 [33] onActivate -> Self -> playSound -> lightOn.wav
[X] 2 [3033] onActivate -> Self -> playSound -> lightOff.wav

   This is a very simple door.
   To make a multi brick door, you do something similar.
   First, make your door.
   Second, name every brick "Door"
   Lastly, give all bricks these events:
Code: [Select]
[X] 0 [0] onActivate -> <NAMED BRICK> {Door} -> disappear -> [3]
[X] 1 [33] onActivate -> Self -> playSound -> lightOn.wav
[X] 2 [3033] onActivate -> Self -> playSound -> lightOff.wav

   Now, the entire door disappears!

   Animating is quite simple too. This requires two doors.
   First, make your door. Then, make the same door
   in a turned position as if it were open.
   Name the first door "Door_Closed", and the open door "Door_Open"
   Now, make every brick on the open door invisible
   by turning off raycasting, collision, and rendering

   Now add these events to every brick in the closed door:

Code: [Select]
[X] 0 [0] onActivate -> <NAMED BRICK> {Door_Open} -> disappear -> [-1]
[X] 1 [0] onActivate -> <NAMED BRICK> {Door_Closed} -> disappear -> [0]
[X] 2 [33] onActivate -> Self -> playSound -> lightOn.wav

   This will make the closed door disappear, and the opened door appear.
   To reverse this, add these events to evey brick in the opened door:

Code: [Select]
[X] 0 [0] onActivate -> <NAMED BRICK> {Door_Closed} -> disappear -> [-1]
[X] 1 [0] onActivate -> <NAMED BRICK> {Door_Opened} -> disappear -> [0]
[X] 2 [33] onActivate -> Self -> playSound -> lightOff.wav

   Now you can simulate a door opening and closing!

--- B. JVS Doors ---

   JVS Doors are quite simple. When you first place a JVS Door,
   it comes up fully functional. Like the JVS Button, I am going to
   break down how the JVS Door works.

   First off, plant a JVS, and clear all of the events.
   We're going to start from scratch.

   Now, notice how the rendering is check off on the door.
   Turn it on, and notice how it turns into a solid 1x4x5.
   Something like this can be used as a secret door.

   Turn rendering back off, and let's continue.

   We need that door to open. So give the door these events:

Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> {Unrestricted} CW [ ]
   This event opens the door in the CW, or Clock-Wise, direction.
   There are no sound effects, and the door does not close.
   All it will do is spin clock-wise.

   Let's make the door close behind us by adding this event:

Code: [Select]
[X] 1 [3000] onContentStart -> Self -> contentStop -> {Unrestricted} CW [ ]
   Notice that I didn't use onActivate for this event.
   I used onContentStart, so that when the door is opened,
   it will close 3000 miliseconds, or 3 seconds, later.
   You don't put contentStop events with an onActivate input.
   It's just no good practice, and your brick can sometimes be messed up.

   Let's add sound effects now:

Code: [Select]
[X] 2 [33] onContentStart -> Self -> playSound -> (Desired Door Opening Sound)
[X] 3 [33] onContentStop -> Self -> playSound -> (Desired Door Closing Sound)

   By now, you might be wondering why I give all
   of my sound effects a 33ms delay.
   This is just common practice for me.

   Anywho, you now have a working door.
   But wait, didn't the defaulted events that came with
   the door have a bunch of events?
   Yes, it did, but you don't need them if the door is unrestricted.
   Doors can be restricted by Trust, BL ID, or Admin only.
   The text box at the end is used for enter a list of
   BL ID's, each being separated by a space.

   Here's an example on what onContentRestricted
   could be used for:

Code: [Select]
[X] 0 [0] onActivate -> Self -> contentStart -> {Trust 1} CW [ ]
[X] 1 [0] onContentStart -> Self -> contentStop -> {Unrestricted} CW [ ]
[X] 2 [33] onContentStart -> Self -> playSound -> lightOn.wav
[X] 3 [33] onContentStop -> Self -> playSound -> lightOff.wav
[X] 4 [0] onContentRestricted -> Client -> centerPrint -> [<color:FFFFFF>Sorry, Boom does not trust you.] [3]
[X] 5 [33] onContentRestricted -> Self -> playSound -> Beep_No.wav

   Notice how the contentStop output is still unrestricted.
   Many people put both parameters on the same thing.
   This is never a good idea to do.
   Let's say someone opens a resricted door,
   and then someone that is unable to open the door
   stands in its path. The door will now buzz until
   that person moves, which is very annoying.
   Although my method allows the player to get through,
   there's normally a better way of securing something
   if there's an actual reason for keeping something
   restricted.

   Still, there's only 6 events. The default events for
   the JVS Door had so many events! Truth is,
   you don't need half of them.
   onContentCreated is executed when the brick is planted,
   it's a one time event, so it can be discarded.
   onContentBlocked is just to notify the player if the door
   is stuck. If the door won't open, then it's stuck. Simple
   as that. You can easily take away these silly events,
   and be left with 4-6 events. If you want to do something
   more fancy with it, then by all means do so. I'm just not
   a fan of having events that aren't needed.
« Last Edit: October 06, 2010, 01:03:57 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #7 on: September 04, 2009, 12:15:13 PM »
=== V. Useful ===

--- A. Delays ---

   Delays are one of the simplest concepts to grasp.
   Delays are at the beginning of an event.
   Delays do what delays do, delay. (Simple, huh.)
   They are measured in milliseconds (ms).
   1,000 miliseconds are in one second.
   The maximum delay on one event is 30,000 miliseconds, or 30 seconds.

--- B. Relays ---

   Relays are very helpful.
   Relays are events start with an "onRelay" command.
   To fire a relay, a "fireRelay(xx)" command is required.
   Here are the expliantions of the "fireRelays":

      fireRelay - Fires a Relay to the selected object
      fireRelayUp - Fires a Relay to all bricks that are directly above the brick
      fireRelayDown - Fires a Relay to all bricks that are directly below the brick
      fireRelayNorth - Fires a Relay to all bricks that are directly North of the brick
      fireRelayEast - Fires a Relay to all bricks that are directly East of the brick
      fireRelaySouth - Fires a Relay to all bricks that are directly South of the brick
      fireRelayWest - Fires a Relay to all bricks that are directly West of the brick

   Think of an "onRelay" event as an "onActivate" event,
   but instead of a player triggering an event, an event triggers an event.

   To allow a player to fire a Relay, set up an event that has this:
Code: [Select]
[X] 0 [0] onActivate -> Self -> fireRelay
   To loop a Relay, so that the event is always happening, add this event:
Code: [Select]
[X] 1 [500] onRelay -> Self -> fireRelay
   Notice that I added a 500 ms Delay.
   I did this because having too many Relay events can cancel events.
   The high the time in the loop, the better.
   Also, try not have too many loops.
   To end a loop, either toggle off the loop event,
   or use a "cancelEvents" event to cease all Relays at once,
   stopping the loop.

--- C. Command Explanations ---

   --- Input Events ---

      onActivate: Plays the remander of the event line if the object is clicked by a player
      onBlownUp: Plays the remander of the event line when the object is fakeKilled.
      onBotTouch: Plays the remander of the event line if a Bot is touching the brick
      onPlayerTouch: Plays the remainder of the event line if a player is touching the brick
      onPrintCountOverFlow: Plays the remainder of the event line if the Print Count count
         of the brick goes over nine
      onProjectileHit: Plays the remainder of the event line if a projectile hits the brick
      onRelay: Plays the remainder of the event line if a Relay is fired on the brick
      onRespawn: Plays the remainder of the event line when the brick respawns

      onVariableFalse: Plays the remainder of the event line if the variable/value statement is false
      onVariableFunction: Plays the remainder of the event line if the function is called
      onVariableTrue: Plays the remainder of the event line if the variable/value stamement is true

   --- Targets ---

      Self: Itself; meaning the brick
      Bot: The Bot
      Driver: The Driver of the Bot/Vehicle
      Player: The Player (Blockhead)
      Projectile: Any flying object
      Client: The Client (The User)
      Minigame: The MiniGame that the event was activated in
      Vehicle: The Vehicle
      <NAMED BRICK>: A variable that is linked to a brick that you have named

   --- Output Events ---

      cancelEvents: Cancels any on going, or looping events
      decrementPrintCount: Decreases the print count by the number stated
      disappear: Toggles off Collision, Raycasting, and Rendering for a set amount of time
         (-1 means infinity because you cannot re-appear before you dissapear)
      fakeKillBrick: Simulates killing the brick.
      fireRelay: Fires a Relay
      fireRelayDown: Fires a Relay to the adjacent brick below itself
      fireRelayEast: Fires a Relay to the adjacent brick east of itself
      fireRelayNorth: Fires a Relay to the adjacent brick north of itself
      fireRelaySouth: Fires a Relay to the adjacent brick south of itself
      fireRelayU: Fires a Relay to the adjacent brick above itself
      incrementPrintCount: Increases the print count by the number stated
      playSound: Plays a selected sound
      radiusImpulse: Pushes the player back a set amount
      recoverVehicle: Recovers the Vehicle
      respawn: Respawns the indicated target
      respawnVehicle: Respawns the host brick's vehicle
      setColliding: Sets the target's collision on or off
      setColor: Sets the target's color
      setColorFX: Sets the target's color effect
      setEmitter: Sets the target's emitter
      setEmitterDirection: Sets the target emitter's direction
      setEventEnabled: Sets the designated event numbers of the target on or off
      setItem: Sets the item of the target
      setItemDirection: Sets the item's direction of the target
      setItemPosition: Sets the postion of the target's item
      setLight: Sets the light of the target
      setMusic: Sets the music of the target
      setPrintCount: Sets the print count of the target
      setRayCasting: Sets the target's ray casting on or off
      setRendering: Sets the target's rendering on or off
      setShapeFX: Sets the target's shape effect
      setVehicle: Set the Vehicle of the target
      spawnExplosion: Spawns an explosion at the origin point of the target
      spawnItem: Spawns an item at the designated target
      spawnProjectile: Spawns a moving projectile at the designated target,
         with a defined speed in the format of "X Speed, Y Speed, Z Speed, X Off, Y Off, Z Off"
      toggleEventEnabled: Toggles the target's selected events on and off

      VCE_callFuntion: Calls a designated fuction
      VCE_ifValue: Creates a statement to check a value of a designated variable
      VCE_ifVariable: Creates a statement to check a variable against another designated variable
      VCE_loadVariable: Loads a designated variable that has been saved
      VCE_modVariable: Modifies a variable in a designated way by a designated value
      VCE_saveVariable: Saves a designated variable
      VCE_stateFunction: Defines a fuction

--- D. Print Blocks ---

   Print blocks are very easy to grasp.
   Plant a print brick, and click it with the printer tool in hand.
   A GUI (or a menu) will pop up with pictures, letters, and numbers.
   You just select one, and there you have it.

   Print blocks also have a second feature.
   There are two output events called incrementPrintCount and decrementPrintCount.
   This can be used for keeping score and such.

   To have higher values, such as 11, 81, 64, etc,
   you can use onPrintOverflow to increase the print block
   being used as the tens place. If you want a countdown effect,
   you can use decrementPrintCount, and onPrintUnderflow to decrease
   the print block being used as the tens place.
« Last Edit: May 05, 2011, 03:27:18 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #8 on: September 04, 2009, 12:15:57 PM »
=== VI. Tutorials ===

--- A. Basic Tutorials ---

   --- Contents ---

      Lightswitch - Boom
      Color Changer - Shappeh

   --- Lightswitch ---
   By: Boom

   This tutorial is how to make a light switch with one brick.
   First, create a brick, any one will do, pull out the wrench tool,
   and click on the brick.

   Give the brick these events:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setLight -> [None]
[X] 1 [0] onActivate -> Self -> playSound -> [lightOn.wav]
[ ] 2 [0] onActivate -> Self -> setLight -> [Player Light]
[ ] 3 [0] onActivate -> Self -> playSound -> [lightOff.wav]
[X] 4 [0] onActivate -> Self -> toggleEventEnabled -> [0 1 2 3]

   Here what that means in English:

   Make the brick light up.
   Make the brick play a sound.
   Do nothing
   Do nothing
   Turn events 0 and 1 off, and 2 and 3 on.

   Do nothing
   Do nothing
   Make the brick not light up.
   Make the brick play a sound.
   Turn events 0 and 1 on, and 2 and 3 off.

   --- Color Changer ---
   By: Shappeh
   Revision by: Boom

   (Coming Soon)

--- B. Delays, Relays, and Named Bricks ---

   --- Contents ---

      Password Consoles - Lego_Addict

   --- Password Consoles ---
   By: Lego_Addict
   Revision By: Boom

   This guide is intended for a numbered console with numbers 0-9 on it, as if on a cellphone keypad.
   Also, because of the amount of eventing needed to do this,
   it is only recommended to more advanced eventers.

   First, you need to make the hidden blocks. These are to be placed in a location out-of-sight,
   so a weary wrench doesn't get to them. The number of the hidden blocks is depended on
   how many digits your code will be (I recommend 4).

   The first block should be named whatever the first digit in your code is,
   and the second block should be the second digit in your combo, and so on.
   Once you finish naming the blocks, then you should start eventing.

   The first block/number in the combo has events as follows:

Code: [Select]
[ ] 0 [0] onRelay -> <NAMED BRICK> [next # in combo] -> setEventEnabled [0] [X]
   The above event is repeated if you used more than 4 blocks/numbers in your combo EXCEPT
   for the last two blocks/numbers.

   Second to last is as follows:

Code: [Select]
[ ] 0 [0] onRelay -> <NAMED BRICK> [next # in combo] -> setEventEnabled [0 1] [X]
   The last block/number in the combo is evented as follows:

Code: [Select]
[ ] 0 [0] onRelay -> <NAMED BRICK> [Keep empty] -> setEventEnabled [2 3 4] [X]
[ ] 1 [0] onRelay -> <NAMED BRICK> [Keep empty] -> setEventEnabled [5 6] [ ]


   NOTE: The namedbricks in the events of the last block will be filled in at the end of the tutorial.

   The last two blocks/numbers are always needed. So say if you only use 3 numbers in your combo,
   you would not need the second block's/number's events, only use the first block's/number's
   events and use the second to last and last blocks'/numbers' events. If you only used 2
   (not Recommended) Than only use the last two blocks'/numbers' events. Keep in mind,
   the first block's/number's events in the combo are always to be activated, or on.
   So in other words, the events are depended on how many blocks/numbers there are.

   Second, you need make the door that is wanted to be passworded, and name it whatever you choose;
   for the tutorial, I will say "door". You should not remove any events in the door,
   but change the access priviledges for activating and opening the the door to "Admin",
   so admins don't delete your build for not being able to get into your passworded room.

   Next, you should add the following events:

Code: [Select]
[X] 17 [0]onDoorClose -> <NAMED BRICK> [first # block in the combo] -> setEventEnabled [0] [X]
[X] 18 [0] onDoorClose -> <NAMED BRICK> [the other # blocks including the second to last] -> setEventEnabled [0] [ ]
[X] 19 [0] onDoorClose -> <NAMED BRICK> [last # in the combo] -> setEventEnabled [0 1] [ ]
[X] 20 [0] onDoorClose -> <NAMED BRICK> [Keep empty] -> setEventEnabled [2 3 4] [ ]
[X] 21 [0] onDoorClose -> <NAMED BRICK> [Keep empty] -> setEventEnabled [5 6] [X]

   NOTE: These are the added events if you DID NOT download the the JVS content.
   If you did, replace the input event "onDoorClose" with "onContentStop".

   Lastly, you need to event the password console.
   First thing you need to do with the password console is make the blocks that will function as the numbers

   NOTE: These do NOT need to be printable 1x1's, nor do they need to be named.
   Naming the blocks would only make it more confusing.

   Make the blocks functioning as numbers in the order as on a phone keypad,
   so input of the code would be easier. Event each of the blocks that will act
   as the digits in the combo as such:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX [Glow]
[X] 1 [150] onActivate -> Self -> setColorFX [NONE]
[X] 2 [0] onActivate -> Self -> playSound [Beep_Checkout.wav]
[X] 3 [0] onActivate -> <NAMED BRICK> [corresponding block in combo] -> fireRelay

   Make each of the blocks that don't have a corresponding number in the combo as such...

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX [Glow]
[X] 1 [150] onActivate -> Self -> setColorFX [NONE]
[X] 2 [0] onActivate -> Self -> playSound [Beep_Checkout.wav]
[X] 3 [0] onActivate -> <NAMED BRICK> [first # block in the combo] -> setEventEnabled [0] [ ]
[X] 4 [0] onActivate -> <NAMED BRICK> [the other # blocks including the second to last] -> setEventEnabled [0] [ ]
[X] 5 [0] onActivate -> <NAMED BRICK> [Keep empty] -> setEventEnabled [2 3 4] [ ]
[X] 6 [0] onActivate -> <NAMED BRICK> [Keep empty] -> setEventEnabled [5 6] [X]

   The "Keep empty" here will be filled in at the end of the tutorial.

   Next, you need to make the button that will clear the digits you put in if you happen to
   make a mistake upon entering your code (this block doesn't need to be named, either):

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX [Glow]
[X] 1 [150] onActivate -> Self -> setColorFX [NONE]
[X] 2 [0] onActivate -> Self -> playSound [Beep_EKG.wav]
[X] 3 [0] onActivate -> <NAMED BRICK> [first # block in the combo] -> setEventEnabled [0] [X]
[X] 4 [0] onActivate -> <NAMED BRICK> [the other # blocks including the second to last] -> setEventEnabled [0] [ ]
[X] 5 [0] onActivate -> <NAMED BRICK> [last # in the combo] -> setEventEnabled [0 1] [ ]

   Last thing to do with the password console is make a button that will open the door if you
   put in the code correctly. This block DOES need to be named, and for this I will name it "ok".
   Event it as such:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX [Glow]
[X] 1 [150] onActivate -> Self -> setColorFX [NONE]
[ ] 2 [0] onActivate -> Self -> playSound [Beep_Key.wav]
[ ] 3 [0] onActivate -> <NAMED BRICK> [door] -> doorOpen OR contentStart [X]
[ ] 4 [0] onActivate -> Client -> bottomPrint [whatever message you want for getting pass correct] [3]
[X] 5 [0] onActivate -> Self -> playSound [Beep_No.wav]
[X] 6 [0] onActivate -> Client -> bottomPrint [whatever message you want for getting pass wrong] [3]

   NOTE: This is the namedbrick you have to put into the events at the beginning, the middle,
   and end of the guide that we had to "Keep empty".

   I will explain how this works now. The first thing you do when putting the code in is start
   typing in the code. When you press the first digit in the code on the console,
   it would fire a relay to the first block/number in the combo, and the events of that block
   make it so when the relay is fired, it activates the once deactivated event of the next block.
   If you were to keep putting the code in correctly, it would keep this chain going to the last
   block/number in the combo. If you make the code completely correct, and press the last
   digit in your combo, than it would switch the events activated on the "ok" block, making it
   so when you press the "ok" block, it would open the door. The reason why the door won't
   keep opening when you press the "ok" button after the door closes is because the events
   of the door reverse what events are activated on the button when it closes.
   If you were to put in the code incorrectly, like say you pressed a number not in the code,
   then it would deactivate the hidden blocks and make sure the "ok" button was turned off if
   the person did one-too many numbers. If this were to happen, than the "clear" button would
   reset all the functions of the blocks.

--- C. Mixed Tutorials ---

   (Coming Soon)

--- D. VCE Tutorials ---

   --- Contents ---

      VCE Password Consoles - Boom

   --- VCE Password Consoles ---
   By: Boom

   Here's my version of a passworded console.
   This one takes more of a mathmatical approach.
   I'll be using the newest version of the VCE.
   For those who have the VCE without functions,
   I'll let you know what you can't do.
   Let's get started.

   First off, your setup. You can either have 12 Print Blocks,
   that have labels for each number, or you can have 12 1x1f plates,
   that do not show you a number on the brick.

   Your keypad needs to consist of whole numbers 0-9,
   an accept button (green) and a reset button (red).

   Now, if you don't know how to use the VCE,
   either one, read Section VII before continuing,
   or two, do exactly as I say.

   Now, here's the basics to make the keypad light up.
   Apply these events to ONLY the numbers buttons:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX -> Glow
[X] 1 [100] onActivate -> Self -> setColorFX -> None
[X] 2 [33] onActivate -> Self -> playSound -> Beep_EKG.wav

   Now we have all of the number buttons lighting up,
   but they don't do anything. This is where the VCE comes in.
   Add this:

Code: [Select]
[X] 3 [0] onActivate -> Self -> Mod_Variable -> [Client] [password] Multiply [10]
[X] 4 [5] onActivate -> Self -> VCE_modVariable -> [Client] [password] Add [ ]

   Notice how I kept the Add [ ] blank. This is because you put the number
   of the brick in here. Meaning, the brick that represents 1, gets a "1" in that box.
   2 gets "2", 3 gets "3" etc.

   Now, he's the next part, it can only be done with the newest VCE.
   If you don't have it, you don't need it. This is just some eye-candy. :)
   Add this:

Code: [Select]
[X] 5 [0] onActivate -> Self -> VCE_stateFunction -> [Display] [6 6]
[X] 6 [0] onFunction -> Client -> bottomPrint -> [<color:FFFF00>Code<color:FFFFFF>: <var:client:password>]
[X] 7 [10] onActivate -> Self -> VCE_callFunction [Display] [ ]

   So, here's the code put together:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX -> Glow
[X] 1 [100] onActivate -> Self -> setColorFX -> None
[X] 2 [33] onActivate -> Self -> playSound -> Beep_EKG.wav
[X] 3 [0] onActivate -> Self -> Mod_Variable -> [Client] [password] Multiply [10]
[X] 4 [5] onActivate -> Self -> VCE_modVariable -> [Client] [password] Add [ ]
[X] 5 [0] onActivate -> Self -> VCE_stateFunction -> [Display] [6 6]
[X] 6 [0] onFunction -> Client -> bottomPrint -> [<color:FFFF00>Code<color:FFFFFF>: <var:client:password>]
[X] 7 [10] onActivate -> Self -> VCE_callFunction [Display] [ ]

   Don't forget to fill in the "Add [ ]" parameter!

   Okay, so you have your key pad. Before we make the check, we need the clear.
   Add this to the red clear button:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX -> Glow
[X] 1 [100] onActivate -> Self -> setColorFX -> None
[X] 2 [33] onActivate -> Self -> playSound -> Beep_Checkout.wav

   Now it lights up, but it still needs to have a "Clear" function.
   Add this:

Code: [Select]
[X] 3 [0] onActivate -> Self -> VCE_modVariable -> [password] Set [0]
[X] 4 [0] onActivate -> Client -> bottomPrint -> [<color:FFFFFF>You have <color:FF0000>RESET<color:FFFFFF> the code.]

   Now that that's out of the way, time to move onto the check button.

   Long story short, add this:

Code: [Select]
[X] 0 [0] onActivate -> Self -> setColorFX -> Glow
[X] 1 [100] onActivate -> Self -> setColorFX -> None
[X] 2 [0] onActivate -> Client -> ifVariable -> [password] == [ ] [3 7]
[X] 3 [33] onVariableTrue -> Self -> playSound -> [Beep_Key.wav]
[X] 4 [0] onVariableTrue -> Client -> bottomPrint -> [<color:00FF00>Correct!]
[X] 5 [0] onVariableTrue -> <NAMED BRICK> [ ] -> contentStart
[X] 6 [33] onVariableFalse -> Self -> playSound -> [Beep_No.wav]
[X] 7 [0] onVariableFalse -> Client -> bottomPrint -> [<color:FF0000>Incorrect!]

   Notice that I left the "<NAMED BRICK> [ ]" section blank.
   This is where the name of your door goes.

   Also, if you choose not to have a JVS Door,
   instead of using "contentStart" on Event 5,
   use "dissappear [3]".

   Another thing I left blank, "[password] == [ ] [3 7]"
   put in the number you wish to be your password.
   (Recommended less than 6)

   If you have any questions, post them in the Comments thread,
   or just PM me.

--- E. Advanced Tutorials ---

   (Coming Soon)

--- F. Other Tutorials ---

   (Coming Soon)
« Last Edit: February 01, 2012, 07:01:36 PM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #9 on: September 04, 2009, 12:16:38 PM »
=== VII. VCE ===

--- Introduction ---

   Welcome to the most advanced form of Wrench Events. The Variable Conditional Events,
   or VCE, controls variables, and allows you to do things that would be nearly impossible
   with basic events. Everything covered in this section will be appliable to both VCE Values
   and VCE Variables.

   Let's take a VCE code, and break it apart:
   In a VCE code, you have the basic things like "[X] 0 [0] (Event)"
   You then have two text boxes. Before I explain what they are,
   you need to know these math symbols:

      "= =" equals
      "!="does not equal
      ">=" greater than or equal to
      "<=" less than or equal to
      ">" greater than
      "<" less than
      "~=" similiar or equal to

   So, here how it works. If this "= =" this, do this [2 4]
   The "[2 4]" box means run events 2 through 4.

   Events triggered by the VCE will normally be "Variable True/False" events.
   Events that are not toggled on will not run.
   Events that are not variable true/false arguments will be played no matter what.

--- B. Values ---

   In the VCE, a Value is normally a string of text, or a boolean (0 or 1).
   Values aren't too hard to grasp, but allow new levels of eventing.

   To use Values, you must first know how to set up the "if [this] = = [that]"
   The "[this]" part, is what you're comparing "[that]" to.
   Let’s introduce the possible "[this]" entrees:

      <var:client:name> : The player's name
      <var:client:bl_id> : The player's Blockland ID.
      <var:client:lastmsg> : The player's last message
      <var:client:lastteammsg> : The player's last team message
      <var:client:score> : The player's score
      <var:client:isAdmin> : If the player is an Admin (Boolean)
      <var:client:isSuperAdmin> : If the player is a Super Admin (Boolean)
      <var:client:clanPrefix> : The player's clan prefix tag
      <var:client:clanSuffix> : The player's clan suffix tag

      <var:player:jetting> : If the player is jetting (Boolean)
      <var:player:jumping> : If the player is jumping (Boolean)
      <var:player:firing> : If the player if firing the mouse (Boolean)
      <var:player:damage> : The amount of damage the player does to another
      <var:player:health> : The player's current health
      <var:player:maxhealh> : The player's maximum health
      <var:player:velx> : The player's velocity on the x-axis
      <var:player:vely> : The player's velocity on the y-axis
      <var:player:velz> : The player's velocity on the z-axis
      <var:player:currentItem> : The UI Name of the current item the player is using
      <var:player:item*> : The UI Name of the *th item in the player's inventory

      <var:brick:colorid> : The brick's color name
      <var:brick:printcount> : The brick's printcount
      <var:brick:colorfxid> : The brick's color effect name
      <var:brick:shapefxid> : The brick's shape effect name

   Values cannot be changed, for they are properties,
   but they can be displayed in an evented print.

--- C. Variables ---

   VCE Variables come in two parts.
   One is setting the Variable, and the other is using the Variable.
   Variables are numbers that are kept track of, and is given a unit name.
   The name is the Variable's Name, and the Value is the Numerical Value of the Variable.

   Part 1-Modifing Variables
   When you select the event "VCE_modVariable",
   You'll see a text box, a math operand (set, add, multiply, etc.), and another text box.
   The first text box handles the name of the Variable.
   The math operand tells you how you plan on modifying the Variable.
   The second text box will always be a digit,
   unless you want it as a string, but then,
   using operands other than "set" won't work.

   Part 2-If Variable Statements
   When you select the event "ifVariable"
   You'll see a text box, a math symbol (= =, !=, <=, etc.), and another text box.
   The first text box states the name of the Variable.
   The math symbol tells you what you are comparing the number to.
   The second text box will always be a digit.

   Example:
   Let’s say you have a teleporter, there are two senders, and one receiver.
   To make that receiver send to both senders, you need a VCE Variable.
   Okay, assuming you know how to set up a teleporter*,
   create the events for the two senders, but wait on the receiver.
   Once you have set up your teleporters, add a VCE Mod Variable Event.
   You may name the Variable anything you want, but in this case,
   I'll call it "Sender". Then change the math statement to "set",
   then on one teleporter, have "Sender" set to "1", and on another,
   have "Sender" set to "2". Now to the receiver.

   On the receiver, instead of teleporting the player,
   create an "ifVariable" Event. Then have input "Sender = = 1",
   meaning if the "Sender" Variable is at the Value of "1",
   the statement is true, if it is not 1, like "2", then the
   statement is false. Now add the events to teleport the player
   to the first teleporter on a "VariableTrue" event, and add the
   events to teleport the player on "VariableFalse".

   Now try out the teleporter!

--- D. Functions ---

   Variable Functions are a little hard to get at first, but once you get it down,
   you will love them.

   What is a Variable Function? Think of it as a relay with a name.
   Instead on using "fireRelay" you will you "VCE_callFunction".

   Easy, right?

   Now hold your horses. You can't just call a function out of the blue!
   In order to call a function, you must first state that function,
   by using "VCE_stateFunction".

   Here is an example of a stated function:

Code: [Select]
[X] 0 [0] onActivate -> Self -> VCE_stateFunction -> [Example] [1 1]
[X] 1 [0] onVariableFunction -> Player -> setPlayerScale -> [I---------]

   Now you have a stated function!

   Now to call that function:

Code: [Select]
[X] 0 [0] onActivate -> Self -> VCE_stateFunction -> [Example] [1 1]
[X] 1 [0] onVariableFunction -> Player -> setPlayerScale -> [I---------]
[X] 2 [0] onActivate -> Self -> VCE_callFunction -> [Example] [ ]

   There you have it! This may seem a little simple, and that was because it was just an example.

   When would I need functions? When you find yourself in need of using multiple relays,
   you normally would have to make another brick for another relay. Well that is no more!

   With VCE Functions, you can have up to 17,340 functions on ONE brick!

   Lastly, let's look at Event 2 in the example:

Code: [Select]
[X] 2 [0] onActivate -> Self -> VCE_callFunction -> [Example] [ ]
   Wondering what that last textbox is for? You can use it to call functions on other bricks!
   You do this by typing in the name of that brick.
   If the box is left empty, or the brick named does not exist,
   then the function is called on itself, and if a called function doesn't exist,
   then nothing happens!

   This means that on a server, you can have 300,675,600 different functions,
   and you can call them ALL with ONE brick!

   That my friend, is the power of the VCE.

--- E. Saving/Loading Variables ---

   Saving and loading variables is pretty simple.
   When you choose the event to save/load a variable,
   you will be asked to save/load to or from either the player or the client.

   Let me take some time to describe the difference between the player and the client.
   The player is the Blockhead himself. Everytime you die,
   you get a new Blockhead with full health, and the server/minigame's defualt items.
   When you die, all variables on the player are lost.
   Meaning it is probably a bad idea to save variables to the player,
   unless what you want would require that.

   For instance, let's say that you have a button that gives the player a key.
   If you die, the key should remain with your body.
   Meaning you would loose the key variable if you died.
   If you have a long maze with several different keys,
   you might add checkpoints for just incase you die.
   If you have save points in the maze,
   The player can load the key variable from their previous life.

   The client, is the actuall connection of the player.
   If the player dies, the variable is kept.
   If the player logs out, the variable is lost.
   A variable that you might want to save to the client could be a currency.
   If you have the players obtain gold,
   when they died, they would keep their gold amount.
   If they logged out, all they would have to do is reload their gold amount!

   Now that you know the difference, and their possible uses,
   Let's move on to how to type the variables you want saved.
   You do not have to save each variable individually.
   You can if you want to, but it is not needed.
   To save variables, you just simply type the variable name in the box,
   and you separate each variable by a comma.

   Here are some correct examples:

      [Blocks,Exp,Key1,Key2,Shield]
      [Points, Level, Status, Score]
      [Q1Complete,Q2Complete,Gold,Silver,Bronze]

   Here are some incorrect examples:

      [Money, Car,Grown, Int]
      [Data1.Data2,Data3 Data4]
      [Arg1 . Arg 2 . Team]
      [Cash,Spawn, Tools,Color]

   Saving and loading works the same way in both text boxes.
   Just note that if you use a comma, but no space, then
   that style must be continued, and vise-versa with commas
   with spaces.

--- F. Using VCE_retroCheck ---

   VCE_retroCheck was made for the people who prefer the old variables.
   Here's a list of the options:

      ifPlayerName : The player's name
      ifPlayerID : The player's ID
      ifAdmin : If the player is an admin
      ifPlayerEnergy : The amount of energy left (refers to the blue bar)
      ifPlayerDamage : The player's health
      ifPlayerScore : The player's score
      ifLastPlayerMsg : The last message the player said
      ifBrickName : The name of the brick
      ifRandomDice : The random number between 1 and 6 (This changes every time the event is called)

   VCE_retroCheck works just like any other value, it can't be changed,
   but it can't be displayed in an evented print. Some people prefer these
   over VCE_ifValue, but I personally like VCE_ifValue, but that's just me.

--- G. Using onVariableUpdate and Varlinks ---

   Let's start off with onVariableUpdate. Basically, when a custom variable
   is modified via VCE_modVariable or clicking a varlink, this event is executed.

   When a special variable is updated, onVariableUpdate is not executed. Why?
   This is due to a thing we call "common sense". Take the special variable
   "<var:player:velx>". This variable is updated at insane speeds. If onVariableUpdate
   was fired when values like that changed, it would create undesireable effects.

   Now that onVariableUpdate has been covered, let's move on to varlinks.

   Varlinks break down like this: <varlink:Text_VarName:Value>

   "varlink" defines the command as a varlink
   "Text" is what the link will look like
   "VarName" is the name of the client variable being modified when clicked
   "Value" is value that the variable will be set to

   For example, if I used <varlink:Click Here_Clicked:1>, it would display
   "Click Here" as a link. When clicked, that client's variable named "Clicked"
   will be set to "1".

   Also, links only work in chat messages. Varlinks are no different. Varlinks only
   work in chat messages.

   So, what's the use?

   Let's look at the use of varlinks to make a teleporter. You're going to need
   setPlayerTransform and, or course, the VCE.

   Here's our logic. You click a brick, and everyone in the minigame gets the
   message, "Click Here to teleport to my build!". "Click Here" is our link,
   and the variable "Tele" will be set to "1". Once the variable is updated, we'll
   run for the check of "Tele" being equal to "1", and if true, teleport them.

   So, display the varlink:

Code: [Select]
[X] 0 [0] onActivate -> Minigame -> chatMsgAll -> [<varlink:Click Here_Tele:1><color:FFFFFF> to teleport to my build!]
   Now, run the check for the varlink being clicked:

Code: [Select]
[X] 0 [0] onActivate -> Minigame -> chatMsgAll -> [<varlink:Click Here_Tele:1><color:FFFFFF> to teleport to my build!]
[X] 1 [0] onVariableUpdate -> Client -> VCE_ifVariable -> [Tele] == [1] [ ]

   Lastly, execute the teleportation.

Code: [Select]
[X] 0 [0] onActivate -> Minigame -> chatMsgAll -> [<varlink:Click Here_Tele:1><color:FFFFFF> to teleport to my build!]
[X] 1 [0] onVariableUpdate -> Client -> VCE_ifVariable -> [Tele] == [1] [ ]
[X] 2 [0] onVariableTrue -> Self -> setPlayerTransform -> None [ ] [ ]

   There we go! Sure, it could use some eye candy, but I'll leave that up to
   you. Varlinks aren't that hard after all.
« Last Edit: October 06, 2010, 01:06:11 AM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #10 on: September 04, 2009, 12:17:25 PM »
=== VIII. Credits ===

--- A. Main Author ---

Written By: Boom

--- B. Helpers ---

Tutorial Help: Lego_Addict
Tutorial Help: Shappeh
Tutorial Help: Boom
Hex Code Help: Mr.Doom
Font Type Help: Mr.Doom
Review Help: Destiny
Review Help: Boom
Admin Help: GMoney
HTML Help: KINEX
HTML Help: Mr.Doom
Event Help: Wizzard
Event Help: GunnaBoy

--- C. Special Thanks ---

Being Badspot: Badspot
[SS] Server Owner: KINEX
VCE Creator: Destiny
Being Awesome: Blastdown
Beastly Builder: Gunnaboy
Lego Buddy: Marto
Support: The Scattered Space Community
« Last Edit: February 01, 2012, 07:03:05 PM by Boom »

Offline Boom

  • Basement Dweller
  • Moderator
  • Jukebox Hero (Stars in their eyes)
  • ***
  • Posts: 5966
  • Reputation: 130
  • Changing the world one brick at a time.
    • View Profile
  • Alias: Deathwishez
  • Blockland ID: 9740
Re: The BETC Project (BETC Only)
« Reply #11 on: September 22, 2009, 07:00:18 PM »
=== IX. Change Log ===

--- A. Versions 0.01 - 0.29 ---

   Version 0.01 - 0.09 (Unknown Dates)

      Construction

   Version 0.10 (Released 8/18/09)

      First recorded date

   Version 0.11 - 0.13 (Approx. 8/18-24/09)

      Construction

   Version 0.14 (Approx. 8/24/09)

      Added VCE in Table of Contents
      Revised Tutorial Section in Table of Contents
      Removed JVS Terms under section II.

   Version 0.15 (August 8/24/09)

      Fixed Errors
      Added Bolds and Italics to labels
      Filled in topics
      Added Credits (Help me out to get in there!)

   Version 0.16 (Somewhere between 8/24/09 and 9/1/09)

      Reached 20,000 Character Limit

   Version 0.17 (9/1/09)

      Split BETC into two posts

   Version 0.18 (9/2/09)

      Added Relay Section
      Added Colors
      Adjusted "BETC" to new forum layout

   Version 0.19 (9/2/09)

      Color coded Table of Contents
      Color coded Scetions and Subsections

   Versions 0.20 - 0.27 (9/2-21/09)

      BETC given its own thread
      Major Revisions

   Version 0.28 (9/21/09)

      Table of Contents Revised
      Event formats have been changed to one style
      Button section has been filled
      Doors section has been changed to match the table of contents
      Yet another spelling check

   Version 0.29 (9/22/09)

      Fixed some code errors

--- B. Versions 0.30 - 0.39 ---

   Version 0.30 (9/22/09)

      Change Log Created
      Filled Log up to Version 0.30

   Version 0.31 (9/22/09)

      Fixed some display errors
      Moved codes for better display
      Fixed code types
      Fixed indention errors

   Version 0.32 (9/24/09)

      Fixed some logging errors
      Filled in most of Section V. C.

   Version 0.33 (9/24/09)

      Shortened Log Dates
      Added VCE Funtions under Section VII
      Added VCE Save/Load under Section VII
      Bolded Version Numbers in Section IX for better review

   Version 0.34 (9/24/09)

      Fixed even more coding errors
      Bolded All subsections within subsections

   Version 0.35 (9/25/09)

      Added First Tutorial!
      Massive Edits of Lego_Addict's Tutorial
      Added "Contents" under Section VI. B.

   Version 0.36 (9/26/09)

      Slight VCE changes
      Fixed vocabulary
      Other minor changes

   Version 0.37 (9/28/09)

      Added a second tutorial
      Updated Credits List

   Version 0.38 (10/21/09)

      Made minor changes
      Added to the Blockland forums

   Version 0.39 (10/27/09)

      Added "Lightswitch" tutorial
      Added "Color Changer" tutorial
      Extended Credits List

--- C. Versions 0.40 - 0.49 ---

   Version 0.40 (10/29/09)

      Fixed the Table of Contents
      Massive edits to BETC Google Edition   
      Credits list updated
      Fixed a few typoes
      Fixed some logging errors

   Version 0.41 (10/29/09)

      Filled in Section VII. E.
      Fixed Errors in the Table of Contents
      Changed names of Subsections in Section VII

   Version 0.42 (10/30/09)

      Fixed more coding errors
      Added a small bit of text
      Fixed some spelling errors
      Fixed some grammatical errors
      Shortened external reference names

   Version 0.43 (10/30/09)

      Changed Introduction
      Added links to BETC references
      Changed Some Colors

   Version 0.44 (11/06/09)

      Fixed more errors
      Corrected inaccurate information
      Began research on Zone Events

   Version 0.45 (12/03/09)

      Fixed even more errors
      Filled in Section VII D

   Version 0.46 (12/16/09)

      Updated color status
      Corrected incorrect information

   Version 0.47 (2/04/10)

      Added "Using retroCheck" in Section VII
      Added new values for the VCE

   Version 0.48 (3/31/10)

      Changed numerous event coding problems
      Fixed more typos
      Filled in Non-JVS Doors

   Version 0.49 (4/08/10)

      Filled in JVS Doors
      Fixed a few typos

--- D. Versions 0.50 - 0.59 ---

   Version 0.50 (4/15/10)

      Filled in Advanced Switches
      Filled in Print Blocks
      Filled in all non-tutorial sections!

   Version 0.51 (4/20/10)

      Fixed errors in section VII
      Added a section G to section VII
      Fixed errors in section I
      Added <a:url> to section I E.

   Version 0.52 (10/5/10)

      Fixed typos
      Globalized event format
      Filled in final subsection of VII

   Version 0.53 (5/4/11)

      Typo fixes
      Profile status correction
      BBCode improvement
      Picture added at beginning
      Removed outdated content

   Version 0.54 (2/1/12)

      Profile status correction
      Status correction for Senior Administration
      Hyperlink added for comments thread
      Updated to new Forum template
      Miscellaneous Fixes
« Last Edit: February 01, 2012, 07:05:42 PM by Boom »