Easy? method for support of custom skills

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Easy? method for support of custom skills

Post by Xuri »

Allow custom entries to skills.dfn, have source code which does nothing except basic skill-checking (success true/false), and let the actual skills be coded in JS.

It's already possible to edit the skills-gump(skills.mul/skills.idx?), and likewise also possible (I think) to include custom skills.mul/skills.idx in UOGateway patches - the only thing missing is support for actually creating new skills server-side.

EDIT: Oh, this would also make it easier to implement missing/new OSI skills ;P
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

As it stands one can implement any skill they like in JS. The main problem I can think of off the top of my head is we do alot of checking based on the skill number, which we associate to an enum in the source, and is later associated with a char array giving us the skillnames.

As for skills already in the OSI client, I can't think of any reason you can't write your own JS functionality for them right now, unless they require something you just can't do in JS (a problem I would try to remedy for you). :)
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Well - the problem is you can't use any new OSI (or custom) skills, because the JS engine needs a skillnumber =) Take for instance function onSkill( objUsing, skillUsed, objType ) - you need a valid skill number for the skillUsed-value, which is either hardcoded in UOX3 or read in through skills.dfn.

Which means I (or anyone else) can't script support for the Necromancy, Chivalry, Ninjitsu and Bushido skills even if we wanted.

If UOX3 could read in new skillnumbers defined in skills.dfn and make them accessible to the JS engine, then it'd be piece of cake =)
-= Ho Eyo He Hum =-
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

Do us a favour Xu. Search the source for __NEW_SKILLS__ :D

In a relatively global header (Config.h seems a good candidate :)) put this just under "#define _NOACTCOPY_ 0"

Code: Select all

#define __NEW_SKILLS__
This should enable the server to support three more skills: Necromancy, Focus and Chivalry.

You could probably try implementing from there :)
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I was under the impression __NEW_SKILLS__ was enabled already. :P

Shows how much I know *shrug*
Scott
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

It never got enabled, at least by me, because I never had a client that had the new skills in it, at the time :)

Technically, I still don't... but that's because of a lack of client in general :D

In theory, it should all be good, but it's not exhaustively tested.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Note to self: enable these skills when I get home. :)
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hmm how is this handled? As of right now, SKILL 49, 50 and 51 in SKILLS.DFN represent STR, DEX and INT, which is exactly what Necromancy, Focus and Chivalry are supposed to use. Are you moving the former to different numbers? If so, remember to make room for Bushido and Ninjitsu as well, which appear to have skillnumbers 52 and 53. :P (Enable these as well? :)
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I will have to have a look at the entire system, honestly. As I really don't know how they function off the top of my head (never needed to bother with it).

But I certainly will enable ALL new skills, are those the only two? (And is that the proper names for them?).
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

These are all the new ones, with the proper names and skill numbers:
(49) Necromancy
(50) Focus
(51) Chivalry
(52) Bushido
(53) Ninjitsu

Is there no way we could get UOX3 to map the skills to skillnumbers based on what exists in skills.dfn - or even moving the enum stuff out of the source and into skills.dfn instead?
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I will look into making the whole thing scriptable. My opinion is why should we be forced to recompile for a new skill if we don't for a new map? :D
Scott
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Ok, I have enabled support for the 3 AoS skills, and added support for the 2 Samurai Empire skills. Notably this will probably cause any client not capable of handling SE skills to crash. However this is only temporary as I would like it scriptable all around.

As far as scripting it, there is one hitch, that could cause issues for the NPC scripts. Currently we have the ability to use FLETCHING=0,100 or something similar for an NPC tag. If all skills (and skill names) are scriptable, we require a better way to go about this.

My thought is instead of SKILLNAME=#,# we use SKILL=#,#,#.

For instance

SKILL=24,0,100 would set lockpicking (as lockpicking is 24 by default) to a random number between 0 and 100.

This could prove to be more confusing, but it is the only way (that I can think of) to make it truly scriptable.
Scott
Post Reply