ID:1004737
 
Code:

#define DEBUG

world
maxx=10
maxy=10
maxz=1

client
proc/blur(icon/i)
var/obj/o = new(locate(1,1,1))
o.icon = i
var/obj/j = new(locate(1,1,1))
var/icon/k = new(i)
k.MapColors(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,0.3)
j.icon = k
spawn() while(1)
j.pixel_x++
j.pixel_y++
sleep(rand(1,2))
j.pixel_x=0
j.pixel_y=0

verb/load(i as icon)
blur(i)


Problem description:
I receive a run time that says this:
runtime error: list index out of bounds
proc name: MapColors (/icon/proc/MapColors)
usr: Metamorphman (/mob)
src: /icon (/icon)
call stack:
/icon (/icon): MapColors(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.3)
Metamorphman (/client): blur('avbig.png')
Metamorphman (/client): load('avbig.png')


I followed the instructions from here: http://www.byond.com/forum/?post=265777#comment1224562

just... wat
y u lie to me lummox :,(
MapColors(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.3)


I don't believe you can use a decimal in an rgb() type proc, so try adjusting that "0.3".
Thanks, but I don't think that is the issue. All these numbers are multipliers, therefore 0.3 there basically means I want 30 percent of the old alpha component. This is what is said in the reference (I believe). In this argument layout, the numbers can range from 0 to 1.

The problem is fixed now, though. Flame Sage helped me out. I forgot that you could do stuff like this using the rgb() proc!

j.icon -= rgb(0,0,0,100)


Still, some clarification on this would be nice. Maybe something about MapColors has changed since Lummox posted the code I linked to? Or is this something that was an issue from the start, aka, it's a bug?

P.S. Welcome back to BYOND! :)
Your problem is: None of the formats support a 16 value long thing.
The procedure internally looks like this:
icon
var
icon
proc
MapColors(a,b,c,d,e,f,g,h,i,j=0,k=0,l=0)
if(istext(a))
if(!e) _dm_icon_map_colors(icon,a,b,c,d)
else _dm_icon_map_colors(icon,a,b,c,d,e)
else if(args.len <= 12) _dm_icon_map_colors(icon,a,b,c,d,e,f,g,h,i,j,k,l)
else _dm_icon_map_colors(icon,a,b,c,d,e,f,g,h,i,j,k,l,args[13],args[14],args[15],args[16],args[17],args[18],args[19],args[20])


4, 5, 9, 12, or 20, it looks like.
The index bounds error is because it thinks you're using the latter format, but args[17] through args[20] aren't valid entries in the list. The list is only 16 values long. So, you'd have to do:
k.MapColors(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,0.3, 0,0,0,0)