Author Topic: [RESOURCE] Eventing Variables tutorial.  (Read 3667 times)

Introduction
I see a lot of people wanting to know how to do things with events that could easily be done with Z0W0's VCE system.
So I'm making this tutorial on how to create a money system, and what you can do with it.


Cool stuff you need
Download Z0W0's VCE here.
http://forum.returntoblockland.com/dlm/viewFile.php?id=150

There are also third party add-ons that can be done with VCE:


Basics of VCE
You can do quite a bit with variables, let's look at all the default variables that come with the add-on.

--Client.

Quote
- Client <var:cl:BRICKCOUNT> - get's your brickcount.
- Client <var:cl:bl_ID> - get's your bl_id.
- Client <var:cl:name> - Gets your name.
- Client <var:cl:kdratio> your kd.
- Client <var:cl:clanprefix> your clan's prefix.
- Client <var:cl:clanfuffix> Your clan's suffix.
- Client <var:cl:score> your score.
- Client <var:cl:lastmsg> gets your last message said.
and much more.

--Player
Quote
- player <var:pl:health> - your players health.
- player <var:pl:maxhealth> max health.
- player <var:pl:speed> your players speed.
- player <var:pl:itemy>
- player <var:pl:currentitem> your player's current holding item
.

--Global
Quote
- Global variables <var:global:date> current date.
- Global variables <var:global:brickcount> server's brickcount.
- Global variables <var:global:time> military time( i think ).
- Global variables <var:global:servername> server's name.
- Global variables <var:global:port> server's port.
- Global variables <var:global:maxplayercount> the max players that the admins of the server put.
- Global variables <var:global:playercount> how many clients are connected.
Alot more of these but I think you get the point.

--Slayer's VCE variables via http://blockland.nullable.se/wiki/Slayer#VCE_Variables
Quote
    <var:cl:lives> Gives the player's remaining lives.
<var:cl:kills>
<var:cl:deaths>
<var:cl:team> Player's team number.
<var:cl:teamName> Player's team name.
<var:cl:teamNameColored> Player's team name, colored the team color.
<var:cl:teamColor> Player's team color. Use in place of a color code like <color:ff00ff>
<var:cl:teamScore>
<var:cl:teamMembers> Number of players on the team.
<var:br:teamName> The team (or teams) in control of the brick.
<var:br:teamNameColored> Same as above, but colored team colors.
<var:mg:teamScore[1-6]> The team score for team X: <var:mg:teamScore3>
<var:mg:teamMembers[1-6]> The number of players on team X: <var:mg:teamMembers2>
<var:mg:teamCount> The total number of teams.
<var:mg:gamemode> The fName of the gamemode.
<var:mg:resetting> Whether the round is resetting.
<var:mg:useRounds>
<var:mg:useTeams> Whether the gamemode allows teams.
<var:mg:lives> The minigame starting lives.
<var:mg:points> Number of points to win.
<var:mg:time> Total time to win.



Now let's continue to create our own variables.

Let's make a system of coins.

OnActivate >> Client >> VCE_modVariable [Coins] Add [5]
OnActivate >> Client >> ChatMessage [you now have <var:cl:coins> Coins.


Quote
Q. What did we just do?
A. We just created a variable for clients.

Q. What's the difference between client, player, and global, Plate?
A. Client is saved to their client(bl_id).  Player is just saved to the player, until they leave, global, is for the server.

Now what can we do with that variable I just made?
Let's make a system where if we have 10 Coins we can buy a Spear.

OnActivate >> Client >> VCE_ifVariable [Coins] >= [10]
OnVariableFalse >> Client >> ChatMessage [you do not have enough Coins]
OnVariableTrue >> Client >> ChatMessage [You bought a Spear for 10 coins]
OnVariableTrue >> Player >> setItem >> [Spear]
OnVariableTrue >> Client >> VCE_ModVariable [Coins] Subtract [10]
OnVariableTrue >> Client >> ChatMessage [you now have <var:cl:coins> Coins.]


Quote
Q. What did we just do now?
A. We bought a Spear for 10 coins, we checked if their coins were greater or equal to 10, If they didn't It displayed [You do not have enough coins.], If they did have 10 coins, It said they Bought the Spear for 10 coins, and set the Item Spear, then it took away the 10 Coins, and told them their Coin ammounce.


Quote
Q. Now, Plate, what can we do with the the add-on HUD Prints you linked?
A. Here, i'll show you.

Inside your RTB preferences you find a section called HUD prints, you can use that to display variables.

BottomPrint: [Health: <var:pl:health>  Coins: <var:cl:coins>]

Quote
Q. So, I can display variables in the HUD prints selection?
A. Yep.


If you have any more questions or would like to learn more, PM me or post here inside the thread about what you would like to know, and I hope this helped.
« Last Edit: May 21, 2013, 04:31:16 PM by Plate »

Reserving for whatever reason.

You'll probably want to add more to the variable listings like <var:pl:sitting> and <var:pl:jetting>(?)

I would've made a more in-depth tutorial also giving more examples of doing stuff with VCE, but this covers stuff up.
You should try adding more "stuff you can do".
Perhaps you can include community events?

Also, player also has <var:pl:itemy> y being 1-5.
Also, worth mentioning that installing Slayer has it's own set of events.
http://blockland.nullable.se/wiki/Slayer#VCE_Variables
Also, you forgot minigame events.
Also, you forgot to mention about functions.
« Last Edit: May 21, 2013, 04:22:27 PM by LeetZero »

Perhaps you can include community events?
Not sure what you mean, elaborate.

Included Slayer's variables.

Not sure what you mean, elaborate.

Included Slayer's variables.

Basically include VCE events some people make, or ideas, or something.

Basically include VCE events some people make, or ideas, or something.

This is mainly for VCE it's self, this is the basics, when I found all this stuff out in OP, i learned the rest on my own.

This is mainly for VCE it's self, this is the basics, when I found all this stuff out in OP, i learned the rest on my own.

Yeaah but you could've done a better op formulation/styling.
Though I appreciate you doing this, I like it when there are lists of variables and stuff instead of having to look rarely-used ones up, and plus I think this will help a lot of people... more or less.

Yeaah but you could've done a better op formulation/styling.
Though I appreciate you doing this, I like it when there are lists of variables and stuff instead of having to look rarely-used ones up, and plus I think this will help a lot of people... more or less.
If you feel like you wanna help, just PM me everything you want to include, and I'll put it all in the reserved post and give you credit.

Thanks if you do, that would be awesome.

dude
why is everything centered