Page 1 of 1

Custom skills?

Posted: Tue Feb 21, 2006 6:15 pm
by stranf
I'm attempting to create a new category in the skills menu for social skills that will be useful for GMed quests.

Skills such as persuation, intimidation, lying, bluffing, etc..

My question:

How do I get the skills to display properly in the skills menu, attach scripts to the skill, and put that nice little blue gem next to the skill so when clicked on it runs the script.

Basically what I envision these skills doing is rolling a d20, adding a modifier based on the skill, and printing the result to the screen via global text. Should be fairly simple to code once I know how to attach and implement the skill.


This brings me to the second question. Which function displays global text? (So that all clients recieve the displayed text.)

Posted: Tue Feb 21, 2006 7:11 pm
by Xuri
To edit the default UO skillgump you have to use an editor and edit skills.mul/idx by hand. And as far as I know, you can only exchange skills with new ones (i.e. rename) and not add new ones.

If, however, you use the onSkillGump JS event, you can override the client's request to open the skillgump, and instead send a custom one with as many or as few skills as you'd like =)

Note that any new skills you add would have to be scripted entirely, including skillchecks, skillgain, etc, since the source is hardcoded with a specific number of skills and only supports skillchecks and whatnot for those, I believe.

Posted: Tue Feb 21, 2006 9:50 pm
by stranf
Hmm....that seems more work then it is worth.

Perhaphs I will bypass the gump entirely. How do I store global variables on the PC?

If I can store the skill on the PC, I can do the check/gain/etc. locally in my JS script, and forgo the gump portion.

Posted: Thu Feb 23, 2006 7:41 am
by stranf
**bump**

Is there anyway to store variables on objects/npcs/pcs so that I could store unique custom skill values?

Posted: Thu Feb 23, 2006 9:28 am
by Xuri
To set a custom tag on an object (which is saved along with the object), use myChar.SetTag( "tagname", value );

To get a custom tag from an object, use something like var myVar = myChar.GetTag( "tagname" );

Posted: Thu Feb 23, 2006 2:59 pm
by stranf
Thanks.