Jump to content
Eternal Lands Official Forums
LabRat

Custom clothing patch completed

Recommended Posts

I finally upped my custom clothing patch to Berlios: http://developer.berlios.de/patch/?func=de...p;group_id=1256

 

The patch needs -dCUSTOM_LOOK (thanks octane)

 

I know the plan was to output a Uint32 uniq_id to identify the player, but I chose to use another unique identifier that the client already sends: the player name itself.

 

It strips off any leading colour characters (NPCs, PKable players, god mode), strips off anything after the last character in the name and finally converts the name to lowercase.

 

To use myself as an example it would convert "LabRat [tag colour](TC)" to "labrat"

 

Custom clothing for a player (using myself as an example again) needs to go in:

$EL/custom/player/labrat/meshes/

replace labrat with the player name as required.

 

Custom clothing for an entire guild (using (TC) in this example) needs a little work to find out the correct directory:

The directory name is a string of a Uint32 that is constructed of the guild name bytes:

(TC) would be broken down as follows:

  unsigned char c[8]="(TC)", folder[128]="custom/guild/", newdir[128]={0};
 int x;
 unsigned int d;
/*
 for(x=0;x<strlen(c);x++)
  if(c[x]>='A' && c[x]<='Z')
	  c[x]+=32;
*/
 d=(c[3]<<24)+(c[2]<<16)+(c[1]<<8)+c[0];
 sprintf(newdir,"%s%u",folder,d);
 printf("Creating folder %s\n",newdir);
 mkdir(newdir);

A little longwinded perhaps, but that code is ready to be made into a source to create the guild name automatically:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
 //this code could easily be patched to make it command line driven
 unsigned char folder[]="Eternal Lands/custom", c[128]="". newdir[128]={0};
  int x, player;
unsigned int d;
printf("Is this a player Y/N? ");
 player=getch();
 if(player=='Y' || player=='y')
 {
  player=1;
  printf("Yes.\nPlease enter player name eg LabRat: ");
 }
 else
 {
  player=0;
  printf("No.\nPlease enter guild short tag eg (TC): ");
 }

 gets(c);
/*
 for(x=0;x<strlen(c);x++)
  if(c[x]>='A' && c[x]<='Z')
	  c[x]+=32;
*/
 d=(c[3]<<24)+(c[2]<<16)+(c[1]<<8)+c[0];
 if(player==0)
  sprintf(newdir,"%s/guild/%u",folder,d);
 else
  sprintf(newdir,"%s/player/%s",folder,c);
 printf("Creating folder %s\n",newdir);
 mkdir(newdir);
 if(player==0)
  sprintf(newdir,"%s\\guild\\%u\\meshes",folder,d);
 else
  sprintf(newdir,"%s\\player\\%s\\meshes",folder,c);

 printf("Creating folder %s\n",newdir);
 mkdir(newdir);
 if(player==0)
 {
  sprintf(newdir,"%s\\guilds.txt",folder);
  FILE *fp=fopen(newdir,"a");
  sprintf(newdir,"%u\t%s\n",d,c);
  fputs(newdir,fp);
  fclose(fp);
 }
 return 0;
}

 

To put this into use, you will need to find out exactly what you wish to change on a character (face, clothing, armour item, weapon, cape etc), find the corresponding .bmp from $el/meshes eg harvester cape is "$el/meshes/cape1_brown.bmp" and copy that to the relevant folder as created by the above code snippet.

 

Once the item texture is in the correct location, feel free to edit it in the custom folder, but remember to save the resulting image with the same filename (overwrite) and in the same colour depth and image height and width.

 

If you get a black texture on your modded item, check the bit depth (256 colours normally) and image sizes.

 

 

This all sounds extremely complicated (well it does to me and I am the one writing it :P ) but to be honest it is not going to take more than a minute or two the first time, and you will get faster as soon as you learn how to do it :)

---------------------------------------------------------------

Custom clothing ingame is something that is included in the standard client (mod capes etc) and something that Teh Gods charge for. Although this would bypass the requirement to pay for custom clothing etc, you would still have to distribute your modified clothing yourself.

 

Please consider paying The Gods for your custom clothing packs, and having them shipped with the standard client so that absolutely everybody ingame will be able to see your glorious new designs.

