Author Topic: VCE function - need help  (Read 835 times)

So how do I use VCE events? I don't get the tutorial, would someone mind explaining it a bit more detailed?

Let's say I have a brick called "brick1" on which i state the function "function1"
Then I call the function from some other brick like this:

onActivate -> NamedBrick [brick1] ->VCE_callfunction [function1] [argument goes here]

First of all, what kind of arguments can I use, and how can "brick1" process them?

Let's say I call "function1" with argument "cake"
If I understood it right, my brick "brick1" now saves the value "cake" to a variable called "arg0" Is that right so far?

Can I make an event like:
onVariableFunction -> self -> ifvalue -> [<var:br:arg0>] == [cake]
?

Help would be much apreciated.

Reading the VCE manual can be quite a bit to take in at once. I suggest you attempt to do something before asking questions.

Reading the VCE manual can be quite a bit to take in at once. I suggest you attempt to do something before asking questions.

I did, but I didn't get the arguments to work. I succeeded in calling a function from another brick, but I guess I could have used relays for that (unless I wanted more than one)

From what you've posted, it seems correct to me. However, I believe it only accepts variables. I may be wrong though.

If you're passing more than one, be sure to seperate them with an '|'. ("<var:cl:name> | <var:cl:bl_id>").

It's possible that you just made a dummy error and mispelled something. I make goofy mistakes all the time.


Quote
# Event Saver v0.1 - 05/12/11 20:53:02
X 0ms   onActivate   Self   VCE_stateFunction   function1   
X 0ms   onVariableFunction   Self   VCE_ifValue   <var:br:arg0>   ==   green   2 2
X 0ms   onVariableTrue   Self   setColor   green
X 0ms   onVariableFunction   Self   VCE_ifValue   <var:br:arg0>   ==   red   4 4
X 0ms   onVariableTrue   Self   setColor   red
this is "Brick"

Quote
# Event Saver v0.1 - 05/12/11 20:52:44
X 0ms   onActivate   ID Brick   VCE_callFunction   function1   green
and this is where i call the function from.
But it doesnt work :S


Try changing "green" in the argument parameter box on the other brick to "<var:cl:lastmsg>". Then say "green", and see what happens.

Also, make sure that you've activated "Brick" or else there's no function to be called.