Only When / On Events From -- How to create this construct?


#1

I’m stumped. How do I create a Only When / On Events From logical construct? That part of the Wiki is a stub. Can’t find anything here or on Google search. I’ve looked high and low in WC and cannot find it. Frustrated!!

I want to insert this snippet from Robin that determines if all specified lights are off, then turn one back on. I tested this last night in a stand-alone piston after importing Robin’s code from eqs6 and it worked perfectly. But I want to add this code to my Vacation piston


Do Block & On Event
#2

@Robin

Forgot to include you, Robin.


#3

While editing the piston, you can choose in the top right corner:
For “Only When”, you want: Options > Show restrictions
For “On Events From”, you want: Options > Show advanced statements
(when you add a new statement you’ll see “On event” as a new option)


#4

Thanks, WC. I was using the icons at top left to turn on “Show Restrictions” and “Show Complex IFs.” I thought (incorrectly) that Options at top right duplicated the icons at top left. Until you pointed it out, I did not realize that Options has “Show advanced statements” which is NOT available as an icon.

I was cracking my head against the wall for a couple hours last night trying to find that and never once pulled down the Options menu.

Thanks again.


#5

OK, still stumped how to actually insert the “On Events From” statement into the code. “Show advanced statements” is checked.

On%20Events

How can I add “On Events From” as a top-level statement?


#6

Click on + add a new statement that is outside of any other blocks, and then click on this:

temp


You can also drag misplaced code if you have the option turned on up top:

temp


#7

Thanks. Got it.

Not very intuitive. I sure fumble around a lot in WC trying to figure this stuff out.


#8

The add a new statement adds code right there, so you can be selective where it goes.
(or just do what I do and drag it to it’s proper place afterwards)


#9

We need the whole piston in order to help. You can’t see anything in the snippets you’re posting. What exactly are you trying to do? don’t just tell us about the part you’re trying to fix, tell the objective of the whole thing. That way we can help you get there. Trying to tell you how to do part of it is not going to help you in the long run because your whole construction might be wrong. You tell your mechanic to fix your brakes because you’re having trouble stopping but don’t let him see your bald tires. You brakes could be fine but you still won’t be able to stop because of the bald tires.