Author Topic: Motion Sensor help  (Read 1517 times)

Hello, i just bought Blockland yesterday and worked out a cool House.
I wanted to add a Motion-Sensor (using Events) to my Door.
To be exact, to the place in front of my Entrance.
Which switches ON a light, for 20 seconds.
And after this 20 seconds, the light switches OFF automatically.

Well, it worked not as i wanted to.
Additional Info:
- I am playing on a Internetgame. So i want, that the Motion-Sensor works on every Player.

Here is a Screenshot of my Ground-Event (the Plate, a person walks over, to activate the Sensor)



At first i got a Question to VCE Mod - SubSystem (marked Red, upper right corner of the screen). Is it used in the correct way? "1 10" <-- to Run from Line 1 to Line 10, from this VCE_ifVariable.

Then, let me explain my Event:
- When a Player touches the plate (walks onto it), it checks if the Variable Sensor2 is 0
- Sensor2 = 0; Means Lights are currently OFF, so they could now be switched ON
- Sensor2 = 1; Means Lights are currently ON, so they CANT/shouldnt be switched ON now
- When Swnsor2 = 0, the Lights are getting switched ON, and the Value of Sensor2 is Set to 1 (which means, lights are currently ON)
- After that delay of 20 seconds, after they got switched ON, the lights will get switched back OFF, and the Value of Sensor2 gets back to 0 (which means, the lights are OFF and COULD be switched ON again, by the next "PlayTouch")

Now couple of things happen:
- 1.) Works ONLY @ me
- 2.) Works perfect.
- 3.) The Lights are Blinking as a Strobo-light (On, off, on, off, etc....)

So, what i think is, that the variable Sensor2 is only client sided.
That means, that only me has this Variable in his Client.
I have made a Brick, where i made "VCE_modVariable -> Sensor2 Set 0" on Activate.
So that this Variable got declared to my Client.
After this, it worked fine.
But only until, others activated the Brick (and with that declared the Sensor2-Variable to his client) Then the Motion-Sensor worked on this Player aswell.
But when we, both together, jumped over and over, the Motion-Sensor.
It got buggy, and started to STAY OFF, or started to BLINK like strobo-light.

So i think i need a Server-Declared Variable, where every Player, uses THE SAME Value, of the current state of the Motion-Sensor (ON/OFF).

How can i manage the Motion-Sensor, to work propper on all Players, automatically?
How can i store a Variable to the Server, that everyone can access it.
PS: I am NOT having Admin-Rights on this Server, i am a normal Player.

Thank you very much, for reading until here and i hope you can help me out.
Meanwhile, i will search the Forums too. But i couldnt find anything helpfull yet.

Best regards,
Deniz

Um.. why not just use onPlayerTouch???

Or zone bricks/events.

Why use VCE? If there's one thing I've learned on Blockland, it's that don't overcomplicate something that can work perfectly with half as many bricks or events. This could be accomplished with the simple "onPlayertouch" event. That way, you'll be dealing with a significantly smaller amount of events, and much less confusion.

And I apologize for the double post, but instead of having each lamp a different name, just have them all one name. It's much easier and less cunfusing.

Yeah i already found out that i can name any Lamp the same name.
Thanks.

Why you telling me to work with OnPlayerTouch.
Look my Screenshot, it IS working with OnPlayerTouch.

I am new to this Game and Event-System, Blockland uses.
Please speicify a bit more from the topic: zone bricks/events.

I had it simple, but then it didnt work as i wanted it to work.
Make a Wall with a Lamp, and a baseplate in front of it, with the
Events. Let a couple of People walk over/off it at the same time.
You will see, it will start to NOT work on the way, it should.

And still got the Problem, that a Player, who joins the Server
and walk over my Sensor-Plates, does not "have" the Variable.
So the Event Check cant be performed and the Lights wont be on.

I don't see any problems with the eventing...

On playertouch is all you need for this, with a timeout of 20000ms between the first set of stuff and last set. There's no need for all this variable stuff.

Zone bricks: Look on RTB
Events: You just used the most complicated version of events



"I had it simple, but then it didnt work as i wanted it to work" This happens all time to everyone. Just make it slightly differently


"And still got the Problem, that a Player, who joins the Server
and walk over my Sensor-Plates, does not "have" the Variable" Not sure why this should happen, and all the more reason to avoid VCE for this kinda thing. All players should have their variables at 0 unless saved, and there should be no reason for the player to have a variable before they spawn

Yeah i already found out that i can name any Lamp the same name.
Thanks.

Why you telling me to work with OnPlayerTouch.
Look my Screenshot, it IS working with OnPlayerTouch.


you used:

onPlayerTouch -> VCE_ifVariable -> [Sensor2] =
  • [110]

onVariableTrue -> <namedbrick> (lamp1) -> setLight -> RedDim
ect...


Here is what you should have done:

onPlayerTouch -> <namedbrick> (lamps) -> setlight -> RedDim

The ways posted before will work as follows;
Player touches brick - Everything goes red, untill the player stops touching the brick the light will keep turning red...
After the player has stopped touching the brick, the 20 second timer will begin.
I'm not sure if this is how you want it?

-Ohwait just saw your nice variable changing-


I would simply do...
  • [0][OnPlayerTouch]>[NamedBrick]>[setLight]>
  • [1][20000]
[OnPlayerTouch]>[NamedBrick]>[setLight]>[None]
[2][33][OnPlayerTouch]>[Self]>[setEventTimeout]>[20000]

With setEventTimeout I can't remember what the name is... (SetEventTimeout or EventTimeout) and I can't remember whether the time output is seconds or milliseconds (20 or 20,000) but you get the idea. I also can't remember whether it is an add-on... If it is you can just set event enabled (not true) then set event enabled (true) 20s later.

All players should trigger this, however it can't be re-activated once the 20,000 ms time has started

I know an even SIMPLER way:
use onPlayerTouch and then tell it to turn on the lights and turn them of after a 20000 millisecond delay, and have the brick disappear for 20 seconds to it will wait for 20 seconds to do it again.

-snip-

[0][0][OnPlayerTouch]>[NamedBrick]>[setLight]>[Red]
[1][20000][OnPlayerTouch]>[NamedBrick]>[setLight]>[None]
[2][33][OnPlayerTouch]>[Self]>[setEventTimeout]>[20000]

-snip-
Fix't bbc.

Fix't bbc.
Thats what I was trying to say, I just didnt finish it.

Hello to everyone,

i was busy, so i had no time to check the Forum again, yet.

Thank you very much, to all, who are helping.
The Server where i am playing, at the moment, went offline for maintenance.
So i wont be able to test it now, but will do later.

The mentioned way looks nice, thank you =)

Best regards. Deniz`

You know all variables are set to "1" by default?
It's either 1 or some other number. >:(

You know all variables are set to "1" by default?
It's either 1 or some other number. >:(
They are actually set to a null value, basically being 0.