Blockland Forums > Suggestions & Requests

Event Suggestion: VCE Sets

Pages: (1/4) > >>

Gen. Hothauser:

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: ---[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [==] [0] [1 1]
[1] [Onvariabletrue] [Player] [Kill]

--- End code ---

For ifvariable with a single Variable and a Value set.


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

--- End code ---

For ifvariable with a Variable set and Value set


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

--- End code ---

For Modvariable with variable set and single value.


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

--- End code ---

For Modvariable with single variable and value set. Not possible

For Modvariable with variable set and value set.


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

--- End code ---

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


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

--- End code ---
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: ---[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [x] [==] [100]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

--- End code ---
This checks if either Hunger, thirst, or energy is 100. 
/discuss or /make

SWAT One:

Great idea.  /support

Evar678:


--- Quote from: Gen. Hothauser on October 18, 2012, 12:27:34 AM ---
--- Code: ---[0] [Onactivate] [Client] [VCE_Ifvariable] [{Hunger, Thirst, Energy}] [x] [==] [100]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

--- End code ---
This checks if either Hunger, thirst, or energy is 100. 
/discuss or /make

--- End quote ---
What happened to this?

--- Code: ---[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

--- End code ---


Gen. Hothauser:


--- Quote from: Evar678 on October 18, 2012, 04:16:41 PM ---What happened to this?

--- Code: ---[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

--- End code ---

--- End quote ---

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.

Evar678:


--- Quote from: Gen. Hothauser on October 18, 2012, 12:27:34 AM ---This checks if either Hunger, thirst, or energy is 100. 

--- End quote ---


This, below, checks that.

--- Quote from: Evar678 on October 18, 2012, 04:16:41 PM ---
--- Code: ---[0] [Onactivate] [Client] [VCE_IfVariable] [{Hunger || Thirst || Energy}] [==] [100] [1 1]
[1] [Onvariabletrue] [Client] [Centerprint] [You win]

--- End code ---

--- End quote ---
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.

Pages: (1/4) > >>

Go to full version