Easy? method for support of custom skills
- 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
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
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
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).
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
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
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 =)
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:
Do us a favour Xu. Search the source for __NEW_SKILLS__ 
In a relatively global header (Config.h seems a good candidate
) put this just under "#define _NOACTCOPY_ 0"
This should enable the server to support three more skills: Necromancy, Focus and Chivalry.
You could probably try implementing from there
In a relatively global header (Config.h seems a good candidate
Code: Select all
#define __NEW_SKILLS__
You could probably try implementing from there
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
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.
(Enable these as well? 
-= Ho Eyo He Hum =-
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
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?
(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
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.
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