Blockland Forums > Help
BETC
Deathwishez:
I am making an online tutorial on the forums for basic, and advanced, events. BETC, read "BET" "C", or betsy, is know as Boom's Event Training Center (Boom is my online user name). It was originally designed to be a building on SS, but sadly the server is down, so until it is up, I will induce live brainstorming here.
On that note, one either state what you wish to be included, or ask how to event something, or two, state how to event something random. (Like explain how the Midi Synth Machine Works.) Right now, I won't list anything until I have a good, and detail way of explaining things. I will try to make a table of contents, so that you guys can put something like, III. A, at the beginning of your reply so that the helpless can just look at the contents, and scroll through looking for the right numeral, and letter. Until then, just ask questions. Have fun learning!
Deathwishez:
BETC
Written By: Boom
Co-Writer: Nasa62 (Mr. Doom)
Version 0.37
===== 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 Buttons
B. JVS Buttons
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. VCE Tutorial
B. VCE Values
C. VCE Variables
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
Deathwishez:
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 2,176,782,336, 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): http://digitalconsciousness.com/reference/colorcodetest.phtml
Color Table (Easy to use, Easy to Print) : http://trafficlog.info/WebTutor/bgcolors1536.png
Color Table : http://www.htmltricks.com/htmlcolortips.htm
Color Table : http://www.immigration-usa.com/html_colors.html
--- 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
Comic sans
Heveltica
Impact
Jokerman
Kristen ITC
LCD
Lucida Console
Lucida Sans Unicode
Monotype corsiva
Outlineletters
Outline
Palatino Linotype Bold
Palatino Linotype
Papyrus
pusillanimous individualcat
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.
<var:client:name> : Display the player who started the print's name.
<var:client:bl_id> : Display the player who started the print's Blockland Identification Number.
<var:brick:printcount> : Displays the print count of a print block.
--- F. Other ---
Character Limit:
There is a 255 Character Limit.
"<>" Commands are included in this count.
Deathwishez:
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: --- [X] 0 [ ] onActivate > Player > setPlayerScale > [I---------]
--- End code ---
This simply makes you small.
Because I prefer taking simple things to the point of confusion,
I'll add some more things.
--- Code: --- [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
--- End code ---
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: --- [X] 0 [ ] onContentStart > Player > setPlayerScale > [I---------]
--- End code ---
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: --- [X] 0 [ ] onContentStart > Player > setPlayerScale > [I---------]
[X] 1 [ ] onActivate > Self > contentStart > TrustLevel3 > [ ]
[X] 2 [ ] onContentStart > Self > contentStop > Unrestricted > [ ]
--- End code ---
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: --- [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]
--- End code ---
Now the button "clicks" and buzzes if a person without Trust Level 3 presses it.
Now to add some nice little "centerPrint" events.
--- Code: --- [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.]
--- End code ---
There you have it! A JVS Button that shrinks you.
Deathwishez:
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: --- 0 [X] onActivate > Self > toggleEventEnabled [1 2]
1 [X] onActivate > Self > setLight > PlayerLight
2 [ ] onActivate > Self > setLight > None
--- End code ---
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: --- 0 [X] onActivate > Self > toggleEventEnabled [1 2 3 4]
1 [X] onActivate > Self > setLight > PlayerLight
2 [ ] onActivate > Self > setLight > None
3 [X] onActivate > Self > playSound > lightOn.wav
4 [ ] onActivate > Self > playSound > lightOff.wav
--- End code ---
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: --- 0 [X] onActivate > Self > toggleEventEnabled [1 2 3 4 5 6]
1 [X] onActivate > Self > setLight > PlayerLight
2 [ ] onActivate > Self > setLight > None
3 [X] onActivate > Self > playSound > lightOn.wav
4 [ ] onActivate > Self > playSound > lightOff.wav
5 [X] onActivate > Client > centerPrint [You turn the light on.]
6 [ ] onActivate > Client > centerPrint [You turn the light off.]
--- End code ---
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: --- 0 [X] onActivate > Self > toggleEventEnabled [1 2 3 4 5 6]
1 [X] onActivate > Self > setLight > PlayerLight
2 [ ] onActivate > Self > setLight > None
3 [X] onActivate > Self > playSound > lightOn.wav
4 [ ] onActivate > Self > playSound > lightOff.wav
5 [X] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
6 [ ] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]
--- End code ---
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: --- 0 [X] onActivate > Self > contentStart > CW > Unrestricted > [ ]
1 [ ] onActivate > Self > contentStop > CW > Unrestricted > [ ]
2 [X] onActivate > Self > toggleEventEnabled > [0 1]
--- End code ---
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: --- 0 [X] onActivate > Self > toggleEventEnabled [1 2 3 4 5 6]
1 [X] onActivate > Self > setLight > PlayerLight
2 [ ] onActivate > Self > setLight > None
3 [X] onActivate > Self > playSound > lightOn.wav
4 [ ] onActivate > Self > playSound > lightOff.wav
5 [X] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
6 [ ] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]
--- End code ---
Now to tweak it:
--- Code: --- 0 [X] onActivate > Self > contentStart > CW > Unrestricted > [ ]
1 [ ] onActivate > Self > contentStop > CW > Unrestricted > [ ]
2 [X] onActivate > Self > toggleEventEnabled > [0 1]
3 [X] onActivate > Self > setLight > PlayerLight
4 [ ] onActivate > Self > setLight > None
5 [X] onActivate > Self > playSound > lightOn.wav
6 [ ] onActivate > Self > playSound > lightOff.wav
7 [X] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
8 [ ] onActivate > Client > centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]
--- End code ---
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: --- 0 [X] onActivate > Self > contentStart > CW > Unrestricted > [ ]
1 [X] onActivate > Self > contentStop > CW > Unrestricted > [ ]
2 [X] onActivate > Self > toggleEventEnabled > [0 1]
3 [X] onContentStart > Self > setLight > PlayerLight
4 [X] onContentStop > Self > setLight > None
5 [X] onContentStart > Self > playSound > lightOn.wav
6 [X] onContentStop > Self > playSound > lightOff.wav
7 [X] onContentStart > Client > centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
8 [X] onContentStop > Client > centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]
--- End code ---
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: --- 0 [X] onActivate > Self > contentStart > CW > Unrestricted > [ ]
1 [X] onActivate > Self > contentStop > CW > Unrestricted > [ ]
2 [X] onActivate > Self > toggleEventEnabled > [0 1]
3 [X] onContentStart > <NAMED BRICK> > Light > setLight > PlayerLight
4 [X] onContentStop > <NAMED BRICK> > Light > setLight > None
5 [X] onContentStart > <NAMED BRICK> > Light > playSound > lightOn.wav
6 [X] onContentStop > <NAMED BRICK> > Light > playSound > lightOff.wav
7 [X] onContentStart > Client > centerPrint [<color:FFFFFF>You turn the light <color:00FF00>ON<color:FFFFFF>.]
8 [X] onContentStop > Client > centerPrint [<color:FFFFFF>You turn the light <color:FF0000>OFF<color:FFFFFF>.]
--- End code ---
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 ---
(Coming Soon)