openBVE plugin blinking lights problem
2 posters
Page 1 of 1
openBVE plugin blinking lights problem
So recently I am trying to create a blinking light with plugins(which once you press a button,it will start blinking) but I have an problem, since the blinking light is blinking quite fast,if a user pressed the button when the lights are on,it will stay on. But I want no matter if the blinking lights state is on or off, it will still go off when user pressed the button,is there anyways to do so?(I've tried using currentState,but it end up crashing object viewers and openBVE)
Btw here's my code:
[Object]
States = DirectionLightoff.csv, DirectionLighton.csv
Position = -2.75,0,0.1
Statefunction = Mod[value + pluginstate[105], 2]
RefreshRate = 0.55
The code I tried but crashed:
[Object]
States = DirectionLightoff.csv, DirectionLighton.csv
Position = -2.75,0,0.1
Statefunction = if[currentState==1 & pluginstate[105],0,1]
RefreshRate = 0.55
Btw here's my code:
[Object]
States = DirectionLightoff.csv, DirectionLighton.csv
Position = -2.75,0,0.1
Statefunction = Mod[value + pluginstate[105], 2]
RefreshRate = 0.55
The code I tried but crashed:
[Object]
States = DirectionLightoff.csv, DirectionLighton.csv
Position = -2.75,0,0.1
Statefunction = if[currentState==1 & pluginstate[105],0,1]
RefreshRate = 0.55
Re: openBVE plugin blinking lights problem
Interesting, you seem to have hit a somewhat long-standing problem- CurrentObjectState was a little broken (Dates back to Michelle!).
This function should now work as intended.
However, your second set of code isn't the way to go- It'll never actually get as far as changing state.
Probably easiest to do the following:
Note the added conditional, so that if pluginState[105] is not 1, it will always return 0
This function should now work as intended.
However, your second set of code isn't the way to go- It'll never actually get as far as changing state.
Probably easiest to do the following:
- Code:
[Object]
States = DirectionLightoff.csv, DirectionLighton.csv
Position = -2.75,0,0.1
Statefunction = if[pluginstate[105] == 1, Mod[value + pluginstate[105], 2] ,0]
RefreshRate = 0.55
Note the added conditional, so that if pluginState[105] is not 1, it will always return 0
Similar topics
» OpenBVE signal problem
» OpenBVE launch problem.
» OpenBVE PROBLEM! Please help!
» OpenBVE v. 0.5.4.1 set up problem
» HK OpenBVE Seltrac Plugin Issues
» OpenBVE launch problem.
» OpenBVE PROBLEM! Please help!
» OpenBVE v. 0.5.4.1 set up problem
» HK OpenBVE Seltrac Plugin Issues
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum