Author Topic: Event Suggestion: VCE Sets  (Read 1614 times)

I had this idea a while ago, before I knew functions, and when I reached the max of 100 lines of events on a single brick.  What this VCE extension does is that instead of entering a single variable in the output  paramaters for ifvariable and modvariable, you can type a set of variables, or values.  For ifvariable, the output param check value would then check if any variables, or every variable (maybe a check box for switching between all or any?), would fit the required check.  If a set is typed in the value box, then each number in the value box has to correspond to a variable in the output param variable box.  This way, fewer events can be used to make more complex creations.  The same can be done for modvariable.

Examples.

For ifvariable with a Variable set and single Value.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [==] [0] [1 1]
[1] [Onvariabletrue] [Player] [Kill]

For ifvariable with a single Variable and a Value set.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [Hunger] [==] [{1, 5, 10, 25, 50, 75}] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [Your hunger: <var:cl:Hunger>/100]

For ifvariable with a Variable set and Value set

Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [{Strength, Hunger, Thirst}] [==] [{100, 50, 100, 100}] [1 1]
[1] [Onvariabletrue] [Self] [Spawnexplosion] [Vehiclefinalexplosion] [------||-]

For Modvariable with variable set and single value.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Modvariable] [{Hunger, Thirst, Energy}] [set] [100]

For Modvariable with single variable and value set. Not possible

For Modvariable with variable set and value set.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Modvariable] [{Speed, defense, attack}] [add] [{5, -5, 5}]

If the number of variables in a set does not match the number of values a set, then the events will not work.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Modvariable] [{Hunger, Thirst, Energy}] [set] [{100, 100}]
This won't work.

A check box after the variable set box can change between any and all for ifvariable variable set to single value event lines.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [x] [==] [100]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]
This checks if either Hunger, thirst, or energy is 100. 
/discuss or /make
« Last Edit: October 17, 2012, 11:32:31 PM by Gen. Hothauser »


Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [x] [==] [100]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]
This checks if either Hunger, thirst, or energy is 100. 
/discuss or /make
What happened to this?
Code: [Select]
[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

What happened to this?
Code: [Select]
[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

The first one you quoted was for demonstrating a check if hunger, thirst, or energy were 100, thus any one of the variables could be 100, not all of them have to be 100.  The second one you quoted was for demonstrating a variable set and single value check, just for demonstrating a single thought before I added the first quoted events.

This checks if either Hunger, thirst, or energy is 100. 


This, below, checks that.
Code: [Select]
[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]
That basically reads out as: "If your Hunger or thirst or energy are 100", which is what you were asking for.
In vce, the || character means 'or'.
It outputs true as long as at least one of those values are 100.

you can raise max events on a brick can't you

you can raise max events on a brick can't you
Not that I'm aware of.

He wants one line that checks for 3 independent variables that meet a certain condition.

IE:

If hunger, thirst AND energy = 100, then the event is triggered.

Example:Works?
24, 78, 92No
12, 78, 100No
100, 100, 85No
100, 100, 100Yes

He wants one line that checks for 3 independent variables that meet a certain condition.
That already exists.
Code: [Select]
[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger & Thirst & Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]
« Last Edit: October 18, 2012, 09:30:26 PM by Evar678 »

So 2 & signs=key to happiness?

What are more of these vague symbols and underlying knick knacks that make VCE do amazing things?

*edit*
You're the guy that is making the advanced VCE manual. Nevermind. I'll wait for it's release.
« Last Edit: October 18, 2012, 09:30:21 PM by J MASTER »

Er, i meant one & sign, my bad.
Basically, || = or, and & = and.

Er, i meant one & sign, my bad.
Basically, || = or, and & = and.

Oh, I just realized you didn't quote me on that second event a while back.  I never realized there were or functions set in VCE.  This is what I get for just figuring out VCE and never looking at the manual.  Thanks, I know that now.  I assume & works invetween the variables like || does but for and instead of or.  But, do we have a way to check these:

For ifvariable with a single Variable and a Value set.

Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [Hunger] [==] [{1, 5, 10, 25, 50, 75}] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [Your hunger: <var:cl:Hunger>/100]

For ifvariable with a Variable set and Value set

A magical bomb that requires all stats to be maxed out.
Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [{Strength, [b]Mana[/b], Hunger, Thirst}] [==] [{100, 50, 100, 100}] [1 1]
[1] [Onvariabletrue] [Self] [Spawnexplosion] [Vehiclefinalexplosion] [------||-]

In my OP, I accidentally removed mana, and didn't remove the value that corresponded to the mana variable.  Sorry for any confusion that may have occurred.

For Modvariable with variable set and value set.

A magic potion that makes you faster and stronger, but lessens your defense.
Code: [Select]
[0] [Onactivate] [Client] [VCE_Modvariable] [{Speed, defense, attack}] [add] [{5, -5, 5}]

If the number of variables in a set does not match the number of values a set, then the events will not work.

A rejuvenation potion that resets your conditional stats.
Code: [Select]
[0] [Onactivate] [Client] [VCE_Modvariable] [{Hunger, Thirst, Energy}] [set] [{100, 100}]
This won't work.

I updated some of the events and added descriptions as to what they can be used for.  I don't plan on using any of the example events in any build in the future, it was just easiest to come up with some classic MMORPG fantasy items in event form.

Also, in the examples you gave, you used braces when listing like {Hunger||Thirst||Energy}.  Are braces required, was it a typo, or is it a good organizational technique?

Also, in the examples you gave, you used braces when listing like {Hunger||Thirst||Energy}.  Are braces required, was it a typo, or is it a good organizational technique?
The two braces is the symbol for the 'or' logic, that wasn't for organization.

I assume & works invetween the variables like || does but for and instead of or.
Yes, and remember, its only one &, not two. Having 2 &'s was a mistake by me.

But, do we have a way to check these:
Code: [Select]
[0] [Onactivate] [Client] [VCE_Ifvariable] [Hunger] [==] [{1, 5, 10, 25, 50, 75}] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [Your hunger: <var:cl:Hunger>/100]
Yes theres a way.
Code: [Select]
[0] [0] [Onactivate] [client] [VCE_Ifvariable] [loop] [!=] [{1}] [1 1]
[1] [0] [OnVariableTrue] [client] [VCE_Ifvariable] [Hunger] [==] [{1}] [2 3]
[2] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[3] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{5}] [4 5]
[4] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[5] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{10}] [6 7]
[6] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[7] [0] [OnVariableFalse] [Client] [Vce_Ifvariable] [Hunger] [==] [{25}] [8 9]
[8] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[9] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{50}] [10 11]
[10] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[11] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{75}] [12 13]
[12] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[13] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{100}] [14 15]
[13] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[14] [0] [OnVariableFalse] [Client] [VCE_ModVariable] [loop] [set] [1]
[15] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [loop] [==] [1] [1 1]
[16] [500] [OnVariableTrue] [Client] [VCE_Ifvariable] [hunger] [==] [<var:pl:hunger>] [1 1]
The above was typed at 3:30 am, apologies if theres mistakes.

