The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternative way to control a custom skilltree GUMP?
Author Message
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #1
Alternative way to control a custom skilltree GUMP?
I've made a new Skill Tree gump, and it works great except for one small problem, I cant figure out how to make it fire when you click the "SKILLS" button but NOT when you receive a skill gain..

ON=@UserSkills fires whenever you press the "Skills" button *or* you update the player's skills. The problem is, this is also the only way I can seem to control the Skills button on the paperdoll. So, what happens right now is any time a player gains a skill, the skill tree pops up if it isn't already open, and thats a bit annoying. Smile

So, I need a way to open the skill tree via the SKILL button that is NOT on=@UserSkills.

Any advice?

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 09-16-2012 12:34 PM by Rayvolution.)
09-16-2012 12:33 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
RE: Alternative way to control a custom skilltree GUMP?
set a tag when you use @userskills to identify if you have opened the gump, here's an example considering that d_skill_list is the name of your gump:
Code:
on=@userskills
ctag.userskills=1 //set tag
dialogclose d_skill_list
dialog d_skill_list

on=@skillgain
if (<isonline>)
  if (<ctag0.userskills>)
    dialogclose d_skill_list
    dialog d_skill_list
  endif
endif
and in your skill list dialog (assuming d_skill_list):
Code:
on=0
ctag.userskills= //erase tag

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 09-16-2012 06:31 PM by Skul.)
09-16-2012 06:31 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #3
RE: Alternative way to control a custom skilltree GUMP?
http://wiki.sphere.torfo.org/index.php/@UserSkills
I'm sure you will find what you are looking for here Smile

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
09-16-2012 10:53 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #4
RE: Alternative way to control a custom skilltree GUMP?
(09-16-2012 06:31 PM)Skul Wrote:  set a tag when you use @userskills to identify if you have opened the gump, here's an example considering that d_skill_list is the name of your gump:
Code:
on=@userskills
ctag.userskills=1 //set tag
dialogclose d_skill_list
dialog d_skill_list

on=@skillgain
if (<isonline>)
  if (<ctag0.userskills> == 01) // also tried without == 01
    dialogclose d_skill_list
    dialog d_skill_list
  endif
endif
and in your skill list dialog (assuming d_skill_list):
Code:
on=0
ctag.userskills= //erase tag

(09-16-2012 10:53 PM)Ben Wrote:  http://wiki.sphere.torfo.org/index.php/@UserSkills
I'm sure you will find what you are looking for here Smile

I already tried using @UserSkills. Sad

The problem is for some reason @UserSkills fires when your skill changes, I'd almost think this was a bug.

So, the only way to block it under @UserSkills is to tag the menu when it's opened/closed, the problem is, if you check to see if it's open/closed on @UserSkills it won't be able to open in the first place when you hit the Skills button. :/

Here's my original test-script modified with Skul's code:
Code:
ON=@UserSkills
ctag.userskills=1 //set tag
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
RETURN 1

ON=@SkillGain
if (<isonline>)
  if (<ctag0.userskills>)
    SRC.f_skillcolor
    SRC.DIALOGCLOSE d_skill_tree
    SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
  endif
endif

It pretty much ends up working exactly like my original code, it'll open the skill menu when you gain/change skill because it's firing @UserSkills on skill changes for some reason.

Here's my original code, with no @SkillGain at all.
Code:
ON=@UserSkills
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
RETURN 1



EDIT:
Solved! Big Grin

Digging around in the Sphere Wiki I found a command I didn't know existed... (ISDIALOGOPEN) and with Bens nudge, I noticed <ARGN1> could be helpful. It solved my problem. Smile

Code:
ON=@UserSkills
IF <ARGN1> == -1 //If -1, this trigger fired without a skill being specificed (Skill button was pressed)
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
RETURN 1
ELSE
IF <ISDIALOGOPEN d_skill_tree> == 1> // If your skill gump is open, go ahead and allow the skillgain to trigger the gump to open/close so it'lll update.
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
RETURN 1
ENDIF
RETURN 1

Now, if no skills are specified when it fires (You hit the skill button) it'll open the dialog. Also, if the dialog IS already open, it'll close/open it if you do get a skill update.

If the dialog is closed, and you get a skill update, the pesky thing won't pop up at all.

Thanks guys. Wink

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 09-17-2012 12:58 AM by Rayvolution.)
09-17-2012 12:39 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #5
RE: Alternative way to control a custom skilltree GUMP?
Glad I could help... The wiki can be really helpfull Big Grin

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
09-17-2012 01:47 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #6
RE: Alternative way to control a custom skilltree GUMP?
Yeah, I use it quite often.

It's really handy getting into the meat and bones of the code. Wink

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
09-17-2012 02:52 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #7
RE: Alternative way to control a custom skilltree GUMP?
Quote:Digging around in the Sphere Wiki I found a command I didn't know existed... (ISDIALOGOPEN) and with Bens nudge, I noticed <ARGN1> could be helpful. It solved my problem.

I didn't know that existed. Looks like I need to update some of my scritps too.

Good to see you got the error solved.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-17-2012 01:59 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #8
RE: Alternative way to control a custom skilltree GUMP?
(09-17-2012 01:59 PM)Skul Wrote:  
Quote:Digging around in the Sphere Wiki I found a command I didn't know existed... (ISDIALOGOPEN) and with Bens nudge, I noticed <ARGN1> could be helpful. It solved my problem.

I didn't know that existed. Looks like I need to update some of my scritps too.

Good to see you got the error solved.

Thanks Smile

Here's the final version of the script if you/anyone wants to look at it.

Note that the @Login Tag is there, and gets removed right at UserSkills fires. For some reason, on=@Login causes a UserSkills fire that I couldn't avoid. So I set UserSkills to stop if NoSkillTree == 1.

That way, when you login, all that happens is Login fires, setting the NoSkillTree 1 and then UserSkills fires immediately after and catches the tag, stops the DIALOG from opening, and deletes the tag so the script will work normally from then on out.

Later I'm going to rewrite my custom skillgain messages for "increases" and "decreases". Right now it'll just tell you if they changed and what they changed to.

The script is highly customized for my server, but at the very least you guys can pick out how all the IF statements are setup and make it fit for your own servers. Wink

Code:
ON=@Login
CTAG.NoSkillTree 1

ON=@UserSkills
IF <CTAG.NoSkillTree> == 1 // I just logged in, DON'T open the Skill Dialog
CTAG.NoSkillTree= // Remove the tag so the player can use the dialog now.
RETURN 1
ENDIF
IF <ARGN1> == -1 //I clicked the Skills button on the paperdoll to open the Skills DIALOG.
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
RETURN 1
ELSE
IF <ISDIALOGOPEN d_skill_tree> == 1> //I gained skill, and the Skills DIALOG is open. So close/reopen it to emulate an "update".
SRC.f_skillcolor
SRC.DIALOGCLOSE d_skill_tree
SRC.SDIALOG d_skill_tree <TAG0.SkillTreePage>
SRC.SYSMESSAGESKILL Your skill in <SERV.SKILL.<ARGN1>.NAME> has changed, it is now <SRC.<ARGN1>>!
RETURN 1
ENDIF //I passed all the IFs, so I should just give the player the skill message without opening/closing any DIALOGS.
ENDIF
SRC.SYSMESSAGESKILL Your skill in <SERV.SKILL.<ARGN1>.NAME> has changed, it is now <SRC.<ARGN1>>!
RETURN 1

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 09-17-2012 03:13 PM by Rayvolution.)
09-17-2012 03:10 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)