---------------------------------------------------------------

Please remember that all custom clothing modifications are an extension of the game, and if you make inappropriate custom items and distribute them you alone are responsible for them - there are strict policies in place about what is deemed suitable. If you think you could get banned for wearing an image on your cape, don't make that design.

---------------------------------------------------------------

I foresee a lucrative trade coming up in clothing designs :)

---------------------------------------------------------------

If you compile the CVS with the custom clothing patch, you may be interested in seeing me as Superman, and (TC) in their custom capes etc: http://www.labrat.be/player.zip. Extract the zip (use folder names) to $EL/ and the files will (with the benefit of malice aforethought) end up located in the right place.

Edited by LabRat

Share this post


Link to post
Share on other sites
Custom clothing for an entire guild (using (TC) in this example) needs a little work to find out the correct directory:

Don't we already have this as the CUSTOM_LOOK define?

[edit] And I thought there was another thread stating the changing of textures was forbidden (outside officially sanctioned changes). Granted, that person was trying to make all rabbits red so that he could hunt them better.

Edited by 0ctane

Share this post


Link to post
Share on other sites

-dCUSTOM_LOOK :P you are correct for some reason I keep calling it the wrong thing :) (original post edited to reflect the correction)

 

The custom clothing stuff was written as a request from on high that I have been promising to do for over a year now, and I have no doubt will be accepted as I promised those on high I would have it done when I chatted last week.

 

The client has had -dCUSTOM_LOOK for a long time, I was merely finishing it as requested.

 

Edit: I just double checked - the patch won't allow you to change animal colours etc, only NPCs and players as it is using "add_enhanced_actor_from_server" and "actor_wear_item" which do not deal with monsters and creatures.

Edited by LabRat

Share this post


Link to post
Share on other sites

-dCUSTOM_LOOK :cry: you are correct for some reason I keep calling it the wrong thing :P (original post edited to reflect the correction)

 

The custom clothing stuff was written as a request from on high that I have been promising to do for over a year now, and I have no doubt will be accepted as I promised those on high I would have it done when I chatted last week.

 

The client has had -dCUSTOM_LOOK for a long time, I was merely finishing it as requested.

 

Edit: I just double checked - the patch won't allow you to change animal colours etc, only NPCs and players as it is using "add_enhanced_actor_from_server" and "actor_wear_item" which do not deal with monsters and creatures.

 

Okay, so this is a "client side only" thing? Not something that others see (ala Second Life)? Aww, I was hopeful. ;)

 

Because that would be just plain keen. :cry: I could easily picture people paying a premium to a crafter that makes clothing with neat designs. You could even have the designs constrained to colors that stand for various texture elements on the item so that you don't get, say, a iron sword with yellow smiley faces all over it. Having a user-created texture map to an in-game texture would also save space in terms of the data that needs to be transmitted -- the user texture would be lower res and have only a few "colors", which the client then uses to create the full texture. Textures would be cached locally on your machine whenever an object with a custom texture is near you. Low bandwidth users could optionally not download the user-created textures, and rely only on default textures.

 

Of course, this would be a pretty advanced thing to implement, so I don't hold out any hopes for seing it any time soon. :cry:

Share this post


Link to post
Share on other sites

Plans are in the works for a premium paid service where everyone sees your custom clothing using an auto update type system. Downloaind the custom looks info would be optional for players, so those with slower connections don't have to get bogged down by downloads.

Share this post


Link to post
Share on other sites

Plans are in the works for a premium paid service where everyone sees your custom clothing using an auto update type system. Downloaind the custom looks info would be optional for players, so those with slower connections don't have to get bogged down by downloads.

 

Niftiness. ;)

Share this post


Link to post
Share on other sites

I just updated the patch on berlios again (this version works as intended - for some reason the committed version didn't work as it should).

 

If you need any help feel free to PM me ingame and I'll see if I can help :)

Share this post


Link to post
Share on other sites

I just updated the patch on berlios again (this version works as intended - for some reason the committed version didn't work as it should).

 

If you need any help feel free to PM me ingame and I'll see if I can help :)

There is one portion of the code I'm changing currently ... the dir creation. Either wait or send me and any change you are making.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×