Anyway, that's a very basic vce loop. It will infinitely check that variable until one of the conditions are met. It's a little bulky on events, but, its lightweight on your server, and it works.
Its basically a bare-boned 'for' loop.
More info on loops whenever i finish the advanced vce manual.

The two braces is the symbol for the 'or' logic, that wasn't for organization.
Yes, and remember, its only one &, not two. Having 2 &'s was a mistake by me.
Yes theres a way.
Code: [Select]
[0] [0] [Onactivate] [client] [VCE_Ifvariable] [loop] [!=] [{1}] [1 1]
[1] [0] [OnVariableTrue] [client] [VCE_Ifvariable] [Hunger] [==] [{1}] [2 3]
[2] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[3] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{5}] [4 5]
[4] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[5] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{10}] [6 7]
[6] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[7] [0] [OnVariableFalse] [Client] [Vce_Ifvariable] [Hunger] [==] [{25}] [8 9]
[8] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[9] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{50}] [10 11]
[10] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[11] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{75}] [12 13]
[12] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[13] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [Hunger] [==] [{100}] [14 15]
[13] [0] [OnVariableTrue] [Client] [Centerprint] [Your hunger: <var:cl:hunger>/100]
[14] [0] [OnVariableFalse] [Client] [VCE_ModVariable] [loop] [set] [1]
[15] [0] [OnVariableFalse] [Client] [VCE_Ifvariable] [loop] [==] [1] [1 1]
[16] [500] [OnVariableTrue] [Client] [VCE_Ifvariable] [hunger] [==] [<var:pl:hunger>] [1 1]
The above was typed at 3:30 am, apologies if theres mistakes.

Anyway, that's a very basic vce loop. It will infinitely check that variable until one of the conditions are met. It's a little bulky on events, but, its lightweight on your server, and it works.
Its basically a bare-boned 'for' loop.
More info on loops whenever i finish the advanced vce manual.

Oh stuff, I should have been more specific.  Ya, I knew how to do what you typed out.  The reason for the Set extension is to reduce the number of events needed to do this, because I have run out of room for events many times.  So instead of using 17 lines of events, you'd only need to use 1.

Oh stuff, I should have been more specific.  Ya, I knew how to do what you typed out.  The reason for the Set extension is to reduce the number of events needed to do this, because I have run out of room for events many times.  So instead of using 17 lines of events, you'd only need to use 1.
I know, but sadly, until somebody makes this addon, this is basically the only way to test that.
You do know that you can just use multiple bricks, right?