Author Topic: Need a little VCE help  (Read 381 times)

Why doesnt this work:

0
  • onminigamereset -> self -> modvariable [team] -> set [2]

1
  • onteamplayertouch1 -> self -> VCEifvariable [team] == [1] -> [2 4]

2
  • onvariablefalse -> self -> modvariable [team] -> set [1]

3
  • onvariablefalse -> self -> firerelayup

4
  • onvariablefalse -> minigame -> chatmsgall ["Team 1 has captured the flag"]


5
  • onteamplayertouch2 -> self -> VCEifvariable [team] == [2] -> [6 8]

6
  • onvariablefalse -> self -> modvariable [team] -> set [2]

7
  • onvariablefalse -> self -> firerelayup

8
  • onvariablefalse -> minigame -> chatmsgall ["Team 2 has captured the flag"]


When a player touches the brick, no matter if it is team 1 or 2, it keeps firing relays up and keeps saying the minigame-chatmsg.
I think it doesnt change the variable of the brick, but I don't know why.


Code: [Select]
0 [0] onminigamereset -> self -> modvariable [team] -> set [2]
1 [0] onteamplayertouch1 -> self -> VCEifvariable [team] == [1] -> [2 4]
2 [0] onvariablefalse -> self -> modvariable [team] -> set [1]
3 [0] onvariablefalse -> self -> firerelayup
4 [0] onvariablefalse -> minigame -> chatmsgall ["Team 1 has captured the flag"]
5 [0] onteamplayertouch2 -> self -> VCEifvariable [team] == [2] -> [6 8]
6 [0] onvariablefalse -> self -> modvariable [team] -> set [2]
7 [0] onvariablefalse -> self -> firerelayup
8 [0] onvariablefalse -> minigame -> chatmsgall ["Team 2 has captured the flag"]
Well, one problem I see is that you're checking the "Self", the actual brick, to see what its team is. And when the minigame is reset, it sets the team to 2. So the team would always be 2.

How would the team always be 2? When team 1 touches, the brick checks what team the brick is asigned to. If the check "is team 1?" fails, then the new value is set to team 1. Or so I thought...

Oh, sorry, I misunderstood it. Do you have a server? I fix problems better when I can do a few tests.

Noedit:
Fixed the problem. "team" is apparently a built in variable already. Once I set it to "teamT", it worked the way it should have.

Thanks for helping and locking!