ID:138893
 
Code:
Skills
layer=50
parent_type = /obj
Click()
if(usr.Skill_Tree)
winshow(usr,"SkillTree")
winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
verb
Learn()
//blablabla


Problem description: What this is doing is activating the Learn() command instead of changing the buttons command to Learn(). So for example, when I click on the skill, It activates Learn() and doesn't even change the buttons command.

Any ideas?

i think you messed up on the command part. You put "SkillTree.Learn" but you have it Classified as "Skills". This means it would be "Skills.Learn"

Edited Version:
Code:
> Skills
> layer=50
> parent_type = /obj
> Click()
> if(usr.Skill_Tree)
> winshow(usr,"SkillTree")
> winset(usr,"Skills.Learn","command = \"[src.Learn()]\"")
> verb
> Learn()
> //blablabla

In response to XxLucifersJesterxX
XxLucifersJesterxX wrote:
i think you messed up on the command part. You put "SkillTree.Learn" but you have it Classified as "Skills". This means it would be "Skills.Learn"

Edited Version:
Code:
> > Skills
> > layer=50
> > parent_type = /obj
> > Click()
> > if(usr.Skill_Tree)
> > winshow(usr,"SkillTree")
> > winset(usr,"Skills.Learn","command = \"[src.Learn()]\"")
> > verb
> > Learn()
> > //blablabla


nonono 'SkillTree' is the window that pops up with the button using the ID "Learn". So 'SkillTree.Learn' is correct.
In response to AbdelJN
Honestly your making things way over complicated...

Skills
layer=50
parent_type = /obj
Click()
if(usr.Skill_Tree)
winshow(usr,"SkillTree")
winset(usr,"Skills.Learn","command = \"[src.Learn()]\"")
if(!(src in usr.LearnedSkills))
usr.Learn(src)

Mob/verb
Learn(Learning)
Set Hidden = 1
usr.LearnedSkills+=Learning

Mob/var/LearnedSkills = list()


if this isn't what you want your going to have to go into a lot more detail cause i might not be getting what your asking for.

In response to XxLucifersJesterxX
XxLucifersJesterxX wrote:
Honestly your making things way over complicated...

> Skills
> layer=50
> parent_type = /obj
> Click()
> if(usr.Skill_Tree)
> winshow(usr,"SkillTree")
> winset(usr,"Skills.Learn","command = \"[src.Learn()]\"")
> if(!(src in usr.LearnedSkills))
> usr.Learn(src)
>
> Mob/verb
> Learn(Learning)
> Set Hidden = 1
> usr.LearnedSkills+=Learning
>
> Mob/var/LearnedSkills = list()
>

if this isn't what you want your going to have to go into a lot more detail cause i might not be getting what your asking for.


.. It's not complicated at all but alright, I'm trying to change the "Learn" buttons command to src.Learn() when the windows opens up. When I'm calling 'src' I'm not calling the player but I'm calling the skill. So src.Learn() would activate the skills Learn() verb. The problem is that the command isn't changing and instead, it's activating it when the windows open. Here's a clear example of what happens step by step:

1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.
In response to AbdelJN
1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.

I see now.

Skills
layer=50
parent_type = /obj
Click()
if(usr.SkillTreeOpen)
winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
return
if(usr.Skill_Tree)
winshow(usr,"SkillTree")
usr.SkillTreeOpen = 1
verb
Learn()

This should work.
In response to XxLucifersJesterxX
XxLucifersJesterxX wrote:
1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.

I see now.

> Skills
> layer=50
> parent_type = /obj
> Click()
> if(usr.SkillTreeOpen)
> winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
> return
> if(usr.Skill_Tree)
> winshow(usr,"SkillTree")
> usr.SkillTreeOpen = 1
> verb
> Learn()
>

This should work.

This would make it so I had to click the skill again once the window is already open. Anyways, I think it's possible that buttons don't support anything besides player commands, I hope that's not the case.. Can anyone confirm this for me?
In response to AbdelJN
AbdelJN wrote:
XxLucifersJesterxX wrote:
1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.

I see now.

> > Skills
> > layer=50
> > parent_type = /obj
> > Click()
> > if(usr.SkillTreeOpen)
> > winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
> > return
> > if(usr.Skill_Tree)
> > winshow(usr,"SkillTree")
> > usr.SkillTreeOpen = 1
> > verb
> > Learn()
> >

This should work.

This would make it so I had to click the skill again once the window is already open. Anyways, I think it's possible that buttons don't support anything besides player commands, I hope that's not the case.. Can anyone confirm this for me?

Isnt that what you wanted?... and you can always make the button use a command that has a proc in it which changes the button.
In response to XxLucifersJesterxX
XxLucifersJesterxX wrote:
AbdelJN wrote:
XxLucifersJesterxX wrote:
1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.

I see now.

> > > Skills
> > > layer=50
> > > parent_type = /obj
> > > Click()
> > > if(usr.SkillTreeOpen)
> > > winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
> > > return
> > > if(usr.Skill_Tree)
> > > winshow(usr,"SkillTree")
> > > usr.SkillTreeOpen = 1
> > > verb
> > > Learn()
> > >

This should work.

This would make it so I had to click the skill again once the window is already open. Anyways, I think it's possible that buttons don't support anything besides player commands, I hope that's not the case.. Can anyone confirm this for me?

Isnt that what you wanted?... and you can always make the button use a command that has a proc in it which changes the button.

Yeah I just figured that out, it's a pretty fair work around. I'm still wondering if buttons have support for verbs that aren't player verbs. Anyways I'm currently using the workaround until an answer comes up. Btw, thanks for your time Lucifer
In response to AbdelJN
AbdelJN wrote:
XxLucifersJesterxX wrote:
AbdelJN wrote:
XxLucifersJesterxX wrote:
1. I click skill
2. Window opens with the 'Learn' button
2. I click on the Learn button and nothing happens. Instead when the window opened up, it automatically activated the Learn() verb.

I'm curious as to if what I want is possible. There are other ways of going about this, but I found this method to be the most simple. I'd rather not have to make Learn() a player verb.

I see now.

> > > > Skills
> > > > layer=50
> > > > parent_type = /obj
> > > > Click()
> > > > if(usr.SkillTreeOpen)
> > > > winset(usr,"SkillTree.Learn","command = \"[src.Learn()]\"")
> > > > return
> > > > if(usr.Skill_Tree)
> > > > winshow(usr,"SkillTree")
> > > > usr.SkillTreeOpen = 1
> > > > verb
> > > > Learn()
> > > >

This should work.

This would make it so I had to click the skill again once the window is already open. Anyways, I think it's possible that buttons don't support anything besides player commands, I hope that's not the case.. Can anyone confirm this for me?

Isnt that what you wanted?... and you can always make the button use a command that has a proc in it which changes the button.

Yeah I just figured that out, it's a pretty fair work around. I'm still wondering if buttons have support for verbs that aren't player verbs. Anyways I'm currently using the workaround until an answer comes up. Btw, thanks for your time Lucifer

Np =3
You need to set the command to the name of the verb, not a call to the verb itself. What you're doing is actually embedding the return value of /Skills/Learn() in your text. What you want to do is "command=Learn".
In response to Kaiochao
Kaiochao wrote:
You need to set the command to the name of the verb, not a call to the verb itself. What you're doing is actually embedding the return value of /Skills/Learn() in your text. What you want to do is "command=Learn".

Yeah I figured that, though since it's like that.. how would you change the command to an objects verb?