ID:273592
 
I need help creating a Change Icon verb. I want the player to be able to use their own icon file. If anyone has anything they think might help please post it here. I don't care if its the code or how to make the code it would help. I am also working on a simple building code(like icon ultima or icon fantasy) but not getting to far.

Thanks in advance.
Joey the .hacker wrote:
I need help creating a Change Icon verb. I want the player to be able to use their own icon file. If anyone has anything they think might help please post it here. I don't care if its the code or how to make the code it would help. I am also working on a simple building code(like icon ultima or icon fantasy) but not getting to far.

http://www.byond.com/docs/ref/info.html#/verb/arguments
In response to RJTaylor
Thanks so much
In response to Joey the .hacker
Im sorry in advance for sounding lazy or like a newb but can u point out the part in specific I should look at cuz i might accidently read over what I need
In response to Captshoot
Captshoot wrote:
Im sorry in advance for sounding lazy or like a newb but can u point out the part in specific I should look at cuz i might accidently read over what I need

I was referring to the arguments, which listed icon as one of the many inputs.

icon <font color = silver>// an icon file from the user's computer</font color>

mob/verb/Icon(I as icon) usr.icon = I
In response to RJTaylor
Oh. Well im kinda new to coding so im looking for any and all help i can get.
In response to RJTaylor
Thanks for all the help, got that icon verb working ^.^ but does anyone know a way to change the icon sate of the icon your using without having to change the icon?

If you need me to ill post what i tried to use as a change icon state verb.
In response to Joey the .hacker
Learn to use the DM Reference religiously. You can quickly access it by pressing F1 in Dream Maker.

You can do a simple text-based version just like the icon-based version you were just given:
mob/verb/IconState(T as text) usr.icon_state = T

However, that's gross and you should probably provide an option list for the user to select from. In the DM Reference, look up the input() proc, which allows the player to make a selection from a list (among other means of input), and the icon_states() proc, to get a list of icon_states in their icon file.

Exercise #1:
Create a verb that allows the user to select an icon_state from usr.icon, and set usr.icon_state to the selection.

Exercise #2:
To the list of icon_states that you provide to the user in Exercise #1, add a "<Nameless State>" option, because icons usually have an icon_state with no name (the default state), and it's kinda hard to pick an empty option from the list. Before setting usr.icon_state to the selection, use conditional logic---an if() branch---to determine if this fabricated option was selection; if so, set usr.icon_state to the default icon state (""), otherwise, set usr.icon_state to the selection.

Try to complete both exercises. If you have to ask for further help, you must include code examples of what you are doing that is not providing the desired results. You can include code on these forums by putting it between <dm> </dm> tags. If you are unsure where to even begin or if any part of either problem has you at a loss for direction, read the DM Guide. You might also look at Dantom's Your First World and Deadron's Step BYOND.

Good luck.