ID:1822252
 
(See the best response by Ter13.)
Code:
var
button.namek1b
Click()
mob/player/var/last_clicked = "src"

-----------------------------------------------------------------------------
mob
proc
Click()
switch(new_icon)
if (namek1b)
set usr.icon = 'Namek1.dmi'
if (namek2b)

I'm terribly new at this, and reading the wall of text that is the skin reference DM reference, and the DM guide is.. just.. wow.

Problem description:
I've created a icon selection menu using a window with buttons that have images of icons that a player may select. These buttons however do not hold the .dmi that is required for the mob icon to have all the animations. I've attempted to store the button in a variable with Click(), so that I can define which button gives what icon, but to no avail. I also need to delete or hide the window afterwards. I know how to hide it, but with only one command to be called, I'm having difficulty doing both at the same time.

I've not read anywhere thus far that tells you what button ID is defined as in the code so that I can reference it.Does it automatically save the ID as a variable at root or is it buried in a tree?

I also can't seem to find a way to reference a players last click to either use it as a variable or to call another proc. I think I'm on the right track, but I'm at head-bashing point.

So, if you could overlook my new-guyishness (as demonstrated with the above code), please assist me with this.
Best response
I'm terribly new at this, and reading the wall of text that is the skin reference DM reference, and the DM guide is.. just.. wow.

Calling it a wall of text does you a disservice. Read the guide. It's the only way to learn. If you don't put the effort into reading and get the basic syntax of DM right, there's not a lot we can do to help you.
Ter's right. I wanted to try to offer more detailed help and explain why each of those lines is specifically wrong, but the syntax is too far broken. It's really important you get a handle on the fundamentals, because right now it's apparent that you're just trying things at random. The Guide isn't the only way you can learn the basics--there are some good tutorials out there--but it's a good way to start.

I believe what you're trying to do is create buttons in the skin, and make them do things when clicked. The little I can tell you right now is that Click() is for objects on the map, not interface buttons. Buttons work by having a command value. That command is sent to the game when the button is clicked, as if you typed it yourself.
In response to Lummox JR
Ter13 wrote:
I'm terribly new at this, and reading the wall of text that is the skin reference DM reference, and the DM guide is.. just.. wow.

Calling it a wall of text does you a disservice. Read the guide. It's the only way to learn. If you don't put the effort into reading and get the basic syntax of DM right, there's not a lot we can do to help you.

Thank you for your response, but this is not the kind of answer I was looking for. I've read up to chapter 5 in the guide so far, but there's only so much text I can look at before my brain just says "No." Typically I supplement a video or audio recording with reading or tutorials, because that seems to be the method in which I can learn. I've even attempted to have my computer read the text to me, but it can only do so much as well.

I'm sorry that I didn't clarify before.

Lummox JR wrote:
Ter's right. I wanted to try to offer more detailed help and explain why each of those lines is specifically wrong, but the syntax is too far broken. It's really important you get a handle on the fundamentals, because right now it's apparent that you're just trying things at random. The Guide isn't the only way you can learn the basics--there are some good tutorials out there--but it's a good way to start.

I believe what you're trying to do is create buttons in the skin, and make them do things when clicked. The little I can tell you right now is that Click() is for objects on the map, not interface buttons. Buttons work by having a command value. That command is sent to the game when the button is clicked, as if you typed it yourself.

Thank you as well. Your response is much more what I needed to jump-start my mind. I have used the command line for a verb to hide the window. It looks as if I'll have to make individual verbs for each button in order to accomplish my goal. Would that be efficient or would I run into performance issues with having so many unused verbs?

Also thanks for clarifying the Click() proc. I misunderstood what a control and param are when they were defined in the reference.

Thank you both for your time.
You will not need individual verbs for each button. A single verb that takes an argument (like text or a number) is all you need.

But don't discount what Ter is saying so lightly; you do need to get better with the basic syntax. In your original post you tried to declare a proc under a var declaration. The post shows that you're struggling a lot with the syntax. I suggest rereading those first five chapters until the syntax is clearer.