Author Topic: A good VCE tutorial  (Read 1656 times)

Could you give me a link or description on VCE?

thanks

I remember when I didnt know VCE...

So basically its like this:
Modvariable is to modify a variable, so say

Code:
OnActive>player>vcemodvariable[gold[add]25]
OnActive>client>bottomprint>[You get 25 gold]
But if you want the person to work for it, say you make a tree, the player must cut it down to
get wood, now this would be an advanced tree (not just one that you click and it dissapears) :

Code:
Onactive>Self>VCEifvariable>cuts[>]15]
Onvariabletrue>player>VCEmodvariable>[wood[add]1]
Onvariabletrue>client>bottomprint>[You got 1 log, you now have <var:pl:wood> logs.]
Onvariabletrue>self>VCEmodvariable>[cuts[set]0]
Onvariabletrue>self>disapear[5]
Onvariablefalse>self>VCEmodvariable>[cuts[add]1]
Onvariablefalse>client>bottomprint>[Tree: <var:br:cuts> /15 cuts.]
Onvariablefalse>self>playsound>[swordhit.wav]
Im pretty sure thats correct,
now what its telling you and the brick to do is when you hit thhe brick it adds the variable, and only once that variable is reached it then awards you with logs, now if you would like to sell the logs:

Code:
Onactive>player>VCEifvariable>[wood[>]1]
Onvariabletrue>player>VCEmodvariable>[money[add]5]
Onvariabletrue>client>bottomprint>[You got 5 dollars, you know have <var:pl:money> dollars
Onvariabletrue>player>VCEmodevariable>[wood[subtract]1]
Onvariablefalse>client>bottomprint>[you don't have enough wood!]
Now what this is doing is it is giving you 5 dollars in exchange for 1 peice of wood.

PM me if you need more info.
-guide by Sniper Pete

Variable/Conditional Events
Information:
Features
A large variety of input and output events to make the best event contraptions possible
A function system with arguements, for advanced users who want to make the best event contraptions out there
In-game manual you can call upon if you get lost
In-game changelog so you can find out whats new
Hundreds, even thousands, of users that use this mod, where you can get help from

Input Events
onVariableTrue
This input is called when a variable check comes back true.
onVariableFalse
This input is called when a variable check comes back false.
onVariableFunction
This input is called when a function is called. Read the manual for more information.
onVariableUpdate
This input is called after VCE_modVariable or when a varlink is clicked.

Output Events
VCE_modVariable
The modVariable event is simply what it states; it allows you to modify the value of variables. The first arguement of this event is a pop-down list in which you select the target you want to modify the variable of. The second arguement is the name of the variable. The third arguement is the modVariable function, most of the modVariable functions are self-explanatory, but for the confusing ones you can check out the "modVariable Functions" sub-category in the Beginner area in the manual. The fourth arguement/parameter is the value to which the mod function needs. For example, if you are using the mod function "Set" the fourth arguement will be the new value of the variable. If you were using the mod function "Add" the fourth arguement would be the amount you would like to add to the variable's value.
VCE_ifVariable
The ifVariable is for doing conditional checks on the target's variable values. For example:
Code:
onActivate > Client > VCE_ifVariable > [test] [==] [1] [""]

The above events will check to see if the client's variable "test" is equal (==) to 1. If it is it will process all "onVariableTrue" inputs, otherwise process all "onVariableFalse" inputs. The first arguement of this event is the name of the variable you are checking. The second arguement is the type of conditional logic you want to use. Here's what the symbols mean:
==: Equals
!=: Does not equal
>=: Larger than or equal
<=: Smaller than or equal
<: Smaller than
>: Larger than
~=: Similar or equal
The fourth arguement in this event is the sub data. You can read the manual to find out what sub data is, but until then it will work fine with out it.
VCE_ifValue
This is for comparing two values. This is for advanced users only, as this requires knowledge about variable replacers. You can read about variable replacers in the "Advanced" area on the manual.
VCE_retroCheck
Allows you to do simple if* checks like the old versions of this mod. All of the checks are self explanatory. Note: ifAdmin does not use the other parameters, only the first one. It simply triggers onVariableTrue if the client is admin and oNVariableFalse if the client is not admin.
VCE_saveVariable
This saves a client or player's variable to a file then can be loaded again with the VCE_loadVariable event. The first arguement is the target and the second arguement is the name of the variable. You can also put multiple names of variables seperated by commas and it will save all of them.
VCE_loadVariable
This loads a previously saved variable that was saved by the VCE_saveVariable event. The first arguement is the target and the second is the name of the variable.
VCE_callFunction & VCE_stateFunction
For advanced users only. You can read about these in the "VCE Functions" sub-category in the Advanced area on the manual.
Please read the in-game manual thoroughly before asking questions.
Credits:
Destiny - Core Scripter
Truce - Scripter
Clockturn - Scripter
Chrono - Scripter
Lilboarder - Documentation
"Everyone who supports us."