Alternative way to control a custom skilltree GUMP? - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Alternative way to control a custom skilltree GUMP? (/Thread-Alternative-way-to-control-a-custom-skilltree-GUMP) |
Alternative way to control a custom skilltree GUMP? - Rayvolution - 09-16-2012 12:33 PM 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. So, I need a way to open the skill tree via the SKILL button that is NOT on=@UserSkills. Any advice? RE: Alternative way to control a custom skilltree GUMP? - Skul - 09-16-2012 06:31 PM 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 Code: on=0 RE: Alternative way to control a custom skilltree GUMP? - Ben - 09-16-2012 10:53 PM http://wiki.sphere.torfo.org/index.php/@UserSkills I'm sure you will find what you are looking for here RE: Alternative way to control a custom skilltree GUMP? - Rayvolution - 09-17-2012 12:39 AM (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: (09-16-2012 10:53 PM)Ben Wrote: http://wiki.sphere.torfo.org/index.php/@UserSkills I already tried using @UserSkills. 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 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 EDIT: Solved! 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. Code: ON=@UserSkills 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. RE: Alternative way to control a custom skilltree GUMP? - Ben - 09-17-2012 01:47 AM Glad I could help... The wiki can be really helpfull RE: Alternative way to control a custom skilltree GUMP? - Rayvolution - 09-17-2012 02:52 AM Yeah, I use it quite often. It's really handy getting into the meat and bones of the code. RE: Alternative way to control a custom skilltree GUMP? - Skul - 09-17-2012 01:59 PM 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. RE: Alternative way to control a custom skilltree GUMP? - Rayvolution - 09-17-2012 03:10 PM (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. Thanks 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. Code: ON=@Login |