Wire lights

Me and my friend have been working on cars that need toggled wire lights instead of lamps, and I haven’t got a clue about E2 it’s not the same as the scripting I usually do but here’s a code he has so far
but cant figure out how to make it actually work

CODE]

@outputs V:vector RGB:vector Headlights
@inputs Light

interval(10)

if(Light=1 (RGB=vec(int(255),int(255),int(255)) else {Light=0}


First of all, I don’t think this forum applies to what you want, but here’s the solution: Your syntax is wrong

Generally in programming languages you follow this syntax rule:

if ( Statement ) { Code }

Your code is:

if ( Statement ( Code ) ) else { Code }

Which is incorrect syntax.
Not to mention that you wrote “Light=1” = means assigning a value == means comparing the values.
I also don’t see why would use the function int
Also, the whole logic of it is wrong… Anyways

Fix it by changing it to this:


if ( Light == 1 ) {

    RGB = vec( 255, 255, 255 )

} else {

    RGB = vec( 0, 0, 0 )

}

Or assuming you can multiply vectors by numbers in E2


RGB = vec( 255, 255, 255 ) * Light

Was not me who made it it was my friend.