How would I code it so that every atom in the world's color,will be turned to its opposite color,thus adding a negative effect to everything,everywhere.Any help would be greatly appreciated,thnx.
PS.I'm just starting to learn about color variation,so I don't know much about it.I do now rgb(blah,blah,blah).
ID:166542
Jul 23 2006, 6:14 am
|
|
Jul 23 2006, 9:07 am
|
|
Unless I'm missing something, you'd need a 'GetPixelColor()' proc, something which I don't think exists.
|
In response to DivineO'peanut
|
|
and That's what I'm trying to figure out.
|
Neat idea for an effect, I like it.
You can use icon arithmetic to accomplish this. But be warned - it will be slow! And by "slow" I mean "Matrix bullet-time effect". But with fewer trenchcoats. First, create a new DMI file. Call it white.dmi, and fill the entire icon with pure white (RGB 255,255,255). Then set every atom's icon to 'white.dmi' minus itself, like so: for (var/atom/A in world) Tada! But like I said, performing an icon operation on every icon in the world will be very slow. To avoid this, you could create negative versions of every icon file that you have, and set every atom's icon to that negative version. This is more labour-intensive but will ultimately be much much faster. Another possible route is to precalculate the negative version of every atom in the world at startup, and when something's icon changes. This just moves the work to when the server is started; so it's still not ideal, but it will help a little. |
In response to Crispy
|
|
Crispy wrote:
Neat idea for an effect, I like it. for (var/atom/A in world) Tada! I am sorry Crispy to bother you with somthing like this but, how does minusing a white icon from the original invert the colors? |
In response to Green Lime
|
|
The RGB value of the colour white is 255,255,255, which is the largest allowed RGB value. Subtracting any RGB value from this colour thus inverts it; for example, blue is 0,0,255. If we subtract these RGB values from the corresponding RGB values for white, we get:
255-0, 255-0, 255-255 = 255, 255, 0 ...which is yellow, the inverse of blue. Subtracting icons just subtracts RGB values, in exactly the same way as adding icons adds RGB values. |
In response to Crispy
|
|
Hey,thnx crisp.and I think it'll be ok if it's slow.You'll see what I mean when my new original game,The Dragon Ball Chronicles comes out ;).
PS.Don't Call my new game a rip,cause it isn't,and it never will be.Everyone just hates the DBZ RIPS</font></font></font></font>.Not the original ones. |
In response to Crispy
|
|
runtime error: bad icon operation
proc name: Login (/mob/Login) source file: The Dragon Ball Chronicles.dm,16 usr: Metamorphman (/mob) src: Metamorphman (/mob) call stack: Metamorphman (/mob): Login() Setting network delay to 0. |
In response to Metamorphman
|
|
Metamorphman wrote:
source file: The Dragon Ball Chronicles.dm,16 There's your problem. You didn't make a wish. -- Data |
In response to Android Data
|
|
WHat?No.It's not for a wish.And anyways,line sixtenn is:
A.icon = 'Time Icons.dmi' - A.icon
|
In response to Metamorphman
|
|
This works:
for(var/atom/A in world) *Edit* Now it can go back and forth. However, it has problems with movement states, and I'm pretty sure if you use this to switch them back that you'll make your players download 3 icons, instead of just two. |
In response to DarkCampainger
|
|
To tell you the truth,everything is meant to freeze in game when the negative effect happens,so no worries about icon states.But thanks.I appreciate ur help.
|