mounts

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
Blackstone
UOX3 Newbie
Posts: 3
Joined: Thu Jun 29, 2006 4:28 am
Has thanked: 0
Been thanked: 0
Contact:

mounts

Post by Blackstone »

First off, I hope this is the correct forum for this post?

Second, I've been searching thru the free shards for ideas for mine I often run into players riding dragons and other non-mountable creatures. My question is how the heck do they do that?

Finally, Does anyone know of a way to import a newly created php account into the shard accounts?

Blackstone
www.uocastle.com
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 »

There are just two steps to be able to use dragons and other normally non-mountable creatures as mounts in UOX3.

Firstly, you have to create new "mount-items" in the tiledata.mul with a program like Mulpatcher, and secondly, you need to make UOX3 recognize the new mounts as valid mounts by editing the UOX3 source code and compiling a new .exe.

Step 1 - Tiledata
First backup your tiledata.mul file, and start MulPatcher. In the Settings-tab (should be open by default), click on the button with three dots on it next to the empty path to the Tiledata.mul, and select the tiledata.mul file (the one you didn't back up). Then click the "Load"-button.

Next, click on the Tiledata (S)-tab and scroll to the bottom of the artwork index list, where you'll find a lot of empty (with no names next to them) entries. Select one of the empty entries and write for instance "Giant Spider". Under Animation ID, write 0x1c, which is the body ID of a giant spider. To find that, I opened models/models.txt in my UO folder and converted the first number ( 28 ) on the following line to HEX (0x1c) using Windows calculator in Scientific-Mode:

Code: Select all

28	0	0	FFFFFFFF	0	1.3	1.3	1.3	arachnids_spider_giant
You can also do 'CSTATS or 'TWEAK ingame to see a particular NPC's body ID, or look it up in UOX3's DFN files.

Type 1 under "Height" and 25 under "Quality", then enable the "Animation" and "Wearable" checkboxes. Go back to the "Settings"-tab, and click the Tiledata's SAVE button. Select the tiledata.mul in your UO folder (not the backed up copy!) and press OK. Close Mulpatcher.

Note that you will need the backed up tiledata.mul in case you want to download official UO patches, so be careful with it!

Step 2 - UOX3
Depending on how well versed you are in compiling UOX3 from the source yourself, the first step might have been the easy part of the process.

Before you can use your new giant spider-mount, UOX3 needs to recognize the giant spider as a valid mount. And that is done by entering the correct IDs in two places in the source; under bool CChar::IsValidMount( void ) const in cChar.cpp:

Code: Select all

bool CChar::IsValidMount( void ) const
{
	bool retVal = false;
	switch( id )
	{
		[color=yellow]case 0x1C: //Giant Spider!!![/color]
		// Basic Ridables
		case 0xC8:		// horse (Light brown)
		...
...and under void MountCreature( CSocket *sockPtr, CChar *s. CChar *x ) in uox3.cpp:

Code: Select all

void MountCreature( CSocket *sockPtr, CChar *s, CChar *x )
{
	if( s->IsOnHorse() )
		return;

	if( !objInRange( s, x, DIST_NEXTTILE ) )
		return;
	if( x->GetOwnerObj() == s || Npcs->checkPetFriend( s, x ) || s->IsGM() )
	{
		if( !cwmWorldState->ServerData()->CharHideWhileMounted() )
			s->ExposeToView();

		s->SetOnHorse( true );
		CItem *c = Items->CreateItem( NULL, s, 0x0915, 1, x->GetSkin(), OT_ITEM );
		c->SetName( x->GetName() );
		c->SetDecayable( false );
		c->SetLayer( IL_MOUNT );

		switch( x->GetID() )
		{
			[color=yellow]case 0x1C:  c->SetID( 0x3FF0 ); break; // Giant Spider[/color]
			case 0x72:	c->SetID( 0x3EA9 );	break;	// Dark Steed
			case 0x73:	c->SetID( 0x3EAA );	break;	// Etheral Horse
			...
In the above code snippets, 0x1C was the body ID of the giant spider character model, and 0x3FF0 was the empty artwork index I picked while working in Mulpatcher.

Last thing you need to do, is to compile a new uox3.exe after including the necessary information about the new mounts (as I did in the example above), and make sure that both your UO client and the server itself reads the new tiledata.mul file. For more information on how to compile UOX3 yourself, check out the How to compile UOX3 under Windows or How to compile UOX3 under Linux threads.

Below you can see a screenshot of me on my new ridable giant spider. As you can see, not all creatures are equally suitable to function as mounts, as the riding animation of your own character always occurs at the same height, no matter the actual height of the mount in question :P
Image
-= Ho Eyo He Hum =-
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 »

Note: As of the next UOX3 version (it's on the CVS right now), UOX3 no longer has hardcoded mount-IDs, and you can easily setup UOX3 to accept new mounts by adding the right ID (the empty artwork ID you choose in Mulpatcher, like for instance 0x3FF0) to that character model's section in creatures.dfn, like this:

Code: Select all

[CREATURE 0x1c]
{ Giant Spider
ICON=0x20fd
SOUND_STARTATTACK=0x183
SOUND_IDLE=0x184
SOUND_ATTACK=0x185
SOUND_DEFEND=0x186
SOUND_DIE=0x187
MOVEMENT=LAND
[color=yellow]MOUNTID=0x3FF0[/color]
}
Doing that becomes the new Step 2, editing the UOX3 source itself will no longer be necessary. Editing tiledata.mul using a tool like Mulpatcher will, though.
-= Ho Eyo He Hum =-
Post Reply