Page 2 of 2

PostPosted: Sun Aug 12, 2007 8:32 am
by DocRabbit
This explanation always helped me remember colors, so I thought I would share it. This is in the terms of (RGB)=(0 to 255,0 to 255, 0 to 255). Color, as we perceive it, is the reflected light on an object. So in terms of RGB, the numbers represent reflection amount. Thus, to make something red, set green and blue to min amounts and red to max amount, (255,0,0). To make White, set all to max(255,255,255). To make black, set all to min(0,0,0).

I think if you are use to RGB values, to use Rux's paintcolor for a known RGB value, it would passthru this formula first.

RGB=Normal RGB values from 0 to 255
GEr,GEg,GEb=GameEditor Rux's paintcolor values 1 to 0.

R=abs((255*GEr)-255) and GEr=(255-R)/255
G=abs((255*GEg)-255) and GEg=(255-G)/255
B=abs((255*GEb)-255) and GEb=(255-B)/255

You may want to check my math but these should work.

Rux, I am confused on your 0 to 1 values for rgb variables, my GE seems to work on 255 values.

PostPosted: Sun Aug 12, 2007 12:11 pm
by florafinn@yahoo.com
I am trying to make my actor change colors.

PostPosted: Sun Aug 12, 2007 2:00 pm
by pixelpoop
Add a "Draw Actor" event of action "Script Editor" onto your actor. Put this in the code:
Code: Select all
r=rand(256);
g=rand(256);
b=rand(256);


now hit Add->Immediate Action
now hit Game Mode and watch the actor turn colors.

and again I suggest, if you haven't gone through the tutorials, you really should.

PostPosted: Sun Aug 12, 2007 2:20 pm
by florafinn@yahoo.com
sweet It worked thanks!


but is there a way for It only to change one ( not blinking ) color and it being because it toughted another actor

read my form and I hope you can answer with a good answer. :D ( game-editor.com Forum Index -> General -> Change )



Hope you understand you know mario like he changes when he toughtes stuff.

PostPosted: Sun Aug 12, 2007 6:56 pm
by pixelpoop
You can set up a collision event and script in the color change to that.

and again I suggest, if you haven't gone through the tutorials, you really should.


.

PostPosted: Mon Aug 13, 2007 4:49 am
by Troodon
You can use the actorname.r in any event where you use script editor.
If you want your actor to change colour itself randomly, you can do a timer and everytime the time happens you add the random code

actorname.r = rand(255);
actorname.g = rand(255);
actorname.b = rand(255);

If you don't use timer, the colour will chance very quickly. (Depending on your fps)

You can use almost any script math with the colours. Here is some examples:

actorname.r = yoruvariable;

actorname.r += 1;

actorname.r = actorname.g - actorname.b;

You can play with them and see what happens. :)