ID:272917
 
Hey it's your daily newb again back with another code for you to fix :D and here it is!

mob
verb
Edit_Object(obj/A in view()) // obj/A in view(1) means an object (with the A variable) from 1 tile away from you.
switch(input("What would you like to do?","Edit Object's Icon","Edit Object's Icon State","Edit Object's Density") as null|anything in list("Edit Object's Icon","Edit Object's Icon State","Edit Object's Density"))
if("Edit Object's Icon")
A.icon = input("What would you like the [A]'s icon to be?","The [A]'s Icon") as icon
A.icon_state = input("What would you like the [A]'s iconstate to be?","The [A]'s IconState") as null|anything in icon_states(A.icon)
src << "<b>You change the [A]'s icon!"

if("Edit Object's Icon State")
A.icon_state = input("What would you like the [A]'s iconstate to be?","The [A]'s IconState") as null|anything in icon_states(A.icon)
src << "<b>You change the [A]'s iconstate!</b>"

if("Edit Object's Density")
var/t=input("What would you like to set the density to?(Either 1 or 0)") as num
for(var/obj/o in view())
o.density = t
else
return

What I don't understand is why it only ask me about Edit Object's Density when I want to access the other 2 options as well.

Thanks for helping!

-The Grimster.
Sigh. You're filling in title and default response as well.

Look up input() and see the order of arguments.
Gr1m d4 r34p3r wrote:
Hey it's your daily newb again back with another code for you to fix :D

Hmm, how do I say this? You're not meant to use this forum to get every code you make fixed, or otherwise get every little single problem solved. You're meant to learn to do it yourself and actually use resources like the DM Reference and Guide (like you obviously haven't here), thank you. Not everybody will tolerate help vampirism, so try not to get there. Obviously it's also in your own benefit to learn.
In response to Kaioken
I was joking.
In response to Gr1m d4 r34p3r
Yes, I could see the smiley. I didn't say that just because of that sentence - I remembered you making numerous threads already and this topic also had a simple problem that you rather clearly didn't make a lot of effort to try to fix, so I'd said that just in case you might've otherwise went down the dark path of the vampire (woo~). Which is not too uncommon here, really.
In response to Kaioken
Well, I'm not the owner of this account,rather it is my brother's who codes. I like messing with his code but I can't fix it, so I ask you guys for help D:. And vampirism is tempting.
In response to Gr1m d4 r34p3r
Well I can't tell what's wrong with it!It's perfect!There shouldn't be anything wrong with it!Why the hell is there a format for args?ARGHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!
In response to Gr1m d4 r34p3r
The options don't need to be there twice. Only in the 'in' part, inside the list. The arguments directly inside input() are for other purposes.
In response to Kaioken
Kinda helps to point out which line of code too!The options in the "switch"?Because I removed it and a few thing happened.
In response to Gr1m d4 r34p3r
Gr1m d4 r34p3r wrote:
Kinda helps to point out which line of code too!

You've already been referred to the input() (and even to look it up, which should've indicated the issue to you) arguments in this thread before I posted (although that post didn't indicate the exact, actual problem), and my post also referred to it, so I thought you'd figure out that what I mentioned are the options for the player to choose from. Also, common sense dictates a problem with the actual input will likely be in the input() call, but that's besides the point. Anyway, I am sorry for not being ultra-specific. Look up input() and see what arguments are supposed to go in its parentheses. First, the options for the player aren't supposed to go there, but in the 'in' part, which you already have. Second, you have 1 more string arguments than the total amount of string args supported.

and a few thing happened.

Ok, thanks for the informative notification.
In response to Kaioken
Thank you so much!!!ARGHHH FINALLY IT'S RESOLVED.Oh for future reference how would you instantly know what to search up?
In response to Gr1m d4 r34p3r
I guess while you're still here I'll ask you one more question.How do we make it so that this specific verb doesn't appear in our Commands tab but if we right click and Build/Obj the verb will show up?
In response to Gr1m d4 r34p3r
Gr1m d4 r34p3r wrote:
Oh for future reference how would you instantly know what to search up?

Experience.

I guess while you're still here I'll ask you one more question.How do we make it so that this specific verb doesn't appear in our Commands tab but if we right click and Build/Obj the verb will show up?

http://www.byond.com/docs/ref/info.html#/verb/set/category
In response to Garthor
Alright Thank you.