im not sure but i think setColor stes the color of the expression-chip not anything else
so, i have this code:
I am basically trying to set the color of the wirelink entity (a holo emitter) and i can't find out how i could combine the codes E:setColor(N,N,N) and XWL:entity(), i have tried setting a in chip variable thats an entity (X) to the one selected by wirelink, and than to change the color of the variable (X). But that failed horriblyCode:@name @inputs E:entity @outputs V:vector Active FadeRate Fire @persist X:entity interval(10) V = E:shootPos() + E:eye() * 80 Active=1, FadeRate=100 R=random(0,255) G=random(0,255) B=random(0,255) Fire=random(0,1) X=XWL:entity() X:setColor(R,G,B)Any help would be appreciated
im not sure but i think setColor stes the color of the expression-chip not anything else
I'm assuming that code validates, because it does look good from at a first glance.
However, E:setColor() is partly unusable (sorry for the bad documentation), it is limited to only your own entities, however, ownership in gmod doesn't really appear to be properly defined, thus, in most occassions it will not report you as the owner... so it will not do anything.
So basically, E:setColor() doesn't really work right now.
damn
ill just go back to using the colorer heh
anyways, thanks for clarifying that
Little tip on the Fire = random(1,0) part:
You can use Fire = -Fire +1
The random() method maybe sticks to <0.5 for 10 executions, while the other method constantly switches every execution.
I haven't tested the functions myself, but you can now set the color of your entities using setColor.
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
Bookmarks