// ...
closearts()
var/{obj/menu/souk/I1; obj/menu/shak/I2; obj/menu/byak/I3; obj/menu/cero/I4; obj/menu/grandcero/I5; obj/menu/arm/I6; obj/menu/attack/I7; obj/menu/defense/I8; obj/menu/mask/I9; obj/menu/vaicero/I10; obj/menu/reborn/I11; obj/menu/release/I12}
for(I1)
del(I1)
for(I2)
del(I2)
for(I3)
del(I3)
for(I4)
del(I4)
for(I5)
del(I5)
for(I6)
del(I6)
for(I7)
del(I7)
for(I8)
del(I8)
for(I9)
del(I9)
for(I10)
del(I10)
for(I11)
del(I11)
for(I12)
del(I12)
src=/obj/menu/arts
src.icon_state="arts"
Problem description:
I get this runtime error when that proc is exicuted:
runtime error: Cannot modify /obj/menu/arts.icon_state.
proc name: closearts (/mob/proc/closearts)
usr: M (/mob)
src: /obj/menu/arts (/obj/menu/arts)
call stack:
/obj/menu/arts (/obj/menu/arts): closearts()
the arts (/obj/menu/arts): Click(null, "default.map1", "icon-x=15;icon-y=12;left=1;scr...")
> // ...
OUCH! My eye!
Why not just do it in one line total with something like for(var/obj/menu/O) del O? Or if you can't do that, restructure your objects so you can.
Also, you realize this will delete all such objects, on a global basis? This will likely be problematic, but maybe you've been aware of this already.
If you'll excuse the profanity: as they say, "no s***, Sherlock". I mean, I know you didn't start programming yesterday, so you should know what's wrong here, beginner or not. You're trying to change a var of a type path. Not possible. When you do Var.something = value, Var must always hold an object reference (that is to say, an object instance, or in another words, an object in existence), or you'll get an error. A type path isn't an object, rather it's just an object type, a blueprint, signature or specification for a certain type of objects.
Also, you shouldn't be arbitrarily setting src. That has no place here (in most places, unless you have a specific good reason).
When you set something's value, you have to specify a specific, single object whose var you want to change...
As for how to do that in your present situation, if you explained what you tried to do, I or someone else could answer. Basically you need to find that whatever-object-you're-looking-for (the object you want to change the icon_state of), reference it in a var, then use that var on the left-hand side of the . operator.