Author Topic: VCE - checking variables through bricks  (Read 368 times)

I'm attempting a special kind of CTF that uses resources for upgrades.
(I'm using Slayer if that makes any difference)
However, I thought that instead of allowing every player on a team to purchase upgrades for the team individually, I added a sort of resource stockpile in the main base of both teams. (This allows for more teamwork and is useful because variables are player-sided and lost upon death <-- this is intentional)

So rather than having VCE check individual player's variables, all resource variables are first transferred to a specific brick. i.e. Metal_Total_Team1. This transfers all metal to that brick, then uses if statements to check the variables. So if the team's stockpile contains all necessary resources (this can be more than one variable like metal & oil) the upgrade is activated.

After a while of troubleshooting through all the events, I think I've nailed down the problem:

One brick is named Test_Brick. When activated, a variable (A) is set to one.

onActivate -> self -> VCE_modVariable -> Brick [A] -> set [1]

A second brick has the following events:

onActivate -> NAMED BRICK (Test_Brick) -> VCE_ifVariable [A] == [1]

Any True/False events following this have failed to execute. I've made sure all the bricks have the proper number of variables, so that isn't the problem.

I'm assuming this is an easy fix, or I'm just overlooking something.
VCE should be able to check for variables through bricks, right?

don't you have to do <var:nb_Test_Brick:A>?

i don't know other than that

don't you have to do <var:nb_Test_Brick:A>?
that seems to only work for displaying variables.

that seems to only work for displaying variables.
try using VCE_ifValue with that.

when you're calling onactivate>namedbrick[test brick]>VCE_ifvariable[brick][a][==][1], that calls VCE_ifvariable[brick][a][==][1] on test brick, and triggers events on test brick
you could have different lines of onvariabletrue's to then trigger named bricks for upgrades