Feature request!
Brought up by fren in THIS thread about a vp version of FPs FlashforMS command to blink lights for a duration, and I thought it would be handy to add to light objects in VPX.
a light object BlinkDuration(integer) which by default would be 0 or -1 for blink until shut off, then you could call Light.blinkduration, 50 and it would start it blinking whatever the pattern was currently set as for 50ms.
see the linked thread above for more details, but I personally would use this a lot! Yes it's fairly easy to script something like this, but it would be even easier to do it without having to make a bunch of _timer subs.
Thanks
edit: forgot to add in that should probably have an end-state variable on there as well to tell it either on or off after the blink time (0 or 1) so Light.blinkduration, 50, 1 for blink for 50ms then have light be on.
But isn't that already there? Check the CommandReference.txt under LIGHT:
State(LightState) - 0=Off, 1=On, 2=Blinking
BlinkInterval(int) - the value is in ms
Only the mysterious BlinkPattern only works if set to 10. I didn't understand the meaning of it or what it suppose to do so it could be broken
True that part is there, but I think what fren is looking for an I am looking for is to say "run that blink pattern for the next 5 seconds" and it runs whatever pattern is in there and then stops and then hopefully sets it to a state we can use. So instead of
sub blinkLight1()
Light1.timerinterval=5000
Light1.state=2
Light1.timerenabled=1
end sub
sub Light1_timer()
light1.state=1
me.enabled=0
end sub
we can simply say
Light1.blinkduration 5000, 1
and all the rest is taken care of by VP. Of course this is a pretty basic example and could be used as part of arrays and other things, but this is what I was looking at (and hopefully I understood correctly from fren's post)





Top

Contributor












are all trademarks of VPFORUMS.