[IMPLEMENTED] Move mount-data to creatures.dfn?

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:

Move mount-data to creatures.dfn?

Post by Xuri »

Instead of having a hardcoded list of which IDs are valid as mounts, and which IDs to create in the user's backpack when mounting them, move it all out to creatures.dfn so UOX3 users can more easily implement custom mounts etc. without having to edit the UOX3 source themselves.

For instance, we could add another tag to the creatures.dfn file named simply "MOUNT", as well as some tag to identify the corresponding item-ID.

Example:
In void MountCreature() in uox3.cpp, we have

Code: Select all

case 0x7A:	c->SetID( 0x3EB4 );	break;	// Unicorn
which could be moved into creatures.dfn like this:

Code: Select all

[CREATURE 0x7a]
{ Unicorn
ICON=0x25ce
SOUND_STARTATTACK=0x4bc
SOUND_IDLE=0x4bd
SOUND_ATTACK=0x4be
SOUND_DEFEND=0x4bf
SOUND_DIE=0x4c0
MOVEMENT=LAND
ANIMAL
[color=yellow]MOUNT[/color]
[color=yellow]MOUNTITEM=0x3EB4[/color]
}
That would also (I think) remove the need for the IsValidMount function in cChar.cpp, or at least the hardcoded list of body IDs there (could generate a list based MOUNT tags in creatures.dfn on startup or something?.

Thoughts?
Last edited by Xuri on Sun Jul 02, 2006 10:21 pm, edited 4 times in total.
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

I would just use the mountitem tag, if it's set to a valid id the creature is mountable. If not it's not mountable.
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 »

Then call it "MountID" or something instead =P
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Then call it "MountID" or something instead =P
About to be done...
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 »

Excellent :) Seems to work like a charm :D
-= Ho Eyo He Hum =-
Post Reply